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
PRODUCTION-201610052203-260805057 - Trading
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="JayC" data-source="post: 386336" data-attributes="member: 36373"><p>[CODE]</p><p>using System;</p><p>using System.Linq;</p><p>using System.Text;</p><p>using System.Collections.Generic;</p><p>using Plus.HabboHotel.Rooms.Trading;</p><p>using Plus.HabboHotel.Items;</p><p></p><p>namespace Plus.Communication.Packets.Outgoing.Inventory.Trading</p><p>{</p><p>class TradingUpdateComposer : ServerPacket</p><p>{</p><p>public TradingUpdateComposer(Trade Trade) : base(ServerPacketHeader.TradingUpdateMessageComposer)</p><p>{</p><p></p><p>if (Trade.Users.Count() < 2)</p><p>return;</p><p></p><p>var User1 = Trade.Users.First();</p><p>var User2 = Trade.Users.Last();</p><p></p><p>base.WriteInteger(User1.GetClient().GetHabbo().Id);</p><p>SerializeUserItems(User1);</p><p></p><p>base.WriteInteger(0);</p><p>base.WriteInteger(0);</p><p>base.WriteInteger(1);</p><p></p><p>SerializeUserItems(User2);</p><p></p><p>base.WriteInteger(0);</p><p>base.WriteInteger(0);</p><p></p><p>/*base.WriteInteger(User.GetClient().GetHabbo().Id);</p><p>base.WriteInteger(User.OfferedItems.Count);</p><p></p><p>foreach (Item Item in User.OfferedItems.ToList())</p><p>{</p><p>base.WriteInteger(Item.Id);</p><p>base.WriteString(Item.GetBaseItem().Type.ToString().ToLower());</p><p>base.WriteInteger(Item.Id);</p><p>base.WriteInteger(Item.Data.SpriteId);</p><p>base.WriteInteger(0);//Not sure.</p><p>if (Item.LimitedNo > 0)</p><p>{</p><p>base.WriteBoolean(false);//Stackable</p><p>base.WriteInteger(256);</p><p>base.WriteString("");</p><p>base.WriteInteger(Item.LimitedNo);</p><p>base.WriteInteger(Item.LimitedTot);</p><p>}</p><p>else</p><p>{</p><p>base.WriteBoolean(true);//Stackable</p><p>base.WriteInteger(0);</p><p>base.WriteString("");</p><p>}</p><p></p><p>base.WriteInteger(0);</p><p>base.WriteInteger(0);</p><p>base.WriteInteger(0);</p><p></p><p>if (Item.GetBaseItem().Type == 's')</p><p>base.WriteInteger(0);</p><p></p><p>base.WriteInteger(0);</p><p>base.WriteInteger(0);</p><p>base.WriteInteger(-1);*/</p><p>}</p><p>private void SerializeUserItems(TradeUser User)</p><p>{</p><p>base.WriteInteger(User.OfferedItems.Count);//While</p><p>foreach (Item Item in User.OfferedItems.ToList())</p><p>{</p><p>base.WriteInteger(Item.Id);</p><p>base.WriteString(Item.Data.Type.ToString().ToUpper());</p><p>base.WriteInteger(Item.Id);</p><p>base.WriteInteger(Item.Data.SpriteId);</p><p>base.WriteInteger(1);</p><p>base.WriteBoolean(true);</p><p></p><p>//Func called _SafeStr_15990</p><p>base.WriteInteger(0);</p><p>base.WriteString("");</p><p></p><p>//end Func called</p><p>base.WriteInteger(0);</p><p>base.WriteInteger(0);</p><p>base.WriteInteger(0);</p><p>if (Item.Data.Type.ToString().ToUpper() == "S")</p><p>base.WriteInteger(0);</p><p>}</p><p>//End of while</p><p>}</p><p>}</p><p>}[/CODE]</p></blockquote><p></p>
[QUOTE="JayC, post: 386336, member: 36373"] [CODE] using System; using System.Linq; using System.Text; using System.Collections.Generic; using Plus.HabboHotel.Rooms.Trading; using Plus.HabboHotel.Items; namespace Plus.Communication.Packets.Outgoing.Inventory.Trading { class TradingUpdateComposer : ServerPacket { public TradingUpdateComposer(Trade Trade) : base(ServerPacketHeader.TradingUpdateMessageComposer) { if (Trade.Users.Count() < 2) return; var User1 = Trade.Users.First(); var User2 = Trade.Users.Last(); base.WriteInteger(User1.GetClient().GetHabbo().Id); SerializeUserItems(User1); base.WriteInteger(0); base.WriteInteger(0); base.WriteInteger(1); SerializeUserItems(User2); base.WriteInteger(0); base.WriteInteger(0); /*base.WriteInteger(User.GetClient().GetHabbo().Id); base.WriteInteger(User.OfferedItems.Count); foreach (Item Item in User.OfferedItems.ToList()) { base.WriteInteger(Item.Id); base.WriteString(Item.GetBaseItem().Type.ToString().ToLower()); base.WriteInteger(Item.Id); base.WriteInteger(Item.Data.SpriteId); base.WriteInteger(0);//Not sure. if (Item.LimitedNo > 0) { base.WriteBoolean(false);//Stackable base.WriteInteger(256); base.WriteString(""); base.WriteInteger(Item.LimitedNo); base.WriteInteger(Item.LimitedTot); } else { base.WriteBoolean(true);//Stackable base.WriteInteger(0); base.WriteString(""); } base.WriteInteger(0); base.WriteInteger(0); base.WriteInteger(0); if (Item.GetBaseItem().Type == 's') base.WriteInteger(0); base.WriteInteger(0); base.WriteInteger(0); base.WriteInteger(-1);*/ } private void SerializeUserItems(TradeUser User) { base.WriteInteger(User.OfferedItems.Count);//While foreach (Item Item in User.OfferedItems.ToList()) { base.WriteInteger(Item.Id); base.WriteString(Item.Data.Type.ToString().ToUpper()); base.WriteInteger(Item.Id); base.WriteInteger(Item.Data.SpriteId); base.WriteInteger(1); base.WriteBoolean(true); //Func called _SafeStr_15990 base.WriteInteger(0); base.WriteString(""); //end Func called base.WriteInteger(0); base.WriteInteger(0); base.WriteInteger(0); if (Item.Data.Type.ToString().ToUpper() == "S") base.WriteInteger(0); } //End of while } } }[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
PRODUCTION-201610052203-260805057 - Trading
Top