From f890be0728644b968f6d59534c1769dd6aadb779 Mon Sep 17 00:00:00 2001 From: "PC-20230316NUNE\\Administrator" <2858626794@qq.com> Date: Wed, 22 Nov 2023 17:46:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=AE=8C=E7=BE=8E=E7=9A=84?= =?UTF-8?q?=E6=97=A0=E5=A4=B4=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JisolGameCocos/assets/script/App.ts | 14 +- JisolGameCocos/assets/script/Env.ts | 5 +- .../assets/script/action/PVPAction.ts | 18 +- .../assets/script/battle/GBaseMode.ts | 4 +- .../script/battle/GBattleModeManager.ts | 13 +- .../assets/script/battle/modes/GPVPMode.ts | 6 +- .../assets/script/consts/GAction.ts | 3 +- .../assets/script/consts/GActionType.ts | 3 + JisolGameCocos/extensions/ngame | 2 +- JisolGameCocos/proto/GPVPMessage.proto | 8 + .../cn/jisol/game/actions/GActionEnum.java | 1 + .../cn/jisol/game/actions/GRefereeAction.java | 44 +- .../jisol/game/actions/onhook/GPVPAction.java | 145 +-- .../java/cn/jisol/game/network/WebSocket.java | 7 +- .../java/cn/jisol/game/proto/GPVPMessage.java | 864 ++++++++++++++++-- .../cn/jisol/game/proto/GPVPMessage.proto | 8 + headless/index.js | 5 +- 17 files changed, 975 insertions(+), 175 deletions(-) diff --git a/JisolGameCocos/assets/script/App.ts b/JisolGameCocos/assets/script/App.ts index 1a96ec36..5370f45a 100644 --- a/JisolGameCocos/assets/script/App.ts +++ b/JisolGameCocos/assets/script/App.ts @@ -28,10 +28,10 @@ import AppAction from "./AppAction"; // 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.174:8080` -// let WsPath = `ws://192.168.0.174: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 = `https://api.pet.jisol.cn` // let WsPath = `wss://api.pet.jisol.cn/websocket` @@ -231,8 +231,8 @@ export const app = { } app.api.addRequestInterceptors((config:JAPIConfig) => { - // //设置Token - // if(StorageData.get(StorageEnum.Token)) - // config.headers["Token"] = StorageData.get(StorageEnum.Token); + //设置Token + if(StorageData.get(StorageEnum.Token)) + config.headers["Token"] = StorageData.get(StorageEnum.Token); return true; }) \ No newline at end of file diff --git a/JisolGameCocos/assets/script/Env.ts b/JisolGameCocos/assets/script/Env.ts index 044ffb6a..99b6b734 100644 --- a/JisolGameCocos/assets/script/Env.ts +++ b/JisolGameCocos/assets/script/Env.ts @@ -1,3 +1,5 @@ + + //打包环境 export enum Env{ Server, //服务器模式 @@ -5,4 +7,5 @@ export enum Env{ } //当前环境 -export const EnvCurrent:Env = Env.Server; \ No newline at end of file +export const EnvCurrent:Env = Env.H5; + diff --git a/JisolGameCocos/assets/script/action/PVPAction.ts b/JisolGameCocos/assets/script/action/PVPAction.ts index 8dec353b..1c2593e1 100644 --- a/JisolGameCocos/assets/script/action/PVPAction.ts +++ b/JisolGameCocos/assets/script/action/PVPAction.ts @@ -1,7 +1,6 @@ -import { JNSyncFrameEvent } from "../../../extensions/ngame/assets/ngame/sync/frame/JNSyncFrame"; import { app } from "../App"; import { Env, EnvCurrent } from "../Env"; -import GBattleModeManager, { BattleMode } from "../battle/GBattleModeManager"; +import GBattleModeManager, { BattleMode, GBattleModeEvent } from "../battle/GBattleModeManager"; import { GAction } from "../consts/GAction"; import { GActionType } from "../consts/GActionType"; import { GUI } from "../ui/UIConfig"; @@ -12,6 +11,8 @@ export interface GPVPStart{ leftPets:{[key:number]:string}; //左边玩家的宠物 rightTactical:string; //右边玩家的阵法 rightPets:{[key:number]:string}; //左边玩家的宠物 + leftPlayerId:number; //左边的玩家Id + rightPlayerId:number; //右边的玩家Id } @@ -22,6 +23,7 @@ export interface GPVPText{ export default class PVPAction extends BaseAction { onInit(){ + app.socket.on(GAction.C_MODE_PVP_START_WAIT,this.onModePVPStartWait,this); app.socket.on(GAction.C_MODE_PVP_END_WAIT,this.onModePVPEndWait,this); app.socket.on(GAction.C_MODE_PVP_START,this.onModePVPStart,this,GActionType.GPVPStart); @@ -29,7 +31,9 @@ export default class PVPAction extends BaseAction { if(EnvCurrent == Env.Server){ app.socket.on(GAction.CR_REFEREE_PVP_MODE,this.onCrReferee,this,GActionType.GPVPStart); //监听PVP裁决 + app.event.on(GBattleModeEvent.Close,this.onBattleRefereeClose,this); //模式结束运行 } + } //PVP开始等待 @@ -63,6 +67,16 @@ export default class PVPAction extends BaseAction { app.layer.Open(GUI.Tips,{text:info.text}) } + //裁决结束返回 + onBattleRefereeClose(type:BattleMode,data?:number){ + if(type == BattleMode.PVP){ + console.log("裁决结束胜利玩家",data) + app.socket.Send(GAction.CR_REFEREE_PVP_END,{ + winnerId:data + },GActionType.GPVPRefereeInfo) + } + } + } diff --git a/JisolGameCocos/assets/script/battle/GBaseMode.ts b/JisolGameCocos/assets/script/battle/GBaseMode.ts index 79ad5659..bee4bc4d 100644 --- a/JisolGameCocos/assets/script/battle/GBaseMode.ts +++ b/JisolGameCocos/assets/script/battle/GBaseMode.ts @@ -37,8 +37,8 @@ export default class GBaseMode extends GObject { } //结束场景 - Close(){ - GBattleModeManager.getIns().Close(); + Close(data?:any){ + GBattleModeManager.getIns().Close(data); } onSyncUpdate(dt: number,frame:JNFrameInfo, input?: T) { diff --git a/JisolGameCocos/assets/script/battle/GBattleModeManager.ts b/JisolGameCocos/assets/script/battle/GBattleModeManager.ts index 072a7a4b..2dd89c9d 100644 --- a/JisolGameCocos/assets/script/battle/GBattleModeManager.ts +++ b/JisolGameCocos/assets/script/battle/GBattleModeManager.ts @@ -22,6 +22,12 @@ export interface GBattleModeInfo{ root:Node, //世界场景Root } +//事件 +export enum GBattleModeEvent{ + //关闭模式 + Close = "GBattleModeEvent_Close", +} + //全局战斗模式管理器 export default class GBattleModeManager extends Singleton { @@ -93,13 +99,16 @@ export default class GBattleModeManager extends Singleton { } //关闭当前模式 - async Close(){ + async Close(data?:any){ //主动调用场景销毁 app.sync.onReset(); + let current = this.current; this.current = null; this.frameNoSwitch = true; + //结束通知 + app.event.emit(GBattleModeEvent.Close,current,data); } //设置自动推帧 ( 帧不由addFrame控制 管理器自动推帧) @@ -109,8 +118,6 @@ export default class GBattleModeManager extends Singleton { this.autoTime = 0; } - //设置自动追帧 - //清除当前模式 private clear(){ if(!this.isInit) return; diff --git a/JisolGameCocos/assets/script/battle/modes/GPVPMode.ts b/JisolGameCocos/assets/script/battle/modes/GPVPMode.ts index 8ee4a85e..65d38147 100644 --- a/JisolGameCocos/assets/script/battle/modes/GPVPMode.ts +++ b/JisolGameCocos/assets/script/battle/modes/GPVPMode.ts @@ -214,10 +214,14 @@ export default class GPVPMode extends GBaseMode<{},GPVPStart>{ //判断是否有队伍都死亡 if(this.getOnesRoleAlive(GPVPModePlayerEnum.PLAYER).length == 0 || this.getOnesRoleAlive(GPVPModePlayerEnum.ENEMY).length == 0){ this.isEndGame = true; + let winner = this.data.leftPlayerId; + if(this.getOnesRoleAlive(GPVPModePlayerEnum.ENEMY).length){ + winner = this.data.rightPlayerId; + } //结束游戏 JNFrameTime.getInstance().setTimeout(() => { console.log(this.getOnesRoleAlive(GPVPModePlayerEnum.PLAYER).length,this.getOnesRoleAlive(GPVPModePlayerEnum.ENEMY).length) - this.Close(); + this.Close(winner); },3000) } diff --git a/JisolGameCocos/assets/script/consts/GAction.ts b/JisolGameCocos/assets/script/consts/GAction.ts index 94e29f38..1ac77d20 100644 --- a/JisolGameCocos/assets/script/consts/GAction.ts +++ b/JisolGameCocos/assets/script/consts/GAction.ts @@ -19,6 +19,7 @@ export enum GAction { /*************** 裁决 *********************/ - CR_REFEREE_PVP_MODE = 4001, //裁决PVP模式 + CR_REFEREE_PVP_MODE = 4001, //裁决PVP模式 + CR_REFEREE_PVP_END = 4002, //裁决PVP结束 } \ No newline at end of file diff --git a/JisolGameCocos/assets/script/consts/GActionType.ts b/JisolGameCocos/assets/script/consts/GActionType.ts index 27cfc855..1b81bae7 100644 --- a/JisolGameCocos/assets/script/consts/GActionType.ts +++ b/JisolGameCocos/assets/script/consts/GActionType.ts @@ -15,4 +15,7 @@ export enum GActionType { GPVPStart = "GPVPStart", //PVP 开始 GPVPText = "GPVPText", //PVP 提示 + /*************** 裁决 ********************/ + GPVPRefereeInfo = "GPVPRefereeInfo" //PVP 裁决信息 + } \ No newline at end of file diff --git a/JisolGameCocos/extensions/ngame b/JisolGameCocos/extensions/ngame index 95f8a3c6..e527d34f 160000 --- a/JisolGameCocos/extensions/ngame +++ b/JisolGameCocos/extensions/ngame @@ -1 +1 @@ -Subproject commit 95f8a3c6c6310f66d8671958e940291020636a81 +Subproject commit e527d34fb68064a47d20d21764044c7cda2ed719 diff --git a/JisolGameCocos/proto/GPVPMessage.proto b/JisolGameCocos/proto/GPVPMessage.proto index d309b115..94ef6ad0 100644 --- a/JisolGameCocos/proto/GPVPMessage.proto +++ b/JisolGameCocos/proto/GPVPMessage.proto @@ -9,6 +9,8 @@ message GPVPStart { map leftPets = 2; //左边的宠物 key:宠物Id value 宠物配置Id string rightTactical = 3; //右边的布阵 map rightPets = 4; //右边的宠物 key:宠物Id value 宠物配置Id + int64 leftPlayerId = 5; //左边的玩家Id + int64 rightPlayerId = 6; //右边的玩家Id } //PVP 消息提示 @@ -16,4 +18,10 @@ message GPVPText { string text = 1; //消息提示 } +//PVP 裁决结束返回 +message GPVPRefereeInfo{ + //获胜玩家Id + int64 winnerId = 1; +} + diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/GActionEnum.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/GActionEnum.java index a3827b78..625ca28f 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/GActionEnum.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/actions/GActionEnum.java @@ -21,5 +21,6 @@ public interface GActionEnum { /*************** 裁决 *********************/ int CR_REFEREE_PVP_MODE = 4001; //裁决PVP模式 + int CR_REFEREE_PVP_END = 4002; //裁决PVP结束 } 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 fdf37a20..36aa4751 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 @@ -1,15 +1,12 @@ package cn.jisol.game.actions; -import cn.jisol.game.network.client.GClient; import cn.jisol.game.network.client.GRefereeClient; import cn.jisol.game.proto.GPVPMessage; import cn.jisol.ngame.actions.core.NAction; import cn.jisol.ngame.actions.core.NActionMethod; -import java.util.Iterator; import java.util.Map; import java.util.Objects; -import java.util.Set; /** * 裁决员行为 处理裁决 @@ -20,27 +17,12 @@ public class GRefereeAction { //裁决员列表 public static Map REFEREES; - //裁决PVP - public static void onPVPReferee(GPVPMessage.GPVPStart info){ - - GRefereeClient referee; - - //判断是否有裁决员 如果 没有裁决员则返回 - if(Objects.isNull(referee = getFreeReferee())) { - System.out.println("没有裁决员"); - return; - } - - //如果有裁决员则向裁决员发送要裁决的信息 - referee.invoke(GActionEnum.CR_REFEREE_PVP_MODE,info); - - } - //获取一个空闲的裁决员 public static GRefereeClient getFreeReferee(){ for (String key : REFEREES.keySet()) { if (!(REFEREES.get(key).isReferee)) { + REFEREES.get(key).isReferee = true; return REFEREES.get(key); } } @@ -48,4 +30,28 @@ public class GRefereeAction { } + //放回一个空闲裁决员 + public static void addFreeReferee(GRefereeClient referee){ + referee.isReferee = false; + } + + //自动回收裁决 + public static boolean autoReferee(GRefereeActionAutoInter inter){ + GRefereeClient referee = getFreeReferee(); + if (Objects.nonNull(referee)) { + referee = inter.run(referee); + //未使用则收回 + if(Objects.nonNull(referee)){ + addFreeReferee(referee); + return false; + } + return true; + } + return false; + } + + public interface GRefereeActionAutoInter{ + GRefereeClient run(GRefereeClient referee); + } + } 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 50685d2e..2e730a22 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 @@ -8,6 +8,7 @@ import cn.jisol.game.controller.game.GPlayerPetController; import cn.jisol.game.controller.game.GPlayerTacticalController; 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.service.PlayerTacticalService; import cn.jisol.ngame.actions.core.NAction; @@ -80,76 +81,104 @@ public class GPVPAction { //判断是否有两人在等待 有 则两人匹配成功 while (pool.size() >= 2){ - //匹配成功 - GClient client1 = pool.poll(); - GClient client2 = pool.poll(); - if(Objects.isNull(client1) || Objects.isNull(client2)) continue; - //确保玩家都在线 - if(!(client1.isOpen() && client2.isOpen())){ - if(client2.isOpen()) pool.addFirst(client2); - if(client1.isOpen()) pool.addFirst(client1); - continue; - } + if (!(GRefereeAction.autoReferee(referee -> { - //获取双方的阵型 - GPlayerTacticalController tacticalController = SpringBeanUtils.getBean(GPlayerTacticalController.class); - GPlayerPetController petController = SpringBeanUtils.getBean(GPlayerPetController.class); + //匹配成功 + GClient client1 = pool.poll(); + GClient client2 = pool.poll(); - String leftTactical = tacticalController.getInfo(client1.player).data.getTacticalData(); - String rightTactical = tacticalController.getInfo(client2.player).data.getTacticalData(); - - - //如果有人阵法是默认 则 不开始 - if (leftTactical.equals(tacticalController.InitTactical) || rightTactical.equals(tacticalController.InitTactical)){ - if(leftTactical.equals(tacticalController.InitTactical)){ - client1.invoke(GActionEnum.C_MODE_PVP_END_WAIT); - client1.invoke(GActionEnum.C_MODE_PVP_MESSAGE, GPVPMessage.GPVPText.newBuilder().setText("你的阵法没有宠物~").build()); - }else{ - //加入回列表 - pool.addFirst(client1); + if(Objects.isNull(client1) || Objects.isNull(client2)) { + return referee; } - if(rightTactical.equals(tacticalController.InitTactical)){ - client2.invoke(GActionEnum.C_MODE_PVP_END_WAIT); - client2.invoke(GActionEnum.C_MODE_PVP_MESSAGE, GPVPMessage.GPVPText.newBuilder().setText("你的阵法没有宠物~").build()); - }else{ - //加入回列表 - pool.addFirst(client2); + //确保玩家都在线 + if(!(client1.isOpen() && client2.isOpen())){ + if(client2.isOpen()) pool.addFirst(client2); + if(client1.isOpen()) pool.addFirst(client1); + return referee; } + + //获取双方的阵型 + GPlayerTacticalController tacticalController = SpringBeanUtils.getBean(GPlayerTacticalController.class); + GPlayerPetController petController = SpringBeanUtils.getBean(GPlayerPetController.class); + + String leftTactical = tacticalController.getInfo(client1.player).data.getTacticalData(); + String rightTactical = tacticalController.getInfo(client2.player).data.getTacticalData(); + + + //如果有人阵法是默认 则 不开始 + if (leftTactical.equals(tacticalController.InitTactical) || rightTactical.equals(tacticalController.InitTactical)){ + if(leftTactical.equals(tacticalController.InitTactical)){ + client1.invoke(GActionEnum.C_MODE_PVP_END_WAIT); + client1.invoke(GActionEnum.C_MODE_PVP_MESSAGE, GPVPMessage.GPVPText.newBuilder().setText("你的阵法没有宠物~").build()); + }else{ + //加入回列表 + pool.addFirst(client1); + } + if(rightTactical.equals(tacticalController.InitTactical)){ + client2.invoke(GActionEnum.C_MODE_PVP_END_WAIT); + client2.invoke(GActionEnum.C_MODE_PVP_MESSAGE, GPVPMessage.GPVPText.newBuilder().setText("你的阵法没有宠物~").build()); + }else{ + //加入回列表 + pool.addFirst(client2); + } + return referee; + } + + //构建匹配信息 + GPVPMessage.GPVPStart.Builder builder = GPVPMessage.GPVPStart.newBuilder() + .setLeftPlayerId(client1.player.getPlayerId()) + .setRightPlayerId(client2.player.getPlayerId()) + .setLeftTactical(leftTactical) + .setRightTactical(rightTactical); + //构建玩家宠物列表 + petController.getPetList(client1.player).data.forEach(pet -> { + builder.putLeftPets(pet.getPetId(), JSONUtil.toJsonStr(pet)); + }); + petController.getPetList(client2.player).data.forEach(pet -> { + builder.putLeftPets(pet.getPetId(), JSONUtil.toJsonStr(pet)); + }); + + //取消等待 + client1.invoke(GActionEnum.C_MODE_PVP_END_WAIT); + client2.invoke(GActionEnum.C_MODE_PVP_END_WAIT); + + GPVPMessage.GPVPStart info = builder.build(); + + //PVP 开始 + client1.invoke(GActionEnum.C_MODE_PVP_START, info); + client2.invoke(GActionEnum.C_MODE_PVP_START, info); + + //PVP 裁决 + onPVPReferee(referee,info); + + return null; //返回空则占用 需要 手动释放 + }))){ + System.out.println("匹配失败 暂无裁决者空闲"); + //如果获取不到裁决 则 返回 return; } - //构建匹配信息 - GPVPMessage.GPVPStart.Builder builder = GPVPMessage.GPVPStart.newBuilder() - .setLeftTactical(leftTactical) - .setRightTactical(rightTactical); - //构建玩家宠物列表 - petController.getPetList(client1.player).data.forEach(pet -> { - builder.putLeftPets(pet.getPetId(), JSONUtil.toJsonStr(pet)); - }); - petController.getPetList(client2.player).data.forEach(pet -> { - builder.putLeftPets(pet.getPetId(), JSONUtil.toJsonStr(pet)); - }); - - - - //取消等待 - client1.invoke(GActionEnum.C_MODE_PVP_END_WAIT); - client2.invoke(GActionEnum.C_MODE_PVP_END_WAIT); - - GPVPMessage.GPVPStart info = builder.build(); - - //PVP 开始 - client1.invoke(GActionEnum.C_MODE_PVP_START, info); - client2.invoke(GActionEnum.C_MODE_PVP_START, info); - - //发送裁决 - GRefereeAction.onPVPReferee(info); - } } + //裁决PVP + public static void onPVPReferee(GRefereeClient referee,GPVPMessage.GPVPStart info){ + //如果有裁决员则向裁决员发送要裁决的信息 + referee.invoke(GActionEnum.CR_REFEREE_PVP_MODE,info); + } + + //裁决结束返回 + @NActionMethod(GActionEnum.CR_REFEREE_PVP_END) + public static void onPVPRefereeEnd(GPVPMessage.GPVPRefereeInfo info,GRefereeClient referee){ + + System.out.println("获胜的玩家是:"+info.getWinnerId()); + //裁决结束 等待下次裁决 + referee.isReferee = false; + + } + //通知玩家等待定时器 public static void onWaitTimer(){ //向所有玩家发送等待 diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/network/WebSocket.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/network/WebSocket.java index e304e186..48c9a72d 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/network/WebSocket.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/network/WebSocket.java @@ -74,9 +74,10 @@ public class WebSocket { @OnMessage public void onMessage(Session session, InputStream inputStream){ - GClient client = CLIENTS.get(session.getId()); - GClient referee = REFEREES.get(session.getId()); - JNetwork.onMessage(inputStream,client,client,referee,CLIENTS,client.user,client.player); + GClient client; + if(Objects.isNull(client = CLIENTS.get(session.getId()))) + client = REFEREES.get(session.getId()); + JNetwork.onMessage(inputStream,client,client,CLIENTS,client.user,client.player); } @OnClose diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/proto/GPVPMessage.java b/JisolGameServer/Main/src/main/java/cn/jisol/game/proto/GPVPMessage.java index 62dd5f46..59dc3996 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/proto/GPVPMessage.java +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/proto/GPVPMessage.java @@ -169,6 +169,26 @@ String defaultValue); String getRightPetsOrThrow( long key); + + /** + *
+     *左边的玩家Id
+     * 
+ * + * int64 leftPlayerId = 5; + * @return The leftPlayerId. + */ + long getLeftPlayerId(); + + /** + *
+     *右边的玩家Id
+     * 
+ * + * int64 rightPlayerId = 6; + * @return The rightPlayerId. + */ + long getRightPlayerId(); } /** *
@@ -260,6 +280,16 @@ String defaultValue);
                   rightPets__.getKey(), rightPets__.getValue());
               break;
             }
+            case 40: {
+
+              leftPlayerId_ = input.readInt64();
+              break;
+            }
+            case 48: {
+
+              rightPlayerId_ = input.readInt64();
+              break;
+            }
             default: {
               if (!parseUnknownField(
                   input, unknownFields, extensionRegistry, tag)) {
@@ -305,7 +335,7 @@ String defaultValue);
         internalGetFieldAccessorTable() {
       return GPVPMessage.internal_static_GPVPStart_fieldAccessorTable
           .ensureFieldAccessorsInitialized(
-              GPVPMessage.GPVPStart.class, GPVPMessage.GPVPStart.Builder.class);
+              GPVPStart.class, Builder.class);
     }
 
     public static final int LEFTTACTICAL_FIELD_NUMBER = 1;
@@ -594,6 +624,36 @@ String defaultValue);
       return map.get(key);
     }
 
+    public static final int LEFTPLAYERID_FIELD_NUMBER = 5;
+    private long leftPlayerId_;
+    /**
+     * 
+     *左边的玩家Id
+     * 
+ * + * int64 leftPlayerId = 5; + * @return The leftPlayerId. + */ + @Override + public long getLeftPlayerId() { + return leftPlayerId_; + } + + public static final int RIGHTPLAYERID_FIELD_NUMBER = 6; + private long rightPlayerId_; + /** + *
+     *右边的玩家Id
+     * 
+ * + * int64 rightPlayerId = 6; + * @return The rightPlayerId. + */ + @Override + public long getRightPlayerId() { + return rightPlayerId_; + } + private byte memoizedIsInitialized = -1; @Override public final boolean isInitialized() { @@ -626,6 +686,12 @@ String defaultValue); internalGetRightPets(), RightPetsDefaultEntryHolder.defaultEntry, 4); + if (leftPlayerId_ != 0L) { + output.writeInt64(5, leftPlayerId_); + } + if (rightPlayerId_ != 0L) { + output.writeInt64(6, rightPlayerId_); + } unknownFields.writeTo(output); } @@ -661,6 +727,14 @@ String defaultValue); size += com.google.protobuf.CodedOutputStream .computeMessageSize(4, rightPets__); } + if (leftPlayerId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, leftPlayerId_); + } + if (rightPlayerId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(6, rightPlayerId_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -671,10 +745,10 @@ String defaultValue); if (obj == this) { return true; } - if (!(obj instanceof GPVPMessage.GPVPStart)) { + if (!(obj instanceof GPVPStart)) { return super.equals(obj); } - GPVPMessage.GPVPStart other = (GPVPMessage.GPVPStart) obj; + GPVPStart other = (GPVPStart) obj; if (!getLeftTactical() .equals(other.getLeftTactical())) return false; @@ -684,6 +758,10 @@ String defaultValue); .equals(other.getRightTactical())) return false; if (!internalGetRightPets().equals( other.internalGetRightPets())) return false; + if (getLeftPlayerId() + != other.getLeftPlayerId()) return false; + if (getRightPlayerId() + != other.getRightPlayerId()) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -707,74 +785,80 @@ String defaultValue); hash = (37 * hash) + RIGHTPETS_FIELD_NUMBER; hash = (53 * hash) + internalGetRightPets().hashCode(); } + hash = (37 * hash) + LEFTPLAYERID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLeftPlayerId()); + hash = (37 * hash) + RIGHTPLAYERID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getRightPlayerId()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static GPVPMessage.GPVPStart parseFrom( + public static GPVPStart parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static GPVPMessage.GPVPStart parseFrom( + public static GPVPStart parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static GPVPMessage.GPVPStart parseFrom( + public static GPVPStart parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static GPVPMessage.GPVPStart parseFrom( + public static GPVPStart parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static GPVPMessage.GPVPStart parseFrom(byte[] data) + public static GPVPStart parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static GPVPMessage.GPVPStart parseFrom( + public static GPVPStart parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static GPVPMessage.GPVPStart parseFrom(java.io.InputStream input) + public static GPVPStart parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static GPVPMessage.GPVPStart parseFrom( + public static GPVPStart parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } - public static GPVPMessage.GPVPStart parseDelimitedFrom(java.io.InputStream input) + public static GPVPStart parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static GPVPMessage.GPVPStart parseDelimitedFrom( + public static GPVPStart parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static GPVPMessage.GPVPStart parseFrom( + public static GPVPStart parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static GPVPMessage.GPVPStart parseFrom( + public static GPVPStart parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -787,7 +871,7 @@ String defaultValue); public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(GPVPMessage.GPVPStart prototype) { + public static Builder newBuilder(GPVPStart prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @Override @@ -812,7 +896,7 @@ String defaultValue); public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:GPVPStart) - GPVPMessage.GPVPStartOrBuilder { + GPVPStartOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return GPVPMessage.internal_static_GPVPStart_descriptor; @@ -849,7 +933,7 @@ String defaultValue); internalGetFieldAccessorTable() { return GPVPMessage.internal_static_GPVPStart_fieldAccessorTable .ensureFieldAccessorsInitialized( - GPVPMessage.GPVPStart.class, GPVPMessage.GPVPStart.Builder.class); + GPVPStart.class, Builder.class); } // Construct using cn.jisol.ngame.proto.GPVPMessage.GPVPStart.newBuilder() @@ -876,6 +960,10 @@ String defaultValue); rightTactical_ = ""; internalGetMutableRightPets().clear(); + leftPlayerId_ = 0L; + + rightPlayerId_ = 0L; + return this; } @@ -886,13 +974,13 @@ String defaultValue); } @Override - public GPVPMessage.GPVPStart getDefaultInstanceForType() { - return GPVPMessage.GPVPStart.getDefaultInstance(); + public GPVPStart getDefaultInstanceForType() { + return GPVPStart.getDefaultInstance(); } @Override - public GPVPMessage.GPVPStart build() { - GPVPMessage.GPVPStart result = buildPartial(); + public GPVPStart build() { + GPVPStart result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -900,8 +988,8 @@ String defaultValue); } @Override - public GPVPMessage.GPVPStart buildPartial() { - GPVPMessage.GPVPStart result = new GPVPMessage.GPVPStart(this); + public GPVPStart buildPartial() { + GPVPStart result = new GPVPStart(this); int from_bitField0_ = bitField0_; result.leftTactical_ = leftTactical_; result.leftPets_ = internalGetLeftPets(); @@ -909,6 +997,8 @@ String defaultValue); result.rightTactical_ = rightTactical_; result.rightPets_ = internalGetRightPets(); result.rightPets_.makeImmutable(); + result.leftPlayerId_ = leftPlayerId_; + result.rightPlayerId_ = rightPlayerId_; onBuilt(); return result; } @@ -947,16 +1037,16 @@ String defaultValue); } @Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof GPVPMessage.GPVPStart) { - return mergeFrom((GPVPMessage.GPVPStart)other); + if (other instanceof GPVPStart) { + return mergeFrom((GPVPStart)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(GPVPMessage.GPVPStart other) { - if (other == GPVPMessage.GPVPStart.getDefaultInstance()) return this; + public Builder mergeFrom(GPVPStart other) { + if (other == GPVPStart.getDefaultInstance()) return this; if (!other.getLeftTactical().isEmpty()) { leftTactical_ = other.leftTactical_; onChanged(); @@ -969,6 +1059,12 @@ String defaultValue); } internalGetMutableRightPets().mergeFrom( other.internalGetRightPets()); + if (other.getLeftPlayerId() != 0L) { + setLeftPlayerId(other.getLeftPlayerId()); + } + if (other.getRightPlayerId() != 0L) { + setRightPlayerId(other.getRightPlayerId()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -984,11 +1080,11 @@ String defaultValue); com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - GPVPMessage.GPVPStart parsedMessage = null; + GPVPStart parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (GPVPMessage.GPVPStart) e.getUnfinishedMessage(); + parsedMessage = (GPVPStart) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -1508,6 +1604,92 @@ String defaultValue); .putAll(values); return this; } + + private long leftPlayerId_ ; + /** + *
+       *左边的玩家Id
+       * 
+ * + * int64 leftPlayerId = 5; + * @return The leftPlayerId. + */ + @Override + public long getLeftPlayerId() { + return leftPlayerId_; + } + /** + *
+       *左边的玩家Id
+       * 
+ * + * int64 leftPlayerId = 5; + * @param value The leftPlayerId to set. + * @return This builder for chaining. + */ + public Builder setLeftPlayerId(long value) { + + leftPlayerId_ = value; + onChanged(); + return this; + } + /** + *
+       *左边的玩家Id
+       * 
+ * + * int64 leftPlayerId = 5; + * @return This builder for chaining. + */ + public Builder clearLeftPlayerId() { + + leftPlayerId_ = 0L; + onChanged(); + return this; + } + + private long rightPlayerId_ ; + /** + *
+       *右边的玩家Id
+       * 
+ * + * int64 rightPlayerId = 6; + * @return The rightPlayerId. + */ + @Override + public long getRightPlayerId() { + return rightPlayerId_; + } + /** + *
+       *右边的玩家Id
+       * 
+ * + * int64 rightPlayerId = 6; + * @param value The rightPlayerId to set. + * @return This builder for chaining. + */ + public Builder setRightPlayerId(long value) { + + rightPlayerId_ = value; + onChanged(); + return this; + } + /** + *
+       *右边的玩家Id
+       * 
+ * + * int64 rightPlayerId = 6; + * @return This builder for chaining. + */ + public Builder clearRightPlayerId() { + + rightPlayerId_ = 0L; + onChanged(); + return this; + } @Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -1525,12 +1707,12 @@ String defaultValue); } // @@protoc_insertion_point(class_scope:GPVPStart) - private static final GPVPMessage.GPVPStart DEFAULT_INSTANCE; + private static final GPVPStart DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new GPVPMessage.GPVPStart(); + DEFAULT_INSTANCE = new GPVPStart(); } - public static GPVPMessage.GPVPStart getDefaultInstance() { + public static GPVPStart getDefaultInstance() { return DEFAULT_INSTANCE; } @@ -1555,7 +1737,7 @@ String defaultValue); } @Override - public GPVPMessage.GPVPStart getDefaultInstanceForType() { + public GPVPStart getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -1672,7 +1854,7 @@ String defaultValue); internalGetFieldAccessorTable() { return GPVPMessage.internal_static_GPVPText_fieldAccessorTable .ensureFieldAccessorsInitialized( - GPVPMessage.GPVPText.class, GPVPMessage.GPVPText.Builder.class); + GPVPText.class, Builder.class); } public static final int TEXT_FIELD_NUMBER = 1; @@ -1760,10 +1942,10 @@ String defaultValue); if (obj == this) { return true; } - if (!(obj instanceof GPVPMessage.GPVPText)) { + if (!(obj instanceof GPVPText)) { return super.equals(obj); } - GPVPMessage.GPVPText other = (GPVPMessage.GPVPText) obj; + GPVPText other = (GPVPText) obj; if (!getText() .equals(other.getText())) return false; @@ -1785,69 +1967,69 @@ String defaultValue); return hash; } - public static GPVPMessage.GPVPText parseFrom( + public static GPVPText parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static GPVPMessage.GPVPText parseFrom( + public static GPVPText parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static GPVPMessage.GPVPText parseFrom( + public static GPVPText parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static GPVPMessage.GPVPText parseFrom( + public static GPVPText parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static GPVPMessage.GPVPText parseFrom(byte[] data) + public static GPVPText parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static GPVPMessage.GPVPText parseFrom( + public static GPVPText parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static GPVPMessage.GPVPText parseFrom(java.io.InputStream input) + public static GPVPText parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static GPVPMessage.GPVPText parseFrom( + public static GPVPText parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } - public static GPVPMessage.GPVPText parseDelimitedFrom(java.io.InputStream input) + public static GPVPText parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } - public static GPVPMessage.GPVPText parseDelimitedFrom( + public static GPVPText parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } - public static GPVPMessage.GPVPText parseFrom( + public static GPVPText parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } - public static GPVPMessage.GPVPText parseFrom( + public static GPVPText parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -1860,7 +2042,7 @@ String defaultValue); public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } - public static Builder newBuilder(GPVPMessage.GPVPText prototype) { + public static Builder newBuilder(GPVPText prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @Override @@ -1885,7 +2067,7 @@ String defaultValue); public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:GPVPText) - GPVPMessage.GPVPTextOrBuilder { + GPVPTextOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return GPVPMessage.internal_static_GPVPText_descriptor; @@ -1896,7 +2078,7 @@ String defaultValue); internalGetFieldAccessorTable() { return GPVPMessage.internal_static_GPVPText_fieldAccessorTable .ensureFieldAccessorsInitialized( - GPVPMessage.GPVPText.class, GPVPMessage.GPVPText.Builder.class); + GPVPText.class, Builder.class); } // Construct using cn.jisol.ngame.proto.GPVPMessage.GPVPText.newBuilder() @@ -1929,13 +2111,13 @@ String defaultValue); } @Override - public GPVPMessage.GPVPText getDefaultInstanceForType() { - return GPVPMessage.GPVPText.getDefaultInstance(); + public GPVPText getDefaultInstanceForType() { + return GPVPText.getDefaultInstance(); } @Override - public GPVPMessage.GPVPText build() { - GPVPMessage.GPVPText result = buildPartial(); + public GPVPText build() { + GPVPText result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -1943,8 +2125,8 @@ String defaultValue); } @Override - public GPVPMessage.GPVPText buildPartial() { - GPVPMessage.GPVPText result = new GPVPMessage.GPVPText(this); + public GPVPText buildPartial() { + GPVPText result = new GPVPText(this); result.text_ = text_; onBuilt(); return result; @@ -1984,16 +2166,16 @@ String defaultValue); } @Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof GPVPMessage.GPVPText) { - return mergeFrom((GPVPMessage.GPVPText)other); + if (other instanceof GPVPText) { + return mergeFrom((GPVPText)other); } else { super.mergeFrom(other); return this; } } - public Builder mergeFrom(GPVPMessage.GPVPText other) { - if (other == GPVPMessage.GPVPText.getDefaultInstance()) return this; + public Builder mergeFrom(GPVPText other) { + if (other == GPVPText.getDefaultInstance()) return this; if (!other.getText().isEmpty()) { text_ = other.text_; onChanged(); @@ -2013,11 +2195,11 @@ String defaultValue); com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - GPVPMessage.GPVPText parsedMessage = null; + GPVPText parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (GPVPMessage.GPVPText) e.getUnfinishedMessage(); + parsedMessage = (GPVPText) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { @@ -2139,12 +2321,12 @@ String defaultValue); } // @@protoc_insertion_point(class_scope:GPVPText) - private static final GPVPMessage.GPVPText DEFAULT_INSTANCE; + private static final GPVPText DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new GPVPMessage.GPVPText(); + DEFAULT_INSTANCE = new GPVPText(); } - public static GPVPMessage.GPVPText getDefaultInstance() { + public static GPVPText getDefaultInstance() { return DEFAULT_INSTANCE; } @@ -2169,7 +2351,526 @@ String defaultValue); } @Override - public GPVPMessage.GPVPText getDefaultInstanceForType() { + public GPVPText getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GPVPRefereeInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:GPVPRefereeInfo) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     *获胜玩家Id
+     * 
+ * + * int64 winnerId = 1; + * @return The winnerId. + */ + long getWinnerId(); + } + /** + *
+   *PVP 裁决结束返回
+   * 
+ * + * Protobuf type {@code GPVPRefereeInfo} + */ + public static final class GPVPRefereeInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:GPVPRefereeInfo) + GPVPRefereeInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use GPVPRefereeInfo.newBuilder() to construct. + private GPVPRefereeInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GPVPRefereeInfo() { + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new GPVPRefereeInfo(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GPVPRefereeInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + winnerId_ = input.readInt64(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return GPVPMessage.internal_static_GPVPRefereeInfo_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return GPVPMessage.internal_static_GPVPRefereeInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + GPVPRefereeInfo.class, Builder.class); + } + + public static final int WINNERID_FIELD_NUMBER = 1; + private long winnerId_; + /** + *
+     *获胜玩家Id
+     * 
+ * + * int64 winnerId = 1; + * @return The winnerId. + */ + @Override + public long getWinnerId() { + return winnerId_; + } + + private byte memoizedIsInitialized = -1; + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (winnerId_ != 0L) { + output.writeInt64(1, winnerId_); + } + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (winnerId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, winnerId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof GPVPRefereeInfo)) { + return super.equals(obj); + } + GPVPRefereeInfo other = (GPVPRefereeInfo) obj; + + if (getWinnerId() + != other.getWinnerId()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + WINNERID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getWinnerId()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static GPVPRefereeInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static GPVPRefereeInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static GPVPRefereeInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static GPVPRefereeInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static GPVPRefereeInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static GPVPRefereeInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static GPVPRefereeInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static GPVPRefereeInfo parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static GPVPRefereeInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static GPVPRefereeInfo parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static GPVPRefereeInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static GPVPRefereeInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(GPVPRefereeInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     *PVP 裁决结束返回
+     * 
+ * + * Protobuf type {@code GPVPRefereeInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:GPVPRefereeInfo) + GPVPRefereeInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return GPVPMessage.internal_static_GPVPRefereeInfo_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return GPVPMessage.internal_static_GPVPRefereeInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + GPVPRefereeInfo.class, Builder.class); + } + + // Construct using cn.jisol.ngame.proto.GPVPMessage.GPVPRefereeInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @Override + public Builder clear() { + super.clear(); + winnerId_ = 0L; + + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return GPVPMessage.internal_static_GPVPRefereeInfo_descriptor; + } + + @Override + public GPVPRefereeInfo getDefaultInstanceForType() { + return GPVPRefereeInfo.getDefaultInstance(); + } + + @Override + public GPVPRefereeInfo build() { + GPVPRefereeInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public GPVPRefereeInfo buildPartial() { + GPVPRefereeInfo result = new GPVPRefereeInfo(this); + result.winnerId_ = winnerId_; + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof GPVPRefereeInfo) { + return mergeFrom((GPVPRefereeInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(GPVPRefereeInfo other) { + if (other == GPVPRefereeInfo.getDefaultInstance()) return this; + if (other.getWinnerId() != 0L) { + setWinnerId(other.getWinnerId()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + GPVPRefereeInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (GPVPRefereeInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long winnerId_ ; + /** + *
+       *获胜玩家Id
+       * 
+ * + * int64 winnerId = 1; + * @return The winnerId. + */ + @Override + public long getWinnerId() { + return winnerId_; + } + /** + *
+       *获胜玩家Id
+       * 
+ * + * int64 winnerId = 1; + * @param value The winnerId to set. + * @return This builder for chaining. + */ + public Builder setWinnerId(long value) { + + winnerId_ = value; + onChanged(); + return this; + } + /** + *
+       *获胜玩家Id
+       * 
+ * + * int64 winnerId = 1; + * @return This builder for chaining. + */ + public Builder clearWinnerId() { + + winnerId_ = 0L; + onChanged(); + return this; + } + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:GPVPRefereeInfo) + } + + // @@protoc_insertion_point(class_scope:GPVPRefereeInfo) + private static final GPVPRefereeInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new GPVPRefereeInfo(); + } + + public static GPVPRefereeInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @Override + public GPVPRefereeInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GPVPRefereeInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public GPVPRefereeInfo getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -2195,6 +2896,11 @@ String defaultValue); private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_GPVPText_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_GPVPRefereeInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_GPVPRefereeInfo_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -2204,15 +2910,17 @@ String defaultValue); descriptor; static { String[] descriptorData = { - "\n\021GPVPMessage.proto\"\365\001\n\tGPVPStart\022\024\n\014lef" + + "\n\021GPVPMessage.proto\"\242\002\n\tGPVPStart\022\024\n\014lef" + "tTactical\030\001 \001(\t\022*\n\010leftPets\030\002 \003(\0132\030.GPVP" + "Start.LeftPetsEntry\022\025\n\rrightTactical\030\003 \001" + "(\t\022,\n\trightPets\030\004 \003(\0132\031.GPVPStart.RightP" + - "etsEntry\032/\n\rLeftPetsEntry\022\013\n\003key\030\001 \001(\003\022\r" + - "\n\005value\030\002 \001(\t:\0028\001\0320\n\016RightPetsEntry\022\013\n\003k" + - "ey\030\001 \001(\003\022\r\n\005value\030\002 \001(\t:\0028\001\"\030\n\010GPVPText\022" + - "\014\n\004text\030\001 \001(\tB\026\n\024cn.jisol.ngame.protob\006p" + - "roto3" + "etsEntry\022\024\n\014leftPlayerId\030\005 \001(\003\022\025\n\rrightP" + + "layerId\030\006 \001(\003\032/\n\rLeftPetsEntry\022\013\n\003key\030\001 " + + "\001(\003\022\r\n\005value\030\002 \001(\t:\0028\001\0320\n\016RightPetsEntry" + + "\022\013\n\003key\030\001 \001(\003\022\r\n\005value\030\002 \001(\t:\0028\001\"\030\n\010GPVP" + + "Text\022\014\n\004text\030\001 \001(\t\"#\n\017GPVPRefereeInfo\022\020\n" + + "\010winnerId\030\001 \001(\003B\026\n\024cn.jisol.ngame.protob" + + "\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -2223,7 +2931,7 @@ String defaultValue); internal_static_GPVPStart_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_GPVPStart_descriptor, - new String[] { "LeftTactical", "LeftPets", "RightTactical", "RightPets", }); + new String[] { "LeftTactical", "LeftPets", "RightTactical", "RightPets", "LeftPlayerId", "RightPlayerId", }); internal_static_GPVPStart_LeftPetsEntry_descriptor = internal_static_GPVPStart_descriptor.getNestedTypes().get(0); internal_static_GPVPStart_LeftPetsEntry_fieldAccessorTable = new @@ -2242,6 +2950,12 @@ String defaultValue); com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_GPVPText_descriptor, new String[] { "Text", }); + internal_static_GPVPRefereeInfo_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_GPVPRefereeInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_GPVPRefereeInfo_descriptor, + new String[] { "WinnerId", }); } // @@protoc_insertion_point(outer_class_scope) diff --git a/JisolGameServer/Main/src/main/java/cn/jisol/game/proto/GPVPMessage.proto b/JisolGameServer/Main/src/main/java/cn/jisol/game/proto/GPVPMessage.proto index d309b115..94ef6ad0 100644 --- a/JisolGameServer/Main/src/main/java/cn/jisol/game/proto/GPVPMessage.proto +++ b/JisolGameServer/Main/src/main/java/cn/jisol/game/proto/GPVPMessage.proto @@ -9,6 +9,8 @@ message GPVPStart { map leftPets = 2; //左边的宠物 key:宠物Id value 宠物配置Id string rightTactical = 3; //右边的布阵 map rightPets = 4; //右边的宠物 key:宠物Id value 宠物配置Id + int64 leftPlayerId = 5; //左边的玩家Id + int64 rightPlayerId = 6; //右边的玩家Id } //PVP 消息提示 @@ -16,4 +18,10 @@ message GPVPText { string text = 1; //消息提示 } +//PVP 裁决结束返回 +message GPVPRefereeInfo{ + //获胜玩家Id + int64 winnerId = 1; +} + diff --git a/headless/index.js b/headless/index.js index f2f0feee..d8d07e34 100644 --- a/headless/index.js +++ b/headless/index.js @@ -1,12 +1,12 @@ // 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.123:7457/web-desktop/web-desktop/index.html" // const runCocos = () => { const { JSDOM,ResourceLoader } = require('jsdom') const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)); - +const axios = require('axios').default; const WebGL = require('gl'); const { request } = require('express'); const WebGLRenderingContext = WebGL.WebGLRenderingContext; @@ -44,6 +44,7 @@ fetch(URL).then(res => res.text()).then(html => { window.fetch = fetch; window.GUser = "100000"; window.GPassworld = "123456"; + window['axios'] = axios; }) setTimeout(() => {}, 99999999);