血战到底协议定义,和郭涛简单确认过

master_huanxiang
王永芳 2019-06-13 14:52:12 +08:00
parent 1543d1f8f6
commit be8e68a55b
2 changed files with 60 additions and 57 deletions

View File

@ -0,0 +1,52 @@
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 GameStartRequest{
//时间戳,用户客户端修正因网络延时引起的误差,是否使用由实现机制决定,暂时保留
optional int64 clientTimestamp = 1;
}
message GameStartResponse{
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 int32 leftTime = 7;
// 临时背包
optional Drop temporaryItems = 8;
}
message SyncMyselfMoveRequest{
optional int64 clientTimestamp = 1; //请求中的时间戳,原值返回
optional int32 tartXY = 2;
}
message SyncMyselfMoveResponse{
optional int64 clientTimestamp = 1; //请求中的时间戳,原值返回
optional int64 serverTimestamp = 2; //服务器端时间戳
}
message SyncOtherFightIndication{
//参与战斗的用户ID
optional AgentInfo player1 = 1;
optional AgentInfo player2 = 2;
optional int32 result = 3; //1 player1胜 2 player2胜
}

View File

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