Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
Butterfly Emulator Error
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="xabbiehotel" data-source="post: 201096" data-attributes="member: 31748"><p>Hello <img src="/styles/default/xenforo/smilies/emojione/smile.png" class="smilie" loading="lazy" alt=":)" title="Smile :)" data-shortname=":)" /></p><p>I'm having some trouble with my Butterfly Emulator.</p><p>It says there is something wrong with my itemmanager.cs</p><p>Here is the code:</p><p>[CODE]using System;</p><p>using System.Collections.Generic;</p><p>using System.Data;</p><p>using Butterfly.Core;</p><p>using Butterfly.HabboHotel.Items;</p><p>using Database_Manager.Database.Session_Details.Interfaces;</p><p> </p><p>namespace Butterfly.HabboHotel.Items</p><p>{</p><p> class ItemManager</p><p> {</p><p> private Dictionary<UInt32, Item> Items;</p><p> </p><p> internal ItemManager()</p><p> {</p><p> Items = new Dictionary<uint, Item>();</p><p> }</p><p> </p><p> internal void LoadItems(IQueryAdapter dbClient)</p><p> {</p><p> Items = new Dictionary<uint, Item>();</p><p> </p><p> dbClient.setQuery("SELECT * FROM items_base");</p><p> DataTable ItemData = dbClient.getTable();</p><p> </p><p> if (ItemData != null)</p><p> {</p><p> uint id;</p><p> int spriteID;</p><p> string publicName;</p><p> string itemName;</p><p> string type;</p><p> int width;</p><p> int length;</p><p> double height;</p><p> bool allowStack;</p><p> bool allowWalk;</p><p> bool allowSit;</p><p> bool allowRecycle;</p><p> bool allowTrade;</p><p> bool allowMarketplace;</p><p> bool allowGift;</p><p> bool allowInventoryStack;</p><p> InteractionType interactionType;</p><p> int cycleCount;</p><p> string vendingIDS;</p><p> </p><p> foreach (DataRow dRow in ItemData.Rows)</p><p> {</p><p> try</p><p> {</p><p> id = Convert.ToUInt32(dRow[0]);</p><p> spriteID = (int)dRow[1];</p><p> publicName = (string)dRow[2];</p><p> itemName = (string)dRow[3];</p><p> type = (string)dRow[4];</p><p> width = (int)dRow[5];</p><p> length = (int)dRow[6];</p><p> height = Convert.ToDouble(dRow[7]);</p><p> allowStack = Convert.ToInt32(dRow[8]) == 1;</p><p> allowWalk = Convert.ToInt32(dRow[9]) == 1;</p><p> allowSit = Convert.ToInt32(dRow[10]) == 1;</p><p> allowRecycle = Convert.ToInt32(dRow[11]) == 1;</p><p> allowTrade = Convert.ToInt32(dRow[12]) == 1;</p><p> allowMarketplace = Convert.ToInt32(dRow[13]) == 1;</p><p> allowGift = Convert.ToInt32(dRow[14]) == 1;</p><p> allowInventoryStack = Convert.ToInt32(dRow[15]) == 1;</p><p> interactionType = InterractionTypes.GetTypeFromString((string)dRow[16]);</p><p> cycleCount = (int)dRow[17];</p><p> vendingIDS = (string)dRow[18];</p><p> </p><p> Item item = new Item(id, spriteID, publicName, itemName, type, width, length, height, allowStack, allowWalk, allowSit, allowRecycle, allowTrade, allowMarketplace, allowGift, allowInventoryStack, interactionType, cycleCount, vendingIDS);</p><p> Items.Add(id, item);</p><p> }</p><p> catch (Exception e)</p><p> {</p><p> Console.WriteLine(e.ToString());</p><p> Console.ReadKey();</p><p> Logging.WriteLine("Could not load item #" + Convert.ToUInt32(dRow[0]) + ", please verify the data is okay.");</p><p> }</p><p> }</p><p> }</p><p> }</p><p> </p><p> internal Boolean ContainsItem(uint Id)</p><p> {</p><p> return Items.ContainsKey(Id);</p><p> }</p><p> </p><p> internal Item GetItem(uint Id)</p><p> {</p><p> if (ContainsItem(Id))</p><p> return Items[Id];</p><p> </p><p> return null;</p><p> }</p><p> }</p><p>}</p><p>[/CODE]</p><p> </p><p>And below a screenie of the emulator</p></blockquote><p></p>
[QUOTE="xabbiehotel, post: 201096, member: 31748"] Hello :) I'm having some trouble with my Butterfly Emulator. It says there is something wrong with my itemmanager.cs Here is the code: [CODE]using System; using System.Collections.Generic; using System.Data; using Butterfly.Core; using Butterfly.HabboHotel.Items; using Database_Manager.Database.Session_Details.Interfaces; namespace Butterfly.HabboHotel.Items { class ItemManager { private Dictionary<UInt32, Item> Items; internal ItemManager() { Items = new Dictionary<uint, Item>(); } internal void LoadItems(IQueryAdapter dbClient) { Items = new Dictionary<uint, Item>(); dbClient.setQuery("SELECT * FROM items_base"); DataTable ItemData = dbClient.getTable(); if (ItemData != null) { uint id; int spriteID; string publicName; string itemName; string type; int width; int length; double height; bool allowStack; bool allowWalk; bool allowSit; bool allowRecycle; bool allowTrade; bool allowMarketplace; bool allowGift; bool allowInventoryStack; InteractionType interactionType; int cycleCount; string vendingIDS; foreach (DataRow dRow in ItemData.Rows) { try { id = Convert.ToUInt32(dRow[0]); spriteID = (int)dRow[1]; publicName = (string)dRow[2]; itemName = (string)dRow[3]; type = (string)dRow[4]; width = (int)dRow[5]; length = (int)dRow[6]; height = Convert.ToDouble(dRow[7]); allowStack = Convert.ToInt32(dRow[8]) == 1; allowWalk = Convert.ToInt32(dRow[9]) == 1; allowSit = Convert.ToInt32(dRow[10]) == 1; allowRecycle = Convert.ToInt32(dRow[11]) == 1; allowTrade = Convert.ToInt32(dRow[12]) == 1; allowMarketplace = Convert.ToInt32(dRow[13]) == 1; allowGift = Convert.ToInt32(dRow[14]) == 1; allowInventoryStack = Convert.ToInt32(dRow[15]) == 1; interactionType = InterractionTypes.GetTypeFromString((string)dRow[16]); cycleCount = (int)dRow[17]; vendingIDS = (string)dRow[18]; Item item = new Item(id, spriteID, publicName, itemName, type, width, length, height, allowStack, allowWalk, allowSit, allowRecycle, allowTrade, allowMarketplace, allowGift, allowInventoryStack, interactionType, cycleCount, vendingIDS); Items.Add(id, item); } catch (Exception e) { Console.WriteLine(e.ToString()); Console.ReadKey(); Logging.WriteLine("Could not load item #" + Convert.ToUInt32(dRow[0]) + ", please verify the data is okay."); } } } } internal Boolean ContainsItem(uint Id) { return Items.ContainsKey(Id); } internal Item GetItem(uint Id) { if (ContainsItem(Id)) return Items[Id]; return null; } } } [/CODE] And below a screenie of the emulator [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Butterfly Emulator Error
Top