Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

new packets for serialize inventory..

Status
Not open for further replies.
Skilled Illusionist
Joined
Jan 29, 2011
Messages
338
Reaction score
182
new packets for serialize inventory..

RELEASE63-31860-31851-201102281426_0591ca57de662cfc25987433ce0080be
PHP:
public void Serialize(ServerMessage Message)
        {
            Item Item = GetBaseItem();
            if (Item == null) return;
            Message.AppendUInt32(Id);
            Message.AppendStringWithBreak(Item.Type.ToUpper());
            Message.AppendString("qpzZIB");
            Message.AppendInt32(Item.SpriteId);
            Message.AppendInt32(1);
            Message.AppendStringWithBreak(ExtraData);
            Message.AppendBoolean(Item.AllowRecycle);
            Message.AppendBoolean(Item.AllowTrade);
            Message.AppendBoolean(Item.AllowInventoryStack);
            Message.AppendBoolean(UberEnvironment.GetGame().GetCatalog().GetMarketplace().CanSellItem(this));
            Message.AppendInt32(-1);

            if (GetBaseItem().Type.ToLower() == "s")
            {
                Message.AppendStringWithBreak("");
                Message.AppendInt32(0);
            }
        }

qpzZIB is category item
 
Last edited:
Junior Spellweaver
Joined
Mar 11, 2010
Messages
132
Reaction score
2
please help me,as is the code?

Code:
 public void Serialize(ServerMessage Message, Boolean Inventory)
        {
            Message.AppendUInt(Id);
            Message.AppendInt32(0);
            if (GetBaseItem() == null)
                Logging.LogException("Unknown base: " + BaseItem);
            Message.AppendStringWithBreak(GetBaseItem().Type.ToUpper());
            Message.AppendUInt(Id);
            Message.AppendInt32(GetBaseItem().SpriteId);

            if (GetBaseItem().Name.Contains("a2"))
            {
                Message.AppendInt32(3);
            }
            else if (GetBaseItem().Name.Contains("wallpaper"))
            {
                Message.AppendInt32(2);
            }
            else if (GetBaseItem().Name.Contains("landscape"))
            {
                Message.AppendInt32(4);
            }
            else
            {
                Message.AppendInt32(0);
            }

            Message.AppendStringWithBreak(ExtraData);
            Message.AppendBoolean(GetBaseItem().AllowRecycle);
            Message.AppendBoolean(GetBaseItem().AllowTrade);
            Message.AppendBoolean(GetBaseItem().AllowInventoryStack);
            Message.AppendBoolean(UberEnvironment.GetGame().GetCatalog().GetMarketplace().CanSellItem(this));
            Message.AppendInt32(-1);

            if (GetBaseItem().Type.ToLower() == "s")
            {
                Message.AppendStringWithBreak("");
                Message.AppendInt32(-1);
            }
        }
 
Skilled Illusionist
Joined
Jan 29, 2011
Messages
338
Reaction score
182
copy the code and replace -.-"
..


almost forgot

also ..
Code:
        public ServerMessage SerializeItemInventory()
        {
            ServerMessage Message = new ServerMessage(140);
            Message.AppendStringWithBreak("S");
            Message.AppendInt32(1);
            Message.AppendInt32(1);
            Message.AppendInt32(ItemCount);
            List<UserItem> List;
            lock (InventoryItems)
            {
                List = InventoryItems;
            }
            List<UserItem>.Enumerator eItems = List.GetEnumerator();
            while (eItems.MoveNext())
            {
                eItems.Current.Serialize(Message);
            }
            return Message;
        }
 
Junior Spellweaver
Joined
Apr 28, 2009
Messages
150
Reaction score
2
Error:

Error 14 The best overloaded method match for 'XD.Messages.ServerMessage.AppendInt32(int)' has some invalid arguments D:\Usar esse emulador\* r3\HabboHotel\Items\UserItem.cs 51 13 *

Error 15 Argument 1: cannot convert from 'uint' to 'int' D:\Usar esse emulador\* r3\HabboHotel\Items\UserItem.cs 51 33 *

Line:
Message.AppendInt32(Id);
 
Joined
Nov 29, 2006
Messages
559
Reaction score
530
You've done this wrong, jus' saying.

For starters the inventory is now in 2 packets, BLS for flooritems and BLI for wallitems. You can use BLS to update wallitems like you have done, however if you don't have any flooritems then your wall items won't update properly.
Also what's with the "qpzZIB", that looks like an item ID, that's not meant to be there.
 
Retired
Loyal Member
Joined
May 5, 2007
Messages
497
Reaction score
665
Does not work. Would be nice if someone posted a code that works with the new inventory.

- Martin
 
Last edited:
Banned
Banned
Joined
Jan 9, 2010
Messages
1,850
Reaction score
503
Does not work. Would be nice if someone posted a code that works with the new inventory.

- Martin
I thought you where the L33T coder here? Can't you code a simple packet change yourself? :eek:
 
Joined
Nov 29, 2006
Messages
559
Reaction score
530
You've done this wrong, jus' saying.

For starters the inventory is now in 2 packets, BLS for flooritems and BLI for wallitems. You can use BLS to update wallitems like you have done, however if you don't have any flooritems then your wall items won't update properly.
Also what's with the "qpzZIB", that looks like an item ID, that's not meant to be there.

Does not work. Would be nice if someone posted a code that works with the new inventory.

- Martin

BLS.IIKu{LVECS.q{LVECXzNI.HIIHM.HtF]S~BS.pF]S~B[_MI.HHIHM.Hw_a]@BS.s_a]@BZ.EI.HHIHM.PA.
BLI.IIIh]M_YI.h]M_YX_PQA16.HHHHM.

You're welcome.
 
Junior Spellweaver
Joined
Apr 28, 2009
Messages
150
Reaction score
2
WOW! My inventory back to works on magic :O without code.
 
Skilled Illusionist
Joined
Jan 29, 2011
Messages
338
Reaction score
182
Error:

Error 14 The best overloaded method match for 'XD.Messages.ServerMessage.AppendInt32(int)' has some invalid arguments D:\Usar esse emulador\* r3\HabboHotel\Items\UserItem.cs 51 13 *

Error 15 Argument 1: cannot convert from 'uint' to 'int' D:\Usar esse emulador\* r3\HabboHotel\Items\UserItem.cs 51 33 *

Line:
Message.AppendInt32(Id);



sorry in my emulator not used unsigned ints, your use this Message.AppendUInt32(Id)

now update the code..
 
Status
Not open for further replies.
Back
Top