Skilled Illusionist
- Joined
- Jan 29, 2011
- Messages
- 338
- Reaction score
- 182
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);
}
}
Did you code this yourself or..?
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);
}
}
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;
}
I thought you where the L33T coder here? Can't you code a simple packet change yourself?Does not work. Would be nice if someone posted a code that works with the new inventory.
- Martin
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
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);
I thought you where the L33T coder here? Can't you code a simple packet change yourself?