2023-08-31 03:15:38 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
package dof;
|
|
|
|
|
option go_package = "./;pb";
|
|
|
|
|
|
2023-10-20 09:02:57 +00:00
|
|
|
import "google/protobuf/any.proto";
|
|
|
|
|
|
2023-08-31 03:15:38 +00:00
|
|
|
// ClientMessage 客户端发送给服务端的消息类型
|
|
|
|
|
message ClientMessage {
|
|
|
|
|
oneof actual {
|
|
|
|
|
PlayerEnter player_enter = 1;
|
|
|
|
|
LevelPrepared level_prepared = 2;
|
|
|
|
|
PointFound point_found = 3;
|
|
|
|
|
LevelEnd level_end = 4;
|
|
|
|
|
AllLevelEnd all_level_end = 5;
|
|
|
|
|
PlayerLeave player_leave = 6;
|
2023-09-15 10:06:10 +00:00
|
|
|
|
|
|
|
|
Heartbeat heartbeat = 21;
|
2023-08-31 03:15:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ServerMessage 服务端发送给客户端的消息类型
|
|
|
|
|
message ServerMessage {
|
|
|
|
|
oneof actual {
|
|
|
|
|
PlayerEntered player_entered = 1;
|
|
|
|
|
GameStart game_start = 2;
|
|
|
|
|
LevelStart level_start = 3;
|
|
|
|
|
PointFound point_found = 4;
|
|
|
|
|
GameFinish game_finish = 5;
|
2023-09-18 07:55:06 +00:00
|
|
|
|
|
|
|
|
Heartbeat heartbeat = 21;
|
2023-08-31 03:15:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PlayerEnter 客户端进入房间
|
|
|
|
|
message PlayerEnter {
|
|
|
|
|
string room_id = 1;
|
|
|
|
|
string uid = 2;
|
|
|
|
|
string nick_name = 3;
|
|
|
|
|
string country = 4;
|
2023-09-15 10:06:10 +00:00
|
|
|
string app_id = 5;
|
|
|
|
|
string token = 6;
|
2023-08-31 03:15:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message LevelResource {
|
|
|
|
|
string level_id = 1;
|
|
|
|
|
string android_generation = 2;
|
|
|
|
|
string ios_generation = 3;
|
2023-09-18 07:55:06 +00:00
|
|
|
int32 diff_count = 4;
|
2023-08-31 03:15:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PlayerEntered 服务端接收到 PlayerEnter 消息后发还给客户端的回执
|
|
|
|
|
message PlayerEntered {
|
|
|
|
|
int64 cid = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message GameStart {
|
|
|
|
|
repeated LevelResource level_resource = 1;
|
2023-09-13 09:58:39 +00:00
|
|
|
repeated PlayerEnter player_entered = 2;
|
2023-08-31 03:15:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message LevelPrepared {
|
|
|
|
|
int64 cid = 1;
|
|
|
|
|
string level = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message LevelStart {
|
|
|
|
|
string level = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message PointFound {
|
|
|
|
|
int64 cid = 1;
|
|
|
|
|
string level = 2;
|
|
|
|
|
int32 point_id = 3;
|
2023-09-15 10:06:10 +00:00
|
|
|
float combo = 4;
|
2023-08-31 03:15:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message LevelEnd {
|
|
|
|
|
int64 cid = 1;
|
|
|
|
|
string level = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message AllLevelEnd {
|
|
|
|
|
int64 cid = 1;
|
2023-09-15 10:06:10 +00:00
|
|
|
float time_spent = 2;
|
2023-08-31 03:15:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message GameScore {
|
|
|
|
|
string uid = 1;
|
|
|
|
|
int32 score = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message GameFinish {
|
|
|
|
|
repeated GameScore scores = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message PlayerLeave {
|
|
|
|
|
int64 cid = 1;
|
2023-09-15 10:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message Heartbeat {
|
|
|
|
|
int64 timestamp = 1;
|
2023-10-20 09:02:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message Assignment {
|
|
|
|
|
// Connection information for this Assignment.
|
|
|
|
|
string connection = 1;
|
|
|
|
|
|
|
|
|
|
// Customized information not inspected by Open Match, to be used by the match
|
|
|
|
|
// making function, evaluator, and components making calls to Open Match.
|
|
|
|
|
// Optional, depending on the requirements of the connected systems.
|
|
|
|
|
map<string, google.protobuf.Any> extensions = 4;
|
|
|
|
|
|
|
|
|
|
// Deprecated fields.
|
|
|
|
|
reserved 2, 3;
|
2023-09-13 09:58:39 +00:00
|
|
|
}
|