Example #1
0
        public GameManager(Room room)
        {
            Room       = room;
            teamPoints = new int[5];
            teamItems  = new List <RoomItem> [5];
            for (int i = 1; i < 5; i++)
            {
                teamItems[i] = new List <RoomItem>();
            }

            GameStarted = false;

            BattleBanzai = new Banzai(room);
            Freeze       = new Freeze();
        }
Example #2
0
File: Room.cs Project: habb0/Bfly
        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.AppendRawUInt(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.AppendRawUInt(Item.Id);
                    Message.AppendStringWithBreak("");
                    Message.AppendBoolean(false);
                    messages.Add(Message);
                }
            }

            SendMessage(messages);

            mCycleEnded = true;
            using (IQueryAdapter dbClient = ButterflyEnvironment.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);
        }
Example #3
0
File: Room.cs Project: habb0/Bfly
 internal Freeze GetFreeze()
 {
     if (freeze == null)
         freeze = new Freeze(this);
     return freeze;
 }
Example #4
0
File: Room.cs Project: BjkGkh/R106
        internal void FlushSettings()
        {
            List<ServerMessage> messages = new List<ServerMessage>();

            lock (GetRoomItemHandler().mFloorItems)
            {
                foreach (RoomItem Item in GetRoomItemHandler().mFloorItems.Values)
                {
                    ServerMessage Message = PacketHandelingManager.GetRecycledItem(OutputCode.ObjectRemoveMessageEvent);
                    Message.AddInt32((int)Item.Id);
                    Message.AddString(string.Empty);
                    Message.AddBoolean(false);
                    
                    messages.Add(Message);
                }
            }


            lock (GetRoomItemHandler().mWallItems)
            {
                foreach (RoomItem Item in GetRoomItemHandler().mWallItems.Values)
                {
                    ServerMessage Message = PacketHandelingManager.GetRecycledItem(OutputCode.ItemRemoveMessageEvent);
                    Message.AddString(Item.Id.ToString());
                    messages.Add(Message);
                }
            }

            SendMessage(messages);

            mCycleEnded = true;
            using (IQueryAdapter dbClient = ButterflyEnvironment.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);
        }