Furniture won't load?

Results 1 to 7 of 7
  1. #1
    Member Jemz is offline
    MemberRank
    May 2014 Join Date
    63Posts

    Furniture won't load?

    I seem to get the error.


    I am using PlusEMU R2 with tdid's Wired fixes.

    Function in question (with the line 228 highlighted):
    Code:
            internal void LoadFurniture()        {
                //this.Items.Clear();
                this.mFloorItems.Clear();
                this.mWallItems.Clear();
                DataTable Data;
                using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    dbClient.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");
                    dbClient.addParameter("roomid", room.RoomId);
    
    
                    Data = dbClient.getTable();
    
    
                    if (Data.Rows.Count == 2000)
                    {
                        GameClient Client = SilverwaveEnvironment.GetGame().GetClientManager().GetClientByUserID((uint)room.OwnerId);
                        if (Client != null)
                            Client.SendNotif("Your room has more than 2000 items in it. The current limit of items per room is 2000.\n" +
                                "To view the rest, pick some of these items up!");
                    }
    
    
                    uint itemID;
                    int x;
                    int y;
                    Double z;
                    sbyte n;
                    uint baseID;
                    string extradata;
                    string wallposs;
                    uint UserId;
                    uint groupid;
                    int limitedNo;
                    int limitedTot;
                    foreach (DataRow dRow in Data.Rows)
                    {
                        try
                        {
    
    
                            itemID = Convert.ToUInt32(dRow[0]);
                            x = Convert.ToInt32(dRow[5]);
                            y = Convert.ToInt32(dRow[6]);
                            z = Convert.ToDouble(dRow[7]);
                            n = Convert.ToSByte(dRow[8]);
                            groupid = Convert.ToUInt32(dRow[13]);
                            limitedNo = Convert.ToInt32(dRow[11]);
                            limitedTot = Convert.ToInt32(dRow[12]);
                            UserId = Convert.ToUInt32(dRow[1]);
                            if (UserId == 0)
                            {
                                dbClient.setQuery("UPDATE items SET user_id=@userid WHERE id=@itemID LIMIT 1");
                                dbClient.addParameter("itemID", itemID);
                                dbClient.addParameter("userid", room.OwnerId);
                                dbClient.runQuery();
                            }
    
    
                            if (string.IsNullOrWhiteSpace(dRow[9].ToString()))
                            {
                                dbClient.setQuery("SELECT type FROM furniture WHERE id=" + dRow[3] + " LIMIT 1");
                                string thing = dbClient.getString();
    
    
                                if (thing == "i")
                                {
                                    wallposs = ":w=0,2 l=11,53 l";
                                    dbClient.runFastQuery("UPDATE items SET wall_pos='" + wallposs + "' WHERE id=" + itemID + " LIMIT 1");
                                }
                            }
    
    
                            //if (Item.IsWallItem && string.IsNullOrWhiteSpace(dRow[9].ToString()))
                            //{
                            //    wallposs = ":w=0,2 l=11,53 l";
                            //}
                            //else
                            {
                                wallposs = Convert.ToString(dRow[9]);
                            }
    
    
                            baseID = Convert.ToUInt32(dRow[3]);
                            if (DBNull.Value.Equals(dRow[4]))
                                extradata = string.Empty;
                            else
                                extradata = (string)dRow[4];
    
    
                            //groupid = Convert.ToUInt32(dRow[11]);
                            //if ((room.GetRoomItemHandler().mFloorItems.Values.Count + room.GetRoomItemHandler().mWallItems.Values.Count) < 3000)
                            {
                                if (!string.IsNullOrWhiteSpace(wallposs) && wallposs != "0") // Is wallitem
                                {
                                    string WallPossition = WallPositionCheck(":" + wallposs.Split(':')[1]);
                                    RoomItem item = new RoomItem(itemID, room.RoomId, baseID, extradata, WallPossition, room, UserId, groupid, SilverwaveEnvironment.GetGame().GetItemManager().GetItem(baseID).FlatId, limitedNo, limitedTot);
    
    
                                    if (!mWallItems.ContainsKey(itemID))
                                        mWallItems.Inner.Add(itemID, item);
                                }
                                else //Is flooritem
                                {
    
    
                                    RoomItem item = new RoomItem(itemID, room.RoomId, baseID, extradata, x, y, (double)z, n, room, UserId, groupid, SilverwaveEnvironment.GetGame().GetItemManager().GetItem(baseID).FlatId, limitedNo, limitedTot);
    
    
                                    if (!room.GetGameMap().ValidTile(x, y))
                                    {
                                        GameClient Client = SilverwaveEnvironment.GetGame().GetClientManager().GetClientByUserID(UserId);
                                        if (Client != null)
                                        {
                                            Client.GetHabbo().GetInventoryComponent().AddNewItem(item.Id, item.BaseItem, item.ExtraData, groupid, true, true, 0, 0, 0);
                                            dbClient.runFastQuery("UPDATE items SET room_id='0' WHERE id='" + item.Id + "' LIMIT 1");
                                            Client.GetHabbo().GetInventoryComponent().UpdateItems(true);
                                        }
                                        else
                                        {
                                            dbClient.runFastQuery("UPDATE items SET room_id='0' WHERE id='" + item.Id + "' LIMIT 1");
                                        }
                                        continue;
                                    }
    
    
                                    if (item.GetBaseItem().InteractionType == InteractionType.jukebox)
                                        JukeBoxCount++;
    
    
                                    if (item.GetBaseItem().InteractionType == InteractionType.hopper)
                                        HopperCount++;
    
    
                                    if (!mFloorItems.ContainsKey(itemID))
                                        mFloorItems.Inner.Add(itemID, item);
    
    
                                    if (item.IsWired)
                                    {
                                        room.GetWiredHandler().LoadWired(room.GetWiredHandler().GenerateNewItem(item));
                                    }
                                }
                            }
                            /*else
                            {
                                RoomItem Item;
                                GameClient Client = SilverwaveEnvironment.GetGame().GetClientManager().GetClientByUserID(UserId);
                                if (Client != null)
                                {
                                    if (!string.IsNullOrWhiteSpace(wallposs)) // Is wallitem 
                                    {
                                        string WallPossition = WallPositionCheck(":" + wallposs.Split(':')[1]);
                                        Item = new RoomItem(itemID, room.RoomId, baseID, extradata, WallPossition, room, UserId);
                                    }
                                    else
                                        Item = new RoomItem(itemID, room.RoomId, baseID, extradata, x, y, (double)z, n, room, UserId);
                                    Client.GetHabbo().GetInventoryComponent().AddNewItem(Item.Id, Item.BaseItem, Item.ExtraData, true, true, 0);
                                    dbClient.runFastQuery("UPDATE items SET room_id='' WHERE id='" + Item.Id + "' LIMIT 1");
                                    Client.GetHabbo().GetInventoryComponent().UpdateItems(true);
                                }
                                else
                                {
                                    if (!string.IsNullOrWhiteSpace(wallposs)) // Is wallitem
                                    {
                                        string WallPossition = WallPositionCheck(":" + wallposs.Split(':')[1]);
                                        Item = new RoomItem(itemID, room.RoomId, baseID, extradata, WallPossition, room, UserId);
                                    }
                                    else
                                        Item = new RoomItem(itemID, room.RoomId, baseID, extradata, x, y, (double)z, n, room, UserId);
                                    dbClient.runFastQuery("UPDATE items SET room_id='' WHERE id='" + Item.Id + "' LIMIT 1");
                                }
                                continue;
                            }*/
                        }
                        catch (Exception e)
                        {
                            Console.WriteLine(e);
                        }
                    }
    
    
                    foreach (RoomItem Item in mFloorItems.Values)
                    {
                        if (Item.IsRoller)
                            mGotRollers = true;
                        else if (Item.GetBaseItem().InteractionType == Silverwave.HabboHotel.Items.InteractionType.dimmer)
                        {
                            if (room.MoodlightData == null)
                                room.MoodlightData = new MoodlightData(Item.Id);
                        }
                        else if (Item.GetBaseItem().InteractionType == Silverwave.HabboHotel.Items.InteractionType.roombg)
                        {
                            if (room.TonerData == null)
                                room.TonerData = new TonerData(Item.Id);
                        }
    
    
                    }
                }
    
    
                room.GetWiredHandler().ReloadTimers();
            }


  2. #2
    Mr VPS - Cheap VPS Server NOC is offline
    Grand MasterRank
    Sep 2011 Join Date
    Liverpool, UKLocation
    844Posts

    Re: Furniture won't load?

    Is this a fresh database for a hotel or is it an active hotel ?

  3. #3
    Member Jemz is offline
    MemberRank
    May 2014 Join Date
    63Posts

    Re: Furniture won't load?

    Quote Originally Posted by Johno View Post
    Is this a fresh database for a hotel or is it an active hotel ?
    Well the hotel is active as I'm running it and there has been some edits to the database, but it's sorta fresh lol.
    Sorry, I don't really know what you mean aha.

  4. #4

    Re: Furniture won't load?

    Do you have an right SWF?

  5. #5
    Member Jemz is offline
    MemberRank
    May 2014 Join Date
    63Posts

    Re: Furniture won't load?

    Quote Originally Posted by Forex View Post
    Do you have an right SWF?
    Yes the hotel works fine, it's just the furniture doesn't load because of that error. It has nothing to do with SWFs what so ever.
    fyi: the error occured after I added tdid's Wired fixes lol.

  6. #6
    Mr VPS - Cheap VPS Server NOC is offline
    Grand MasterRank
    Sep 2011 Join Date
    Liverpool, UKLocation
    844Posts

    Re: Furniture won't load?

    Did you remove the old wired items ?

  7. #7
    Member Jemz is offline
    MemberRank
    May 2014 Join Date
    63Posts

    Re: Furniture won't load?

    Quote Originally Posted by Johno View Post
    Did you remove the old wired items ?
    No, but I'm still using the wired items swfs etc, all I did was change the code.



Advertisement