40 lines
1020 B
C#
40 lines
1020 B
C#
using System.Collections.Generic;
|
|
using BrewMonster;
|
|
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;
|
|
}
|
|
}
|