PlusEmu Bug

yoyok

Member
Apr 24, 2013
197
24
Hi,

I've a bug when I'm trading with someone. The furni icon image is not loading at the first time when you trade with someone. If I close the trade, and open it again it loads the icon good... but at the first time it's not show the icon up.

I see in the console, that the icon is loading at the first time, but not loading at trade.


First trade (not showing furni Icon, when I'm hover my mouse on it, it shows up)
upload_2016-12-24_13-31-57-png.5719



Second trade (shows the icon at second trade.):

d348a066881a45bea1965e53e48cc9e5.png




Any one now how to solve this?
- Thanks in advance.
 

Blasteh

big tits
Apr 3, 2013
1,156
521
Hi,

I've a bug when I'm trading with someone. The furni icon image is not loading at the first time when you trade with someone. If I close the trade, and open it again it loads the icon good... but at the first time it's not show the icon up.

I see in the console, that the icon is loading at the first time, but not loading at trade.


First trade (not showing furni Icon, when I'm hover my mouse on it, it shows up)
upload_2016-12-24_13-31-57-png.5719



Second trade (shows the icon at second trade.):

d348a066881a45bea1965e53e48cc9e5.png




Any one now how to solve this?
- Thanks in advance.
I see you're using my images lol, but anyway, it's due to a packet issue!
 

JayC

Well-Known Member
Aug 8, 2013
5,505
1,401
How can it be a packet issue? Trade just work when i click on 'Accept', but only the furni icon image is not showing up at the first time.
Packets are controlled in the emulator, you could either be sending the wrong item (image) for the first part of the trade, or there was a packet structure change and you have not updated that. I believe it is a packet since its clearly not your external variables.
 

yoyok

Member
Apr 24, 2013
197
24
Packets are controlled in the emulator, you could either be sending the wrong item (image) for the first part of the trade, or there was a packet structure change and you have not updated that. I believe it is a packet since its clearly not your external variables.
I've checked if the structure is changed for TradingUpdateComposer but it's not changed. What do you mean with sending the wrong image at first part?

I see in the javascript console, that the image is loading at console, but weird enough not showing for the first time in the trade.
 
bump, Still not fixed.
 

Core

Member
Nov 10, 2016
356
138
I'm using: PRODUCTION-201607262204-86871104 right now.

I can't remember how i fixed this but i think the last int for each user on updatetradecomposer is item count, add total number of items there (excluding currency items if you use new trade method)
 

yoyok

Member
Apr 24, 2013
197
24
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);
          


        }
        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
        }
    }
}
I can't remember how i fixed this but i think the last int for each user on updatetradecomposer is item count, add total number of items there (excluding currency items if you use new trade method)
This is my TradingUpdateComposer, don't know exactly how to get the item count.
 
bump
 
I've tried everything, but can't find the solution.
 

Melancholy

Member
Jan 10, 2015
39
13
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);
         


        }
        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
        }
    }
}

This is my TradingUpdateComposer, don't know exactly how to get the item count.
 
bump
 
I've tried everything, but can't find the solution.

I just checked to see if I had the same problem. Apparently I do and I will tackle it, I'll update here if I find a solution. Also, it updates if you add more items in the trade.. So yeah hmm.
 

Damien

Don't need glasses if you can C#
Feb 26, 2012
434
647
You're not setting the users id for the second half of the trade.

Try changing your TradingUpdateComposer function to this:

Code:
        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(User2.GetClient().GetHabbo().Id);
            SerializeUserItems(User2);

            base.WriteInteger(0);
            base.WriteInteger(0);
        }
 
Also those 2 "base.WriteInteger(0);" after the SerializeUserItems function is called are used for trading credits (which aren't needed). The first one is the item count, excluding credit items. The second one is the value of credits in the trade.
 

yoyok

Member
Apr 24, 2013
197
24
@Damiens It does not work, still same issue.

I've tested it with your code:

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(User2.GetClient().GetHabbo().Id);
            SerializeUserItems(User2);

            base.WriteInteger(0);
            base.WriteInteger(0);
      
    }
        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
        }
    }
}


Screenshot:

538e232865614216b77471146076e5ec.png



Same issue as you can see.

 
No one can help me with this? I have still not fixed it.
 
bump
 
I have still a problem with this. Maybe you found the solution? @
 

yoyok

Member
Apr 24, 2013
197
24
It could possibly be the first one in every two then. It's one of them, if it's not that then it's likely not this packet as it works for me.
I'm using PRODUCTION-201607262204-86871104 that emulator with production is released on a other forum.
Maybe you can have a look for me?
 
bump! Still not fixed, I have tried everything was possible for me. No luck..
 

Users who are viewing this thread

Top