Beispiel #1
0
        public void method_0(DatabaseClient class6_0)
        {
            Logging.smethod_0("Loading Bot data..");
            this.list_0 = new List <RoomBot>();
            DataTable           dataTable  = class6_0.ReadDataTable("SELECT * FROM bots;");
            DataTable           dataTable2 = class6_0.ReadDataTable("SELECT Id, bot_id, keywords, response_text, mode, serve_id FROM bots_responses;");
            DataTable           dataTable3 = class6_0.ReadDataTable("SELECT text, shout, bot_id FROM bots_speech;");
            List <BotResponse>  list       = new List <BotResponse>();
            List <RandomSpeech> list2      = new List <RandomSpeech>();

            foreach (DataRow dataRow in dataTable2.Rows)
            {
                list.Add(new BotResponse((uint)dataRow["Id"], (uint)dataRow["bot_id"], (string)dataRow["keywords"], (string)dataRow["response_text"], dataRow["mode"].ToString(), (int)dataRow["serve_id"]));
            }
            foreach (DataRow dataRow in dataTable3.Rows)
            {
                list2.Add(new RandomSpeech((string)dataRow["text"], GoldTree.smethod_3(dataRow["shout"].ToString()), (uint)dataRow["bot_id"]));
            }
            if (dataTable != null)
            {
                foreach (DataRow dataRow in dataTable.Rows)
                {
                    string text  = (string)dataRow["ai_type"];
                    string text2 = text;
                    if (text2 == null)
                    {
                        goto IL_201;
                    }
                    AIType enum2_;
                    if (!(text2 == "generic"))
                    {
                        if (!(text2 == "guide"))
                        {
                            if (!(text2 == "pet"))
                            {
                                goto IL_201;
                            }
                            enum2_ = AIType.const_0;
                        }
                        else
                        {
                            enum2_ = AIType.const_1;
                        }
                    }
                    else
                    {
                        enum2_ = AIType.const_2;
                    }
IL_204:
                    this.list_0.Add(new RoomBot((uint)dataRow["Id"], (uint)dataRow["room_id"], enum2_, (string)dataRow["walk_mode"], (string)dataRow["name"], (string)dataRow["motto"], (string)dataRow["look"], (int)dataRow["x"], (int)dataRow["y"], (int)dataRow["z"], (int)dataRow["rotation"], (int)dataRow["min_x"], (int)dataRow["min_y"], (int)dataRow["max_x"], (int)dataRow["max_y"], ref list2, ref list, (int)dataRow["effect"]));
                    continue;
IL_201:
                    enum2_ = AIType.const_2;
                    goto IL_204;
                }
                Logging.WriteLine("completed!");
            }
        }
Beispiel #2
0
        internal void method_16(string string_0)
        {
            DataRow dataRow = null;

            using (DatabaseClient @class = GoldTree.GetDatabase().GetClient())
            {
                @class.AddParamWithValue("query", string_0.ToLower());
                dataRow = @class.ReadDataRow("SELECT Id,block_newfriends FROM users WHERE username = @query LIMIT 1");
            }
            if (dataRow != null)
            {
                if (GoldTree.smethod_3(dataRow["block_newfriends"].ToString()) && !this.method_25().GetHabbo().HasFuse("ignore_friendsettings"))
                {
                    ServerMessage Message = new ServerMessage(260u);
                    Message.AppendInt32(39);
                    Message.AppendInt32(3);
                    this.method_25().SendMessage(Message);
                }
                else
                {
                    uint num = (uint)dataRow["Id"];
                    if (!this.method_8(this.uint_0, num))
                    {
                        using (DatabaseClient @class = GoldTree.GetDatabase().GetClient())
                        {
                            @class.AddParamWithValue("toid", num);
                            @class.AddParamWithValue("userid", this.uint_0);
                            @class.ExecuteQuery("INSERT INTO messenger_requests (to_id,from_id) VALUES (@toid,@userid)");
                        }
                        GameClient class2 = GoldTree.GetGame().GetClientManager().method_2(num);
                        if (class2 != null && class2.GetHabbo() != null)
                        {
                            uint num2 = 0u;
                            using (DatabaseClient @class = GoldTree.GetDatabase().GetClient())
                            {
                                @class.AddParamWithValue("toid", num);
                                @class.AddParamWithValue("userid", this.uint_0);
                                num2 = @class.ReadUInt32("SELECT Id FROM messenger_requests WHERE to_id = @toid AND from_id = @userid ORDER BY Id DESC LIMIT 1");
                            }
                            MessengerRequest class3 = new MessengerRequest(num2, num, this.uint_0, GoldTree.GetGame().GetClientManager().GetNameById(this.uint_0));
                            class2.GetHabbo().GetMessenger().method_17(num2, num, this.uint_0);
                            ServerMessage Message5_ = new ServerMessage(132u);
                            class3.method_0(Message5_);
                            class2.SendMessage(Message5_);
                        }
                    }
                }
            }
        }
Beispiel #3
0
        public void method_17(DatabaseClient class6_0)
        {
            Logging.smethod_0("Loading your settings..");
            DataRow dataRow = class6_0.ReadDataRow("SELECT * FROM server_settings LIMIT 1");

            LicenseTools.Int32_4         = (int)dataRow["MaxRoomsPerUser"];
            LicenseTools.String_4        = (string)dataRow["motd"];
            LicenseTools.Int32_0         = (int)dataRow["timer"];
            LicenseTools.Int32_1         = (int)dataRow["credits"];
            LicenseTools.Int32_3         = (int)dataRow["pixels"];
            LicenseTools.Int32_2         = (int)dataRow["points"];
            LicenseTools.int_3           = (int)dataRow["pixels_max"];
            LicenseTools.int_5           = (int)dataRow["credits_max"];
            LicenseTools.int_4           = (int)dataRow["points_max"];
            LicenseTools.int_2           = (int)dataRow["MaxPetsPerRoom"];
            LicenseTools.int_0           = (int)dataRow["MaxMarketPlacePrice"];
            LicenseTools.int_1           = (int)dataRow["MarketPlaceTax"];
            LicenseTools.AntiDDoSEnabled = GoldTree.smethod_3(dataRow["enable_antiddos"].ToString());
            LicenseTools.Boolean_3       = GoldTree.smethod_3(dataRow["vipclothesforhcusers"].ToString());
            LicenseTools.Boolean_4       = GoldTree.smethod_3(dataRow["enable_chatlogs"].ToString());
            LicenseTools.Boolean_5       = GoldTree.smethod_3(dataRow["enable_cmdlogs"].ToString());
            LicenseTools.Boolean_6       = GoldTree.smethod_3(dataRow["enable_roomlogs"].ToString());
            LicenseTools.String_2        = (string)dataRow["enable_externalchatlinks"];
            LicenseTools.Boolean_2       = GoldTree.smethod_3(dataRow["enable_securesessions"].ToString());
            LicenseTools.Boolean_1       = GoldTree.smethod_3(dataRow["allow_friendfurnidrops"].ToString());
            LicenseTools.Boolean_0       = GoldTree.smethod_3(dataRow["enable_cmd_redeemcredits"].ToString());
            LicenseTools.bool_18         = GoldTree.smethod_3(dataRow["unload_crashedrooms"].ToString());
            LicenseTools.bool_19         = GoldTree.smethod_3(dataRow["ShowUsersAndRoomsInAbout"].ToString());
            LicenseTools.int_14          = (int)dataRow["idlesleep"];
            LicenseTools.int_15          = (int)dataRow["idlekick"];
            LicenseTools.bool_20         = GoldTree.smethod_3(dataRow["ip_lastforbans"].ToString());
            LicenseTools.int_16          = (int)dataRow["StaffPicksCategoryID"];
            LicenseTools.vipha_interval  = (double)dataRow["vipha_interval"];
            LicenseTools.bool_21         = GoldTree.smethod_3(dataRow["enable_cmd_redeempixels"].ToString());
            LicenseTools.bool_22         = GoldTree.smethod_3(dataRow["enable_cmd_redeemshells"].ToString());
            LicenseTools.viphal_interval = (double)dataRow["viphal_interval"];
            LicenseTools.DisableOtherUsersToMovingOtherUsersToDoor = GoldTree.smethod_3(dataRow["DisableOtherUsersToMovingOtherUsersToDoor"].ToString());
            Logging.WriteLine("completed!");
        }
Beispiel #4
0
        public void method_8(DatabaseClient class6_0)
        {
            Logging.smethod_0("Loading Room Models..");
            this.Models.Clear();
            DataTable dataTable = class6_0.ReadDataTable("SELECT Id,door_x,door_y,door_z,door_dir,heightmap,public_items,club_only FROM room_models");

            if (dataTable != null)
            {
                foreach (DataRow dataRow in dataTable.Rows)
                {
                    string text = (string)dataRow["Id"];
                    this.Models.Add(text, new RoomModel(text, (int)dataRow["door_x"], (int)dataRow["door_y"], (double)dataRow["door_z"], (int)dataRow["door_dir"], (string)dataRow["heightmap"], (string)dataRow["public_items"], GoldTree.smethod_3(dataRow["club_only"].ToString())));
                }
                Logging.WriteLine("completed!");
            }
        }
Beispiel #5
0
        public void method_1(DataRow Row)
        {
            this.Id          = (uint)Row["Id"];
            this.Name        = (string)Row["caption"];
            this.Description = (string)Row["description"];
            this.Type        = (string)Row["roomtype"];
            this.Owner       = (string)Row["owner"];
            this.Achievement = Convert.ToUInt32(Row["achievement"]);
            string text = Row["state"].ToString().ToLower();

            if (text != null)
            {
                if (text == "open")
                {
                    this.State = 0;
                    goto IL_DF;
                }
                if (text == "password")
                {
                    this.State = 2;
                    goto IL_DF;
                }
                if (!(text == "locked"))
                {
                }
            }
            this.State = 1;
IL_DF:
            this.Category         = (int)Row["category"];
            this.UsersNow         = (int)Row["users_now"];
            this.UsersMax         = (int)Row["users_max"];
            this.ModelName        = (string)Row["model_name"];
            this.CCTs             = (string)Row["public_ccts"];
            this.Score            = (int)Row["score"];
            this.Tags             = new List <string>();
            this.AllowPet         = GoldTree.smethod_3(Row["allow_pets"].ToString());
            this.AllowPetsEating  = GoldTree.smethod_3(Row["allow_pets_eat"].ToString());
            this.AllowWalkthrough = GoldTree.smethod_3(Row["allow_walkthrough"].ToString());
            this.bool_3           = false;
            this.Hidewall         = GoldTree.smethod_3(Row["allow_hidewall"].ToString());
            this.Wallthick        = (int)Row["wallthick"];
            this.Floorthick       = (int)Row["floorthick"];
            this.Password         = (string)Row["password"];
            this.Wallpaper        = (string)Row["wallpaper"];
            this.Floor            = (string)Row["floor"];
            this.Landscape        = (string)Row["landscape"];
            this.Event            = null;
            Dictionary <int, int> IconItems = new Dictionary <int, int>();

            string[] array;
            if (Row["icon_items"].ToString() != "")
            {
                array = Row["icon_items"].ToString().Split(new char[]
                {
                    '|'
                });
                for (int i = 0; i < array.Length; i++)
                {
                    string text2 = array[i];
                    if (!string.IsNullOrEmpty(text2))
                    {
                        string[] array2 = text2.Replace('.', ',').Split(new char[]
                        {
                            ','
                        });
                        int key   = 0;
                        int value = 0;
                        int.TryParse(array2[0], out key);
                        if (array2.Length > 1)
                        {
                            int.TryParse(array2[1], out value);
                        }
                        try
                        {
                            if (!IconItems.ContainsKey(key))
                            {
                                IconItems.Add(key, value);
                            }
                        }
                        catch (Exception ex)
                        {
                            Logging.LogException(string.Concat(new string[]
                            {
                                "Exception: ",
                                ex.ToString(),
                                "[",
                                text2,
                                "]"
                            }));
                        }
                    }
                }
            }
            this.myIcon = new RoomIcon((int)Row["icon_bg"], (int)Row["icon_fg"], IconItems);
            array       = Row["tags"].ToString().Split(new char[]
            {
                ','
            });
            for (int i = 0; i < array.Length; i++)
            {
                string Tag = array[i];
                this.Tags.Add(Tag);
            }
            this.class28_0 = GoldTree.GetGame().GetRoomManager().GetModel(this.ModelName, this.Id);
        }
Beispiel #6
0
        public void method_2(string string_0)
        {
            string text = string_0.Split(new char[]
            {
                Convert.ToChar(1)
            })[0];
            string text2 = string_0.Split(new char[]
            {
                Convert.ToChar(1)
            })[1];
            GameClient @class  = null;
            DataRow    dataRow = null;
            string     text3   = text.ToLower();

            if (text3 != null)
            {
                if (MusCommands.dictionary_0 == null)
                {
                    MusCommands.dictionary_0 = new Dictionary <string, int>(29)
                    {
                        {
                            "update_items",
                            0
                        },

                        {
                            "update_catalogue",
                            1
                        },

                        {
                            "update_catalog",
                            2
                        },

                        {
                            "updateusersrooms",
                            3
                        },

                        {
                            "senduser",
                            4
                        },

                        {
                            "updatevip",
                            5
                        },

                        {
                            "giftitem",
                            6
                        },

                        {
                            "giveitem",
                            7
                        },

                        {
                            "unloadroom",
                            8
                        },

                        {
                            "roomalert",
                            9
                        },

                        {
                            "updategroup",
                            10
                        },

                        {
                            "updateusersgroups",
                            11
                        },

                        {
                            "shutdown",
                            12
                        },

                        {
                            "update_filter",
                            13
                        },

                        {
                            "refresh_filter",
                            14
                        },

                        {
                            "updatecredits",
                            15
                        },

                        {
                            "updatesettings",
                            16
                        },

                        {
                            "updatepixels",
                            17
                        },

                        {
                            "updatepoints",
                            18
                        },

                        {
                            "reloadbans",
                            19
                        },

                        {
                            "update_bots",
                            20
                        },

                        {
                            "signout",
                            21
                        },

                        {
                            "exe",
                            22
                        },

                        {
                            "alert",
                            23
                        },

                        {
                            "sa",
                            24
                        },

                        {
                            "ha",
                            25
                        },

                        {
                            "hal",
                            26
                        },

                        {
                            "updatemotto",
                            27
                        },

                        {
                            "updatelook",
                            28
                        }
                    };
                }
                int num;
                if (MusCommands.dictionary_0.TryGetValue(text3, out num))
                {
                    uint   num2;
                    uint   uint_2;
                    Room   class4;
                    uint   num3;
                    string text5;
                    switch (num)
                    {
                    case 0:
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            GoldTree.GetGame().GetItemManager().method_0(class2);
                            goto IL_C70;
                        }

                    case 1:
                    case 2:
                        break;

                    case 3:
                    {
                        Habbo class3 = GoldTree.GetGame().GetClientManager().method_2(Convert.ToUInt32(text2)).GetHabbo();
                        if (class3 != null)
                        {
                            using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                            {
                                class3.method_1(class2);
                                goto IL_C70;
                            }
                        }
                        goto IL_C70;
                    }

                    case 4:
                        goto IL_34E;

                    case 5:
                    {
                        Habbo class3 = GoldTree.GetGame().GetClientManager().method_2(Convert.ToUInt32(text2)).GetHabbo();
                        if (class3 != null)
                        {
                            class3.method_27();
                            goto IL_C70;
                        }
                        goto IL_C70;
                    }

                    case 6:
                    case 7:
                    {
                        num2 = uint.Parse(text2.Split(new char[]
                            {
                                ' '
                            })[0]);
                        uint uint_ = uint.Parse(text2.Split(new char[]
                            {
                                ' '
                            })[1]);
                        int int_ = int.Parse(text2.Split(new char[]
                            {
                                ' '
                            })[2]);
                        string string_ = text2.Substring(num2.ToString().Length + uint_.ToString().Length + int_.ToString().Length + 3);
                        GoldTree.GetGame().GetCatalog().method_7(string_, num2, uint_, int_);
                        goto IL_C70;
                    }

                    case 8:
                        uint_2 = uint.Parse(text2);
                        class4 = GoldTree.GetGame().GetRoomManager().GetRoom(uint_2);
                        GoldTree.GetGame().GetRoomManager().method_16(class4);
                        goto IL_C70;

                    case 9:
                        num3 = uint.Parse(text2.Split(new char[]
                        {
                            ' '
                        })[0]);
                        class4 = GoldTree.GetGame().GetRoomManager().GetRoom(num3);
                        if (class4 != null)
                        {
                            string string_2 = text2.Substring(num3.ToString().Length + 1);
                            for (int i = 0; i < class4.RoomUser_0.Length; i++)
                            {
                                RoomUser class5 = class4.RoomUser_0[i];
                                if (class5 != null)
                                {
                                    class5.GetClient().SendNotif(string_2);
                                }
                            }
                            goto IL_C70;
                        }
                        goto IL_C70;

                    case 10:
                    {
                        int int_2 = int.Parse(text2.Split(new char[]
                            {
                                ' '
                            })[0]);
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            Groups.smethod_3(class2, int_2);
                            goto IL_C70;
                        }
                    }

                    case 11:
                        goto IL_5BF;

                    case 12:
                        goto IL_602;

                    case 13:
                    case 14:
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            ChatCommandHandler.InitWords(class2);
                            goto IL_C70;
                        }

                    case 15:
                        goto IL_633;

                    case 16:
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            GoldTree.GetGame().method_17(class2);
                            goto IL_C70;
                        }

                    case 17:
                        goto IL_6F7;

                    case 18:
                        @class = GoldTree.GetGame().GetClientManager().method_2(uint.Parse(text2));
                        if (@class != null)
                        {
                            @class.GetHabbo().method_14(true, false);
                            goto IL_C70;
                        }
                        goto IL_C70;

                    case 19:
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            GoldTree.GetGame().GetBanManager().method_0(class2);
                        }
                        GoldTree.GetGame().GetClientManager().method_28();
                        goto IL_C70;

                    case 20:
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            GoldTree.GetGame().GetBotManager().method_0(class2);
                            goto IL_C70;
                        }

                    case 21:
                        goto IL_839;

                    case 22:
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            class2.ExecuteQuery(text2);
                            goto IL_C70;
                        }

                    case 23:
                        goto IL_880;

                    case 24:
                    {
                        ServerMessage Message = new ServerMessage(134u);
                        Message.AppendUInt(0u);
                        Message.AppendString("PHX: " + text2);
                        GoldTree.GetGame().GetClientManager().method_16(Message, Message);
                        goto IL_C70;
                    }

                    case 25:
                    {
                        ServerMessage Message2 = new ServerMessage(808u);
                        Message2.AppendStringWithBreak(GoldTreeEnvironment.smethod_1("mus_ha_title"));
                        Message2.AppendStringWithBreak(text2);
                        ServerMessage Message3 = new ServerMessage(161u);
                        Message3.AppendStringWithBreak(text2);
                        GoldTree.GetGame().GetClientManager().method_15(Message2, Message3);
                        goto IL_C70;
                    }

                    case 26:
                    {
                        string text4 = text2.Split(new char[]
                            {
                                ' '
                            })[0];
                        text5 = text2.Substring(text4.Length + 1);
                        ServerMessage Message4 = new ServerMessage(161u);
                        Message4.AppendStringWithBreak(string.Concat(new string[]
                            {
                                GoldTreeEnvironment.smethod_1("mus_hal_title"),
                                "\r\n",
                                text5,
                                "\r\n-",
                                GoldTreeEnvironment.smethod_1("mus_hal_tail")
                            }));
                        Message4.AppendStringWithBreak(text4);
                        GoldTree.GetGame().GetClientManager().method_14(Message4);
                        goto IL_C70;
                    }

                    case 27:
                    case 28:
                    {
                        uint_2 = uint.Parse(text2);
                        @class = GoldTree.GetGame().GetClientManager().method_2(uint_2);
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            dataRow = class2.ReadDataRow("SELECT look,gender,motto,mutant_penalty,block_newfriends FROM users WHERE UserId = '" + @class.GetHabbo().Id + "' LIMIT 1");
                        }
                        @class.GetHabbo().Figure          = (string)dataRow["look"];
                        @class.GetHabbo().Gender          = dataRow["gender"].ToString().ToLower();
                        @class.GetHabbo().Motto           = GoldTree.FilterString((string)dataRow["motto"]);
                        @class.GetHabbo().BlockNewFriends = GoldTree.smethod_3(dataRow["block_newfriends"].ToString());
                        ServerMessage Message5            = new ServerMessage(266u);
                        Message5.AppendInt32(-1);
                        Message5.AppendStringWithBreak(@class.GetHabbo().Figure);
                        Message5.AppendStringWithBreak(@class.GetHabbo().Gender.ToLower());
                        Message5.AppendStringWithBreak(@class.GetHabbo().Motto);
                        @class.SendMessage(Message5);
                        if (@class.GetHabbo().InRoom)
                        {
                            class4 = GoldTree.GetGame().GetRoomManager().GetRoom(@class.GetHabbo().CurrentRoomId);
                            RoomUser      class6   = class4.GetRoomUserByHabbo(@class.GetHabbo().Id);
                            ServerMessage Message6 = new ServerMessage(266u);
                            Message6.AppendInt32(class6.VirtualId);
                            Message6.AppendStringWithBreak(@class.GetHabbo().Figure);
                            Message6.AppendStringWithBreak(@class.GetHabbo().Gender.ToLower());
                            Message6.AppendStringWithBreak(@class.GetHabbo().Motto);
                            Message6.AppendInt32(@class.GetHabbo().AchievementScore);
                            Message6.AppendStringWithBreak("");
                            class4.SendMessage(Message6, null);
                        }
                        text3 = text.ToLower();
                        if (text3 == null)
                        {
                            goto IL_C70;
                        }
                        if (text3 == "updatemotto")
                        {
                            @class.GetHabbo().MottoAchievementsCompleted();
                            goto IL_C70;
                        }
                        if (text3 == "updatelook")
                        {
                            @class.GetHabbo().AvatarLookAchievementsCompleted();
                            goto IL_C70;
                        }
                        goto IL_C70;
                    }

                    default:
                        goto IL_C70;
                    }
                    using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                    {
                        GoldTree.GetGame().GetCatalog().method_0(class2);
                    }
                    GoldTree.GetGame().GetCatalog().method_1();
                    GoldTree.GetGame().GetClientManager().method_14(new ServerMessage(441u));
                    goto IL_C70;
IL_34E:
                    num2 = uint.Parse(text2.Split(new char[]
                    {
                        ' '
                    })[0]);
                    num3 = uint.Parse(text2.Split(new char[]
                    {
                        ' '
                    })[1]);
                    GameClient class7 = GoldTree.GetGame().GetClientManager().method_2(num2);
                    class4 = GoldTree.GetGame().GetRoomManager().GetRoom(num3);
                    if (class7 != null)
                    {
                        ServerMessage Message7 = new ServerMessage(286u);
                        Message7.AppendBoolean(class4.Boolean_3);
                        Message7.AppendUInt(num3);
                        class7.SendMessage(Message7);
                        goto IL_C70;
                    }
                    goto IL_C70;
IL_5BF:
                    uint_2 = uint.Parse(text2);
                    using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                    {
                        GoldTree.GetGame().GetClientManager().method_2(uint_2).GetHabbo().method_0(class2);
                        goto IL_C70;
                    }
IL_602:
                    GoldTree.smethod_18();
                    goto IL_C70;
IL_633:
                    @class = GoldTree.GetGame().GetClientManager().method_2(uint.Parse(text2));
                    if (@class != null)
                    {
                        int int_3 = 0;
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            int_3 = (int)class2.ReadDataRow("SELECT credits FROM users WHERE UserId = '" + @class.GetHabbo().Id + "' LIMIT 1")[0];
                        }
                        @class.GetHabbo().Credits = int_3;
                        @class.GetHabbo().method_13(false);
                        goto IL_C70;
                    }
                    goto IL_C70;
IL_6F7:
                    @class = GoldTree.GetGame().GetClientManager().method_2(uint.Parse(text2));
                    if (@class != null)
                    {
                        int int_4 = 0;
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            int_4 = (int)class2.ReadDataRow("SELECT activity_points FROM users WHERE UserId = '" + @class.GetHabbo().Id + "' LIMIT 1")[0];
                        }
                        @class.GetHabbo().ActivityPoints = int_4;
                        @class.GetHabbo().method_15(false);
                        goto IL_C70;
                    }
                    goto IL_C70;
IL_839:
                    GoldTree.GetGame().GetClientManager().method_2(uint.Parse(text2)).method_12();
                    goto IL_C70;
IL_880:
                    string text6 = text2.Split(new char[]
                    {
                        ' '
                    })[0];
                    text5 = text2.Substring(text6.Length + 1);
                    ServerMessage Message8 = new ServerMessage(808u);
                    Message8.AppendStringWithBreak(GoldTreeEnvironment.smethod_1("mus_alert_title"));
                    Message8.AppendStringWithBreak(text5);
                    GoldTree.GetGame().GetClientManager().method_2(uint.Parse(text6)).SendMessage(Message8);
                }
            }
IL_C70:
            ServerMessage Message9 = new ServerMessage(1u);

            Message9.AppendString("Hello Housekeeping, Love from GoldTree Emu");
            this.socket_0.Send(Message9.GetBytes());
        }
Beispiel #7
0
        public static void smethod_0(DatabaseClient class6_0)
        {
            Logging.smethod_0("Loading Achievements..");
            AchievementManager.dictionary_0.Clear();
            DataTable dataTable = class6_0.ReadDataTable("SELECT * FROM achievements");

            if (dataTable != null)
            {
                foreach (DataRow dataRow in dataTable.Rows)
                {
                    AchievementManager.dictionary_0.Add((uint)dataRow["Id"], new Achievement((uint)dataRow["Id"], (string)dataRow["type"], (int)dataRow["levels"], (string)dataRow["badge"], (int)dataRow["pixels_base"], (double)dataRow["pixels_multiplier"], GoldTree.smethod_3(dataRow["dynamic_badgelevel"].ToString()), (int)dataRow["score_base"], (int)dataRow["pixels_base"]));
                }
                AchievementManager.dictionary_1.Clear();
                dataTable = class6_0.ReadDataTable("SELECT * FROM badges");
                if (dataTable != null)
                {
                    foreach (DataRow dataRow in dataTable.Rows)
                    {
                        AchievementManager.dictionary_1.Add((string)dataRow["badge"], (uint)dataRow["Id"]);
                    }
                    Logging.WriteLine("completed!");
                }
            }
        }
Beispiel #8
0
        public void method_0(DatabaseClient class6_0)
        {
            Logging.smethod_0("Loading Catalogue..");
            this.dictionary_0 = new Dictionary <int, CatalogPage>();
            this.list_0       = new List <EcotronReward>();
            DataTable dataTable  = class6_0.ReadDataTable("SELECT * FROM catalog_pages WHERE order_num >= '0' ORDER BY order_num ASC");
            DataTable dataTable2 = class6_0.ReadDataTable("SELECT * FROM ecotron_rewards ORDER BY item_id");
            DataTable dataTable4 = class6_0.ReadDataTable("SELECT * FROM catalog_pages WHERE order_num = '-1' ORDER BY caption ASC");

            try
            {
                this.uint_0 = (uint)class6_0.ReadDataRow("SELECT ID FROM items ORDER BY ID DESC LIMIT 1")[0];
            }
            catch
            {
                this.uint_0 = 0u;
            }
            this.uint_0 += 1u;
            Hashtable hashtable  = new Hashtable();
            DataTable dataTable3 = class6_0.ReadDataTable("SELECT * FROM catalog_items");

            if (dataTable3 != null)
            {
                foreach (DataRow dataRow in dataTable3.Rows)
                {
                    if (!(dataRow["item_ids"].ToString() == "") && (int)dataRow["amount"] > 0)
                    {
                        string BadgeID = dataRow["BadgeID"].ToString();
                        if (string.IsNullOrEmpty(BadgeID) || string.IsNullOrWhiteSpace(BadgeID))
                        {
                            BadgeID = string.Empty;
                        }
                        hashtable.Add((uint)dataRow["Id"], new CatalogItem((uint)dataRow["Id"], (string)dataRow["catalog_name"], (string)dataRow["item_ids"], (int)dataRow["cost_credits"], (int)dataRow["cost_pixels"], (int)dataRow["cost_snow"], (int)dataRow["amount"], (int)dataRow["page_id"], GoldTree.smethod_2(dataRow["vip"].ToString()), (uint)dataRow["achievement"], (int)dataRow["song_id"], BadgeID));
                    }
                }
            }
            if (dataTable != null)
            {
                foreach (DataRow dataRow in dataTable.Rows)
                {
                    bool bool_  = false;
                    bool bool_2 = false;
                    if (dataRow["visible"].ToString() == "1")
                    {
                        bool_ = true;
                    }
                    if (dataRow["enabled"].ToString() == "1")
                    {
                        bool_2 = true;
                    }
                    this.dictionary_0.Add((int)dataRow["Id"], new CatalogPage((int)dataRow["Id"], (int)dataRow["parent_id"], (string)dataRow["caption"], bool_, bool_2, (uint)dataRow["min_rank"], GoldTree.smethod_3(dataRow["club_only"].ToString()), (int)dataRow["icon_color"], (int)dataRow["icon_image"], (string)dataRow["page_layout"], (string)dataRow["page_headline"], (string)dataRow["page_teaser"], (string)dataRow["page_special"], (string)dataRow["page_text1"], (string)dataRow["page_text2"], (string)dataRow["page_text_details"], (string)dataRow["page_text_teaser"], (string)dataRow["page_link_description"], (string)dataRow["page_link_pagename"], ref hashtable));
                }
            }
            if (dataTable4 != null)
            {
                foreach (DataRow dataRow in dataTable4.Rows)
                {
                    bool bool_  = false;
                    bool bool_2 = false;
                    if (dataRow["visible"].ToString() == "1")
                    {
                        bool_ = true;
                    }
                    if (dataRow["enabled"].ToString() == "1")
                    {
                        bool_2 = true;
                    }
                    this.dictionary_0.Add((int)dataRow["Id"], new CatalogPage((int)dataRow["Id"], (int)dataRow["parent_id"], (string)dataRow["caption"], bool_, bool_2, (uint)dataRow["min_rank"], GoldTree.smethod_3(dataRow["club_only"].ToString()), (int)dataRow["icon_color"], (int)dataRow["icon_image"], (string)dataRow["page_layout"], (string)dataRow["page_headline"], (string)dataRow["page_teaser"], (string)dataRow["page_special"], (string)dataRow["page_text1"], (string)dataRow["page_text2"], (string)dataRow["page_text_details"], (string)dataRow["page_text_teaser"], (string)dataRow["page_link_description"], (string)dataRow["page_link_pagename"], ref hashtable));
                }
            }
            if (dataTable2 != null)
            {
                foreach (DataRow dataRow in dataTable2.Rows)
                {
                    this.list_0.Add(new EcotronReward((uint)dataRow["Id"], (uint)dataRow["display_id"], (uint)dataRow["item_id"], (uint)dataRow["reward_level"]));
                }
            }
            Logging.WriteLine("completed!");
        }
Beispiel #9
0
        private static Habbo smethod_1(DataRow habboData, string SSOTicket, GameClient Session, UserDataFactory class12_0)
        {
            uint   Id                         = (uint)habboData["Id"];
            string Username                   = (string)habboData["username"];
            string Name                       = (string)habboData["real_name"];
            uint   Rank                       = (uint)habboData["rank"];
            string Motto                      = (string)habboData["motto"];
            string ip_last                    = (string)habboData["ip_last"];
            string look                       = (string)habboData["look"];
            string gender                     = (string)habboData["gender"];
            int    credits                    = (int)habboData["credits"];
            int    pixels                     = (int)habboData["activity_points"];
            string account_created            = (string)habboData["account_created"];
            double activity_points_lastupdate = (double)habboData["activity_points_lastupdate"];
            string last_loggedin              = (string)habboData["last_loggedin"];
            int    daily_respect_points       = (int)habboData["daily_respect_points"];
            int    daily_pet_respect_points   = (int)habboData["daily_pet_respect_points"];
            double vipha_last                 = (double)habboData["vipha_last"];
            double viphal_last                = (double)habboData["viphal_last"];

            return(new Habbo(Id, Username, Name, SSOTicket, Rank, Motto, look, gender, credits, pixels, activity_points_lastupdate, account_created, GoldTree.smethod_3(habboData["is_muted"].ToString()), (uint)habboData["home_room"], (int)habboData["newbie_status"], GoldTree.smethod_3(habboData["block_newfriends"].ToString()), GoldTree.smethod_3(habboData["hide_inroom"].ToString()), GoldTree.smethod_3(habboData["hide_online"].ToString()), GoldTree.smethod_3(habboData["vip"].ToString()), (int)habboData["volume"], (int)habboData["vip_points"], GoldTree.smethod_3(habboData["accept_trading"].ToString()), ip_last, Session, class12_0, last_loggedin, daily_respect_points, daily_pet_respect_points, vipha_last, viphal_last));
        }
Beispiel #10
0
        public void method_0(DatabaseClient class6_0)
        {
            Logging.smethod_0("Loading Items..");
            this.dictionary_0 = new Dictionary <uint, Item>();
            DataTable dataTable = class6_0.ReadDataTable("SELECT * FROM furniture;");

            if (dataTable != null)
            {
                foreach (DataRow dataRow in dataTable.Rows)
                {
                    try
                    {
                        this.dictionary_0.Add((uint)dataRow["Id"], new Item((uint)dataRow["Id"], (int)dataRow["sprite_id"], (string)dataRow["public_name"], (string)dataRow["item_name"], (string)dataRow["type"], (int)dataRow["width"], (int)dataRow["length"], (double)dataRow["stack_height"], GoldTree.smethod_3(dataRow["can_stack"].ToString()), GoldTree.smethod_3(dataRow["is_walkable"].ToString()), GoldTree.smethod_3(dataRow["can_sit"].ToString()), GoldTree.smethod_3(dataRow["allow_recycle"].ToString()), GoldTree.smethod_3(dataRow["allow_trade"].ToString()), GoldTree.smethod_3(dataRow["allow_marketplace_sell"].ToString()), GoldTree.smethod_3(dataRow["allow_gift"].ToString()), GoldTree.smethod_3(dataRow["allow_inventory_stack"].ToString()), (string)dataRow["interaction_type"], (int)dataRow["interaction_modes_count"], (string)dataRow["vending_ids"], dataRow["height_adjustable"].ToString(), Convert.ToByte((int)dataRow["EffectF"]), Convert.ToByte((int)dataRow["EffectM"]), GoldTree.smethod_3(dataRow["HeightOverride"].ToString())));
                    }
                    catch (Exception e)
                    {
                        Logging.WriteLine("Could not load item #" + (uint)dataRow["Id"] + ", please verify the data is okay.");
                        Logging.LogItemError(e.Message);
                    }
                }
            }
            Logging.WriteLine("completed!");

            /*Logging.smethod_0("Loading Soundtracks.."); //OMA LUOTU :3
             * this.dictionary_1 = new Dictionary<int, Soundtrack>();
             * DataTable dataTable2 = class6_0.ReadDataTable("SELECT * FROM soundtracks;");
             * if (dataTable2 != null)
             * {
             *      foreach (DataRow dataRow in dataTable2.Rows)
             *      {
             *              try
             *              {
             *                      this.dictionary_1.Add((int)dataRow["Id"], new Soundtrack((int)dataRow["Id"], (string)dataRow["name"], (string)dataRow["author"], (string)dataRow["track"], (int)dataRow["length"]));
             *              }
             *              catch (Exception)
             *              {
             *                      Logging.WriteLine("Could not load item #" + (uint)dataRow["Id"] + ", please verify the data is okay.");
             *              }
             *      }
             * }
             * Logging.WriteLine("completed!");*/
            Logging.smethod_0("Loading Soundtracks..");
            SongManager.Initialize();
            Logging.WriteLine("completed!");
        }
Beispiel #11
0
        public void method_0(DatabaseClient class6_0)
        {
            Logging.smethod_0("Loading Navigator..");
            this.list_0.Clear();
            this.dictionary_0.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 Id,bannertype,caption,image,image_type,room_id,category,category_parent_id FROM navigator_publics 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"], GoldTree.smethod_3(dataRow["cantrade"].ToString())));
                }
            }
            if (dataTable2 != null)
            {
                foreach (DataRow dataRow in dataTable2.Rows)
                {
                    this.dictionary_0.Add((int)dataRow["Id"], new PublicItem((int)dataRow["Id"], int.Parse(dataRow["bannertype"].ToString()), (string)dataRow["caption"], (string)dataRow["image"], (dataRow["image_type"].ToString().ToLower() == "internal") ? PublicImageType.INTERNAL : PublicImageType.EXTERNAL, (uint)dataRow["room_id"], GoldTree.smethod_3(dataRow["category"].ToString()), (int)dataRow["category_parent_id"]));
                    if (!this.dictionary_0[(int)dataRow["Id"]].bool_0)
                    {
                        this.dictionary_1.Add((int)dataRow["Id"], this.dictionary_0[(int)dataRow["Id"]]);
                    }
                }
            }
            Logging.WriteLine("completed!");
        }
Beispiel #12
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.DataTable_7;
            StringBuilder stringBuilder = new StringBuilder();

            foreach (DataRow dataRow in dataTable_.Rows)
            {
                AvatarEffect @class = new AvatarEffect((int)dataRow["effect_id"], (int)dataRow["total_duration"], GoldTree.smethod_3(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 = GoldTree.GetDatabase().GetClient())
                {
                    class2.ExecuteQuery(stringBuilder.ToString());
                }
            }
        }