add protobuff

This commit is contained in:
aozhiwei 2019-09-04 16:40:48 +08:00
parent 35581b09e6
commit 563ed701ef
3 changed files with 50 additions and 1 deletions

View File

@ -60,7 +60,7 @@ add_executable(
add_custom_target(script_pb_protocol ALL)
add_custom_command(TARGET script_pb_protocol
PRE_BUILD
COMMAND python ../../third_party/tools/scripts/construct/build_pb.py --cpp_out=. --pb_files=ss_proto,ss_msgid
COMMAND python ../../third_party/tools/scripts/construct/build_pb.py --cpp_out=. --pb_files=ss_proto,ss_msgid --nohooks 1
)
add_dependencies(masterserver script_pb_protocol)

View File

@ -0,0 +1,14 @@
package ss;
//id定义
enum SSMessageId_e
{
_SS_Ping = 8;
_SS_Pong = 9;
_SS_WSP_SocketDisconnect = 10;
_SS_WSP_RequestTargetServer = 11;
_SS_MS_ResponseTargetServer = 12;
_SS_ForceCloseSocket = 13;
}

View File

@ -0,0 +1,35 @@
package ss;
message SS_Ping
{
}
message SS_Pong
{
}
message SS_WSP_SocketDisconnect
{
}
message SS_WSP_RequestTargetServer
{
optional int64 context_id = 1;
optional string account_id = 2;
optional string team_id = 3;
}
message SS_MS_ResponseTargetServer
{
optional int32 error_code = 1;
optional string error_msg = 2;
optional int64 context_id = 3;
optional string host = 4;
optional int32 port = 5;
}
message SS_ForceCloseSocket
{
}