diff --git a/JisolGameCocos/assets/script/App.ts b/JisolGameCocos/assets/script/App.ts index bf7c4a99..1d16fdcd 100644 --- a/JisolGameCocos/assets/script/App.ts +++ b/JisolGameCocos/assets/script/App.ts @@ -26,12 +26,12 @@ import { JAPI, JAPIConfig } from "../../extensions/ngame/assets/ngame/util/JAPI" import { AppData } from "./AppData"; import AppAction from "./AppAction"; -let APIPath = `http://localhost:8080` -let WsPath = `ws://localhost:8080/websocket` +// let APIPath = `http://localhost:8080` +// let WsPath = `ws://localhost:8080/websocket` // let APIPath = `http://192.168.1.23:8080` // let WsPath = `ws://192.168.1.23:8080/websocket` -// let APIPath = `http://192.168.0.123:8080` -// let WsPath = `ws://192.168.0.123:8080/websocket` +let APIPath = `http://192.168.0.170:8080` +let WsPath = `ws://192.168.0.170:8080/websocket` // let APIPath = `https://api.pet.jisol.cn` // let WsPath = `wss://api.pet.jisol.cn/websocket` diff --git a/JisolGameCocos/extensions/ngame b/JisolGameCocos/extensions/ngame index e527d34f..0ac0cc67 160000 --- a/JisolGameCocos/extensions/ngame +++ b/JisolGameCocos/extensions/ngame @@ -1 +1 @@ -Subproject commit e527d34fb68064a47d20d21764044c7cda2ed719 +Subproject commit 0ac0cc67b0cd8bd70fa3c9ead11fee366a6d7d68 diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/GRefereeAction.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/GRefereeAction.java index 23cd9c74..2ce54333 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/GRefereeAction.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/GRefereeAction.java @@ -77,13 +77,13 @@ public class GRefereeAction { //生成客户端Id String uuid = IdUtil.simpleUUID(); //创建日志类 - Logger log = JLoggerUtil.file(uuid, "D:\\Jisol\\JisolGame\\headless\\logger", uuid + ".log"); + Logger log = JLoggerUtil.file(uuid, "D:\\myproject\\JisolGame\\headless\\logger", uuid + ".log"); if(Objects.isNull(log)) return; Thread thread = new Thread(() -> { try { - Process process = Runtime.getRuntime().exec("cmd /c npm run main", null, new File("D:\\Jisol\\JisolGame\\headless")); + Process process = Runtime.getRuntime().exec("cmd /c npm run main", null, new File("D:\\myproject\\JisolGame\\headless")); InputStream is = process.getInputStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/onhook/GPVPAction.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/onhook/GPVPAction.java index 7e185901..eea09e16 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/onhook/GPVPAction.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/onhook/GPVPAction.java @@ -11,12 +11,12 @@ import cn.jisol.game.entity.game.PlayerTactical; import cn.jisol.game.network.client.GClient; import cn.jisol.game.network.client.GRefereeClient; import cn.jisol.game.proto.GPVPMessage; +import cn.jisol.game.proto.GUIMessage; import cn.jisol.game.service.PlayerTacticalService; import cn.jisol.ngame.actions.core.NAction; import cn.jisol.ngame.actions.core.NActionMethod; import cn.jisol.ngame.util.EventDispatcher; import cn.jisol.ngame.util.spring.SpringBeanUtils; - import java.util.*; //PVP 模式 @@ -177,12 +177,18 @@ public class GPVPAction { //裁决结束返回 @NActionMethod(GActionEnum.CR_REFEREE_PVP_END) - public static void onPVPRefereeEnd(GPVPMessage.GPVPRefereeInfo info,GRefereeClient referee){ + public static void onPVPRefereeEnd(GPVPMessage.GPVPRefereeInfo info,GRefereeClient referee,Map clients){ System.out.println("获胜的玩家是:"+info.getWinnerId()); //裁决结束 等待下次裁决 GRefereeAction.addFreeReferee(referee); + + clients.values().forEach(client -> { + client.invoke(GActionEnum.C_MODE_PVP_MESSAGE, GPVPMessage.GPVPText.newBuilder().setText("服务器裁决胜利者"+info.getWinnerId()).build()); + client.invoke(GActionEnum.CHAT_RECEIVE_MESSAGE, GUIMessage.GUIChatMessage.newBuilder().setMessage("获胜的玩家是:"+info.getWinnerId()).build()); + }); + } //通知玩家等待定时器 diff --git a/headless/index.js b/headless/index.js index a393e0c6..2dae0d1e 100644 --- a/headless/index.js +++ b/headless/index.js @@ -1,7 +1,7 @@ // const URL = "http://192.168.0.174:7457/web-desktop/web-desktop/index.html" // const express = require("express"); // const app = express(); -const URL = "http://192.168.1.23:7456/web-desktop/web-desktop-001/index.html" +const URL = "http://192.168.0.170:7457/web-desktop/web-desktop-001/index.html" // const runCocos = () => { const { JSDOM,ResourceLoader } = require('jsdom')