internal Room() { dispatcher_ = new Dispatcher(); seat_player_dict_ = new MyDictionary<string, uint>(); disconnected_users_ = new List<User>(); request_delete_users_ = new List<User>(); can_close_time_ = 0; room_users_ = new List<User>(); for (int i = 0; i < room_observers_.Length; ++i) { room_observers_[i] = new Observer(); room_observers_[i].OwnRoom = this; } }
internal void SyncForNewObserver(Observer observer) { if (null != observer) { Room room = GetRoom(); if (null != room && null != room.ActiveScene) { //同步场景数据给观察者 for (LinkedListNode<EntityInfo> linkNode = EntityManager.Entities.FirstValue; null != linkNode; linkNode = linkNode.Next) { EntityInfo npc = linkNode.Value; if (null != npc) { Msg_RC_CreateNpc bder = DataSyncUtility.BuildCreateNpcMessage(npc); observer.SendMessage(RoomMessageDefine.Msg_RC_CreateNpc, bder); } } } } }
internal static void SyncBuffListToObserver(EntityInfo obj, Observer observer) { List<ImpactInfo> impacts = obj.GetSkillStateInfo().GetAllImpact(); foreach (ImpactInfo info in impacts) { } }
internal void DropObserver(Observer observer) { if (observer.IsConnected()) { observer.Disconnect(); } observer.IsEntered = false; //observer.IsIdle = true; }