Files
test/Assets/Scripts/EC_GameRun.Task.cs
T

38 lines
1.0 KiB
C#

using System.Collections.Generic;
using BrewMonster.Network;
using CSNetwork;
using CSNetwork.GPDataType;
// Game runtime partial class
partial class CECGameRun : IMsgHandler
{
private readonly Dictionary<int, int> m_CommonDataTab = new Dictionary<int, int>();
public int GetCommonData(int key)
{
// Lookup a common data value by key
// 按键查找通用数据值
if (m_CommonDataTab != null && m_CommonDataTab.TryGetValue(key, out var value))
return value;
else
return 0;
}
private CECCounter l_QueryServerTime = new CECCounter(); // ѯǰʱ
public int HandlerId => -1;
public bool ProcessMessage(ECMSG Msg)
{
switch (Msg.dwMsg)
{
case CommandID.SERVER_TIME:
EC_Game.SetServerTime((int)Msg.dwParam1, (int)Msg.dwParam2);
l_QueryServerTime.Reset();
break;
}
return true;
}
}