123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using CommonAI.Zone;
- using static CommonAI.ZoneClient.ZoneLayer;
- using ET;
- using System.IO;
- using CommonAI.ZoneClient;
- using CommonLang;
- namespace ET.Client
- {
- //处理战斗推送的消息
- [MessageHandler(SceneType.Client)]
- public class BattlePushHandler : AMHandler<BattleEventPush>
- {
- protected override async ETTask Run(Session session, BattleEventPush pushdata)
- {
- //var type = pushdata.key;
- //Log.Debug($"<<receive battle push type({type})");
- if (!BattleResourceMgr.Instance.BattleMsgDecoder.doDecode(new MemoryStream(pushdata.data), out object data))
- {
- return;
- }
- BattleMgr.Instance.Layer.ProcessMessage(data as CommonLang.Protocol.IMessage);
- /*if ((ushort)BattlePushCnst.FastStreamPush == type)
- {
- }
- else if ((ushort)BattlePushCnst.BattleClear == type)
- {
- }
- if (msg is PackEvent)
- {
- PackEvent packEvent = msg as PackEvent;
- for (int i = 0; i < packEvent.events.Count; i++)
- {
- var message = packEvent.events[i];
- if (message is Pong)
- {
- uint num = (uint)CUtils.CurrentTimeMS;
- Pong pong = message as Pong;
- var TimeDiff = (int)(num - pong.ClientTimeDayOfMS);
- Log.Debug($">>battle timediff: {TimeDiff}");
- }
- else
- {
- //mSyncMessageQueue.Add(message);
- }
- }
- }
- else
- {
- //mSyncMessageQueue.Add(message);
- }*/
- await ETTask.CompletedTask;
- }
- }
- }
|