Esempio n. 1
0
 internal void FlushSettings()
 {
     this.mCycleEnded = true;
     using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor())
     {
         this.GetRoomItemHandler().SaveFurniture(queryreactor, null);
     }
     this.Tags.Clear();
     this.UsersWithRights.Clear();
     this.Bans.Clear();
     this.ActiveTrades.Clear();
     this.LoadedGroups.Clear();
     if (this.GotFreeze())
     {
         this.freeze = new Freeze(this);
     }
     if (this.GotBanzai())
     {
         this.banzai = new BattleBanzai(this);
     }
     if (this.GotSoccer())
     {
         this.soccer = new Soccer(this);
     }
     if (this.gameItemHandler != null)
     {
         this.gameItemHandler = new GameItemHandler(this);
     }
 }
Esempio n. 2
0
        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 = FirewindEnvironment.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);
            }
        }
 public BattleBanzai GetBanzai()
 {
     if (_banzai == null)
     {
         _banzai = new BattleBanzai(this);
     }
     return(_banzai);
 }
Esempio n. 4
0
 internal BattleBanzai GetBanzai()
 {
     if (banzai == null)
     {
         banzai = new BattleBanzai(this);
     }
     return(banzai);
 }
Esempio n. 5
0
        public void Dispose()
        {
            SendPacket(new CloseConnectionComposer());

            if (!mDisposed)
            {
                isCrashed = false;
                mDisposed = true;

                /* TODO: Needs reviewing */
                try
                {
                    if (ProcessTask != null && ProcessTask.IsCompleted)
                    {
                        ProcessTask.Dispose();
                    }
                }
                catch { }

                if (ActiveTrades.Count > 0)
                {
                    ActiveTrades.Clear();
                }

                TonerData     = null;
                MoodlightData = null;

                if (MutedUsers.Count > 0)
                {
                    MutedUsers.Clear();
                }

                if (Tents.Count > 0)
                {
                    Tents.Clear();
                }

                if (UsersWithRights.Count > 0)
                {
                    UsersWithRights.Clear();
                }

                if (_gameManager != null)
                {
                    _gameManager.Dispose();
                    _gameManager = null;
                }

                if (_freeze != null)
                {
                    _freeze.Dispose();
                    _freeze = null;
                }

                if (_soccer != null)
                {
                    _soccer.Dispose();
                    _soccer = null;
                }

                if (_banzai != null)
                {
                    _banzai.Dispose();
                    _banzai = null;
                }

                if (_gamemap != null)
                {
                    _gamemap.Dispose();
                    _gamemap = null;
                }

                if (_gameItemHandler != null)
                {
                    _gameItemHandler.Dispose();
                    _gameItemHandler = null;
                }

                // Room Data?

                if (teambanzai != null)
                {
                    teambanzai.Dispose();
                    teambanzai = null;
                }

                if (teamfreeze != null)
                {
                    teamfreeze.Dispose();
                    teamfreeze = null;
                }

                if (_roomUserManager != null)
                {
                    _roomUserManager.Dispose();
                    _roomUserManager = null;
                }

                if (_roomItemHandling != null)
                {
                    _roomItemHandling.Dispose();
                    _roomItemHandling = null;
                }

                if (_wordFilterList.Count > 0)
                {
                    _wordFilterList.Clear();
                }

                if (_filterComponent != null)
                {
                    _filterComponent.Cleanup();
                }

                if (_wiredComponent != null)
                {
                    _wiredComponent.Cleanup();
                }

                if (_bansComponent != null)
                {
                    _bansComponent.Cleanup();
                }

                if (_tradingComponent != null)
                {
                    _tradingComponent.Cleanup();
                }
            }
        }
Esempio n. 6
0
 public BattleBanzai GetBanzai()
 {
     return(_banzai ?? (_banzai = new BattleBanzai(this)));
 }