コード例 #1
0
        public Room(RoomData data)
            : base(data)
        {
            IsLagging = 0;
            Unloaded  = false;
            IdleTime  = 0;

            RoomMuted = false;

            MutedUsers = new Dictionary <int, double>();
            Tents      = new Dictionary <int, List <RoomUser> >();

            _gamemap          = new Gamemap(this, data.Model);
            _roomItemHandling = new RoomItemHandling(this);

            _roomUserManager  = new RoomUserManager(this);
            _filterComponent  = new FilterComponent(this);
            _wiredComponent   = new WiredComponent(this);
            _bansComponent    = new BansComponent(this);
            _tradingComponent = new TradingComponent(this);

            GetRoomItemHandler().LoadFurniture();
            GetGameMap().GenerateMaps();

            LoadPromotions();
            LoadRights();
            LoadFilter();
            InitBots();
            InitPets();

            lastRegeneration = DateTime.Now;
        }
コード例 #2
0
 public RoomItemHandling GetRoomItemHandler()
 {
     if (_roomItemHandling == null)
     {
         _roomItemHandling = new RoomItemHandling(this);
     }
     return(_roomItemHandling);
 }
コード例 #3
0
ファイル: Room.cs プロジェクト: BjkGkh/Boon
        //private ProcessComponent _process = null;
        public Room(RoomData Data)
        {
            this.IsLagging = 0;
            this.IdleTime = 0;

            this._roomData = Data;
            RoomMuted = false;
            mDisposed = false;

            this.Id = Data.Id;
            this.Name = Data.Name;
            this.Description = Data.Description;
            this.OwnerName = Data.OwnerName;
            this.OwnerId = Data.OwnerId;

            this.Category = Data.Category;
            this.Type = Data.Type;
            this.Access = Data.Access;
            this.UsersNow = 0;
            this.UsersMax = Data.UsersMax;
            this.ModelName = Data.ModelName;
            this.Score = Data.Score;
            this.Tags = new List<string>();
            foreach (string tag in Data.Tags)
            {
                Tags.Add(tag);
            }

            this.AllowPets = Data.AllowPets;
            this.AllowPetsEating = Data.AllowPetsEating;
            this.RoomBlockingEnabled = Data.RoomBlockingEnabled;
            this.Hidewall = Data.Hidewall;
            this.Group = Data.Group;

            this.Password = Data.Password;
            this.Wallpaper = Data.Wallpaper;
            this.Floor = Data.Floor;
            this.Landscape = Data.Landscape;

            this.WallThickness = Data.WallThickness;
            this.FloorThickness = Data.FloorThickness;

            this.chatMode = Data.chatMode;
            this.chatSize = Data.chatSize;
            this.chatSpeed = Data.chatSpeed;
            this.chatDistance = Data.chatDistance;
            this.extraFlood = Data.extraFlood;

            this.TradeSettings = Data.TradeSettings;

            this.WhoCanBan = Data.WhoCanBan;
            this.WhoCanKick = Data.WhoCanKick;
            this.WhoCanBan = Data.WhoCanBan;

            this.PushEnabled = Data.PushEnabled;
            this.PullEnabled = Data.PullEnabled;
            this.SPullEnabled = Data.SPullEnabled;
            this.SPushEnabled = Data.SPushEnabled;
            this.EnablesEnabled = Data.EnablesEnabled;
            this.RespectNotificationsEnabled = Data.RespectNotificationsEnabled;
            this.PetMorphsAllowed = Data.PetMorphsAllowed;

            this.ActiveTrades = new ArrayList();
            this.Bans = new Dictionary<int, double>();
            this.MutedUsers = new Dictionary<int, double>();
            this.Tents = new Dictionary<int, List<RoomUser>>();

            _gamemap = new Gamemap(this);
            if (_roomItemHandling == null)
                _roomItemHandling = new RoomItemHandling(this);
            _roomUserManager = new RoomUserManager(this);

            this._filterComponent = new FilterComponent(this);
            this._wiredComponent = new WiredComponent(this);

            GetRoomItemHandler().LoadFurniture();
            GetGameMap().GenerateMaps();

            this.LoadPromotions();
            this.LoadRights();
            this.LoadBans();
            this.LoadFilter();
            this.InitBots();
            this.InitPets();

            Data.UsersNow = 1;
        }
コード例 #4
0
ファイル: Room.cs プロジェクト: BjkGkh/Boon
 public RoomItemHandling GetRoomItemHandler()
 {
     if (_roomItemHandling == null)
     {
         _roomItemHandling = new RoomItemHandling(this);
     }
     return _roomItemHandling;
 }
コード例 #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();
                }
            }
        }
コード例 #6
0
        public Room(RoomData Data)
        {
            IsLagging   = 0;
            IdleTime    = 0;
            RoomData    = Data;
            RoomMuted   = false;
            mDisposed   = false;
            Id          = Data.Id;
            Name        = Data.Name;
            Description = Data.Description;
            OwnerName   = Data.OwnerName;
            OwnerId     = Data.OwnerId;
            Category    = Data.Category;
            Type        = Data.Type;
            Access      = Data.Access;
            UsersNow    = 0;
            UsersMax    = Data.UsersMax;
            ModelName   = Data.ModelName;
            Score       = Data.Score;
            Tags        = new List <string>();
            foreach (var tag in Data.Tags)
            {
                Tags.Add(tag);
            }

            AllowPets           = Data.AllowPets;
            AllowPetsEating     = Data.AllowPetsEating;
            RoomBlockingEnabled = Data.RoomBlockingEnabled;
            Hidewall            = Data.Hidewall;
            Group          = Data.Group;
            Password       = Data.Password;
            Wallpaper      = Data.Wallpaper;
            Floor          = Data.Floor;
            Landscape      = Data.Landscape;
            WallThickness  = Data.WallThickness;
            FloorThickness = Data.FloorThickness;
            chatMode       = Data.chatMode;
            chatSize       = Data.chatSize;
            chatSpeed      = Data.chatSpeed;
            chatDistance   = Data.chatDistance;
            extraFlood     = Data.extraFlood;
            TradeSettings  = Data.TradeSettings;
            WhoCanBan      = Data.WhoCanBan;
            WhoCanKick     = Data.WhoCanKick;
            WhoCanBan      = Data.WhoCanBan;
            PushEnabled    = Data.PushEnabled;
            PullEnabled    = Data.PullEnabled;
            SPullEnabled   = Data.SPullEnabled;
            SPushEnabled   = Data.SPushEnabled;
            EnablesEnabled = Data.EnablesEnabled;
            RespectNotificationsEnabled = Data.RespectNotificationsEnabled;
            PetMorphsAllowed            = Data.PetMorphsAllowed;
            ActiveTrades = new ArrayList();
            MutedUsers   = new Dictionary <int, double>();
            Tents        = new Dictionary <int, List <RoomUser> >();
            _gamemap     = new Gamemap(this);
            if (_roomItemHandling == null)
            {
                _roomItemHandling = new RoomItemHandling(this);
            }
            _roomUserManager  = new RoomUserManager(this);
            _filterComponent  = new FilterComponent(this);
            _wiredComponent   = new WiredComponent(this);
            _bansComponent    = new BansComponent(this);
            _tradingComponent = new TradingComponent(this);
            GetRoomItemHandler().LoadFurniture();
            GetGameMap().GenerateMaps();
            LoadPromotions();
            LoadRights();
            LoadFilter();
            InitBots();
            InitPets();
            Data.UsersNow = 1;
        }
コード例 #7
0
        //private ProcessComponent _process = null;

        public Room(RoomData Data)
        {
            this.IsLagging = 0;
            this.IdleTime  = 0;

            this._roomData = Data;
            RoomMuted      = false;
            mDisposed      = false;

            this.Id          = Data.Id;
            this.Name        = Data.Name;
            this.Description = Data.Description;
            this.OwnerName   = Data.OwnerName;
            this.OwnerId     = Data.OwnerId;

            this.Category  = Data.Category;
            this.Type      = Data.Type;
            this.Access    = Data.Access;
            this.UsersNow  = 0;
            this.UsersMax  = Data.UsersMax;
            this.ModelName = Data.ModelName;
            this.Score     = Data.Score;
            this.Tags      = new List <string>();
            foreach (string tag in Data.Tags)
            {
                Tags.Add(tag);
            }

            this.AllowPets           = Data.AllowPets;
            this.AllowPetsEating     = Data.AllowPetsEating;
            this.RoomBlockingEnabled = Data.RoomBlockingEnabled;
            this.Hidewall            = Data.Hidewall;
            this.Group = Data.Group;

            this.Password  = Data.Password;
            this.Wallpaper = Data.Wallpaper;
            this.Floor     = Data.Floor;
            this.Landscape = Data.Landscape;

            this.WallThickness  = Data.WallThickness;
            this.FloorThickness = Data.FloorThickness;

            this.chatMode     = Data.chatMode;
            this.chatSize     = Data.chatSize;
            this.chatSpeed    = Data.chatSpeed;
            this.chatDistance = Data.chatDistance;
            this.extraFlood   = Data.extraFlood;

            this.TradeSettings = Data.TradeSettings;

            this.WhoCanBan  = Data.WhoCanBan;
            this.WhoCanKick = Data.WhoCanKick;
            this.WhoCanBan  = Data.WhoCanBan;

            this.PushEnabled    = Data.PushEnabled;
            this.PullEnabled    = Data.PullEnabled;
            this.SPullEnabled   = Data.SPullEnabled;
            this.SPushEnabled   = Data.SPushEnabled;
            this.EnablesEnabled = Data.EnablesEnabled;
            this.RespectNotificationsEnabled = Data.RespectNotificationsEnabled;
            this.PetMorphsAllowed            = Data.PetMorphsAllowed;

            this.BankEnabled        = Data.BankEnabled;
            this.ShootEnabled       = Data.ShootEnabled;
            this.HitEnabled         = Data.HitEnabled;
            this.SafeZoneEnabled    = Data.SafeZoneEnabled;
            this.SexCommandsEnabled = Data.SexCommandsEnabled;
            this.TurfEnabled        = Data.TurfEnabled;
            this.RobEnabled         = Data.RobEnabled;
            this.GymEnabled         = Data.GymEnabled;
            this.DeliveryEnabled    = Data.DeliveryEnabled;
            this.TutorialEnabled    = Data.TutorialEnabled;
            this.DriveEnabled       = Data.DriveEnabled;
            this.TaxiFromEnabled    = Data.TaxiFromEnabled;
            this.TaxiToEnabled      = Data.TaxiToEnabled;
            this.EnterRoomMessage   = Data.EnterRoomMessage;
            this.RoleplayEvent      = Data.RoleplayEvent;

            this.ActiveTrades = new ArrayList();
            this.Bans         = new Dictionary <int, double>();
            this.MutedUsers   = new Dictionary <int, double>();
            this.Tents        = new Dictionary <int, List <RoomUser> >();

            _gamemap = new Gamemap(this);
            if (_roomItemHandling == null)
            {
                _roomItemHandling = new RoomItemHandling(this);
            }
            _roomUserManager = new RoomUserManager(this);

            this._filterComponent = new FilterComponent(this);
            this._wiredComponent  = new WiredComponent(this);

            GetRoomItemHandler().LoadFurniture();
            GetGameMap().GenerateMaps();

            this.LoadPromotions();
            this.LoadRights();
            this.LoadBans();
            this.LoadFilter();
            this.InitBots();
            this.InitPets();

            if (this.GetRoomUserManager() != null && this.GetRoomUserManager().GetRoomUsers() != null && this.GetRoomUserManager().GetRoomUsers().Where(x => !x.IsBot) != null)
            {
                Data.UsersNow = this.GetRoomUserManager().GetRoomUsers().Where(x => !x.IsBot).ToList().Count;
            }
            else
            {
                Data.UsersNow = 0;
            }
        }