You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

44 lines
1.6 KiB

using System;
using Sog;
using ProtoCSStruct;
namespace Battle
{
public static class SysSvc
{
public static void OnAddServerTimeSync(uint remoteAppID, StructPacket packet)
{
ref SSAddServerTimeSync sync = ref packet.GetMessage<SSAddServerTimeSync>();
TraceLog.Debug("SysSvc.OnAddServerTimeSync serverid {0} offset {1}"
, ServerIDUtils.IDToString(remoteAppID), sync.Offset);
BattleServerUtils.GetApp().Time.SetOffset(sync.Offset);
BattleServerUtils.GetApp().Time.UpdateTime();
TraceLog.Debug("SysSvc.OnAddServerTimeSync serverid {0} offset {1} set time success"
, ServerIDUtils.IDToString(remoteAppID), sync.Offset);
}
public static void BattleServerVersionReq(uint remoteAppID, StructPacket packet)
{
//SSBattleServerVersionRes res = new SSBattleServerVersionRes();
//res.RemoteAppID = BattleServerUtils.GetAppID();
//res.BattleVersion = BattleServerUtils.GetBattleVersion();
//BattleServerUtils.GetPacketSender().SendToServerByID(remoteAppID, (int)SSGameMsgID.BattleServerVersionRes, ref res, 0);
}
public static void SynSelfVersionToGame()
{
SSBattleServerVersionRes res = new SSBattleServerVersionRes();
res.RemoteAppID = BattleServerUtils.GetAppID();
res.BattleVersion = BattleServerUtils.GetBattleVersion();
//广播给所有game
BattleServerUtils.GetPacketSender().Broadcast((int)ServerType.Game, (int)SSGameMsgID.BattleServerVersionRes, ref res, 0, 0);
}
}
}