예제 #1
0
파일: Room.cs 프로젝트: habb0/PiciEmulator
 internal Freeze GetFreeze()
 {
     if (freeze == null)
         freeze = new Freeze(this);
     return freeze;
 }
예제 #2
0
파일: Room.cs 프로젝트: habb0/PiciEmulator
        internal void FlushSettings()
        {
            List<ServerMessage> messages = new List<ServerMessage>();

            lock (GetRoomItemHandler().mFloorItems)
            {
                foreach (RoomItem Item in GetRoomItemHandler().mFloorItems.Values)
                {
                    ServerMessage Message = new ServerMessage(94);
                    Message.AppendUInt(Item.Id);
                    Message.AppendStringWithBreak("");
                    Message.AppendBoolean(false);
                    messages.Add(Message);
                }
            }

            lock (GetRoomItemHandler().mWallItems)
            {
                foreach (RoomItem Item in GetRoomItemHandler().mWallItems.Values)
                {
                    ServerMessage Message = new ServerMessage(84);
                    Message.AppendUInt(Item.Id);
                    Message.AppendStringWithBreak("");
                    Message.AppendBoolean(false);
                    messages.Add(Message);
                }
            }

            SendMessage(messages);

            mCycleEnded = true;
            using (IQueryAdapter dbClient = PiciEnvironment.GetDatabaseManager().getQueryreactor())
                GetRoomItemHandler().SaveFurniture(dbClient);

            Tags.Clear();
            UsersWithRights.Clear();
            Bans.Clear();
            ActiveTrades.Clear();

            if (GotFreeze())
                freeze = new Freeze(this);
            if (GotBanzai())
                banzai = new BattleBanzai(this);
            if (GotSoccer())
                soccer = new Soccer(this);
            if (gameItemHandler != null)
                gameItemHandler = new GameItemHandler(this);
        }