Skip to content

equipment_paperdoll

EquipmentPaperdoll

Player equipment data. Sent with information about a player's paperdoll. Note that these values are item IDs.

Source code in src/eolib/protocol/_generated/net/server/equipment_paperdoll.py
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
class EquipmentPaperdoll:
    """
    Player equipment data.
    Sent with information about a player's paperdoll.
    Note that these values are item IDs.
    """
    _byte_size: int = 0
    _boots: int = None # type: ignore [assignment]
    _accessory: int = None # type: ignore [assignment]
    _gloves: int = None # type: ignore [assignment]
    _belt: int = None # type: ignore [assignment]
    _armor: int = None # type: ignore [assignment]
    _necklace: int = None # type: ignore [assignment]
    _hat: int = None # type: ignore [assignment]
    _shield: int = None # type: ignore [assignment]
    _weapon: int = None # type: ignore [assignment]
    _ring: list[int] = None # type: ignore [assignment]
    _armlet: list[int] = None # type: ignore [assignment]
    _bracer: list[int] = None # type: ignore [assignment]

    @property
    def byte_size(self) -> int:
        """
        Returns the size of the data that this was deserialized from.

        Returns:
            int: The size of the data that this was deserialized from.
        """
        return self._byte_size

    @property
    def boots(self) -> int:
        """
        Note:
          - Value range is 0-64008.
        """
        return self._boots

    @boots.setter
    def boots(self, boots: int) -> None:
        """
        Note:
          - Value range is 0-64008.
        """
        self._boots = boots

    @property
    def accessory(self) -> int:
        """
        Note:
          - Value range is 0-64008.
        """
        return self._accessory

    @accessory.setter
    def accessory(self, accessory: int) -> None:
        """
        Note:
          - Value range is 0-64008.
        """
        self._accessory = accessory

    @property
    def gloves(self) -> int:
        """
        Note:
          - Value range is 0-64008.
        """
        return self._gloves

    @gloves.setter
    def gloves(self, gloves: int) -> None:
        """
        Note:
          - Value range is 0-64008.
        """
        self._gloves = gloves

    @property
    def belt(self) -> int:
        """
        Note:
          - Value range is 0-64008.
        """
        return self._belt

    @belt.setter
    def belt(self, belt: int) -> None:
        """
        Note:
          - Value range is 0-64008.
        """
        self._belt = belt

    @property
    def armor(self) -> int:
        """
        Note:
          - Value range is 0-64008.
        """
        return self._armor

    @armor.setter
    def armor(self, armor: int) -> None:
        """
        Note:
          - Value range is 0-64008.
        """
        self._armor = armor

    @property
    def necklace(self) -> int:
        """
        Note:
          - Value range is 0-64008.
        """
        return self._necklace

    @necklace.setter
    def necklace(self, necklace: int) -> None:
        """
        Note:
          - Value range is 0-64008.
        """
        self._necklace = necklace

    @property
    def hat(self) -> int:
        """
        Note:
          - Value range is 0-64008.
        """
        return self._hat

    @hat.setter
    def hat(self, hat: int) -> None:
        """
        Note:
          - Value range is 0-64008.
        """
        self._hat = hat

    @property
    def shield(self) -> int:
        """
        Note:
          - Value range is 0-64008.
        """
        return self._shield

    @shield.setter
    def shield(self, shield: int) -> None:
        """
        Note:
          - Value range is 0-64008.
        """
        self._shield = shield

    @property
    def weapon(self) -> int:
        """
        Note:
          - Value range is 0-64008.
        """
        return self._weapon

    @weapon.setter
    def weapon(self, weapon: int) -> None:
        """
        Note:
          - Value range is 0-64008.
        """
        self._weapon = weapon

    @property
    def ring(self) -> list[int]:
        """
        Note:
          - Length must be `2`.
          - Element value range is 0-64008.
        """
        return self._ring

    @ring.setter
    def ring(self, ring: list[int]) -> None:
        """
        Note:
          - Length must be `2`.
          - Element value range is 0-64008.
        """
        self._ring = ring

    @property
    def armlet(self) -> list[int]:
        """
        Note:
          - Length must be `2`.
          - Element value range is 0-64008.
        """
        return self._armlet

    @armlet.setter
    def armlet(self, armlet: list[int]) -> None:
        """
        Note:
          - Length must be `2`.
          - Element value range is 0-64008.
        """
        self._armlet = armlet

    @property
    def bracer(self) -> list[int]:
        """
        Note:
          - Length must be `2`.
          - Element value range is 0-64008.
        """
        return self._bracer

    @bracer.setter
    def bracer(self, bracer: list[int]) -> None:
        """
        Note:
          - Length must be `2`.
          - Element value range is 0-64008.
        """
        self._bracer = bracer

    @staticmethod
    def serialize(writer: EoWriter, data: "EquipmentPaperdoll") -> None:
        """
        Serializes an instance of `EquipmentPaperdoll` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (EquipmentPaperdoll): The data to serialize.
        """
        if data._boots is None:
            raise SerializationError("boots must be provided.")
        writer.add_short(data._boots)
        if data._accessory is None:
            raise SerializationError("accessory must be provided.")
        writer.add_short(data._accessory)
        if data._gloves is None:
            raise SerializationError("gloves must be provided.")
        writer.add_short(data._gloves)
        if data._belt is None:
            raise SerializationError("belt must be provided.")
        writer.add_short(data._belt)
        if data._armor is None:
            raise SerializationError("armor must be provided.")
        writer.add_short(data._armor)
        if data._necklace is None:
            raise SerializationError("necklace must be provided.")
        writer.add_short(data._necklace)
        if data._hat is None:
            raise SerializationError("hat must be provided.")
        writer.add_short(data._hat)
        if data._shield is None:
            raise SerializationError("shield must be provided.")
        writer.add_short(data._shield)
        if data._weapon is None:
            raise SerializationError("weapon must be provided.")
        writer.add_short(data._weapon)
        if data._ring is None:
            raise SerializationError("ring must be provided.")
        if len(data._ring) != 2:
            raise SerializationError(f"Expected length of ring to be exactly 2, got {len(data._ring)}.")
        for i in range(2):
            writer.add_short(data._ring[i])
        if data._armlet is None:
            raise SerializationError("armlet must be provided.")
        if len(data._armlet) != 2:
            raise SerializationError(f"Expected length of armlet to be exactly 2, got {len(data._armlet)}.")
        for i in range(2):
            writer.add_short(data._armlet[i])
        if data._bracer is None:
            raise SerializationError("bracer must be provided.")
        if len(data._bracer) != 2:
            raise SerializationError(f"Expected length of bracer to be exactly 2, got {len(data._bracer)}.")
        for i in range(2):
            writer.add_short(data._bracer[i])

    @staticmethod
    def deserialize(reader: EoReader) -> "EquipmentPaperdoll":
        """
        Deserializes an instance of `EquipmentPaperdoll` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            EquipmentPaperdoll: The data to serialize.
        """
        data: EquipmentPaperdoll = EquipmentPaperdoll()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            data._boots = reader.get_short()
            data._accessory = reader.get_short()
            data._gloves = reader.get_short()
            data._belt = reader.get_short()
            data._armor = reader.get_short()
            data._necklace = reader.get_short()
            data._hat = reader.get_short()
            data._shield = reader.get_short()
            data._weapon = reader.get_short()
            data._ring = []
            for i in range(2):
                data._ring.append(reader.get_short())
            data._armlet = []
            for i in range(2):
                data._armlet.append(reader.get_short())
            data._bracer = []
            for i in range(2):
                data._bracer.append(reader.get_short())
            data._byte_size = reader.position - reader_start_position
            return data
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"EquipmentPaperdoll(byte_size={repr(self._byte_size)}, boots={repr(self._boots)}, accessory={repr(self._accessory)}, gloves={repr(self._gloves)}, belt={repr(self._belt)}, armor={repr(self._armor)}, necklace={repr(self._necklace)}, hat={repr(self._hat)}, shield={repr(self._shield)}, weapon={repr(self._weapon)}, ring={repr(self._ring)}, armlet={repr(self._armlet)}, bracer={repr(self._bracer)})"

byte_size: int property

Returns the size of the data that this was deserialized from.

Returns:

Name Type Description
int int

The size of the data that this was deserialized from.

boots: int property writable

Note
  • Value range is 0-64008.

accessory: int property writable

Note
  • Value range is 0-64008.

gloves: int property writable

Note
  • Value range is 0-64008.

belt: int property writable

Note
  • Value range is 0-64008.

armor: int property writable

Note
  • Value range is 0-64008.

necklace: int property writable

Note
  • Value range is 0-64008.

hat: int property writable

Note
  • Value range is 0-64008.

shield: int property writable

Note
  • Value range is 0-64008.

weapon: int property writable

Note
  • Value range is 0-64008.

ring: list[int] property writable

Note
  • Length must be 2.
  • Element value range is 0-64008.

armlet: list[int] property writable

Note
  • Length must be 2.
  • Element value range is 0-64008.

bracer: list[int] property writable

Note
  • Length must be 2.
  • Element value range is 0-64008.

serialize(writer, data) staticmethod

Serializes an instance of EquipmentPaperdoll to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data EquipmentPaperdoll

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/equipment_paperdoll.py
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
@staticmethod
def serialize(writer: EoWriter, data: "EquipmentPaperdoll") -> None:
    """
    Serializes an instance of `EquipmentPaperdoll` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (EquipmentPaperdoll): The data to serialize.
    """
    if data._boots is None:
        raise SerializationError("boots must be provided.")
    writer.add_short(data._boots)
    if data._accessory is None:
        raise SerializationError("accessory must be provided.")
    writer.add_short(data._accessory)
    if data._gloves is None:
        raise SerializationError("gloves must be provided.")
    writer.add_short(data._gloves)
    if data._belt is None:
        raise SerializationError("belt must be provided.")
    writer.add_short(data._belt)
    if data._armor is None:
        raise SerializationError("armor must be provided.")
    writer.add_short(data._armor)
    if data._necklace is None:
        raise SerializationError("necklace must be provided.")
    writer.add_short(data._necklace)
    if data._hat is None:
        raise SerializationError("hat must be provided.")
    writer.add_short(data._hat)
    if data._shield is None:
        raise SerializationError("shield must be provided.")
    writer.add_short(data._shield)
    if data._weapon is None:
        raise SerializationError("weapon must be provided.")
    writer.add_short(data._weapon)
    if data._ring is None:
        raise SerializationError("ring must be provided.")
    if len(data._ring) != 2:
        raise SerializationError(f"Expected length of ring to be exactly 2, got {len(data._ring)}.")
    for i in range(2):
        writer.add_short(data._ring[i])
    if data._armlet is None:
        raise SerializationError("armlet must be provided.")
    if len(data._armlet) != 2:
        raise SerializationError(f"Expected length of armlet to be exactly 2, got {len(data._armlet)}.")
    for i in range(2):
        writer.add_short(data._armlet[i])
    if data._bracer is None:
        raise SerializationError("bracer must be provided.")
    if len(data._bracer) != 2:
        raise SerializationError(f"Expected length of bracer to be exactly 2, got {len(data._bracer)}.")
    for i in range(2):
        writer.add_short(data._bracer[i])

deserialize(reader) staticmethod

Deserializes an instance of EquipmentPaperdoll from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Name Type Description
EquipmentPaperdoll 'EquipmentPaperdoll'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/equipment_paperdoll.py
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
@staticmethod
def deserialize(reader: EoReader) -> "EquipmentPaperdoll":
    """
    Deserializes an instance of `EquipmentPaperdoll` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        EquipmentPaperdoll: The data to serialize.
    """
    data: EquipmentPaperdoll = EquipmentPaperdoll()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        data._boots = reader.get_short()
        data._accessory = reader.get_short()
        data._gloves = reader.get_short()
        data._belt = reader.get_short()
        data._armor = reader.get_short()
        data._necklace = reader.get_short()
        data._hat = reader.get_short()
        data._shield = reader.get_short()
        data._weapon = reader.get_short()
        data._ring = []
        for i in range(2):
            data._ring.append(reader.get_short())
        data._armlet = []
        for i in range(2):
            data._armlet.append(reader.get_short())
        data._bracer = []
        for i in range(2):
            data._bracer.append(reader.get_short())
        data._byte_size = reader.position - reader_start_position
        return data
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode