From d1a6e38869ae5f2fb93ecbd90c16c47644abfe09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=B0=B8=E8=8A=B3?= Date: Fri, 14 Jun 2019 18:48:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E5=8C=B9=E9=85=8D=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=88=BF=E9=97=B4=E5=90=8E=EF=BC=8C=E5=8F=91?= =?UTF-8?q?=E9=80=81=E5=9C=B0=E5=9B=BE=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protos/RoomFightProto.proto | 30 ++++++------------------------ protos/RoomProto.proto | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/protos/RoomFightProto.proto b/protos/RoomFightProto.proto index 978b3f8..f7996d2 100644 --- a/protos/RoomFightProto.proto +++ b/protos/RoomFightProto.proto @@ -3,35 +3,17 @@ package com.ljsd.jieling.protocols; option optimize_for = SPEED; import "CommonProto.proto"; - message AgentInfo { - optional int32 playerUid = 1; - optional int32 curHp = 2; - optional int32 maxHp =3; - optional int32 camp =4; //阵营 区分敌我 - optional int32 curXY =5; //所在位置 - repeated FoodBuffer foodBuffers = 6; // buff - optional int32 reviveTime = 7; // 死亡复活剩余时间 - repeated int32 dieList = 8; // 死亡计数(按顺序记录杀死自己的玩家uid) - repeated int32 killList = 9; // 杀人计数(按顺序记录自己杀死的玩家uid) - } + message RoomGameStartRequest{ //时间戳,用户客户端修正因网络延时引起的误差,是否使用由实现机制决定,暂时保留 optional int64 clientTimestamp = 1; } message RoomGameStartResponse{ optional int64 clientTimestamp = 1; //请求中的时间戳,原值返回 - optional int64 serverTimestamp = 2; //服务器端时间戳 - optional int32 mapId =3; - // 地图信息 - repeated Cell mapList = 4; - // 所用英雄 - optional AgentInfo agentInfo = 5; - // 其他人 - repeated AgentInfo otherAgentInfos = 6; + optional int64 serverTimestamp = 2; //服务器端时间戳 + // 探索地图剩余时间(秒) - optional int32 leftTime = 7; - // 临时背包 - optional Drop temporaryItems = 8; + optional int32 leftTime = 3; } message RoomGameEndIndication{ @@ -55,8 +37,8 @@ import "CommonProto.proto"; message RoomTriggerFightIndication{ //参与战斗的用户ID - optional AgentInfo player1 = 1; - optional AgentInfo player2 = 2; + optional int32 player1 = 1; + optional int32 player2 = 2; optional int32 result = 3; //1 player1胜 2 player2胜 } \ No newline at end of file diff --git a/protos/RoomProto.proto b/protos/RoomProto.proto index b2ab938..047faa8 100644 --- a/protos/RoomProto.proto +++ b/protos/RoomProto.proto @@ -3,6 +3,18 @@ package com.ljsd.jieling.protocols; option optimize_for = SPEED; import "CommonProto.proto"; + message AgentInfo { + optional int32 playerUid = 1; + optional int32 curHp = 2; + optional int32 maxHp =3; + optional int32 camp =4; //阵营 区分敌我 + optional int32 curXY =5; //所在位置 + repeated FoodBuffer foodBuffers = 6; // buff + optional int32 reviveTime = 7; // 死亡复活剩余时间 + repeated int32 dieList = 8; // 死亡计数(按顺序记录杀死自己的玩家uid) + repeated int32 killList = 9; // 杀人计数(按顺序记录自己杀死的玩家uid) + } + //因为多个人在一个房间中战斗,需要实现实时的处理方案 //匹配进入的房间 @@ -29,6 +41,13 @@ import "CommonProto.proto"; message RoomMatchSuccessIndication{ optional int32 roomId = 1; optional int32 type = 2; //type 匹配游戏类型 1血战 + optional int32 mapId =3; + // 地图信息 + repeated Cell mapList = 4; + // 其他人 + repeated AgentInfo agentInfos = 5; //playerUid和自己一致的就是自己的信息 + // 临时背包 + optional Drop temporaryItems = 6; } //必须有准备过程防止因为机器性能原因导致,性能好的先进入游戏