public Region(int id)
        {
            _creaturesRWLS = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
            _propsRWLS     = new ReaderWriterLockSlim();
            _itemsRWLS     = new ReaderWriterLockSlim();

            this.Id = id;

            _creatures = new Dictionary <long, Creature>();
            _props     = new Dictionary <long, Prop>();
            _items     = new Dictionary <long, Item>();

            _clients = new HashSet <ChannelClient>();

            this.Collisions = new RegionCollision();

            _regionData = AuraData.RegionInfoDb.Find(this.Id);
            if (_regionData == null)
            {
                Log.Warning("Region: No data found for '{0}'.", this.Id);
                return;
            }

            this.Collisions.Init(_regionData);

            this.LoadClientProps();
        }
Example #2
0
        /// <summary>
        /// Creates new region by id.
        /// </summary>
        /// <param name="regionId"></param>
        private Region(int regionId, RegionMode mode)
        {
            _creaturesRWLS = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
            _propsRWLS     = new ReaderWriterLockSlim();
            _itemsRWLS     = new ReaderWriterLockSlim();

            this.Id     = regionId;
            this.BaseId = regionId;

            this.Mode = mode;

            _creatures = new Dictionary <long, Creature>();
            _props     = new Dictionary <long, Prop>();
            _items     = new Dictionary <long, Item>();

            _clients = new HashSet <ChannelClient>();

            this.Collisions = new RegionCollision();
        }