public MonitorClient() : base() { CharactorPool = new WarServerCharactor(); sync = new IpcSyncClientMsg(); validateSyncClient = false; stopwatch = Stopwatch.StartNew(); /// /// 因为NetMq的缘故,所有的对Dictionary,只有NetMq线程写入, Timer线程只负责读 /// readerWriterLock = new ReaderWriterLockSlim(); task = new TimerTask(TimerTask.RIGHTNOW, TimerTask.INFINITY, 1); task.onEvent = checkClientStatus; task.DispatchToRealHandler(); }
public override void Awake() { base.Awake(); warServerMgr = WarServerManager.Instance; npcMgr = warServerMgr.npcMgr; chaPool = warServerMgr.realServer.monitor.CharactorPool; animMsg = new IpcNpcAnimMsg(); hpMsg = new IpcNpcHpMsg(); skMsg = new IpcSkillMsg(); animState = gameObject.AddComponent <ServerNpcAnimState>(); if (animState != null) { broadcast = animState.OnNewStateReceived; animState.cachedNpc = this; } }
/// <summary> /// 创建地图 /// </summary> public void CreateMap() { Charactors = WarSMgr.realServer.monitor.CharactorPool; MapInfo map = WarSMgr.realServer.mWar.Map; //将数据发给客户端 WarSMgr.realServer.proxyCli.CtorEnv(map); if (map.type == ConfigType.PVEChapter) { ChapterModel chatperModel = Core.Data.getIModelConfig <ChapterModel>(); curChapConfig = chatperModel.get(map.ID); } else { PVPBattleModel pvpModel = Core.Data.getIModelConfig <PVPBattleModel>(); curChapConfig = pvpModel.get(map.ID); } }