[+] Network

[+] Network
This commit is contained in:
ALEXTANG
2023-05-17 23:06:29 +08:00
parent e65245371a
commit 899472a5db
7 changed files with 140 additions and 51 deletions

View File

@@ -0,0 +1,30 @@
using System;
using GameProto;
namespace GameLogic
{
public class ProtoUtil
{
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;
}
}
}