Ejemplo n.º 1
0
        public FileContentResult GetLogotype(string logoType)
        {
            Essential essential = db.Essentials
                                  .FirstOrDefault(c => c != null);

            if (essential != null)
            {
                switch (logoType)
                {
                case "normal":
                    if (essential.LogoImageData != null)
                    {
                        return(File(essential.LogoImageData, essential.LogoImageMimeType));
                    }
                    else
                    {
                        return(null);
                    }

                case "inverted":
                    if (essential.LogoImageInvertedData != null)
                    {
                        return(File(essential.LogoImageInvertedData, essential.LogoImageInvertedMimeType));
                    }
                    else
                    {
                        return(null);
                    }

                default:
                    return(null);
                }
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 2
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Room @class = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null && @class.method_26(Session))
            {
                uint   num  = Event.PopWiredUInt();
                string a    = Event.PopFixedString().ToUpper();
                string text = Essential.FilterString(Event.PopFixedString());
                text  = text.Replace("hd-99999-99999", "");
                text += ".";
                RoomItem class2 = @class.Hashtable_0[num] as RoomItem;
                if (class2 != null)
                {
                    if (class2.ExtraData.Contains(','))
                    {
                        class2.string_2 = class2.ExtraData.Split(new char[]
                        {
                            ','
                        })[0];
                        class2.string_3 = class2.ExtraData.Split(new char[]
                        {
                            ','
                        })[1];
                    }
                    if (a == "M")
                    {
                        class2.string_2 = text;
                    }
                    else
                    {
                        class2.string_3 = text;
                    }
                    class2.ExtraData = class2.string_2 + "," + class2.string_3;
                    class2.UpdateState(true, true);
                }
            }
        }
Ejemplo n.º 3
0
        public void method_8(GameClient Session, uint uint_0, int int_0)
        {
            SupportTicket @class = this.method_5(uint_0);

            if (@class != null && @class.Status == TicketStatus.PICKED && @class.ModeratorId == Session.GetHabbo().Id)
            {
                GameClient   class2 = Essential.GetGame().GetClientManager().GetClient(@class.SenderId);
                int          int_;
                TicketStatus enum6_;
                switch (int_0)
                {
                case 1:
                    int_   = 1;
                    enum6_ = TicketStatus.INVALID;
                    goto IL_AC;

                case 2:
                    int_   = 2;
                    enum6_ = TicketStatus.ABUSIVE;
                    using (DatabaseClient class3 = Essential.GetDatabase().GetClient())
                    {
                        class3.ExecuteQuery("UPDATE user_info SET cfhs_abusive = cfhs_abusive + 1 WHERE user_id = '" + @class.SenderId + "' LIMIT 1");
                        goto IL_AC;
                    }
                }
                int_   = 0;
                enum6_ = TicketStatus.RESOLVED;
IL_AC:
                if (class2 != null)
                {
                    ServerMessage Message = new ServerMessage(Outgoing.ModResponse); // Updated
                    Message.AppendInt32(int_);
                    class2.SendMessage(Message);
                }
                @class.Close(enum6_, true);
                this.method_11(@class);
            }
        }
        public void Handle(GameClient Session, ClientMessage Event)
        {
            int num = Event.PopWiredInt32();

            if (num < 0)
            {
                num = 0;
            }
            else
            {
                if (num > 100)
                {
                    num = 100;
                }
            }
            Session.GetHabbo().Volume = num;
            using (DatabaseClient @class = Essential.GetDatabase().GetClient())
            {
                @class.AddParamWithValue("user_id", Session.GetHabbo().Id);
                @class.AddParamWithValue("volume", num);
                @class.ExecuteQuery("UPDATE users SET volume = @volume WHERE Id = @user_id LIMIT 1;");
            }
        }
Ejemplo n.º 5
0
 public void Handle(GameClient Session, ClientMessage Event)
 {
     try
     {
         Room @class = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);
         if (@class != null)
         {
             RoomItem class2 = @class.method_28(Event.PopWiredUInt());
             if (class2 != null)
             {
                 bool bool_ = false;
                 if (@class.method_26(Session))
                 {
                     bool_ = true;
                 }
                 class2.Interactor.OnTrigger(Session, class2, -1, bool_);
             }
         }
     }
     catch
     {
     }
 }
Ejemplo n.º 6
0
        public void MuteUser(GameClient Session, uint userId, string Message, int TimeInMinutes)
        {
            GameClient TargetClient = Essential.GetGame().GetClientManager().GetClient(userId);

            if (TargetClient != null && TargetClient.GetHabbo().CurrentRoomId >= 1u && TargetClient.GetHabbo().Id != Session.GetHabbo().Id)
            {
                if (TargetClient.GetHabbo().Rank >= Session.GetHabbo().Rank)
                {
                    Session.SendNotification(EssentialEnvironment.GetExternalText("mod_error_permission_kick"));
                }
                else
                {
                    TargetClient.GetHabbo().IsMuted    = true;
                    TargetClient.GetHabbo().UnmuteTime = (int)Essential.GetUnixTimestamp() + (TimeInMinutes * 60);
                    using (DatabaseClient dbClient = Essential.GetDatabase().GetClient())
                    {
                        dbClient.ExecuteQuery("UPDATE users SET is_muted='1' WHERE id=" + userId);
                        dbClient.ExecuteQuery("UPDATE users SET unmute_timestamp='" + TargetClient.GetHabbo().UnmuteTime + "' WHERE id=" + userId);
                    }
                    TargetClient.SendNotification(Message);
                }
            }
        }
Ejemplo n.º 7
0
        public void method_0(int int_1, int int_2)
        {
            using (DatabaseClient @class = Essential.GetDatabase().GetClient())
            {
                @class.ExecuteQuery(string.Concat(new object[]
                {
                    "INSERT INTO user_effects (user_id,effect_id,total_duration,is_activated,activated_stamp) VALUES ('",
                    this.uint_0,
                    "','",
                    int_1,
                    "','",
                    int_2,
                    "','0','0')"
                }));
            }
            this.list_0.Add(new AvatarEffect(int_1, int_2, false, 0.0));
            ServerMessage Message = new ServerMessage(Outgoing.AddEffectToInventary); // UPDATED

            Message.AppendInt32(1);
            Message.AppendInt32(int_1);
            Message.AppendInt32(int_2);
            this.method_8().SendMessage(Message);
        }
Ejemplo n.º 8
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Room @class = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null)
            {
                RoomUser class2 = @class.GetRoomUserByHabbo(Event.PopWiredUInt());
                if (class2 != null && class2.GetClient() != null && class2.GetClient().GetHabbo() != null && !class2.IsBot)
                {
                    ServerMessage Message = new ServerMessage(Outgoing.GetUserTags); // Updated
                    Message.AppendUInt(class2.GetClient().GetHabbo().Id);
                    Message.AppendInt32(class2.GetClient().GetHabbo().list_3.Count);
                    using (TimedLock.Lock(class2.GetClient().GetHabbo().list_3))
                    {
                        foreach (string current in class2.GetClient().GetHabbo().list_3)
                        {
                            Message.AppendStringWithBreak(current);
                        }
                    }
                    Session.SendMessage(Message);
                }
            }
        }
Ejemplo n.º 9
0
        public void Handle(GameClient session, ClientMessage message)
        {
            Room room = Essential.GetGame().GetRoomManager().GetRoom(session.GetHabbo().CurrentRoomId);

            if (room != null && (room.CheckRights(session, true)))
            {
                uint    botId = message.PopWiredUInt();
                UserBot bot   = session.GetHabbo().GetInventoryComponent().GetBotById(botId);
                if (bot != null && !bot.PlacedInRoom)
                {
                    int num  = message.PopWiredInt32();
                    int num2 = message.PopWiredInt32();

                    if (room.method_30(num, num2, 0.0, true, false))//&& !room.ContainsBot())
                    {
                        bot.PlacedInRoom = true;
                        bot.RoomId       = (int)room.Id;
                        List <RandomSpeech> list  = new List <RandomSpeech>();
                        List <BotResponse>  list2 = new List <BotResponse>();
                        try
                        {
                            room.AddBotToRoom(new RoomBot(bot.BotId, (uint)bot.RoomId, AIType.UserBot, "freeroam", bot.Name, "", bot.Look, num, num2, 0, 0, 0, 0, 0, 0, ref list, ref list2, 0), bot);
                        }
                        catch (Exception e)
                        {
                            Console.WriteLine(e.ToString());
                        }
                        session.GetHabbo().GetInventoryComponent().RemoveBotById(bot.BotId);
                        using (DatabaseClient dbClient = Essential.GetDatabase().GetClient())
                        {
                            dbClient.ExecuteQuery("UPDATE user_bots SET room_id = '" + bot.RoomId + "', x = " + num + " , y = " + num2 + " WHERE id = '" + botId + "' LIMIT 1");
                        }
                        session.SendMessage(session.GetHabbo().GetInventoryComponent().ComposeBotInventoryListMessage());
                    }
                }
            }
        }
Ejemplo n.º 10
0
 public void UpdateNeeded(GameClient Session)
 {
     try
     {
         if (Session.GetHabbo().InRoom)
         {
             RoomUser @class = Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
             if (@class.int_1 <= ServerConfiguration.SleepTimer)
             {
                 double double_ = Essential.GetUnixTimestamp();
                 Session.GetHabbo().LastActivityPointsUpdate = double_;
                 if (ServerConfiguration.PointingAmount > 0 && (Session.GetHabbo().ActivityPoints < ServerConfiguration.PixelLimit || ServerConfiguration.PixelLimit == 0))
                 {
                     Session.GetHabbo().ActivityPoints += ServerConfiguration.PointingAmount;
                     Session.GetHabbo().method_16(ServerConfiguration.PointingAmount);
                 }
                 if (ServerConfiguration.CreditingAmount > 0 && (Session.GetHabbo().GetCredits() < ServerConfiguration.CreditLimit || ServerConfiguration.CreditLimit == 0))
                 {
                     Session.GetHabbo().GiveCredits(ServerConfiguration.CreditingAmount, "Pixelmanager");
                     if (Session.GetHabbo().IsVIP)
                     {
                         Session.GetHabbo().GiveCredits(ServerConfiguration.CreditingAmount, "VIP Bonus (Pixelmanager)");
                     }
                     Session.GetHabbo().UpdateCredits(true);
                 }
                 if (ServerConfiguration.PixelingAmount > 0 && (Session.GetHabbo().VipPoints < ServerConfiguration.PointLimit || ServerConfiguration.PointLimit == 0))
                 {
                     Session.GetHabbo().VipPoints += ServerConfiguration.PixelingAmount;
                     Session.GetHabbo().UpdateVipPoints(false, true);
                 }
             }
         }
     }
     catch
     {
     }
 }
Ejemplo n.º 11
0
 public override void OnTrigger(GameClients.GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
 {
     // Dieser Code wird bei einem Doppelklick ausgeführt.
     if (Session.GetHabbo().CurrentRoom.Owner == Session.GetHabbo().Username) // Wenn der Raumbesitzer den gleichen Namen hat wie der User...
     {
         // Zufallsitem...
         SurpriseBox sb  = Essential.GetGame().GetCatalog().GetSurpriseBoxManager().GetRandomSurpriseBox(); // zufällige Box
         Item        itm = sb.GetItem();                                                                    // item von Box
         int         x   = RoomItem_0.GetX;
         int         y   = RoomItem_0.Int32_1;
         int         rot = RoomItem_0.int_3;
         Session.GetHabbo().CurrentRoom.method_29(Session, RoomItem_0.uint_0, true, true);             //löscht Box ausm Raum (& DB)
         Essential.GetGame().GetCatalog().AddItemToInventory(Session, itm, 1, "", true, 0u, 0, 0, ""); // platziert Item in Inventar
         UserItem ui        = Session.GetHabbo().GetInventoryComponent().GetLastItem();
         RoomItem RoomItem_ = new RoomItem(ui.uint_0, Session.GetHabbo().CurrentRoom.Id, ui.uint_1, ui.string_0, 0, 0, 0.0, 0, "", Session.GetHabbo().CurrentRoom, ui.LtdId, ui.LtdCnt, ui.GuildData);
         if (Session.GetHabbo().CurrentRoom.method_79(Session, RoomItem_, x, y, rot, true, false, false))
         {
             Session.GetHabbo().GetInventoryComponent().method_12(ui.uint_0, 1u, false);
             using (DatabaseClient class3 = Essential.GetDatabase().GetClient())
             {
                 class3.ExecuteQuery(string.Concat(new object[]
                 {
                     "UPDATE items SET room_id = '",
                     Session.GetHabbo().CurrentRoom.Id,
                     "' WHERE Id = '",
                     ui.uint_0,
                     "' LIMIT 1"
                 }));
             }
         }
         try
         {
             Essential.getWebSocketManager().getWebSocketByName(Session.GetHabbo().Username).Send("38|" + sb.Name + "|" + sb.Image);
         }
         catch { }
     }
 }
Ejemplo n.º 12
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            int    PollId      = Event.PopWiredInt32();
            int    QuestionId  = Event.PopWiredInt32();
            int    AnswerCount = Event.PopWiredInt32();
            string AnswerText  = "";

            if (AnswerCount > 1)
            {
                for (int i = 1; i <= AnswerCount; i++)
                {
                    if (AnswerText == "")
                    {
                        AnswerText = Event.PopFixedString();
                    }
                    else
                    {
                        AnswerText = AnswerText + "," + Event.PopFixedString();
                    }
                }
            }
            else
            {
                AnswerText = Event.PopFixedString();
            }

            if (string.IsNullOrEmpty(AnswerText))
            {
                return;
            }

            using (DatabaseClient dbClient = Essential.GetDatabase().GetClient())
            {
                dbClient.AddParamWithValue("answer", AnswerText);
                dbClient.ExecuteQuery("INSERT INTO `room_poll_results` (`poll_id`, `question_id`, `answer_text`, `user_id`) VALUES ('" + PollId + "', '" + QuestionId + "', @answer, '" + Session.GetHabbo().Id + "')");
            }
        }
Ejemplo n.º 13
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            try
            {
                uint   ItemId       = Event.PopWiredUInt();
                string ClothingName = Event.PopFixedString();
                Room   Room         = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

                if (Room != null)
                {
                    RoomItem Item = Room.method_28(ItemId);

                    if (Item == null)
                    {
                        return;
                    }
                    string Lookki = Session.GetHabbo().Figure;
                    Lookki         = Lookki.Replace(GetHair(Session.GetHabbo().Figure), "");
                    Lookki         = Lookki.Replace(GetBody(Session.GetHabbo().Figure), "");
                    Item.ExtraData = Lookki + (char)5 + Session.GetHabbo().Gender + (char)5 + ChatCommandHandler.ApplyFilter(ClothingName);

                    using (DatabaseClient class2 = Essential.GetDatabase().GetClient())
                    {
                        class2.ExecuteQuery("DELETE FROM items_extra_data WHERE item_id = '" + Item.uint_0 + "'");
                        class2.AddParamWithValue("extradata", Item.ExtraData);
                        class2.ExecuteQuery("INSERT INTO items_extra_data (item_id,extra_data) VALUES ('" + Item.uint_0 + "' , @extradata);");
                    }
                    Room.method_79(Session, Item, Item.GetX, Item.Int32_1, Item.int_3, true, false, true);
                    Item.ReqUpdate(1);
                    Item.UpdateState(true, true, false);
                    //  Item.UpdateState(true, true);
                }
            }
            catch
            {
            }
        }
Ejemplo n.º 14
0
        public AvatarEffectsInventoryComponent(uint uint_1, GameClient class16_1, UserDataFactory class12_0)
        {
            this.Session = class16_1;
            this.list_0  = new List <AvatarEffect>();
            this.uint_0  = uint_1;
            this.int_0   = -1;
            this.list_0.Clear();
            DataTable     dataTable_    = class12_0.GetEffects();
            StringBuilder stringBuilder = new StringBuilder();

            foreach (DataRow dataRow in dataTable_.Rows)
            {
                AvatarEffect @class = new AvatarEffect((int)dataRow["effect_id"], (int)dataRow["total_duration"], Essential.StringToBoolean(dataRow["is_activated"].ToString()), (double)dataRow["activated_stamp"]);
                if (@class.Boolean_0)
                {
                    stringBuilder.Append(string.Concat(new object[]
                    {
                        "DELETE FROM user_effects WHERE user_id = '",
                        uint_1,
                        "' AND effect_id = '",
                        @class.int_0,
                        "' LIMIT 1; "
                    }));
                }
                else
                {
                    this.list_0.Add(@class);
                }
            }
            if (stringBuilder.Length > 0)
            {
                using (DatabaseClient class2 = Essential.GetDatabase().GetClient())
                {
                    class2.ExecuteQuery(stringBuilder.ToString());
                }
            }
        }
Ejemplo n.º 15
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            if (Session.GetHabbo().GetInventoryComponent() != null)
            {
                if (Session.GetHabbo().InRoom)
                {
                    Room     class14_ = Session.GetHabbo().CurrentRoom;
                    RoomUser @class   = class14_.GetRoomUserByHabbo(Session.GetHabbo().Id);
                    if (@class.Boolean_3)
                    {
                        return;
                    }
                }
                int int_ = Event.PopWiredInt32();
                Event.PopWiredInt32();
                uint uint_ = Event.PopWiredUInt();

                UserItem class2 = Session.GetHabbo().GetInventoryComponent().GetItemById(uint_);
                if (class2 != null && class2.GetBaseItem().AllowTrade)
                {
                    Essential.GetGame().GetCatalog().GetMarketplace().CreateOffer(Session, class2.uint_0, int_);
                }
            }
        }
Ejemplo n.º 16
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            Room @class = Essential.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (@class != null)
            {
                RoomUser class2 = @class.GetRoomUserByHabbo(Session.GetHabbo().Id);
                if (class2 != null)
                {
                    int Action = Event.PopWiredInt32();
                    //kiss == 2
                    class2.Unidle();
                    class2.DanceId = 0;
                    ServerMessage Message = new ServerMessage(Outgoing.Action); // Updated
                    Message.AppendInt32(class2.VirtualId);
                    Message.AppendInt32(Action);
                    @class.SendMessage(Message, null);

                    if (Action == 5) // idle
                    {
                        class2.bool_8 = true;

                        ServerMessage FallAsleep = new ServerMessage(Outgoing.IdleStatus);
                        FallAsleep.AppendInt32(class2.VirtualId);
                        FallAsleep.AppendBoolean(class2.bool_8);
                        @class.SendMessage(FallAsleep, null);
                    }


                    if (Session.GetHabbo().CurrentQuestId > 0 && Essential.GetGame().GetQuestManager().GetQuestAction(Session.GetHabbo().CurrentQuestId) == "WAVE")
                    {
                        Essential.GetGame().GetQuestManager().ProgressUserQuest(Session.GetHabbo().CurrentQuestId, Session);
                    }
                }
            }
        }
Ejemplo n.º 17
0
        public RoomData method_12(uint uint_0)
        {
            RoomData @class = new RoomData();
            RoomData result;

            lock (this.hashtable_0)
            {
                if (this.hashtable_0.ContainsKey(uint_0))
                {
                    result = (this.hashtable_0[uint_0] as RoomData);
                    return(result);
                }
                if (this.method_13(uint_0))
                {
                    result = this.GetRoom(uint_0).RoomData;
                    return(result);
                }
                DataRow dataRow = null;
                using (DatabaseClient class2 = Essential.GetDatabase().GetClient())
                {
                    dataRow = class2.ReadDataRow("SELECT * FROM rooms WHERE Id = '" + uint_0 + "' LIMIT 1");
                }
                if (dataRow == null)
                {
                    result = null;
                    return(result);
                }
                @class.method_1(dataRow);
            }
            if (!this.hashtable_0.ContainsKey(uint_0))
            {
                this.hashtable_0.Add(uint_0, @class);
            }
            result = @class;
            return(result);
        }
        public void Handle(HabboHotel.GameClients.GameClient Session, global::Essential.Messages.ClientMessage Event)
        {
            if (!Session.GetHabbo().HasFuse("acc_supporttool"))
            {
                return;
            }
            uint   num  = Event.PopWiredUInt();
            string text = Event.PopFixedString();
            int    num2 = Event.PopWiredInt32();

            Console.WriteLine(num + "      " + text + "     " + num2);
            string string_ = string.Concat(new object[]
            {
                "User: "******", Message: ",
                text,
                ", Time: ",
                num2
            });

            Essential.GetGame().GetModerationTool().MuteUser(Session, num, text, num2);
            Essential.GetGame().GetClientManager().StoreCommand(Session, "ModTool - Mute User", string_);
        }
Ejemplo n.º 19
0
 private void WaitForData()
 {
     if (!this.bool_0)
     {
         try
         {
             base.BeginReceive(this.mDataBuffer, 0, 1024, SocketFlags.None, this.mDataReceivedCallback, this);
         }
         catch (SocketException)
         {
             this.Shutdown(SocketShutdown.Both);
             this.Close();
             this.Dispose();
             Essential.GetGame().GetClientManager().Dispose(this.uint_0);
         }
         catch (Exception)
         {
             this.Shutdown(SocketShutdown.Both);
             this.Close();
             this.Dispose();
             Essential.GetGame().GetClientManager().Dispose(this.uint_0);
         }
     }
 }
Ejemplo n.º 20
0
 public override void OnTrigger(GameClients.GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
 {
     if (RoomItem_0.GetRoom().CheckRights(Session, true))
     {
         string   imageUrl = "";
         int      offsetX  = 0;
         int      offsetY  = 0;
         int      offsetZ  = 0;
         int      count    = 0;
         string[] splitted = RoomItem_0.ExtraData.Split(Convert.ToChar(9));
         foreach (string s in RoomItem_0.ExtraData.Split(Convert.ToChar(9)))
         {
             try {
                 if (s == "imageUrl")
                 {
                     imageUrl = splitted[count + 1];
                 }
                 if (s == "offsetX")
                 {
                     offsetX = int.Parse(splitted[count + 1]);
                 }
                 if (s == "offsetY")
                 {
                     offsetY = int.Parse(splitted[count + 1]);
                 }
                 if (s == "offsetZ")
                 {
                     offsetZ = int.Parse(splitted[count + 1]);
                 }
             }catch {}
             count++;
         }
         string tosend = "17|" + RoomItem_0.uint_0 + "|" + imageUrl.Replace("https://", "http://") + "|" + offsetX + "|" + offsetY + "|" + offsetZ;
         Essential.getWebSocketManager().getWebSocketByName(Session.GetHabbo().Username).Send(tosend);
     }
 }
Ejemplo n.º 21
0
        public void Handle(GameClient Session, ClientMessage Event)
        {
            uint num = Event.PopWiredUInt();

            if (Essential.GetConfig().data["emu.messages.roommgr"] == "1")
            {
                Logging.WriteLine("[RoomMgr] Requesting Public Room [ID: " + num + "]");
            }
            RoomData @class = Essential.GetGame().GetRoomManager().method_12(num);

            Session.GetHabbo().uint_2 = num;
            Session.GetClientMessageHandler().method_5(num, "");

            /*   RoomData @class = Essential.GetGame().GetRoomManager().method_12(num);
             *             if (@class != null && !(@class.Type != "public"))
             *             {
             *                     Session.GetClientMessageHandler().method_5(num, "");
             *             }
             * else
             * {
             *
             * }
             */
        }
Ejemplo n.º 22
0
        public void SetInApp(uint uint_0)
        {
            Room @class = Essential.GetGame().GetRoomManager().GetRoom(uint_0);

            if (@class != null)
            {
                @class.Name        = EssentialEnvironment.GetExternalText("mod_inappropriate_roomname");
                @class.Description = EssentialEnvironment.GetExternalText("mod_inappropriate_roomdesc");
                @class.Tags.Clear();
                using (DatabaseClient class2 = Essential.GetDatabase().GetClient())
                {
                    class2.ExecuteQuery(string.Concat(new object[]
                    {
                        "UPDATE rooms SET caption = '",
                        @class.Name,
                        "', description = '",
                        @class.Description,
                        "', tags = '' WHERE Id = '",
                        @class.Id,
                        "' LIMIT 1"
                    }));
                }
            }
        }
Ejemplo n.º 23
0
        public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
        {
            Essential.getWebSocketManager().getWebSocketByName(Session.GetHabbo().Username).Send("4|Bancomat");

            /*  if (!Session.GetHabbo().bankingModeEnabled)
             * {
             *     if (Session.GetHabbo().PIN != "NOACCOUNT")
             *     {
             *         Session.Whisper(Essential.GetBankingConfig().getData("text.welcome"));
             *         Session.Whisper(Essential.GetBankingConfig().getData("text.pincode").Replace("%leave%", Essential.GetBankingConfig().getData("cmd.leave")));
             *         Session.GetHabbo().bankingModeEnabled = true;
             *         Session.GetHabbo().nextStep = "PIN";
             *         RoomUser class4 = Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
             *         if (class4 != null)
             *         {
             *             class4.bool_5 = true;
             *         }
             *     }
             *     else
             *     {
             *         Session.Whisper(Essential.GetBankingConfig().getData("text.noaccount"));
             *     }
             * }*/
        }
Ejemplo n.º 24
0
        public void Initialize(DatabaseClient class6_0)
        {
            Logging.Write("Loading Navigator..");
            this.list_0.Clear();
            this.PublicItems.Clear();
            this.dictionary_1.Clear();
            DataTable dataTable  = class6_0.ReadDataTable("SELECT Id,caption,min_rank,cantrade FROM navigator_flatcats WHERE enabled = '1'");
            DataTable dataTable2 = class6_0.ReadDataTable("SELECT * FROM navigator_publics_new ORDER BY ordernum ASC");

            if (dataTable != null)
            {
                foreach (DataRow dataRow in dataTable.Rows)
                {
                    this.list_0.Add(new FlatCat((int)dataRow["Id"], (string)dataRow["caption"], (int)dataRow["min_rank"], Essential.StringToBoolean(dataRow["cantrade"].ToString())));
                }
            }
            if (dataTable2 != null)
            {
                foreach (DataRow row in dataTable2.Rows)
                {
                    this.PublicItems.Add((int)row["id"], new PublicItem((int)row["id"], int.Parse(row["bannertype"].ToString()), (string)row["caption"], (string)row["description"], (string)row["image"], (row["image_type"].ToString().ToLower() == "internal") ? PublicImageType.INTERNAL : PublicImageType.EXTERNAL, Convert.ToUInt32(row["room_id"]), (int)row["category_id"], (int)row["category_parent_id"], Essential.StringToBoolean(row["recommended"].ToString()), (int)row["typeofdata"], (string)row["tag"]));
                }
            }
            Logging.WriteLine("completed!", ConsoleColor.Green);
        }
Ejemplo n.º 25
0
 public RandomSpeech GetRandomSpeech()
 {
     return(this.list_0[Essential.smethod_5(0, this.list_0.Count - 1)]);
 }
Ejemplo n.º 26
0
        public ServerMessage GetNavigatorMessage(GameClient Session, int int_0)
        {
            Func <RoomData, bool> func  = null;
            Func <Room, bool>     func2 = null;

            Navigator.Class219 @class = new Navigator.Class219();
            @class.int_0 = int_0;
            ServerMessage Message = new ServerMessage(Outgoing.NavigatorPacket);

            if (@class.int_0 >= -1)
            {
                Message.AppendInt32(1);
                Message.AppendString("-1");
            }
            else
            {
                if (@class.int_0 == -2)
                {
                    Message.AppendInt32(0);
                    Message.AppendString("2");
                }
                else
                {
                    if (@class.int_0 == -3)
                    {
                        //Message.AppendInt32(0);
                        Message.AppendInt32(5);
                    }
                    else
                    {
                        if (@class.int_0 == -4)
                        {
                            //Message.AppendInt32(0);
                            Message.AppendInt32(3);
                        }
                        else
                        {
                            if (@class.int_0 == -5)
                            {
                                //Message.AppendInt32(0);
                                Message.AppendInt32(4);
                            }
                        }
                    }
                }
            }

            List <RoomData> list = new List <RoomData>();

            switch (@class.int_0)
            {
            case -5:
            case -4:
                Message.AppendStringWithBreak(string.Empty);
                break;

            case -3:
                Message.AppendStringWithBreak(string.Empty);
                goto IL_3A2;

            case -2:
                goto IL_3E5;

            case -1:
                goto IL_47E;

            default:
            {
                Dictionary <Room, int> dictionary = Essential.GetGame().GetRoomManager().method_21();
                IEnumerable <RoomData> arg_11F_0  = Essential.GetGame().GetRoomManager().list_3;
                if (func == null)
                {
                    func = new Func <RoomData, bool>(@class.method_0);
                }
                IEnumerable <RoomData> enumerable = arg_11F_0.Where(func);
                IEnumerable <Room>     arg_13E_0  = dictionary.Keys;
                if (func2 == null)
                {
                    func2 = new Func <Room, bool>(@class.method_1);
                }
                IEnumerable <Room> arg_160_0 = arg_13E_0.Where(func2);
                if (Navigator.func_2 == null)
                {
                    Navigator.func_2 = new Func <Room, int>(Navigator.GetUsersNow);
                }
                IOrderedEnumerable <Room> orderedEnumerable = arg_160_0.OrderByDescending(Navigator.func_2);
                new List <RoomData>();
                int num = 0;
                foreach (Room current in orderedEnumerable)
                {
                    if (num > 40)
                    {
                        break;
                    }
                    list.Add(current.RoomData);
                    num++;
                }
                using (IEnumerator <RoomData> enumerator2 = enumerable.GetEnumerator())
                {
                    while (enumerator2.MoveNext())
                    {
                        RoomData current2 = enumerator2.Current;
                        if (num > 40)
                        {
                            break;
                        }
                        if (list.Contains(current2))
                        {
                            list.Remove(current2);
                        }
                        list.Add(current2);
                        num++;
                    }
                    goto IL_508;
                }
            }
            }
            List <string>          list2       = new List <string>();
            Dictionary <int, Room> dictionary2 = new Dictionary <int, Room>();
            Hashtable hashtable = Session.GetHabbo().GetMessenger().method_26().Clone() as Hashtable;
            Dictionary <RoomData, int> dictionary3 = new Dictionary <RoomData, int>();

            foreach (MessengerBuddy class2 in hashtable.Values)
            {
                if (class2.Boolean_0 && class2.Boolean_1)
                {
                    GameClient class3 = Essential.GetGame().GetClientManager().GetClient(class2.UInt32_0);
                    if (class3 != null && class3.GetHabbo() != null && class3.GetHabbo().CurrentRoom != null)
                    {
                        RoomData class27_ = class3.GetHabbo().CurrentRoom.RoomData;
                        if (!dictionary3.ContainsKey(class27_))
                        {
                            dictionary3.Add(class27_, class27_.UsersNow);
                        }
                    }
                }
            }
            IEnumerable <RoomData> arg_344_0 = Session.GetHabbo().GetMessenger().GetActiveFriendsRooms();

            if (Navigator.func_0 == null)
            {
                Navigator.func_0 = new Func <RoomData, int>(Navigator.GetUsersNow);
            }
            IOrderedEnumerable <RoomData> orderedEnumerable2 = arg_344_0.OrderByDescending(Navigator.func_0);

            list2.Clear();
            dictionary2.Clear();
            hashtable.Clear();
            dictionary3.Clear();
            using (IEnumerator <RoomData> enumerator2 = orderedEnumerable2.GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    RoomData current3 = enumerator2.Current;
                    list.Add(current3);
                }
                goto IL_508;
            }
IL_3A2:
            using (List <RoomData> .Enumerator enumerator4 = Session.GetHabbo().OwnedRooms.GetEnumerator())
            {
                while (enumerator4.MoveNext())
                {
                    RoomData current3 = enumerator4.Current;
                    list.Add(current3);
                }
                goto IL_508;
            }
IL_3E5:
            DataTable dataTable;

            using (DatabaseClient class4 = Essential.GetDatabase().GetClient())
            {
                dataTable = class4.ReadDataTable("SELECT * FROM rooms WHERE score > 0 AND roomtype = 'private' ORDER BY score DESC LIMIT 40");
            }
            IEnumerator enumerator3 = dataTable.Rows.GetEnumerator();

            try
            {
                while (enumerator3.MoveNext())
                {
                    DataRow dataRow = (DataRow)enumerator3.Current;
                    list.Add(Essential.GetGame().GetRoomManager().method_17((uint)dataRow["Id"], dataRow));
                }
                goto IL_508;
            }
            finally
            {
                IDisposable disposable = enumerator3 as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
IL_47E:
            Dictionary <Room, int> dictionary4 = Essential.GetGame().GetRoomManager().method_21();
            IEnumerable <Room> arg_4B3_0       = dictionary4.Keys;

            if (Navigator.func_1 == null)
            {
                Navigator.func_1 = new Func <Room, int>(Navigator.GetUsersNow);
            }
            IOrderedEnumerable <Room> orderedEnumerable3 = arg_4B3_0.OrderByDescending(Navigator.func_1);
            int num2 = 0;

            foreach (Room current4 in orderedEnumerable3)
            {
                if (num2 >= 40)
                {
                    break;
                }
                num2++;
                list.Add(current4.RoomData);
            }
IL_508:
            Message.AppendInt32(list.Count);
            foreach (RoomData current5 in list)
            {
                current5.Serialize(Message, false, false);
            }
            //	Random random = new Random();
            //	Message.AppendStringWithBreak("");
            //	this.dictionary_1.ElementAt(random.Next(0, this.dictionary_1.Count)).Value.method_0(Message);

            Message.AppendBoolean(false);

            return(Message);
        }
Ejemplo n.º 27
0
 private GameClient method_25()
 {
     return(Essential.GetGame().GetClientManager().GetClient(this.uint_0));
 }
Ejemplo n.º 28
0
        internal void method_18(uint uint_1, string string_0)
        {
            if (!String.IsNullOrEmpty(string_0) && !String.IsNullOrWhiteSpace(string_0))
            {
                if (!this.method_9(uint_1, this.uint_0))
                {
                    this.method_20(6, uint_1);
                }
                else
                {
                    GameClient @class = Essential.GetGame().GetClientManager().GetClient(uint_1);
                    if (@class == null || @class.GetHabbo().GetMessenger() == null)
                    {
                        this.method_20(5, uint_1);
                    }
                    else
                    {
                        if (this.method_25().GetHabbo().IsMuted)
                        {
                            this.method_20(4, uint_1);
                        }
                        else
                        {
                            if (@class.GetHabbo().IsMuted)
                            {
                                this.method_20(3, uint_1);
                                return;
                            }
                            if (this.method_25().GetHabbo().method_4() > 0)
                            {
                                TimeSpan timeSpan = DateTime.Now - this.method_25().GetHabbo().dateTime_0;
                                if (timeSpan.Seconds > 4)
                                {
                                    this.method_25().GetHabbo().int_23 = 0;
                                }
                                if (timeSpan.Seconds < 4 && this.method_25().GetHabbo().int_23 > 5)
                                {
                                    this.method_20(4, uint_1);
                                    return;
                                }
                                this.method_25().GetHabbo().dateTime_0 = DateTime.Now;
                                this.method_25().GetHabbo().int_23++;
                            }

                            string_0 = ChatCommandHandler.ApplyFilter(string_0);
                            if (ServerConfiguration.EnableChatlog && !this.method_25().GetHabbo().IsJuniori)
                            {
                                using (DatabaseClient class2 = Essential.GetDatabase().GetClient())
                                {
                                    class2.AddParamWithValue("message", "<PM to " + @class.GetHabbo().Username + ">: " + string_0);
                                    class2.ExecuteQuery(string.Concat(new object[]
                                    {
                                        "INSERT INTO chatlogs (user_id,room_id,hour,minute,timestamp,message,user_name,full_date) VALUES ('",
                                        this.method_25().GetHabbo().Id,
                                        "','0','",
                                        DateTime.Now.Hour,
                                        "','",
                                        DateTime.Now.Minute,
                                        "',UNIX_TIMESTAMP(),@message,'",
                                        this.method_25().GetHabbo().Username,
                                        "','",
                                        DateTime.Now.ToLongDateString(),
                                        "')"
                                    }));
                                }
                            }
                            @class.GetHabbo().GetMessenger().method_19(string_0, this.uint_0);
                        }
                    }
                }
            }
        }
Ejemplo n.º 29
0
 internal SnowStorm GetWarByGameId(int GameId)
 {
     return(Essential.GetGame().GetStormWars().Wars[GameId]);
 }
Ejemplo n.º 30
0
 private Room method_14()
 {
     return(Essential.GetGame().GetRoomManager().GetRoom(this.uint_0));
 }