Ejemplo n.º 1
0
        public void LoadServerSettings(DatabaseClient class6_0)
        {
            Logging.Write("Loading your settings..");

            DataRow dataRow = class6_0.ReadDataRow("SELECT * FROM server_settings LIMIT 1");

            ServerConfiguration.RoomUserLimit = (int)dataRow["MaxRoomsPerUser"];

            ServerConfiguration.MOTD = (string)dataRow["motd"];

            ServerConfiguration.CreditingInterval = (int)dataRow["timer"];

            ServerConfiguration.CreditingAmount = (int)dataRow["credits"];
            ServerConfiguration.PointingAmount  = (int)dataRow["pixels"];
            ServerConfiguration.PixelingAmount  = (int)dataRow["points"];

            ServerConfiguration.PixelLimit  = (int)dataRow["pixels_max"];
            ServerConfiguration.CreditLimit = (int)dataRow["credits_max"];
            ServerConfiguration.PointLimit  = (int)dataRow["points_max"];

            ServerConfiguration.PetsPerRoomLimit = (int)dataRow["MaxPetsPerRoom"];

            ServerConfiguration.MarketplacePriceLimit = (int)dataRow["MaxMarketPlacePrice"];
            ServerConfiguration.MarketplaceTax        = (int)dataRow["MarketPlaceTax"];

            ServerConfiguration.DDoSProtectionEnabled = GoldTree.StringToBoolean(dataRow["enable_antiddos"].ToString());

            ServerConfiguration.HabboClubForClothes = GoldTree.StringToBoolean(dataRow["vipclothesforhcusers"].ToString());

            ServerConfiguration.EnableChatlog    = GoldTree.StringToBoolean(dataRow["enable_chatlogs"].ToString());
            ServerConfiguration.EnableCommandLog = GoldTree.StringToBoolean(dataRow["enable_cmdlogs"].ToString());
            ServerConfiguration.EnableRoomLog    = GoldTree.StringToBoolean(dataRow["enable_roomlogs"].ToString());

            ServerConfiguration.EnableExternalLinks = (string)dataRow["enable_externalchatlinks"];

            ServerConfiguration.EnableSSO = GoldTree.StringToBoolean(dataRow["enable_securesessions"].ToString());

            ServerConfiguration.AllowFurniDrops = GoldTree.StringToBoolean(dataRow["allow_friendfurnidrops"].ToString());

            ServerConfiguration.EnableRedeemCredits = GoldTree.StringToBoolean(dataRow["enable_cmd_redeemcredits"].ToString());
            ServerConfiguration.EnableRedeemPixels  = GoldTree.StringToBoolean(dataRow["enable_cmd_redeempixels"].ToString());
            ServerConfiguration.EnableRedeemShells  = GoldTree.StringToBoolean(dataRow["enable_cmd_redeemshells"].ToString());

            ServerConfiguration.UnloadCrashedRooms = GoldTree.StringToBoolean(dataRow["unload_crashedrooms"].ToString());

            ServerConfiguration.ShowUsersAndRoomsInAbout = GoldTree.StringToBoolean(dataRow["ShowUsersAndRoomsInAbout"].ToString());

            ServerConfiguration.SleepTimer = (int)dataRow["idlesleep"];
            ServerConfiguration.KickTimer  = (int)dataRow["idlekick"];

            ServerConfiguration.IPLastBan = GoldTree.StringToBoolean(dataRow["ip_lastforbans"].ToString());

            ServerConfiguration.StaffPicksID = (int)dataRow["StaffPicksCategoryID"];

            ServerConfiguration.VIPHotelAlertInterval     = (double)dataRow["vipha_interval"];
            ServerConfiguration.VIPHotelAlertLinkInterval = (double)dataRow["viphal_interval"];

            ServerConfiguration.PreventDoorPush = GoldTree.StringToBoolean(dataRow["DisableOtherUsersToMovingOtherUsersToDoor"].ToString());
            Logging.WriteLine("completed!", ConsoleColor.Green);
        }
Ejemplo n.º 2
0
        public void method_0(DatabaseClient class6_0)
        {
            Logging.Write("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.StringToBoolean(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!", ConsoleColor.Green);
            }
        }
Ejemplo n.º 3
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.StringToBoolean(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");
                            }

                            string gender   = GoldTree.GetGame().GetClientManager().GetDataById(this.uint_0, "gender");
                            string look     = GoldTree.GetGame().GetClientManager().GetDataById(this.uint_0, "look");
                            string username = GoldTree.GetGame().GetClientManager().GetNameById(this.uint_0);

                            if (!(string.IsNullOrEmpty(gender) && string.IsNullOrEmpty(look) && string.IsNullOrEmpty(username)))
                            {
                                MessengerRequest class3 = new MessengerRequest(num2, num, this.uint_0, username, gender, look);
                                class2.GetHabbo().GetMessenger().method_17(num2, num, this.uint_0, username, look, gender);
                                ServerMessage Message5_ = new ServerMessage(132u);
                                class3.method_0(Message5_);
                                class2.SendMessage(Message5_);
                            }
                        }
                    }
                }
            }
        }
        public static void smethod_0(DatabaseClient class6_0)
        {
            Logging.Write("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.StringToBoolean(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!", ConsoleColor.Green);
                }
            }
        }
Ejemplo n.º 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.StringToBoolean(Row["allow_pets"].ToString());
            this.AllowPetsEating  = GoldTree.StringToBoolean(Row["allow_pets_eat"].ToString());
            this.AllowWalkthrough = GoldTree.StringToBoolean(Row["allow_walkthrough"].ToString());
            this.bool_3           = false;
            this.Hidewall         = GoldTree.StringToBoolean(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);
        }
Ejemplo n.º 6
0
        public void method_0(DatabaseClient class6_0)
        {
            Logging.Write("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.StringToBoolean(dataRow["can_stack"].ToString()), GoldTree.StringToBoolean(dataRow["is_walkable"].ToString()), GoldTree.StringToBoolean(dataRow["can_sit"].ToString()), GoldTree.StringToBoolean(dataRow["allow_recycle"].ToString()), GoldTree.StringToBoolean(dataRow["allow_trade"].ToString()), GoldTree.StringToBoolean(dataRow["allow_marketplace_sell"].ToString()), GoldTree.StringToBoolean(dataRow["allow_gift"].ToString()), GoldTree.StringToBoolean(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.StringToBoolean(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!", ConsoleColor.Green);

            /*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!", ConsoleColor.Green);*/
            Logging.Write("Loading Soundtracks..");
            SongManager.Initialize();
            Logging.WriteLine("completed!", ConsoleColor.Green);
        }
Ejemplo n.º 7
0
        public void method_0(DatabaseClient class6_0)
        {
            Logging.Write("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.StringToInt(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.StringToBoolean(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.StringToBoolean(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!", ConsoleColor.Green);
        }
Ejemplo n.º 8
0
        private static Habbo CreateHabbo(DataRow habboData, string ssoTicket, GameClient session, UserDataFactory otherData)
        {
            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.StringToBoolean(habboData["is_muted"].ToString()), (uint)habboData["home_room"], (int)habboData["newbie_status"], GoldTree.StringToBoolean(habboData["block_newfriends"].ToString()), GoldTree.StringToBoolean(habboData["hide_inroom"].ToString()), GoldTree.StringToBoolean(habboData["hide_online"].ToString()), GoldTree.StringToBoolean(habboData["vip"].ToString()), (int)habboData["volume"], (int)habboData["vip_points"], GoldTree.StringToBoolean(habboData["accept_trading"].ToString()), ip_last, session, otherData, last_loggedin, daily_respect_points, daily_pet_respect_points, vipha_last, viphal_last, GoldTree.StringToBoolean(habboData["friend_stream_enabled"].ToString())));
        }
Ejemplo n.º 9
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"], GoldTree.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 = GoldTree.GetDatabase().GetClient())
                {
                    class2.ExecuteQuery(stringBuilder.ToString());
                }
            }
        }
Ejemplo n.º 10
0
        public void method_8(DatabaseClient class6_0)
        {
            Logging.Write("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.StringToBoolean(dataRow["club_only"].ToString())));
                }
                Logging.WriteLine("completed!", ConsoleColor.Green);
            }
        }
Ejemplo n.º 11
0
        public void method_0(DatabaseClient class6_0)
        {
            Logging.Write("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.StringToBoolean(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.StringToBoolean(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!", ConsoleColor.Green);
        }
Ejemplo n.º 12
0
        public void ParsePacket(string data)
        {
            string text = data.Split(new char[]
            {
                Convert.ToChar(1)
            })[0];

            string text2 = data.Split(new char[]
            {
                Convert.ToChar(1)
            })[1];

            GameClient client  = 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.UpdateRights();
                            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.RoomUsers.Length; i++)
                            {
                                RoomUser class5 = class4.RoomUsers[i];
                                if (class5 != null)
                                {
                                    class5.GetClient().SendNotification(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().LoadServerSettings(class2);
                            goto IL_C70;
                        }

                    case 17:
                        goto IL_6F7;

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

                    case 19:
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            GoldTree.GetGame().GetBanManager().Initialise(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.GetExternalText("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.GetExternalText("mus_hal_title"),
                                "\r\n",
                                text5,
                                "\r\n-",
                                GoldTreeEnvironment.GetExternalText("mus_hal_tail")
                            }));
                        Message4.AppendStringWithBreak(text4);
                        GoldTree.GetGame().GetClientManager().BroadcastMessage(Message4);
                        goto IL_C70;
                    }

                    case 27:
                    case 28:
                    {
                        uint_2 = uint.Parse(text2);
                        client = 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 id = '" + client.GetHabbo().Id + "' LIMIT 1");
                        }
                        client.GetHabbo().Figure          = (string)dataRow["look"];
                        client.GetHabbo().Gender          = dataRow["gender"].ToString().ToLower();
                        client.GetHabbo().Motto           = GoldTree.FilterString((string)dataRow["motto"]);
                        client.GetHabbo().BlockNewFriends = GoldTree.StringToBoolean(dataRow["block_newfriends"].ToString());
                        ServerMessage Message5            = new ServerMessage(266u);
                        Message5.AppendInt32(-1);
                        Message5.AppendStringWithBreak(client.GetHabbo().Figure);
                        Message5.AppendStringWithBreak(client.GetHabbo().Gender.ToLower());
                        Message5.AppendStringWithBreak(client.GetHabbo().Motto);
                        client.SendMessage(Message5);
                        if (client.GetHabbo().InRoom)
                        {
                            class4 = GoldTree.GetGame().GetRoomManager().GetRoom(client.GetHabbo().CurrentRoomId);
                            RoomUser      class6   = class4.GetRoomUserByHabbo(client.GetHabbo().Id);
                            ServerMessage Message6 = new ServerMessage(266u);
                            Message6.AppendInt32(class6.VirtualId);
                            Message6.AppendStringWithBreak(client.GetHabbo().Figure);
                            Message6.AppendStringWithBreak(client.GetHabbo().Gender.ToLower());
                            Message6.AppendStringWithBreak(client.GetHabbo().Motto);
                            Message6.AppendInt32(client.GetHabbo().AchievementScore);
                            Message6.AppendStringWithBreak("");
                            class4.SendMessage(Message6, null);
                        }
                        text3 = text.ToLower();
                        if (text3 == null)
                        {
                            goto IL_C70;
                        }
                        if (text3 == "updatemotto")
                        {
                            client.GetHabbo().MottoAchievementsCompleted();
                            goto IL_C70;
                        }
                        if (text3 == "updatelook")
                        {
                            client.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().BroadcastMessage(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.IsPublic);
                        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.Close();
                    goto IL_C70;
IL_633:
                    client = GoldTree.GetGame().GetClientManager().method_2(uint.Parse(text2));
                    if (client != null)
                    {
                        int int_3 = 0;
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            int_3 = (int)class2.ReadDataRow("SELECT credits FROM users WHERE id = '" + client.GetHabbo().Id + "' LIMIT 1")[0];
                        }
                        client.GetHabbo().Credits = int_3;
                        client.GetHabbo().UpdateCredits(false);
                        goto IL_C70;
                    }
                    goto IL_C70;
IL_6F7:
                    client = GoldTree.GetGame().GetClientManager().method_2(uint.Parse(text2));
                    if (client != null)
                    {
                        int int_4 = 0;
                        using (DatabaseClient class2 = GoldTree.GetDatabase().GetClient())
                        {
                            int_4 = (int)class2.ReadDataRow("SELECT activity_points FROM users WHERE id = '" + client.GetHabbo().Id + "' LIMIT 1")[0];
                        }
                        client.GetHabbo().ActivityPoints = int_4;
                        client.GetHabbo().UpdateActivityPoints(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.GetExternalText("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.ClientSocket.Send(Message9.GetBytes());
        }