コード例 #1
0
        public ModeratorTicketChatlogComposer(SupportTicket Ticket, RoomData RoomData, double Timestamp)
            : base(ServerPacketHeader.ModeratorTicketChatlogMessageComposer)
        {
            base.WriteInteger(Ticket.TicketId);
            base.WriteInteger(Ticket.SenderId);
            base.WriteInteger(Ticket.ReportedId);
            base.WriteInteger(RoomData.Id);

            base.WriteByte(1);
            base.WriteShort(2);//Count
           base.WriteString("roomName");
            base.WriteByte(2);
           base.WriteString(RoomData.Name);
           base.WriteString("roomId");
            base.WriteByte(1);
            base.WriteInteger(RoomData.Id);

            base.WriteShort(Ticket.ReportedChats.Count);
            foreach (string Chat in Ticket.ReportedChats)
            {
                Habbo Habbo = PlusEnvironment.GetHabboById(Ticket.ReportedId);

                base.WriteInteger(((int)PlusEnvironment.GetUnixTimestamp() - Convert.ToInt32(Timestamp)) * 1000);
                base.WriteInteger(Ticket.ReportedId);
               base.WriteString(Habbo != null ? Habbo.Username : "******");
               base.WriteString(Chat);
                base.WriteBoolean(false);
            }
        }
コード例 #2
0
ファイル: RoomAppender.cs プロジェクト: BjkGkh/Boon
        public static void WriteRoom(ServerPacket Packet, RoomData Data, RoomPromotion Promotion, bool NewNavigator = false)
        {
            Packet.WriteInteger(Data.Id);
            Packet.WriteString(Data.Name);
            Packet.WriteInteger(Data.OwnerId);
            Packet.WriteString(Data.OwnerName);
            Packet.WriteInteger(RoomAccessUtility.GetRoomAccessPacketNum(Data.Access));
            Packet.WriteInteger(Data.UsersNow);
            Packet.WriteInteger(Data.UsersMax);
            Packet.WriteString(Data.Description);
            Packet.WriteInteger(Data.TradeSettings);
            Packet.WriteInteger(Data.Score);
            Packet.WriteInteger(0);//Top rated room rank.
            Packet.WriteInteger(Data.Category);

            Packet.WriteInteger(Data.Tags.Count);
            foreach (string tag in Data.Tags)
            {
                Packet.WriteString(tag);
            }

            int RoomType = 0;
            if (Data.Group != null)
                RoomType += 2;
            if (Data.Promotion != null)
                RoomType += 4;
            if (Data.Type == "private")
                RoomType += 8;
            if (Data.AllowPets == 1)
                RoomType += 16;

            FeaturedRoom Item = null;
            if (PlusEnvironment.GetGame().GetNavigator().TryGetFeaturedRoom(Data.Id, out Item))
            {
                RoomType += 1;
            }

            Packet.WriteInteger(RoomType);

            if (Item != null)
            {
                Packet.WriteString(Item.Image);
            }

            if (Data.Group != null)
            {
                Packet.WriteInteger(Data.Group == null ? 0 : Data.Group.Id);
                Packet.WriteString(Data.Group == null ? "" : Data.Group.Name);
                Packet.WriteString(Data.Group == null ? "" : Data.Group.Badge);
            }

            if (Data.Promotion != null)
            {
                Packet.WriteString(Promotion != null ? Promotion.Name : "");
                Packet.WriteString(Promotion != null ? Promotion.Description : "");
                Packet.WriteInteger(Promotion != null ? Promotion.MinutesLeft : 0);
            }
        }
コード例 #3
0
ファイル: ChatlogEntry.cs プロジェクト: BjkGkh/Boon
        public ChatlogEntry(int PlayerId, int RoomId, string Message, double Timestamp, Habbo Player = null, RoomData Instance = null)
        {
            this._playerId = PlayerId;
            this._roomId = RoomId;
            this._message = Message;
            this._timestamp = Timestamp;

            if (Player != null)
                this._playerReference = new WeakReference(Player);

            if (Instance != null)
                this._roomReference = new WeakReference(Instance);
        }
コード例 #4
0
ファイル: ModerationTicket.cs プロジェクト: BjkGkh/Boon
 public ModerationTicket(int Id, int Type, int Category, double Timestamp, int Priority, Habbo Sender, Habbo Reported, string Issue, RoomData Room)
 {
     this.Id = Id;
     this.Type = Type;
     this.Category = Category;
     this.Timestamp = Timestamp;
     this.Priority = Priority;
     this.Sender = Sender;
     this.Reported = Reported;
     this.Moderator = null;
     this.Issue = Issue;
     this.Room = Room;
     this.Answered = false;
 }
コード例 #5
0
ファイル: RoomEventComposer.cs プロジェクト: BjkGkh/Boon
 public RoomEventComposer(RoomData Data, RoomPromotion Promotion)
     : base(ServerPacketHeader.RoomEventMessageComposer)
 {
     base.WriteInteger(Promotion == null ? -1 : Convert.ToInt32(Data.Id));
     base.WriteInteger(Promotion == null ? -1 : Data.OwnerId);
    base.WriteString(Promotion == null ? "" : Data.OwnerName);
     base.WriteInteger(Promotion == null ? 0 : 1);
     base.WriteInteger(0);
    base.WriteString(Promotion == null ? "" : Promotion.Name);
    base.WriteString(Promotion == null ? "" : Promotion.Description);
     base.WriteInteger(0);
     base.WriteInteger(0);
     base.WriteInteger(0);//Unknown, came in build RELEASE63-201411181343-400753188
 }
コード例 #6
0
        public ModeratorRoomInfoComposer(RoomData Data, bool OwnerInRoom)
            : base(ServerPacketHeader.ModeratorRoomInfoMessageComposer)
        {
            base.WriteInteger(Data.Id);
            base.WriteInteger(Data.UsersNow);
            base.WriteBoolean(OwnerInRoom); // owner in room
            base.WriteInteger(Data.OwnerId);
           base.WriteString(Data.OwnerName);
            base.WriteBoolean(Data != null);
           base.WriteString(Data.Name);
           base.WriteString(Data.Description);
           
            base.WriteInteger(Data.Tags.Count);
            foreach (string Tag in Data.Tags)
            {
               base.WriteString(Tag);
            }

            base.WriteBoolean(false);
        }
コード例 #7
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;
        }
コード例 #8
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;
        }
コード例 #9
0
        public static void WriteRoom(ServerPacket Packet, RoomData Data, RoomPromotion Promotion, bool NewNavigator = false)
        {
            Packet.WriteInteger(Data.Id);
            Packet.WriteString(Data.Name);
            Packet.WriteInteger(Data.OwnerId);
            Packet.WriteString(Data.OwnerName);
            Packet.WriteInteger(RoomAccessUtility.GetRoomAccessPacketNum(Data.Access));
            Packet.WriteInteger(Data.UsersNow);
            Packet.WriteInteger(Data.UsersMax);
            Packet.WriteString(Data.Description);
            Packet.WriteInteger(Data.TradeSettings);
            Packet.WriteInteger(Data.Score);
            Packet.WriteInteger(0);//Top rated room rank.
            Packet.WriteInteger(Data.Category);

            Packet.WriteInteger(Data.Tags.Count);
            foreach (string tag in Data.Tags)
            {
                Packet.WriteString(tag);
            }

            int RoomType = 0;

            if (Data.Group != null)
            {
                RoomType += 2;
            }
            if (Data.Promotion != null)
            {
                RoomType += 4;
            }
            if (Data.Type == "private")
            {
                RoomType += 8;
            }
            if (Data.AllowPets == 1)
            {
                RoomType += 16;
            }

            FeaturedRoom Item = null;

            if (PlusEnvironment.GetGame().GetNavigator().TryGetFeaturedRoom(Data.Id, out Item))
            {
                RoomType += 1;
            }

            Packet.WriteInteger(RoomType);

            if (Item != null)
            {
                Packet.WriteString(Item.Image);
            }

            if (Data.Group != null)
            {
                Packet.WriteInteger(Data.Group == null ? 0 : Data.Group.Id);
                Packet.WriteString(Data.Group == null ? "" : Data.Group.Name);
                Packet.WriteString(Data.Group == null ? "" : Data.Group.Badge);
            }

            if (Data.Promotion != null)
            {
                Packet.WriteString(Promotion != null ? Promotion.Name : "");
                Packet.WriteString(Promotion != null ? Promotion.Description : "");
                Packet.WriteInteger(Promotion != null ? Promotion.MinutesLeft : 0);
            }
        }
コード例 #10
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;
            }
        }
コード例 #11
0
        public GetGuestRoomResultComposer(GameClient Session, RoomData Data, Boolean isLoading, Boolean checkEntry)
            : base(ServerPacketHeader.GetGuestRoomResultMessageComposer)
        {
            base.WriteBoolean(isLoading);
            base.WriteInteger(Data.Id);
            base.WriteString(Data.Name);
            base.WriteInteger(Data.OwnerId);
            base.WriteString(Data.OwnerName);
            base.WriteInteger(RoomAccessUtility.GetRoomAccessPacketNum(Data.Access));
            base.WriteInteger(Data.UsersNow);
            base.WriteInteger(Data.UsersMax);
            base.WriteString(Data.Description);
            base.WriteInteger(Data.TradeSettings);
            base.WriteInteger(Data.Score);
            base.WriteInteger(0);//Top rated room rank.
            base.WriteInteger(Data.Category);

            base.WriteInteger(Data.Tags.Count);
            foreach (string Tag in Data.Tags)
            {
                base.WriteString(Tag);
            }

            if (Data.Group != null && Data.Promotion != null)
            {
                base.WriteInteger(62);//What?

                base.WriteInteger(Data.Group == null ? 0 : Data.Group.Id);
                base.WriteString(Data.Group == null ? "" : Data.Group.Name);
                base.WriteString(Data.Group == null ? "" : Data.Group.Badge);

                base.WriteString(Data.Promotion != null ? Data.Promotion.Name : "");
                base.WriteString(Data.Promotion != null ? Data.Promotion.Description : "");
                base.WriteInteger(Data.Promotion != null ? Data.Promotion.MinutesLeft : 0);
            }
            else if (Data.Group != null && Data.Promotion == null)
            {
                base.WriteInteger(58);//What?
                base.WriteInteger(Data.Group == null ? 0 : Data.Group.Id);
                base.WriteString(Data.Group == null ? "" : Data.Group.Name);
                base.WriteString(Data.Group == null ? "" : Data.Group.Badge);
            }
            else if (Data.Group == null && Data.Promotion != null)
            {
                base.WriteInteger(60);//What?
                base.WriteString(Data.Promotion != null ? Data.Promotion.Name : "");
                base.WriteString(Data.Promotion != null ? Data.Promotion.Description : "");
                base.WriteInteger(Data.Promotion != null ? Data.Promotion.MinutesLeft : 0);
            }
            else
            {
                base.WriteInteger(56);//What?
            }


            base.WriteBoolean(checkEntry);
            base.WriteBoolean(false);
            base.WriteBoolean(false);
            base.WriteBoolean(false);

            base.WriteInteger(Data.WhoCanMute);
            base.WriteInteger(Data.WhoCanKick);
            base.WriteInteger(Data.WhoCanBan);

            base.WriteBoolean(Session.GetHabbo().GetPermissions().HasRight("mod_tool") || Data.OwnerName == Session.GetHabbo().Username);//Room muting.
            base.WriteInteger(Data.chatMode);
            base.WriteInteger(Data.chatSize);
            base.WriteInteger(Data.chatSpeed);
            base.WriteInteger(Data.extraFlood);//Hearing distance
            base.WriteInteger(Data.chatDistance);//Flood!!
        }
コード例 #12
0
ファイル: RoomManager.cs プロジェクト: xjoao97/HabboRP
        public void UnloadRoom(Room Room, bool RemoveData = false)
        {
            if (Room == null)
            {
                return;
            }

            #region Roleplay Checks

            #region Turf
            Turf Turf = TurfManager.GetTurf(Room.RoomId);

            if (Turf != null)
            {
                Turf.Flag        = null;
                Turf.FlagSpawned = false;
            }
            #endregion

            #region Texas Hold Em
            List <TexasHoldEm> Games = TexasHoldEmManager.GetGamesByRoomId(Room.Id);
            if (Games.Count > 0)
            {
                foreach (TexasHoldEm Game in Games)
                {
                    if (Game != null)
                    {
                        #region PotSquare Check
                        Game.PotSquare.Furni = null;
                        #endregion

                        #region JoinGate Check
                        Game.JoinGate.Furni = null;
                        #endregion

                        #region Player1 Check
                        foreach (TexasHoldEmItem Item in Game.Player1.Values)
                        {
                            Item.Furni = null;
                        }
                        #endregion

                        #region Player2 Check
                        foreach (TexasHoldEmItem Item in Game.Player2.Values)
                        {
                            Item.Furni = null;
                        }
                        #endregion

                        #region Player3 Check
                        foreach (TexasHoldEmItem Item in Game.Player3.Values)
                        {
                            Item.Furni = null;
                        }
                        #endregion

                        #region Banker Check
                        foreach (TexasHoldEmItem Item in Game.Banker.Values)
                        {
                            Item.Furni = null;
                        }
                        #endregion
                    }
                }
            }
            #endregion

            #region Farming
            List <FarmingSpace> FarmingSpaces = FarmingManager.GetFarmingSpacesByRoomId(Room.Id);
            if (FarmingSpaces.Count > 0)
            {
                foreach (FarmingSpace Space in FarmingSpaces)
                {
                    if (Space != null)
                    {
                        Space.Item    = null;
                        Space.Spawned = false;
                    }
                }
            }
            #endregion

            #region Houses
            List <House> Houses = PlusEnvironment.GetGame().GetHouseManager().GetHousesBySignRoomId(Room.Id);
            if (Houses.Count > 0)
            {
                foreach (House House in Houses)
                {
                    if (House.Sign != null)
                    {
                        House.Sign.Item    = null;
                        House.Sign.Spawned = false;
                    }
                }
            }
            #endregion

            #region Bots
            RoleplayBotManager.EjectRoomsDeployedBots(Room);
            #endregion

            #endregion

            new Thread(() => {
                Thread.Sleep(200);
                Room room = null;
                if (this._rooms.TryRemove(Room.RoomId, out room))
                {
                    Room.Dispose();

                    if (RemoveData)
                    {
                        RoomData Data = null;
                        this._loadedRoomData.TryRemove(Room.Id, out Data);
                    }
                }
            }).Start();
        }
コード例 #13
0
ファイル: RoomManager.cs プロジェクト: BjkGkh/Boon
        public RoomData GenerateRoomData(int RoomId)
        {
            if (_loadedRoomData.ContainsKey(RoomId))
                return (RoomData)_loadedRoomData[RoomId];

            RoomData Data = new RoomData();

            Room Room;

            if (TryGetRoom(RoomId, out Room))
                return Room.RoomData;

            DataRow Row = null;
            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.SetQuery("SELECT * FROM rooms WHERE id = " + RoomId + " LIMIT 1");
                Row = dbClient.getRow();
            }

            if (Row == null)
                return null;

            Data.Fill(Row);

            if (!_loadedRoomData.ContainsKey(RoomId))
                _loadedRoomData.TryAdd(RoomId, Data);

            return Data;
        }
コード例 #14
0
ファイル: RoomManager.cs プロジェクト: BjkGkh/Boon
        public RoomData FetchRoomData(int RoomId, DataRow dRow)
        {
            if (_loadedRoomData.ContainsKey(RoomId))
                return (RoomData)_loadedRoomData[RoomId];
            else
            {
                RoomData data = new RoomData();

                data.Fill(dRow);

                if (!_loadedRoomData.ContainsKey(RoomId))
                    _loadedRoomData.TryAdd(RoomId, data);
                return data;
            }
        }