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
[PlusEMU] Trouble With Marketplace
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="treebeard" data-source="post: 430106" data-attributes="member: 79259"><p>Here is my MarkeOfferEvent.cs</p><p>[CODE]using System;</p><p>using System.Linq;</p><p>using System.Text;</p><p>using System.Collections.Generic;</p><p></p><p>using Plus.HabboHotel.Items;</p><p>using Plus.HabboHotel.Catalog.Utilities;</p><p>using Plus.Communication.Packets.Outgoing.Marketplace;</p><p>using Plus.Database.Interfaces;</p><p></p><p></p><p>namespace Plus.Communication.Packets.Incoming.Marketplace</p><p>{</p><p> class MakeOfferEvent : IPacketEvent</p><p> {</p><p> public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)</p><p> {</p><p> int SellingPrice = Packet.PopInt();</p><p> int ComissionPrice = Packet.PopInt();</p><p> int ItemId = Packet.PopInt();</p><p></p><p> Item Item = Session.GetHabbo().GetInventoryComponent().GetItem(ItemId);</p><p> if (Item == null)</p><p> {</p><p> Session.SendPacket(new MarketplaceMakeOfferResultComposer(0));</p><p> return;</p><p> }</p><p></p><p> if (!ItemUtility.IsRare(Item))</p><p> {</p><p> Session.SendNotification("Sorry, only Rares & LTDs can go be auctioned off in the Marketplace!");</p><p> return;</p><p> }</p><p></p><p> if (SellingPrice > 70000000 || SellingPrice == 0)</p><p> {</p><p> Session.SendPacket(new MarketplaceMakeOfferResultComposer(0));</p><p> return;</p><p> }</p><p></p><p> int Comission = PlusEnvironment.GetGame().GetCatalog().GetMarketplace().CalculateComissionPrice((float)SellingPrice);</p><p> int TotalPrice = SellingPrice + Comission;</p><p> int ItemType = 1;</p><p> if (Item.GetBaseItem().Type == 'i')</p><p> ItemType++;</p><p></p><p> using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())</p><p> {</p><p> dbClient.SetQuery("INSERT INTO `catalog_marketplace_offers` (`furni_id`,`item_id`,`user_id`,`asking_price`,`total_price`,`public_name`,`sprite_id`,`item_type`,`timestamp`,`extra_data`,`limited_number`,`limited_stack`) VALUES ('" + ItemId + "','" + Item.BaseItem + "','" + Session.GetHabbo().Id + "','" + SellingPrice + "','" + TotalPrice + "',@public_name,'" + Item.GetBaseItem().SpriteId + "','" + ItemType + "','" + PlusEnvironment.GetUnixTimestamp() + "',@extra_data, '" + Item.LimitedNo + "', '" + Item.LimitedTot + "')");</p><p> dbClient.AddParameter("public_name", Item.GetBaseItem().PublicName);</p><p> dbClient.AddParameter("extra_data", Item.ExtraData);</p><p> dbClient.RunQuery();</p><p></p><p> dbClient.RunQuery("DELETE FROM `items` WHERE `id` = '" + ItemId + "' AND `user_id` = '" + Session.GetHabbo().Id + "' LIMIT 1");</p><p> }</p><p></p><p> Session.GetHabbo().GetInventoryComponent().RemoveItem(ItemId);</p><p> Session.SendPacket(new MarketplaceMakeOfferResultComposer(1));</p><p> }</p><p> }</p><p>}[/CODE]</p><p></p><p>Also these are the only packet headers I'm seeing in the respective locations</p><p>[CODE]Client Packet Headers</p><p>---------------------</p><p>public const int GetMarketplaceItemStatsMessageEvent = 1561;//1203</p><p>public const int GetMarketplaceConfigurationMessageEvent = 2811;//1604</p><p>public const int GetMarketplaceCanMakeOfferMessageEvent = 1552;//1647</p><p></p><p>Server Packet Headers</p><p>---------------------</p><p>public const int MarketplaceCanMakeOfferResultMessageComposer = 2452;//1874</p><p>public const int MarketplaceConfigurationMessageComposer = 1817;//3702</p><p>public const int MarketplaceItemStatsMessageComposer = 480;//2909</p><p>public const int MarketPlaceOwnOffersMessageComposer = 1892;//2806</p><p>public const int MarketPlaceOffersMessageComposer = 291;//2985</p><p>public const int MarketplaceMakeOfferResultMessageComposer = 480;//3960</p><p>public const int MarketplaceCancelOfferResultMessageComposer = 1892;//202[/CODE]</p></blockquote><p></p>
[QUOTE="treebeard, post: 430106, member: 79259"] Here is my MarkeOfferEvent.cs [CODE]using System; using System.Linq; using System.Text; using System.Collections.Generic; using Plus.HabboHotel.Items; using Plus.HabboHotel.Catalog.Utilities; using Plus.Communication.Packets.Outgoing.Marketplace; using Plus.Database.Interfaces; namespace Plus.Communication.Packets.Incoming.Marketplace { class MakeOfferEvent : IPacketEvent { public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { int SellingPrice = Packet.PopInt(); int ComissionPrice = Packet.PopInt(); int ItemId = Packet.PopInt(); Item Item = Session.GetHabbo().GetInventoryComponent().GetItem(ItemId); if (Item == null) { Session.SendPacket(new MarketplaceMakeOfferResultComposer(0)); return; } if (!ItemUtility.IsRare(Item)) { Session.SendNotification("Sorry, only Rares & LTDs can go be auctioned off in the Marketplace!"); return; } if (SellingPrice > 70000000 || SellingPrice == 0) { Session.SendPacket(new MarketplaceMakeOfferResultComposer(0)); return; } int Comission = PlusEnvironment.GetGame().GetCatalog().GetMarketplace().CalculateComissionPrice((float)SellingPrice); int TotalPrice = SellingPrice + Comission; int ItemType = 1; if (Item.GetBaseItem().Type == 'i') ItemType++; using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { dbClient.SetQuery("INSERT INTO `catalog_marketplace_offers` (`furni_id`,`item_id`,`user_id`,`asking_price`,`total_price`,`public_name`,`sprite_id`,`item_type`,`timestamp`,`extra_data`,`limited_number`,`limited_stack`) VALUES ('" + ItemId + "','" + Item.BaseItem + "','" + Session.GetHabbo().Id + "','" + SellingPrice + "','" + TotalPrice + "',@public_name,'" + Item.GetBaseItem().SpriteId + "','" + ItemType + "','" + PlusEnvironment.GetUnixTimestamp() + "',@extra_data, '" + Item.LimitedNo + "', '" + Item.LimitedTot + "')"); dbClient.AddParameter("public_name", Item.GetBaseItem().PublicName); dbClient.AddParameter("extra_data", Item.ExtraData); dbClient.RunQuery(); dbClient.RunQuery("DELETE FROM `items` WHERE `id` = '" + ItemId + "' AND `user_id` = '" + Session.GetHabbo().Id + "' LIMIT 1"); } Session.GetHabbo().GetInventoryComponent().RemoveItem(ItemId); Session.SendPacket(new MarketplaceMakeOfferResultComposer(1)); } } }[/CODE] Also these are the only packet headers I'm seeing in the respective locations [CODE]Client Packet Headers --------------------- public const int GetMarketplaceItemStatsMessageEvent = 1561;//1203 public const int GetMarketplaceConfigurationMessageEvent = 2811;//1604 public const int GetMarketplaceCanMakeOfferMessageEvent = 1552;//1647 Server Packet Headers --------------------- public const int MarketplaceCanMakeOfferResultMessageComposer = 2452;//1874 public const int MarketplaceConfigurationMessageComposer = 1817;//3702 public const int MarketplaceItemStatsMessageComposer = 480;//2909 public const int MarketPlaceOwnOffersMessageComposer = 1892;//2806 public const int MarketPlaceOffersMessageComposer = 291;//2985 public const int MarketplaceMakeOfferResultMessageComposer = 480;//3960 public const int MarketplaceCancelOfferResultMessageComposer = 1892;//202[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
[PlusEMU] Trouble With Marketplace
Top