Ejemplo n.º 1
0
 internal RoomItemHandling GetRoomItemHandler()
 {
     if (roomItemHandling == null)
     {
         roomItemHandling = new RoomItemHandling(this);
     }
     return roomItemHandling;
 }
Ejemplo n.º 2
0
        private void Initialize(UInt32 Id, string Name, string Description, string Type, string Owner, int OwnerId, int Category,
            int State, int UsersMax, string ModelName, int Score, List<string> pTags, int AllowPets,
            int AllowPetsEating, int AllowWalkthrough, int Hidewall, string Password, string Wallpaper, string Floor,
            string Landscape, RoomData RoomData, bool RightOverride, int walltickness, int floorthickness, Group group, int GameId, int chattype,
            int chatballoon, int chatspeed, int chatmaxdis, int chatprotection, int whomute, int whokick, int whoban, uint groupid, List<Chatlog> Chat)
        {
            this.mDisposed = false;
            this.Id = Id;
            this.Name = Name;
            this.Description = Description;
            this.Owner = Owner;
            this.OwnerId = OwnerId;
            this.Category = Category;
            this.Type = Type;
            this.State = State;
            this.UsersNow = 0;
            this.UsersMax = UsersMax;
            this.ModelName = ModelName;
            this.Score = Score;
            tagCount = 0;
            this.Tags = new ArrayList();
            foreach (string tag in pTags)
            {
                tagCount++;
                Tags.Add(tag);
            }

            this.ChatType = chattype;
            this.ChatBalloon = chatballoon;
            this.ChatSpeed = chatspeed;
            this.ChatMaxDistance = chatmaxdis;
            this.ChatFloodProtection = chatprotection;

            this.AllowPets = AllowPets;
            this.AllowPetsEating = AllowPetsEating;
            this.AllowWalkthrough = AllowWalkthrough;
            this.Hidewall = Hidewall;
            this.Group = group;

            this.Password = Password;
            this.Bans = new Dictionary<Int64, double>();
            this.MutedUsers = new Dictionary<uint, uint>();
            this.Wallpaper = Wallpaper;
            this.Floor = Floor;
            this.Landscape = Landscape;
            this.ActiveTrades = new ArrayList();

            this.MutedPets = false;
            this.MutedBots = false;
            this.mCycleEnded = false;

            this.mRoomData = RoomData;
            this.EveryoneGotRights = RightOverride;

            this.roomMessages = new Queue();
            this.chatMessageQueue = new Queue();
            this.LoadedGroups = new Dictionary<uint, String>();

            this.roomMessages = new Queue();
            this.roomAlerts = new Queue();
            this.roomBadge = new Queue();
            this.roomKick = new Queue();
            this.roomServerMessages = new Queue();
            //this.DiceQueue = new Queue();
            this.IdleTime = 0;
            this.RoomMuted = false;
            this.WallThickness = walltickness;
            this.FloorThickness = floorthickness;

            this.gamemap = new Gamemap(this);
            if (roomItemHandling == null)
                this.roomItemHandling = new RoomItemHandling(this);
            this.roomUserManager = new RoomUserManager(this);
            this.RoomChat = Chat;
            this.ForSale = false;
            this.SalePrice = 0;
            this.Event = SilverwaveEnvironment.GetGame().GetRoomEvents().GetEvent(Id);
            this.GameId = GameId;
            this.WhoCanBan = whoban;
            this.WhoCanKick = whokick;
            this.WhoCanBan = whoban;
            this.GroupId = groupid;

            LoadRights();
            GetRoomItemHandler().LoadFurniture();
            GetGameMap().GenerateMaps();
            LoadMusic();
            LoadBans();
            InitUserBots();
            this.Added = new List<Chatlog>();
            using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.runFastQuery("UPDATE rooms SET users_now=1 WHERE id=" + Id + " LIMIT 1");
            }
            SilverwaveEnvironment.GetGame().GetRoomManager().QueueActiveRoomAdd(mRoomData);
        }