From 1543d1f8f644301f95a39f9728c63361a54de1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=B0=B8=E8=8A=B3?= Date: Thu, 13 Jun 2019 13:34:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=80=E6=88=98=E5=88=B0=E5=BA=95=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protos/RoomProto.proto | 61 +++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/protos/RoomProto.proto b/protos/RoomProto.proto index 0c5eddb..8a2ac02 100644 --- a/protos/RoomProto.proto +++ b/protos/RoomProto.proto @@ -3,7 +3,11 @@ package com.ljsd.jieling.protocols; option optimize_for = SPEED; import "CommonProto.proto"; - + message HeroInfo { + optional string heroId = 1; + optional int32 heroHp = 2; + optional int32 heroMaxHp =3; + } //因为多个人在一个房间中战斗,需要实现实时的处理方案 //匹配进入的房间 @@ -14,7 +18,7 @@ import "CommonProto.proto"; //匹配应答 message RoomMatchResponse{ optional int64 clientTimestamp = 1; //请求中的时间戳,原值返回 - optional int64 serverTimestamp = 1; //服务器端时间戳 + optional int64 serverTimestamp = 2; //服务器端时间戳 } //取消匹配,必须等待服务器应答成功后,客户端才能退出匹配界面, @@ -23,31 +27,31 @@ import "CommonProto.proto"; } message RoomCancelMatchResponse{ - optional bool result; //true 取消成功,false 不能取消 + optional bool result = 1; //true 取消成功,false 不能取消 } message MatchSuccessIndication{ - optional int32 roomId; + optional int32 roomId =1; // 地图信息 - repeated Cell mapList = 1; + repeated Cell mapList = 2; // 当前所在坐标 - optional int32 curXY = 2; + optional int32 curXY = 3; // 所用英雄 - repeated HeroInfo heroInfos = 3; + repeated HeroInfo heroInfos = 4; // 探索地图剩余时间(秒) - optional int32 leftTime = 4; + optional int32 leftTime = 5; // 临时背包 - optional Drop temporaryItems = 5; + optional Drop temporaryItems = 6; // buff - repeated FoodBuffer foodBuffers = 6; + repeated FoodBuffer foodBuffers = 7; // 走过的格子 - repeated int32 wakeCells = 7; + repeated int32 wakeCells = 8; // 任务 - optional Mission missions = 8; + optional Mission missions = 9; // 复活剩余时间 - optional int32 reviveTime = 9; + optional int32 reviveTime = 10; // 死亡次数 - optional int32 dieCount = 10; + optional int32 dieCount = 11; } //必须有准备过程防止因为机器性能原因导致,性能好的先进入游戏 @@ -58,34 +62,31 @@ import "CommonProto.proto"; //匹配应答 message StartGameReadyResponse{ optional int64 clientTimestamp = 1; //请求中的时间戳,原值返回 - optional int64 serverTimestamp = 1; //服务器端时间戳 + optional int64 serverTimestamp = 2; //服务器端时间戳 } message StartGameIndication{ - optional int32 roomId; + optional int32 roomId = 1; } message SyncMyselfMoveRequest{ optional int64 clientTimestamp = 1; //请求中的时间戳,原值返回 - optional int32 tartX; - optional int32 tartY; + optional int32 tartX = 2; + optional int32 tartY = 3; } message SyncMyselfMoveResponse{ optional int64 clientTimestamp = 1; //请求中的时间戳,原值返回 - optional int64 serverTimestamp = 1; //服务器端时间戳 - } - message SyncOtherMoveIndication{ - optional int32 tartX; - optional int32 tartY; + optional int64 serverTimestamp = 2; //服务器端时间戳 } + message SyncOtherMoveIndication{ //参与战斗的用户ID - optional int32 player1Uid; - optional int32 player2Uid; - optional int32 successUid; //当为-1是,表示平局 + optional int32 player1Uid = 1; + optional int32 player2Uid = 2; + optional int32 successUid = 3; //当为-1是,表示平局 //战斗结束后用的的位置 - optional int32 player1X; - optional int32 player1Y; - optional int32 player2X; - optional int32 player2Y; + optional int32 player1X = 4; + optional int32 player1Y = 5; + optional int32 player2X = 6; + optional int32 player2Y = 7; } \ No newline at end of file