mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
30 lines
728 B
C#
30 lines
728 B
C#
using System;
|
|
using GameProto;
|
|
|
|
namespace GameLogic
|
|
{
|
|
public partial class ProtobufUtility
|
|
{
|
|
public static UInt32 MsgEcho = 0;
|
|
|
|
/// <summary>
|
|
/// 根据msgId来生成一个数据包
|
|
/// </summary>
|
|
/// <param name="msgId"></param>
|
|
/// <returns></returns>
|
|
public static CSPkg BuildCsMsg(int msgId)
|
|
{
|
|
CSPkg tmp = new CSPkg();
|
|
tmp.Head = new CSPkgHead();
|
|
tmp.Head.MsgId = (UInt16)msgId;
|
|
tmp.Head.Echo = GetNextEcho();
|
|
// tmp.Body.create(msgId);
|
|
return tmp;
|
|
}
|
|
|
|
private static UInt32 GetNextEcho()
|
|
{
|
|
return ++MsgEcho;
|
|
}
|
|
}
|
|
} |