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="Sledmore" data-source="post: 386394" data-attributes="member: 591"><p>I'm curious why you have another method in there when it isn't needed? The disconnections are due to invalid packet structure.</p><p></p><p>The issue here is one of the packets are wrong - the accept & confirm have the same headers.</p><p></p><p>TradingAcceptMessageComposer</p><p>TradingConfirmedMessageComposer</p><p></p><p>Should be the same packet ID value. So one of those is wrong, simply test both to see which is correct.</p><p></p><p>As for your TradingUpdateComposer that is very wrong, you should never break/return mid structure.</p><p></p><p>[PHP]</p><p>if (Trade.Users.Count() < 2)</p><p>return;[/PHP]</p><p></p><p>Needs removing for a start.</p><p></p><p>[PHP]</p><p> class TradingUpdateComposer : ServerPacket</p><p> {</p><p> public TradingUpdateComposer(Trade Trade)</p><p> : base(ServerPacketHeader.TradingUpdateMessageComposer)</p><p> {</p><p> foreach (TradeUser User in Trade.Users.ToList())</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></p><p> base.WriteBoolean(true);//Stackable</p><p> base.WriteInteger(0);</p><p> base.WriteString("");</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></p><p> base.WriteInteger(User.OfferedItems.Count);//Item Count</p><p> base.WriteInteger(0);//Value of the items.</p><p> }</p><p> }</p><p> }[/PHP]</p><p></p><p>Is what it should be.</p></blockquote><p></p>
[QUOTE="Sledmore, post: 386394, member: 591"] I'm curious why you have another method in there when it isn't needed? The disconnections are due to invalid packet structure. The issue here is one of the packets are wrong - the accept & confirm have the same headers. TradingAcceptMessageComposer TradingConfirmedMessageComposer Should be the same packet ID value. So one of those is wrong, simply test both to see which is correct. As for your TradingUpdateComposer that is very wrong, you should never break/return mid structure. [PHP] if (Trade.Users.Count() < 2) return;[/PHP] Needs removing for a start. [PHP] class TradingUpdateComposer : ServerPacket { public TradingUpdateComposer(Trade Trade) : base(ServerPacketHeader.TradingUpdateMessageComposer) { foreach (TradeUser User in Trade.Users.ToList()) { 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. 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(User.OfferedItems.Count);//Item Count base.WriteInteger(0);//Value of the items. } } }[/PHP] Is what it should be. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
PRODUCTION-201610052203-260805057 - Trading
Top