PlusEmulator - System login error

zMagenta

Posting Freak
Jul 15, 2011
1,414
682
Hello.

A few of our users (tame hotel) are having the same issue. I will send a screenshot, the error on the txt and on the emulator.

Client:
1241051_10201416881958196_1261711242_n.jpg


text:
Code:
Bug duing user login: System.InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.String'.
  at Plus.HabboHotel.Users.UserDataManagement.UserDataFactory.GetUserData(String sessionTicket, String ip, Byte& errorCode)
  at Plus.HabboHotel.GameClients.GameClient.tryLogin(String AuthTicket)

Emulator:
sIzWMkQ.png


Only person I for sure may know how to fix is @Sledmore - Any ideas?
 

zMagenta

Posting Freak
Jul 15, 2011
1,414
682
For added information, here is the void of 'LoadFurniture':
PHP:
internal void LoadFurniture()
        {
            this.mFloorItems.Clear();
            this.mWallItems.Clear();
            using (IQueryAdapter adapter = PlusEnvironment.GetDatabaseManager().getQueryreactor())
            {
                GameClient clientByUserID;
                adapter.setQuery("SELECT `items`.* , COALESCE(`items_groups`.`group_id`, 0) AS group_id FROM `items` LEFT OUTER JOIN `items_groups` ON `items`.`id` = `items_groups`.`id` WHERE items.room_id=@roomid LIMIT 2000");
                adapter.addParameter("roomid", this.room.RoomId);
                DataTable table = adapter.getTable();
                if (table.Rows.Count == 0x7d0)
                {
                    clientByUserID = PlusEnvironment.GetGame().GetClientManager().GetClientByUserID((uint) this.room.OwnerId);
                    if (clientByUserID != null)
                    {
                        clientByUserID.SendNotif("Your room has more than 2000 items in it. The current limit of items per room is 2000.\nTo view the rest, pick some of these items up!");
                    }
                }
                foreach (DataRow row in table.Rows)
                {
                    try
                    {
                        string str;
                        string str2;
                        RoomItem item;
                        uint query = Convert.ToUInt32(row[0]);
                        int x = Convert.ToInt32(row[5]);
                        int y = Convert.ToInt32(row[6]);
                        double z = Convert.ToDouble(row[7]);
                        sbyte rot = Convert.ToSByte(row[8]);
                        uint userid = Convert.ToUInt32(row[1]);
                        if (userid == 0)
                        {
                            adapter.setQuery("UPDATE items SET user_id=@userid WHERE id=@itemID LIMIT 1");
                            adapter.addParameter("itemID", query);
                            adapter.addParameter("userid", this.room.OwnerId);
                            adapter.runQuery();
                        }
                        if (string.IsNullOrWhiteSpace(row[9].ToString()))
                        {
                            adapter.setQuery("SELECT type FROM furniture WHERE id=" + row[3] + " LIMIT 1");
                            if (adapter.getString() == "i")
                            {
                                str2 = ":w=0,2 l=11,53 l";
                                adapter.runFastQuery(string.Concat(new object[] { "UPDATE items SET wall_pos='", str2, "' WHERE id=", query, " LIMIT 1" }));
                            }
                        }
                        str2 = Convert.ToString(row[9]);
                        uint baseItem = Convert.ToUInt32(row[3]);
                        if (DBNull.Value.Equals(row[4]))
                        {
                            str = string.Empty;
                        }
                        else
                        {
                            str = (string) row[4];
                        }
                        uint group = Convert.ToUInt32(row[10]);
                        if (!string.IsNullOrWhiteSpace(str2))
                        {
                            string wallCoord = this.WallPositionCheck(":" + str2.Split(new char[] { ':' })[1]);
                            item = new RoomItem(query, this.room.RoomId, baseItem, str, wallCoord, this.room, userid, group);
                            if (!this.mWallItems.ContainsKey(query))
                            {
                                this.mWallItems.Inner.Add(query, item);
                            }
                        }
                        else
                        {
                            item = new RoomItem(query, this.room.RoomId, baseItem, str, x, y, z, rot, this.room, userid, group);
                            if (!this.room.GetGameMap().ValidTile(x, y))
                            {
                                clientByUserID = PlusEnvironment.GetGame().GetClientManager().GetClientByUserID(userid);
                                if (clientByUserID != null)
                                {
                                    clientByUserID.GetHabbo().GetInventoryComponent().AddNewItem(item.Id, item.BaseItem, item.ExtraData, group, true, true, 0, 0, 0);
                                    adapter.runFastQuery("UPDATE items SET room_id='' WHERE id='" + item.Id + "' LIMIT 1");
                                    clientByUserID.GetHabbo().GetInventoryComponent().UpdateItems(true);
                                }
                                else
                                {
                                    adapter.runFastQuery("UPDATE items SET room_id='' WHERE id='" + item.Id + "' LIMIT 1");
                                }
                            }
                            else
                            {
                                if ((item.GetBaseItem().InteractionType == InteractionType.onewaygate) || (item.GetBaseItem().InteractionType == InteractionType.teleport))
                                {
                                    adapter.setQuery("SELECT toll_price FROM item_tolls WHERE item_id='" + item.Id + "' LIMIT 1");
                                    item.TollPrice = adapter.getInteger();
                                }
                                if (item.GetBaseItem().InteractionType == InteractionType.hopper)
                                {
                                    this.HopperCount++;
                                }
                                if (!this.mFloorItems.ContainsKey(query))
                                {
                                    this.mFloorItems.Inner.Add(query, item);
                                }
                                if (item.IsWired)
                                {
                                    this.room.GetWiredHandler().LoadWired(this.room.GetWiredHandler().GenerateNewItem(item));
                                }
                            }
                        }
                    }
                    catch (Exception exception)
                    {
                        Console.WriteLine(exception);
                    }
                }
                foreach (RoomItem item2 in this.mFloorItems.Values)
                {
                    if (item2.IsRoller)
                    {
                        this.mGotRollers = true;
                    }
                    else if (item2.GetBaseItem().InteractionType == InteractionType.dimmer)
                    {
                        if (this.room.MoodlightData == null)
                        {
                            this.room.MoodlightData = new MoodlightData(item2.Id);
                        }
                    }
                    else if ((item2.GetBaseItem().InteractionType == InteractionType.roombg) && (this.room.TonerData == null))
                    {
                        this.room.TonerData = new TonerData(item2.Id);
                    }
                }
            }
        }
 

Users who are viewing this thread

Top