血战到底协议定义
parent
3e43c06dae
commit
1543d1f8f6
|
|
@ -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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue