mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
[+] Network
[+] Network
This commit is contained in:
30
Assets/GameScripts/HotFix/GameLogic/Network/ProtoUtil.cs
Normal file
30
Assets/GameScripts/HotFix/GameLogic/Network/ProtoUtil.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4d4427af9be14c56b01e4674853c09a8
|
||||
timeCreated: 1684334469
|
Reference in New Issue
Block a user