Exemple #1
0
        public void parse(GameClient Session, ClientMessage Event)
        {
            Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null)
            {
                RoomItem class2 = @class.GetItem(Event.PopWiredUInt());
                if (class2 != null && !(class2.GetBaseItem().InteractionType.ToLower() != "postit"))
                {
                    string text  = Event.PopFixedString();
                    string text2 = text.Split(new char[]
                    {
                        ' '
                    })[0];
                    string str = PhoenixEnvironment.FilterInjectionChars(text.Substring(text2.Length + 1), true, true);
                    if (@class.CheckRights(Session) || text.StartsWith(class2.ExtraData))
                    {
                        string text3 = text2;
                        if (text3 != null && (text3 == "FFFF33" || text3 == "FF9CFF" || text3 == "9CCEFF" || text3 == "9CFF9C"))
                        {
                            class2.ExtraData = text2 + " " + str;
                            class2.UpdateState(true, true);
                        }
                    }
                }
            }
        }
Exemple #2
0
        public void parse(GameClient Session, ClientMessage Event)
        {
            Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null && @class.CheckRights(Session, true))
            {
                ServerMessage Message = new ServerMessage(465u);
                Message.AppendUInt(@class.RoomId);
                Message.AppendStringWithBreak(@class.Name);
                Message.AppendStringWithBreak(@class.Description);
                Message.AppendInt32(@class.State);
                Message.AppendInt32(@class.Category);
                Message.AppendInt32(@class.UsersMax);
                Message.AppendInt32(100);
                Message.AppendInt32(@class.Tags.Count);
                foreach (string current in @class.Tags)
                {
                    Message.AppendStringWithBreak(current);
                }
                Message.AppendInt32(@class.UsersWithRights.Count);
                foreach (uint current2 in @class.UsersWithRights)
                {
                    Message.AppendUInt(current2);
                    Message.AppendStringWithBreak(PhoenixEnvironment.GetGame().GetClientManager().GetNameById(current2));
                }
                Message.AppendInt32(@class.UsersWithRights.Count);
                Message.AppendBoolean(@class.AllowPet);
                Message.AppendBoolean(@class.AllowPetsEating);
                Message.AppendBoolean(@class.AllowWalkthrough);
                Message.AppendBoolean(@class.Hidewall);
                Message.AppendInt32(@class.Wallthick);
                Message.AppendInt32(@class.Floorthick);
                Session.SendMessage(Message);
            }
        }
Exemple #3
0
        public void parse(GameClient Session, ClientMessage Event)
        {
            uint num    = Event.PopWiredUInt();
            Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null && [email protected])
            {
                RoomUser class2 = @class.method_48(num);
                if (class2 == null || class2.PetData == null)
                {
                    DataRow dataRow = null;
                    using (DatabaseClient class3 = PhoenixEnvironment.GetDatabase().GetClient())
                    {
                        class3.AddParamWithValue("petid", num);
                        dataRow = class3.ReadDataRow("SELECT Id, user_id, room_id, name, type, race, color, expirience, energy, nutrition, respect, createstamp, x, y, z FROM user_pets WHERE Id = @petid LIMIT 1");
                    }
                    if (dataRow != null)
                    {
                        Session.SendMessage(PhoenixEnvironment.GetGame().GetCatalog().GeneratePetFromRow(dataRow).SerializeInfo());
                    }
                }
                else
                {
                    Session.SendMessage(class2.PetData.SerializeInfo());
                }
            }
        }
Exemple #4
0
        public void parse(GameClient Session, ClientMessage Event)
        {
            Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null && (@class.AllowPet || @class.CheckRights(Session, true)))
            {
                uint uint_  = Event.PopWiredUInt();
                Pet  class2 = Session.GetHabbo().GetInventoryComponent().GetPet(uint_);
                if (class2 != null && !class2.PlacedInRoom)
                {
                    int num  = Event.PopWiredInt32();
                    int num2 = Event.PopWiredInt32();
                    if (@class.CanWalk(num, num2, 0.0, true, false))
                    {
                        if (@class.Int32_2 >= GlobalClass.MaxPetsPerRoom)
                        {
                            Session.SendNotif(TextManager.GetText("error_maxpets") + GlobalClass.MaxPetsPerRoom);
                        }
                        else
                        {
                            class2.PlacedInRoom = true;
                            class2.RoomId       = @class.RoomId;
                            List <RandomSpeech> list  = new List <RandomSpeech>();
                            List <BotResponse>  list2 = new List <BotResponse>();
                            @class.method_4(new RoomBot(class2.PetId, class2.RoomId, AIType.Pet, "freeroam", class2.Name, "", class2.Look, num, num2, 0, 0, 0, 0, 0, 0, ref list, ref list2, 0), class2);
                            if (@class.CheckRights(Session, true))
                            {
                                Session.GetHabbo().GetInventoryComponent().MovePetToRoom(class2.PetId, @class.RoomId);
                            }
                        }
                    }
                }
            }
        }
Exemple #5
0
        public ServerMessage SerializeRoomTool(RoomData Data)
        {
            Room Room    = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Data.Id);
            uint OwnerId = 0;

            using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
            {
                try
                {
                    adapter.AddParamWithValue("owner", Data.Owner);
                    OwnerId = (uint)adapter.ReadDataRow("SELECT Id FROM users WHERE username = @owner LIMIT 1")[0];
                }
                catch (Exception)
                {
                }
            }
            ServerMessage Message = new ServerMessage(538);

            Message.AppendUInt(Data.Id);
            Message.AppendInt32(Data.UsersNow);
            if (Room != null)
            {
                Message.AppendBoolean(Room.GetRoomUserByHabbo(Data.Owner) != null);
            }
            else
            {
                Message.AppendBoolean(false);
            }
            Message.AppendUInt(OwnerId);
            Message.AppendStringWithBreak(Data.Owner);
            Message.AppendUInt(Data.Id);
            Message.AppendStringWithBreak(Data.Name);
            Message.AppendStringWithBreak(Data.Description);
            Message.AppendInt32(Data.TagCount);
            foreach (string current in Data.Tags)
            {
                Message.AppendStringWithBreak(current);
            }
            if (Room != null)
            {
                Message.AppendBoolean(Room.HasOngoingEvent);
                if (Room.Event == null)
                {
                    return(Message);
                }
                Message.AppendStringWithBreak(Room.Event.Name);
                Message.AppendStringWithBreak(Room.Event.Description);
                Message.AppendInt32(Room.Event.Tags.Count);
                using (TimedLock.Lock(Room.Event.Tags))
                {
                    foreach (string current in Room.Event.Tags)
                    {
                        Message.AppendStringWithBreak(current);
                    }
                    return(Message);
                }
            }
            Message.AppendBoolean(false);
            return(Message);
        }
Exemple #6
0
 public void parse(GameClient Session, ClientMessage Event)
 {
     if (Session.GetHabbo().HasRole("acc_chatlogs"))
     {
         Session.SendMessage(PhoenixEnvironment.GetGame().GetModerationTool().SerializeUserChatlog(Event.PopWiredUInt()));
     }
 }
Exemple #7
0
 internal void OnEnterRoom(uint RoomId)
 {
     if (GlobalClass.RecordRoomVisits)
     {
         using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
         {
             adapter.ExecuteQuery(string.Concat(new object[]
             {
                 "INSERT INTO user_roomvisits (user_id,room_id,entry_timestamp,exit_timestamp,hour,minute) VALUES ('",
                 Id,
                 "','",
                 RoomId,
                 "',UNIX_TIMESTAMP(),'0','",
                 DateTime.Now.Hour,
                 "','",
                 DateTime.Now.Minute,
                 "')"
             }));
         }
     }
     this.CurrentRoomId = RoomId;
     if (CurrentRoom.Owner != Username && CurrentQuestId == 15)
     {
         PhoenixEnvironment.GetGame().GetQuestManager().ProgressUserQuest(15, GetClient());
     }
     this.Messenger.OnStatusChanged(false);
 }
Exemple #8
0
 public void parse(GameClient Session, ClientMessage Event)
 {
     if (Session != null && Session.GetHabbo() != null)
     {
         Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
         if (@class != null)
         {
             RoomUser class2 = @class.GetRoomUserByHabbo(Event.PopWiredUInt());
             if (class2 != null && !class2.IsBot && class2.GetClient() != null)
             {
                 ServerMessage Message = new ServerMessage(228u);
                 Message.AppendUInt(class2.GetClient().GetHabbo().Id);
                 Message.AppendInt32(class2.GetClient().GetHabbo().GetBadgeComponent().EquippedCount);
                 using (TimedLock.Lock(class2.GetClient().GetHabbo().GetBadgeComponent().BadgeList))
                 {
                     foreach (Badge current in class2.GetClient().GetHabbo().GetBadgeComponent().BadgeList)
                     {
                         if (current.Slot > 0)
                         {
                             Message.AppendInt32(current.Slot);
                             Message.AppendStringWithBreak(current.Code);
                         }
                     }
                 }
                 Session.SendMessage(Message);
             }
         }
     }
 }
Exemple #9
0
 internal void SendData(byte[] Data)
 {
     if (!this.mDisposed)
     {
         try
         {
             if (base.Connected)
             {
                 SocketError error;
                 base.BeginSend(Data, 0, Data.Length, SocketFlags.None, out error, this.mDataSentCallback, this);
                 if ((error != SocketError.Success) && (error != SocketError.IOPending))
                 {
                     PhoenixEnvironment.GetGame().GetClientManager().AddGameClient(this);
                 }
             }
             else
             {
                 PhoenixEnvironment.GetGame().GetClientManager().AddGameClient(this);
             }
         }
         catch
         {
             PhoenixEnvironment.GetGame().GetClientManager().AddGameClient(this);
         }
     }
 }
Exemple #10
0
        public void parse(GameClient Session, ClientMessage Event)
        {
            Room     room            = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
            RoomUser roomUserByHabbo = room.GetRoomUserByHabbo(Session.GetHabbo().Id);

            roomUserByHabbo.Unidle();
            int i = Event.PopWiredInt32();

            if (i < 0 || i > 4 || (!Session.GetHabbo().GetSubscriptionManager().HasSubscription("habbo_club") && i > 1))
            {
                i = 0;
            }
            if (i > 0 && roomUserByHabbo.CarryItemID > 0)
            {
                roomUserByHabbo.CarryItem(0);
            }
            roomUserByHabbo.DanceId = i;
            ServerMessage Message = new ServerMessage(480);

            Message.AppendInt32(roomUserByHabbo.VirtualId);
            Message.AppendInt32(i);
            room.SendMessage(Message, null);

            if (Session.GetHabbo().CurrentQuestId == 6)
            {
                PhoenixEnvironment.GetGame().GetQuestManager().ProgressUserQuest(6, Session);
            }
        }
Exemple #11
0
        public void parse(GameClient Session, ClientMessage Event)
        {
            ServerMessage Message = new ServerMessage(36u);

            Message.AppendInt32(PhoenixEnvironment.GetGame().GetCatalog().CheckPetName(Event.PopFixedString()) ? 0 : 2);
            Session.SendMessage(Message);
        }
Exemple #12
0
        public void parse(GameClient Session, ClientMessage Event)
        {
            Room Room = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room != null)
            {
                if (!Room.CanTradeInRoom)
                {
                    Session.GetHabbo().Sendselfwhisper(TextManager.GetText("trade_error_roomdisabled"));
                }
                else
                {
                    RoomUser UserOne = Room.GetRoomUserByHabbo(Session.GetHabbo().Id);
                    RoomUser UserTwo = Room.GetRoomUserByVirtualId(Event.PopWiredInt32());
                    if (UserOne != null && UserTwo != null && UserTwo.GetClient().GetHabbo().AcceptTrading)
                    {
                        Room.TryStartTrade(UserOne, UserTwo);
                    }
                    else
                    {
                        Session.GetHabbo().Sendselfwhisper(TextManager.GetText("trade_error_targetdisabled"));
                    }
                }
            }
        }
Exemple #13
0
 public void parse(GameClient Session, ClientMessage Event)
 {
     try
     {
         Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
         if (@class != null && @class.CheckRights(Session, true) && @class.MoodlightData != null)
         {
             ServerMessage Message = new ServerMessage(365u);
             Message.AppendInt32(@class.MoodlightData.Presets.Count);
             Message.AppendInt32(@class.MoodlightData.CurrentPreset);
             int num = 0;
             foreach (MoodlightPreset current in @class.MoodlightData.Presets)
             {
                 num++;
                 Message.AppendInt32(num);
                 Message.AppendInt32(int.Parse(PhoenixEnvironment.BoolToEnum(current.BackgroundOnly)) + 1);
                 Message.AppendStringWithBreak(current.ColorCode);
                 Message.AppendInt32(current.ColorIntensity);
             }
             Session.SendMessage(Message);
         }
     }
     catch
     {
     }
 }
Exemple #14
0
        public void parse(GameClient Session, ClientMessage Event)
        {
            uint Id = Event.PopWiredUInt();

            Event.PopFixedString();
            Event.PopWiredInt32();
            RoomData Data = PhoenixEnvironment.GetGame().GetRoomManager().GenerateRoomData(Id);

            if (Data != null)
            {
                if (Data.Type == "private")
                {
                    ServerMessage Message = new ServerMessage(286);
                    Message.AppendBoolean(Data.IsPublicRoom);
                    Message.AppendUInt(Id);
                    Session.SendMessage(Message);
                }
                else
                {
                    ServerMessage Message2 = new ServerMessage(453);
                    Message2.AppendUInt(Data.Id);
                    Message2.AppendStringWithBreak(Data.CCTs);
                    Message2.AppendUInt(Data.Id);
                    Session.SendMessage(Message2);
                }
            }
        }
Exemple #15
0
 public void parse(GameClient Session, ClientMessage Event)
 {
     if (Session.GetHabbo().HasRole("acc_supporttool"))
     {
         uint   RoomId            = Event.PopWiredUInt();
         bool   LockRoom          = Event.PopWiredBoolean();
         bool   InappropriateRoom = Event.PopWiredBoolean();
         bool   KickUsers         = Event.PopWiredBoolean();
         string Act = "";
         if (LockRoom)
         {
             Act += "Apply Doorbell";
         }
         if (InappropriateRoom)
         {
             Act += " Change Name";
         }
         if (KickUsers)
         {
             Act += " Kick Users";
         }
         PhoenixEnvironment.GetGame().GetClientManager().RecordCmdLogs(Session, "ModTool - Room Action", Act);
         PhoenixEnvironment.GetGame().GetModerationTool().PerformRoomAction(Session, RoomId, KickUsers, LockRoom, InappropriateRoom);
     }
 }
Exemple #16
0
        public void parse(GameClient Session, ClientMessage Event)
        {
            Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null && @class.CheckRights(Session, true))
            {
                foreach (uint current in @class.UsersWithRights)
                {
                    RoomUser class2 = @class.GetRoomUserByHabbo(current);
                    if (class2 != null && !class2.IsBot)
                    {
                        class2.GetClient().SendMessage(new ServerMessage(43u));
                    }
                    ServerMessage Message = new ServerMessage(511u);
                    Message.AppendUInt(@class.RoomId);
                    Message.AppendUInt(current);
                    Session.SendMessage(Message);
                }
                using (DatabaseClient class3 = PhoenixEnvironment.GetDatabase().GetClient())
                {
                    class3.ExecuteQuery("DELETE FROM room_rights WHERE room_id = '" + @class.RoomId + "'");
                }
                @class.UsersWithRights.Clear();
            }
        }
Exemple #17
0
        public void parse(GameClient Session, ClientMessage Event)
        {
            uint     num             = Event.PopWiredUInt();
            Room     room            = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
            RoomUser roomUserByHabbo = room.GetRoomUserByHabbo(num);

            if (room != null && room.CheckRights(Session, true) && roomUserByHabbo != null && !roomUserByHabbo.IsBot && !room.UsersWithRights.Contains(num))
            {
                room.UsersWithRights.Add(num);
                using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                {
                    adapter.ExecuteQuery(string.Concat(new object[]
                    {
                        "INSERT INTO room_rights (room_id,user_id) VALUES ('",
                        room.RoomId,
                        "','",
                        num,
                        "')"
                    }));
                }
                ServerMessage Message = new ServerMessage(510);
                Message.AppendUInt(room.RoomId);
                Message.AppendUInt(num);
                Message.AppendStringWithBreak(roomUserByHabbo.GetClient().GetHabbo().Username);
                Session.SendMessage(Message);
                roomUserByHabbo.AddStatus("flatctrl", "");
                roomUserByHabbo.UpdateNeeded = true;
                roomUserByHabbo.GetClient().SendMessage(new ServerMessage(42));
            }
        }
Exemple #18
0
        public void parse(GameClient Session, ClientMessage Event)
        {
            uint   num  = Event.PopWiredUInt();
            string text = PhoenixEnvironment.FilterInjectionChars(Event.PopFixedString());

            if (Session.GetHabbo().GetMessenger() != null)
            {
                if (num == 0 && Session.GetHabbo().HasRole("cmd_sa"))
                {
                    ServerMessage Message = new ServerMessage(134);
                    Message.AppendUInt(0);
                    Message.AppendString(Session.GetHabbo().Username + ": " + text);
                    PhoenixEnvironment.GetGame().GetClientManager().SendStaffChat(Session, Message);
                }
                else
                {
                    if (num == 0)
                    {
                        ServerMessage Message2 = new ServerMessage(261);
                        Message2.AppendInt32(4);
                        Message2.AppendUInt(0);
                        Session.SendMessage(Message2);
                    }
                    else
                    {
                        Session.GetHabbo().GetMessenger().method_18(num, text);
                    }
                }
            }
        }
Exemple #19
0
        public void CheckForAllBanConflicts()
        {
            Dictionary <GameClient, ModerationBanException> BanException = new Dictionary <GameClient, ModerationBanException>();

            for (int i = 0; i < this.Session.Length; i++)
            {
                GameClient Session = this.Session[i];
                if (Session != null)
                {
                    try
                    {
                        PhoenixEnvironment.GetGame().GetBanManager().CheckForBanConflicts(Session);
                    }
                    catch (ModerationBanException ex)
                    {
                        BanException.Add(Session, ex);
                    }
                }
            }
            foreach (KeyValuePair <GameClient, ModerationBanException> pair in BanException)
            {
                pair.Key.SendBanMessage(pair.Value.Message);
                pair.Key.Disconnect();
            }
        }
Exemple #20
0
        public void KickUser(GameClient ModSession, uint UserId, string Message, bool Soft)
        {
            GameClient Client = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(UserId);

            if (Client == null || Client.GetHabbo().CurrentRoomId < 1 || Client.GetHabbo().Id == ModSession.GetHabbo().Id)
            {
                return;
            }
            if (Client.GetHabbo().Rank >= ModSession.GetHabbo().Rank)
            {
                ModSession.SendNotif(TextManager.GetText("mod_error_permission_kick"));
            }

            Room Room = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Client.GetHabbo().CurrentRoomId);

            if (Room != null)
            {
                Room.RemoveUserFromRoom(Client, true, false);
                if (!Soft)
                {
                    Client.SendNotif(Message);
                    using (DatabaseClient adapter = PhoenixEnvironment.GetDatabase().GetClient())
                    {
                        adapter.ExecuteQuery("UPDATE user_info SET cautions = cautions + 1 WHERE user_id = '" + UserId + "' LIMIT 1");
                    }
                }
            }
        }
Exemple #21
0
 public void parse(GameClient Session, ClientMessage Event)
 {
     try
     {
         Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
         if (@class != null && @class.CheckRights(Session, true) && @class.MoodlightData != null)
         {
             RoomItem class2 = null;
             foreach (RoomItem class3 in @class.Hashtable_1.Values)
             {
                 if (class3.GetBaseItem().InteractionType.ToLower() == "dimmer")
                 {
                     class2 = class3;
                     break;
                 }
             }
             if (class2 != null)
             {
                 if (@class.MoodlightData.Enabled)
                 {
                     @class.MoodlightData.method_1();
                 }
                 else
                 {
                     @class.MoodlightData.method_0();
                 }
                 class2.ExtraData = @class.MoodlightData.method_7();
                 class2.UpdateState();
             }
         }
     }
     catch
     {
     }
 }
Exemple #22
0
 public void parse(GameClient Session, ClientMessage Event)
 {
     try
     {
         Room     room  = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
         uint     uint_ = Event.PopWiredUInt();
         RoomItem item  = room.GetItem(uint_);
         string   text  = item.GetBaseItem().InteractionType.ToLower();
         if (text != null && (text == "wf_cnd_trggrer_on_frn" || text == "wf_cnd_furnis_hv_avtrs" || text == "wf_cnd_has_furni_on"))
         {
             Event.PopWiredBoolean();
             Event.PopFixedString();
             item.Extra1 = Event.ToString().Substring(Event.Length - (Event.RemainingLength - 2));
             item.Extra1 = item.Extra1.Substring(0, item.Extra1.Length - 1);
             Event.ResetPointer();
             item = room.GetItem(Event.PopWiredUInt());
             Event.PopWiredBoolean();
             Event.PopFixedString();
             int num = Event.PopWiredInt32();
             item.Extra2 = "";
             for (int i = 0; i < num; i++)
             {
                 item.Extra2 = item.Extra2 + "," + Convert.ToString(Event.PopWiredUInt());
             }
             if (item.Extra2.Length > 0)
             {
                 item.Extra2 = item.Extra2.Substring(1);
             }
         }
     }
     catch
     {
     }
 }
Exemple #23
0
 public void parse(GameClient Session, ClientMessage Event)
 {
     if (Session != null && Session.GetHabbo() != null)
     {
         Session.SendMessage(PhoenixEnvironment.GetGame().GetCatalog().GetIndexMessageForRank(Session.GetHabbo().Rank));
     }
 }
Exemple #24
0
        public void parse(GameClient Session, ClientMessage Event)
        {
            Room @class = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null && @class.CheckRights(Session))
            {
                uint   num  = Event.PopWiredUInt();
                string a    = Event.PopFixedString().ToUpper();
                string text = PhoenixEnvironment.FilterInjectionChars(Event.PopFixedString());
                text  = text.Replace("hd-99999-99999", "");
                text += ".";
                RoomItem class2 = @class.Hashtable_0[num] as RoomItem;
                if (class2.ExtraData.Contains(','))
                {
                    class2.Extra1 = class2.ExtraData.Split(new char[]
                    {
                        ','
                    })[0];
                    class2.Extra2 = class2.ExtraData.Split(new char[]
                    {
                        ','
                    })[1];
                }
                if (a == "M")
                {
                    class2.Extra1 = text;
                }
                else
                {
                    class2.Extra2 = text;
                }
                class2.ExtraData = class2.Extra1 + "," + class2.Extra2;
                class2.UpdateState(true, true);
            }
        }
Exemple #25
0
 public ServerMessage SerializeRecentRooms(GameClient Session)
 {
     using (DatabaseClient @class = PhoenixEnvironment.GetDatabase().GetClient())
     {
         DataTable       dataTable = @class.ReadDataTable("SELECT * FROM rooms JOIN user_roomvisits ON rooms.Id = user_roomvisits.room_id WHERE user_roomvisits.user_id = '" + Session.GetHabbo().Id + "' ORDER BY entry_timestamp DESC LIMIT 50;");
         List <RoomData> list      = new List <RoomData>();
         List <uint>     list2     = new List <uint>();
         if (dataTable != null)
         {
             foreach (DataRow dataRow in dataTable.Rows)
             {
                 RoomData class2 = PhoenixEnvironment.GetGame().GetRoomManager().FetchRoomData((uint)dataRow["Id"], dataRow);
                 class2.method_1(dataRow);
                 list.Add(class2);
                 list2.Add(class2.Id);
             }
         }
         ServerMessage Message = new ServerMessage(451);
         Message.AppendInt32(0);
         Message.AppendInt32(7);
         Message.AppendStringWithBreak("");
         Message.AppendInt32(list.Count);
         foreach (RoomData current in list)
         {
             current.Serialize(Message, false, false);
         }
         return(Message);
     }
 }
Exemple #26
0
        internal void OnStatusChanged(bool bool_1)
        {
            Hashtable hashtable = this.friends.Clone() as Hashtable;

            foreach (MessengerBuddy @class in hashtable.Values)
            {
                try
                {
                    GameClient class2 = PhoenixEnvironment.GetGame().GetClientManager().GetClientByHabbo(@class.Id);
                    if (class2 != null && class2.GetHabbo() != null && class2.GetHabbo().GetMessenger() != null)
                    {
                        class2.GetHabbo().GetMessenger().method_6(this.UserId);
                        if (bool_1)
                        {
                            class2.GetHabbo().GetMessenger().UpdateFriend();
                        }
                    }
                }
                catch
                {
                }
            }
            hashtable.Clear();
            hashtable = null;
        }
Exemple #27
0
 public void FillNull(uint mId)
 {
     this.Id               = mId;
     this.Name             = "Unknown Room";
     this.Description      = "-";
     this.Type             = "private";
     this.Owner            = "-";
     this.Category         = 0;
     this.UsersNow         = 0;
     this.UsersMax         = 0;
     this.ModelName        = "NO_MODEL";
     this.CCTs             = "";
     this.Score            = 0;
     this.Tags             = new List <string>();
     this.AllowPet         = true;
     this.AllowPetsEating  = false;
     this.AllowWalkthrough = true;
     this.Hidewall         = false;
     this.Wallthick        = 0;
     this.Floorthick       = 0;
     this.Password         = "";
     this.Wallpaper        = "0.0";
     this.Floor            = "0.0";
     this.Landscape        = "0.0";
     this.Event            = null;
     this.Achievement      = 0;
     this.bool_3           = false;
     this.myIcon           = new RoomIcon(1, 1, new Dictionary <int, int>());
     this.class28_0        = PhoenixEnvironment.GetGame().GetRoomManager().GetModel(ModelName, mId);
 }
Exemple #28
0
 public void Fill(Room Room)
 {
     this.Id               = Room.RoomId;
     this.Name             = Room.Name;
     this.Description      = Room.Description;
     this.Type             = Room.Type;
     this.Owner            = Room.Owner;
     this.Category         = Room.Category;
     this.State            = Room.State;
     this.UsersNow         = Room.UsersNow;
     this.UsersMax         = Room.UsersMax;
     this.ModelName        = Room.ModelName;
     this.CCTs             = Room.CCTs;
     this.Score            = Room.Score;
     this.Tags             = Room.Tags;
     this.AllowPet         = Room.AllowPet;
     this.AllowPetsEating  = Room.AllowPetsEating;
     this.AllowWalkthrough = Room.AllowWalkthrough;
     this.Hidewall         = Room.Hidewall;
     this.Wallthick        = Room.Wallthick;
     this.Floorthick       = Room.Floorthick;
     this.myIcon           = Room.myIcon;
     this.Password         = Room.Password;
     this.Event            = Room.Event;
     this.Wallpaper        = Room.Wallpaper;
     this.Floor            = Room.Floor;
     this.Landscape        = Room.Landscape;
     this.Achievement      = Room.Achievement;
     this.class28_0        = PhoenixEnvironment.GetGame().GetRoomManager().GetModel(ModelName, Id);
 }
Exemple #29
0
 internal Room GetRoom()
 {
     if (mRoom == null)
     {
         mRoom = PhoenixEnvironment.GetGame().GetRoomManager().GetRoom(RoomId);
     }
     return(mRoom);
 }
Exemple #30
0
 internal Item GetBaseItem()
 {
     if (mBaseItem == null)
     {
         mBaseItem = PhoenixEnvironment.GetGame().GetItemManager().GetItem(BaseItem);
     }
     return(mBaseItem);
 }