diff --git a/Luban/Proto/Gen/NetMsgId.cs b/Luban/Proto/Gen/NetMsgId.cs index 92d447f6..ec489697 100644 --- a/Luban/Proto/Gen/NetMsgId.cs +++ b/Luban/Proto/Gen/NetMsgId.cs @@ -15,6 +15,10 @@ namespace GameProto { public partial class NetMsgId { + //心跳请求 + public const int CS_CMD_HEATBEAT_REQ = 1001; + //心跳回包 + public const int CS_CMD_HEATBEAT_RES = 1002; //帐号登录请求 public const int CS_CMD_ACT_LOGIN_REQ = 2001; //帐号登录回包 diff --git a/Luban/Proto/Gen/proto_cs.cs b/Luban/Proto/Gen/proto_cs.cs index 0fe8ca93..2769374e 100644 --- a/Luban/Proto/Gen/proto_cs.cs +++ b/Luban/Proto/Gen/proto_cs.cs @@ -52,19 +52,16 @@ namespace GameProto public partial class CSPkgBody { [global::ProtoBuf.ProtoMember(1)] - public CSActLoginReq ActLoginReq { get; set; } + public CSHeatBeatReq HeatBeatReq { get; set; } [global::ProtoBuf.ProtoMember(2)] - public CSActLoginRes ActLoginRes { get; set; } + public CSHeatBeatRes HeatBeatRes { get; set; } - } - - // 消息结果 - [Serializable,global::ProtoBuf.ProtoContract(Name = @"ProtoResult")] - public partial class ProtoResult - { [global::ProtoBuf.ProtoMember(3)] - public List Params = new List(); + public CSActLoginReq ActLoginReq { get; set; } + + [global::ProtoBuf.ProtoMember(4)] + public CSActLoginRes ActLoginRes { get; set; } } diff --git a/Luban/Proto/Gen/proto_cs_common.cs b/Luban/Proto/Gen/proto_cs_common.cs new file mode 100644 index 00000000..9d610c1c --- /dev/null +++ b/Luban/Proto/Gen/proto_cs_common.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using ProtoBuf; +using TEngine; +using System.Collections.Generic; + +namespace GameProto +{ + // 常用协议 + // 消息结果 + [Serializable,global::ProtoBuf.ProtoContract(Name = @"ProtoResult")] + public partial class ProtoResult + { + [global::ProtoBuf.ProtoMember(3)] + public List Params = new List(); + + } + + // 心跳请求 + [Serializable,global::ProtoBuf.ProtoContract(Name = @"CSHeatBeatReq")] + public partial class CSHeatBeatReq + { + [global::ProtoBuf.ProtoMember(1)] + public float HeatEchoTime { get; set; } + + } + + // 角色登录结果返回 + [Serializable,global::ProtoBuf.ProtoContract(Name = @"CSHeatBeatRes")] + public partial class CSHeatBeatRes + { + [global::ProtoBuf.ProtoMember(1)] + public float HeatEchoTime { get; set; } + + } + +} diff --git a/Luban/Proto/Gen/proto_cs_player.cs b/Luban/Proto/Gen/proto_cs_player.cs index 64f3f5db..f114c627 100644 --- a/Luban/Proto/Gen/proto_cs_player.cs +++ b/Luban/Proto/Gen/proto_cs_player.cs @@ -13,7 +13,7 @@ using System.Collections.Generic; namespace GameProto { - // 这个文件只放协议,和协议头 + // 玩家协议 // 角色登录结果请求 [Serializable,global::ProtoBuf.ProtoContract(Name = @"CSActLoginReq")] public partial class CSActLoginReq diff --git a/Luban/Proto/pb_schemas/proto_cs.proto b/Luban/Proto/pb_schemas/proto_cs.proto index c2fe39a3..7f959eba 100644 --- a/Luban/Proto/pb_schemas/proto_cs.proto +++ b/Luban/Proto/pb_schemas/proto_cs.proto @@ -23,19 +23,12 @@ message CSPkgHead // 消息协议体 message CSPkgBody { - CSActLoginReq ActLoginReq = 1; //帐号登录请求 - CSActLoginRes ActLoginRes = 2; //帐号登录回包 + CSHeatBeatReq HeatBeatReq = 1; //心跳请求 + CSHeatBeatRes HeatBeatRes = 2; //心跳回包 + CSActLoginReq ActLoginReq = 3; //帐号登录请求 + CSActLoginRes ActLoginRes = 4; //帐号登录回包 } -// 消息结果 -message ProtoResult -{ - int32 Ret =1; //操作结果,0 为成功, 其他为错误码 - int32 ParamCnt =2; //文本参数数目 - repeated string Params = 3;//Ret描述的文本参数 -} - - // 协议ID enum CSMsgID { diff --git a/Luban/Proto/pb_schemas/proto_cs_common.proto b/Luban/Proto/pb_schemas/proto_cs_common.proto new file mode 100644 index 00000000..d67d9cbc --- /dev/null +++ b/Luban/Proto/pb_schemas/proto_cs_common.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package GameProto; +// 常用协议 + +// 消息结果 +message ProtoResult +{ + int32 Ret =1; //操作结果,0 为成功, 其他为错误码 + int32 ParamCnt =2; //文本参数数目 + repeated string Params = 3;//Ret描述的文本参数 +} + +MsgId CS_CMD_HEATBEAT_REQ = 1001; //心跳请求 +// 心跳请求 +message CSHeatBeatReq +{ + float HeatEchoTime = 1; //客户端的请求时间,服务器原包带回 +} + +MsgId CS_CMD_HEATBEAT_RES = 1002; //心跳回包 +// 角色登录结果返回 +message CSHeatBeatRes +{ + float HeatEchoTime = 1; //客户端的请求时间,服务器原包带回 +} diff --git a/Luban/Proto/pb_schemas/proto_cs_player.proto b/Luban/Proto/pb_schemas/proto_cs_player.proto index cf7dc01c..48498e1e 100644 --- a/Luban/Proto/pb_schemas/proto_cs_player.proto +++ b/Luban/Proto/pb_schemas/proto_cs_player.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package GameProto; -// 这个文件只放协议,和协议头 +// 玩家协议 MsgId CS_CMD_ACT_LOGIN_REQ = 2001; //帐号登录请求 // 角色登录结果请求