Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def sendShopList(this, sendItems=True):
- shopItems = [] if this.client.shopItems == "" else this.client.shopItems.split(",")
- packet = ByteArray().writeInt(this.client.shopCheeses).writeInt(this.client.shopFraises).writeUTF(this.client.playerLook).writeInt(len(shopItems))
- for item in shopItems:
- if "_" in item:
- itemSplited = item.split("_")
- realItem = itemSplited[0]
- custom = itemSplited[1] if len(itemSplited) >= 2 else ""
- realCustom = [] if custom == "" else custom.split("+")
- packet.writeByte(len(realCustom)+1).writeInt(int(realItem))
- x = 0
- while x < len(realCustom):
- packet.writeInt(int(realCustom[x], 16))
- x += 1
- else:
- packet.writeByte(0).writeInt(int(item))
- shop = this.server.shopList if sendItems else []
- packet.writeInt(len(shop))
- for item in shop:
- value = item.split(",")
- packet.writeShort(int(value[0]))
- packet.writeShort(int(value[1])).writeByte(int(value[2])).writeByte(int(value[3])).writeByte(int(value[4])).writeInt(int(value[5])).writeInt(int(value[6])).writeShort(0)
- looks = []
- packet.writeByte(len(looks))
- for look in looks:
- packet.writeShort(look[0])
- packet.writeUTF(look[1])
- packet.writeByte(look[2])
- packet.writeShort(len(this.client.clothes))
- for clothe in this.client.clothes:
- clotheSplited = clothe.split("/")
- packet.writeUTF(clotheSplited[1] + ";" + clotheSplited[2] + ";" + clotheSplited[3])
- shamanItems = [] if this.client.shamanItems == "" else this.client.shamanItems.split(",")
- packet.writeShort(len(shamanItems))
- for item in shamanItems:
- if "_" in item:
- itemSplited = item.split("_")
- realItem = itemSplited[0]
- custom = itemSplited[1] if len(itemSplited) >= 2 else ""
- realCustom = [] if custom == "" else custom.split("+")
- packet.writeShort(int(realItem))
- packet.writeBool(item in this.client.shamanLook.split(",")).writeByte(len(realCustom)+1)
- x = 0
- while x < len(realCustom):
- packet.writeInt(int(realCustom[x], 16))
- x += 1
- else:
- packet.writeShort(int(item)).writeBool(item in this.client.shamanLook.split(",")).writeByte(0)
- shamanShop = this.server.shamanShopList if sendItems else []
- packet.writeShort(len(shamanShop))
- for item in shamanShop:
- value = item.split(",")
- packet.writeInt(int(value[0])).writeByte(int(value[1])).writeByte(int(value[2])).writeInt(int(value[3])).writeShort(int(value[4]))
- this.client.sendPacket(Identifiers.send.Shop_List, packet.toByteArray())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement