From 8e644c583cd842a6677c5519a45f2f197af12266 Mon Sep 17 00:00:00 2001 From: "DESKTOP-5RP3AKU\\Jisol" <2858626794@qq.com> Date: Fri, 24 Nov 2023 01:38:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9B=E7=B3=BB=E7=9A=84=E4=B8=80=E5=A4=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JisolGameCocos/assets/script/App.ts | 8 ++++---- JisolGameCocos/assets/script/action/PVPAction.ts | 1 + .../java/cn/jisol/game/actions/GRefereeAction.java | 11 +++++++++-- headless/index.js | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/JisolGameCocos/assets/script/App.ts b/JisolGameCocos/assets/script/App.ts index 1d16fdcd..d77b1e14 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.170:8080` -let WsPath = `ws://192.168.0.170: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/assets/script/action/PVPAction.ts b/JisolGameCocos/assets/script/action/PVPAction.ts index 1c2593e1..7514a8f2 100644 --- a/JisolGameCocos/assets/script/action/PVPAction.ts +++ b/JisolGameCocos/assets/script/action/PVPAction.ts @@ -51,6 +51,7 @@ export default class PVPAction extends BaseAction { //开始PVP onModePVPStart(info:GPVPStart){ console.log("开始PVP",info); + app.layer.Close(GUI.PVPModeMatchView); GBattleModeManager.getIns().Open(BattleMode.PVP,true,info); } 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 2ce54333..ce97b58b 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 @@ -32,6 +32,11 @@ public class GRefereeAction { //最大裁决员数量 public static int MAX = 10; + //headless位置 +// public static String Headless = "D:\\myproject\\JisolGame\\headless"; + public static String Headless = "D:\\Jisol\\JisolGame\\headless"; +// public static String Headless = "D:\\wwwroot\\pet.jisol.cn\\headless"; + //获取一个空闲的裁决员 public static GRefereeClient getFreeReferee(){ @@ -77,13 +82,15 @@ public class GRefereeAction { //生成客户端Id String uuid = IdUtil.simpleUUID(); //创建日志类 - Logger log = JLoggerUtil.file(uuid, "D:\\myproject\\JisolGame\\headless\\logger", uuid + ".log"); + Logger log = JLoggerUtil.file(uuid, Headless+"\\logger", uuid + ".log"); if(Objects.isNull(log)) return; + log.setUseParentHandlers(false); + Thread thread = new Thread(() -> { try { - Process process = Runtime.getRuntime().exec("cmd /c npm run main", null, new File("D:\\myproject\\JisolGame\\headless")); + Process process = Runtime.getRuntime().exec("cmd /c npm run main", null, new File(Headless)); InputStream is = process.getInputStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); diff --git a/headless/index.js b/headless/index.js index 2dae0d1e..a393e0c6 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.0.170:7457/web-desktop/web-desktop-001/index.html" +const URL = "http://192.168.1.23:7456/web-desktop/web-desktop-001/index.html" // const runCocos = () => { const { JSDOM,ResourceLoader } = require('jsdom')