FatalLulz catalogue error

Results 1 to 10 of 10
  1. #1
    Member 1nc1n1gr4t3 is offline
    MemberRank
    Jul 2012 Join Date
    52Posts

    sad FatalLulz catalogue error


    I get this when i imported the things into the db and ran the emulator. help


  2. #2
    Account Upgraded | Title Enabled! asesinato is offline
    MemberRank
    Aug 2014 Join Date
    601Posts

    Re: FatalLulz catalogue error

    I had the same error before, post what is on line 57 in ItemManager.cs

  3. #3
    Member 1nc1n1gr4t3 is offline
    MemberRank
    Jul 2012 Join Date
    52Posts

    Re: FatalLulz catalogue error

    using Database_Manager.Database.Session_Details.Interfaces;
    using Mercury.Core;
    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Linq;
    using System.Net;
    using System.Text;
    using System.Xml.Linq;
    namespace Mercury.HabboHotel.Items
    {
    internal class ItemManager
    {
    internal Dictionary<uint, Item> Items;
    internal ItemManager()
    {
    this.Items = new Dictionary<uint, Item>();
    }

    internal void LoadItems(IQueryAdapter dbClient, out uint itemLoaded)
    {
    LoadItems(dbClient);
    itemLoaded = (uint)Items.Count;
    }

    internal void LoadItems(IQueryAdapter dbClient)
    {
    this.Items = new Dictionary<uint, Item>();
    dbClient.setQuery("SELECT * FROM furniture");
    DataTable table = dbClient.getTable();
    if (table != null)
    {
    string[] array = null;
    foreach (DataRow dataRow in table.Rows)
    {
    try
    {
    uint num = Convert.ToUInt32(dataRow["id"]);
    int sprite = (int)dataRow["sprite_id"];
    int flatId = (int)dataRow["flat_id"];
    string publicName = (string)dataRow["public_name"];
    string name = (string)dataRow["item_name"];
    string type = dataRow["type"].ToString();
    int width = (int)dataRow["width"];
    int length = (int)dataRow["length"];
    double height;
    if (dataRow["stack_height"].ToString().Contains(";"))
    {
    array = dataRow["stack_height"].ToString().Split(new char[]
    {
    ';'
    });
    height = Convert.ToDouble(array[0]);
    }
    else
    {
    height = Convert.ToDouble(dataRow["stack_height"]);
    }
    bool stackable = Convert.ToInt32(dataRow["can_stack"]) == 1;
    bool walkable = Convert.ToInt32(dataRow["is_walkable"]) == 1;
    bool isSeat = Convert.ToInt32(dataRow["can_sit"]) == 1;
    bool allowRecycle = Convert.ToInt32(dataRow["allow_recycle"]) == 1;
    bool allowTrade = Convert.ToInt32(dataRow["allow_trade"]) == 1;
    bool allowMarketplaceSell = Convert.ToInt32(dataRow["allow_marketplace_sell"]) == 1;
    bool allowGift = Convert.ToInt32(dataRow["allow_gift"]) == 1;
    bool allowInventoryStack = Convert.ToInt32(dataRow["allow_inventory_stack"]) == 1;
    InteractionType typeFromString = InterractionTypes.GetTypeFromString((string)dataRow["interaction_type"]);
    int modes = (int)dataRow["interaction_modes_count"];
    string vendingIds = (string)dataRow["vending_ids"];
    bool sub = MercuryEnvironment.EnumToBool(dataRow["subscriber"].ToString());
    int effect = (int)dataRow["effectid"];
    bool stackMultiple = MercuryEnvironment.EnumToBool(dataRow["stack_multiplier"].ToString());
    Item value = new Item(num, sprite, publicName, name, type, width, length, height, stackable, walkable, isSeat, allowRecycle, allowTrade, allowMarketplaceSell, allowGift, allowInventoryStack, typeFromString, modes, vendingIds, sub, effect, stackMultiple, array, flatId);
    this.Items.Add(num, value);
    }
    catch (Exception ex)
    {
    Console.WriteLine(ex.ToString());
    Console.ReadKey();
    Logging.WriteLine("Could not load item #" + Convert.ToUInt32(dataRow[0]) + ", please verify the data is okay.", ConsoleColor.Gray);
    }
    }
    }
    }
    internal void UpdateFlats()
    {

    XDocument xDocument = XDocument.Load("http://www.habbo.com/gamedata/furnidata_xml");
    string text = "";
    string text2 = "";
    int num = -1;
    int num2 = 0;
    int num4 = -1;
    WebClient webClient = new WebClient();
    webClient.Encoding = Encoding.UTF8;
    webClient.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
    using (IQueryAdapter queryreactor = MercuryEnvironment.GetDatabaseManager().getQueryreactor())
    {
    IEnumerable<XElement> enumerable = xDocument.Descendants("roomitemtypes").Descendants("furnitype");
    IEnumerable<XElement> enumerable2 = xDocument.Descendants("wallitemtypes").Descendants("furnitype");
    foreach (XElement current in enumerable)
    {
    try
    {
    text = current.Attribute("classname").Value;
    text2 = current.Element("name").Value;
    num2 = Convert.ToInt32(current.Attribute("id").Value);
    num = Convert.ToInt32(current.Element("offerid").Value);
    num4 = Convert.ToInt32(current.Element("rentofferid").Value);
    if (num4 != -1)
    num = num4;

    Console.WriteLine(text);
    }
    catch (Exception ex)
    {
    Console.WriteLine(ex.ToString());
    }
    try
    {
    queryreactor.setQuery("UPDATE furniture SET public_name = @pubn , flat_id = @flatid , sprite_id = @spriteid WHERE item_name = @name");
    queryreactor.addParameter("pubn", text2);
    queryreactor.addParameter("flatid", num);
    queryreactor.addParameter("spriteid", num2);
    queryreactor.addParameter("name", text);
    queryreactor.runQuery();
    }
    catch (Exception ex2)
    {
    Console.WriteLine(ex2.ToString());
    }
    }
    foreach (XElement current2 in enumerable2)
    {
    text = current2.Attribute("classname").Value;
    text2 = current2.Element("name").Value;
    num2 = Convert.ToInt32(current2.Attribute("id").Value);
    num = Convert.ToInt32(current2.Element("offerid").Value);
    num4 = Convert.ToInt32(current2.Element("rentofferid").Value);
    if (num4 != -1)
    num = num4;

    Console.WriteLine(text);
    try
    {
    queryreactor.setQuery("UPDATE furniture SET public_name = @pubn , flat_id = @flatid , sprite_id = @spriteid WHERE item_name = @name");
    queryreactor.addParameter("pubn", text2);
    queryreactor.addParameter("flatid", num);
    queryreactor.addParameter("spriteid", num2);
    queryreactor.addParameter("name", text);
    queryreactor.runQuery();
    }
    catch (Exception ex3)
    {
    Console.WriteLine(ex3.ToString());
    }
    }
    }
    }
    internal bool ContainsItem(uint Id)
    {
    return this.Items.ContainsKey(Id);
    }
    internal Item GetItem(uint Id)
    {
    if (this.ContainsItem(Id))
    {
    return this.Items[Id];
    }
    return null;
    }

    internal Item GetItemBySprite(int SpriteId, char Type)
    {
    return this.Items.Values.Where(x => x.SpriteId == SpriteId && x.Type == Type).FirstOrDefault<Item>();
    }

    internal Item GetItemByName(string Name)
    {
    return (
    from x in this.Items.Values
    where x.Name == Name
    select x).FirstOrDefault<Item>();
    }
    }
    }
    this is my itemmanager.cs

  4. #4
    Account Upgraded | Title Enabled! asesinato is offline
    MemberRank
    Aug 2014 Join Date
    601Posts

    Re: FatalLulz catalogue error

    Go to furniture > design table > stack_height varchar(255), that should fix the issue :)

  5. #5
    Member 1nc1n1gr4t3 is offline
    MemberRank
    Jul 2012 Join Date
    52Posts

    Re: FatalLulz catalogue error

    its already set at 255

  6. #6
    Account Upgraded | Title Enabled! asesinato is offline
    MemberRank
    Aug 2014 Join Date
    601Posts

    Re: FatalLulz catalogue error

    Isit set to varchar?

  7. #7
    Member 1nc1n1gr4t3 is offline
    MemberRank
    Jul 2012 Join Date
    52Posts

    Re: FatalLulz catalogue error

    yes it is

  8. #8
    Account Upgraded | Title Enabled! asesinato is offline
    MemberRank
    Aug 2014 Join Date
    601Posts

    Re: FatalLulz catalogue error

    Best off asking @FatalLulz himself.

  9. #9
    o/ Konquer is offline
    MemberRank
    Apr 2014 Join Date
    464Posts

    Re: FatalLulz catalogue error

    Did you have that problem before you changed to fatallulz catalogue? I believe you just need to change your systems decimal format from , to .

  10. #10
    Loyalty Vaulient is offline
    MemberRank
    May 2012 Join Date
    MalaysiaLocation
    1,796Posts

    Re: FatalLulz catalogue error

    Replace line 57 with this

    Code:
     string dirtyFix = dataRow["stack_height"].ToString();
    
                                dirtyFix = dirtyFix.Replace(',', '.');
    
                                height = double.Parse(dirtyFix, System.Globalization.CultureInfo.InvariantCulture);
    Then debug the emu. Don't forget to debug. Also check if all items in database have a legal stack_height. If one doesn't then sayanora.



Advertisement