diff --git a/protos/RoomProto.proto b/protos/RoomProto.proto new file mode 100644 index 0000000..0c5eddb --- /dev/null +++ b/protos/RoomProto.proto @@ -0,0 +1,91 @@ +package com.ljsd.jieling.protocols; + +option optimize_for = SPEED; + +import "CommonProto.proto"; + + //因为多个人在一个房间中战斗,需要实现实时的处理方案 + + //匹配进入的房间 + message RoomMatchRequest{ + //时间戳,用户客户端修正因网络延时引起的误差,是否使用由实现机制决定,暂时保留 + optional int64 clientTimestamp = 1; + } + //匹配应答 + message RoomMatchResponse{ + optional int64 clientTimestamp = 1; //请求中的时间戳,原值返回 + optional int64 serverTimestamp = 1; //服务器端时间戳 + } + + //取消匹配,必须等待服务器应答成功后,客户端才能退出匹配界面, + //否则可能服务器端可能匹配成功,客户端退出了匹配模式 + message RoomCancelMatchRequest{ + } + + message RoomCancelMatchResponse{ + optional bool result; //true 取消成功,false 不能取消 + } + + message MatchSuccessIndication{ + optional int32 roomId; + // 地图信息 + repeated Cell mapList = 1; + // 当前所在坐标 + optional int32 curXY = 2; + // 所用英雄 + repeated HeroInfo heroInfos = 3; + // 探索地图剩余时间(秒) + optional int32 leftTime = 4; + // 临时背包 + optional Drop temporaryItems = 5; + // buff + repeated FoodBuffer foodBuffers = 6; + // 走过的格子 + repeated int32 wakeCells = 7; + // 任务 + optional Mission missions = 8; + // 复活剩余时间 + optional int32 reviveTime = 9; + // 死亡次数 + optional int32 dieCount = 10; + } + + //必须有准备过程防止因为机器性能原因导致,性能好的先进入游戏 + message StartGameReadyRequest{ + //时间戳,用户客户端修正因网络延时引起的误差,是否使用由实现机制决定,暂时保留 + optional int64 clientTimestamp = 1; + } + //匹配应答 + message StartGameReadyResponse{ + optional int64 clientTimestamp = 1; //请求中的时间戳,原值返回 + optional int64 serverTimestamp = 1; //服务器端时间戳 + } + + message StartGameIndication{ + optional int32 roomId; + } + message SyncMyselfMoveRequest{ + optional int64 clientTimestamp = 1; //请求中的时间戳,原值返回 + optional int32 tartX; + optional int32 tartY; + } + message SyncMyselfMoveResponse{ + optional int64 clientTimestamp = 1; //请求中的时间戳,原值返回 + optional int64 serverTimestamp = 1; //服务器端时间戳 + } + message SyncOtherMoveIndication{ + optional int32 tartX; + optional int32 tartY; + } + message SyncOtherMoveIndication{ + //参与战斗的用户ID + optional int32 player1Uid; + optional int32 player2Uid; + optional int32 successUid; //当为-1是,表示平局 + //战斗结束后用的的位置 + optional int32 player1X; + optional int32 player1Y; + optional int32 player2X; + optional int32 player2Y; + } + \ No newline at end of file