Skip to content

character_reply_server_packet

CharacterReplyServerPacket

Bases: Packet

Reply to client Character-family packets

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
 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
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
class CharacterReplyServerPacket(Packet):
    """
    Reply to client Character-family packets
    """
    _byte_size: int = 0
    _reply_code: CharacterReply = None # type: ignore [assignment]
    _reply_code_data: 'CharacterReplyServerPacket.ReplyCodeData' = None

    @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 reply_code(self) -> CharacterReply:
        """
        Sometimes a CharacterReply code, sometimes a session ID for character creation
        """
        return self._reply_code

    @reply_code.setter
    def reply_code(self, reply_code: CharacterReply) -> None:
        """
        Sometimes a CharacterReply code, sometimes a session ID for character creation
        """
        self._reply_code = reply_code

    @property
    def reply_code_data(self) -> 'CharacterReplyServerPacket.ReplyCodeData':
        """
        CharacterReplyServerPacket.ReplyCodeData: Gets or sets the data associated with the `reply_code` field.
        """
        return self._reply_code_data

    @reply_code_data.setter
    def reply_code_data(self, reply_code_data: 'CharacterReplyServerPacket.ReplyCodeData') -> None:
        self._reply_code_data = reply_code_data

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Character

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Reply

    def write(self, writer):
        """
        Serializes and writes this packet to the provided EoWriter.

        Args:
            writer (EoWriter): the writer that this packet will be written to.
        """
        CharacterReplyServerPacket.serialize(writer, self)

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterReplyServerPacket): The data to serialize.
        """
        if data._reply_code is None:
            raise SerializationError("reply_code must be provided.")
        writer.add_short(int(data._reply_code))
        if data._reply_code == 0:
            if data._reply_code_data is not None:
                raise SerializationError("Expected reply_code_data to be None for reply_code " + CharacterReply(data._reply_code).name + ".")
        elif data._reply_code == CharacterReply.Exists:
            if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataExists):
                raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataExists for reply_code " + CharacterReply(data._reply_code).name + ".")
            CharacterReplyServerPacket.ReplyCodeDataExists.serialize(writer, data._reply_code_data)
        elif data._reply_code == CharacterReply.Full:
            if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataFull):
                raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataFull for reply_code " + CharacterReply(data._reply_code).name + ".")
            CharacterReplyServerPacket.ReplyCodeDataFull.serialize(writer, data._reply_code_data)
        elif data._reply_code == CharacterReply.Full3:
            if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataFull3):
                raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataFull3 for reply_code " + CharacterReply(data._reply_code).name + ".")
            CharacterReplyServerPacket.ReplyCodeDataFull3.serialize(writer, data._reply_code_data)
        elif data._reply_code == CharacterReply.NotApproved:
            if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataNotApproved):
                raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataNotApproved for reply_code " + CharacterReply(data._reply_code).name + ".")
            CharacterReplyServerPacket.ReplyCodeDataNotApproved.serialize(writer, data._reply_code_data)
        elif data._reply_code == CharacterReply.Ok:
            if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataOk):
                raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataOk for reply_code " + CharacterReply(data._reply_code).name + ".")
            CharacterReplyServerPacket.ReplyCodeDataOk.serialize(writer, data._reply_code_data)
        elif data._reply_code == CharacterReply.Deleted:
            if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataDeleted):
                raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataDeleted for reply_code " + CharacterReply(data._reply_code).name + ".")
            CharacterReplyServerPacket.ReplyCodeDataDeleted.serialize(writer, data._reply_code_data)
        elif data._reply_code == 7:
            if data._reply_code_data is not None:
                raise SerializationError("Expected reply_code_data to be None for reply_code " + CharacterReply(data._reply_code).name + ".")
        elif data._reply_code == 8:
            if data._reply_code_data is not None:
                raise SerializationError("Expected reply_code_data to be None for reply_code " + CharacterReply(data._reply_code).name + ".")
        elif data._reply_code == 9:
            if data._reply_code_data is not None:
                raise SerializationError("Expected reply_code_data to be None for reply_code " + CharacterReply(data._reply_code).name + ".")
        else:
            if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataDefault):
                raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataDefault for reply_code " + CharacterReply(data._reply_code).name + ".")
            CharacterReplyServerPacket.ReplyCodeDataDefault.serialize(writer, data._reply_code_data)

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

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

        Returns:
            CharacterReplyServerPacket: The data to serialize.
        """
        data: CharacterReplyServerPacket = CharacterReplyServerPacket()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            data._reply_code = CharacterReply(reader.get_short())
            if data._reply_code == 0:
                data._reply_code_data = None
            elif data._reply_code == CharacterReply.Exists:
                data._reply_code_data = CharacterReplyServerPacket.ReplyCodeDataExists.deserialize(reader)
            elif data._reply_code == CharacterReply.Full:
                data._reply_code_data = CharacterReplyServerPacket.ReplyCodeDataFull.deserialize(reader)
            elif data._reply_code == CharacterReply.Full3:
                data._reply_code_data = CharacterReplyServerPacket.ReplyCodeDataFull3.deserialize(reader)
            elif data._reply_code == CharacterReply.NotApproved:
                data._reply_code_data = CharacterReplyServerPacket.ReplyCodeDataNotApproved.deserialize(reader)
            elif data._reply_code == CharacterReply.Ok:
                data._reply_code_data = CharacterReplyServerPacket.ReplyCodeDataOk.deserialize(reader)
            elif data._reply_code == CharacterReply.Deleted:
                data._reply_code_data = CharacterReplyServerPacket.ReplyCodeDataDeleted.deserialize(reader)
            elif data._reply_code == 7:
                data._reply_code_data = None
            elif data._reply_code == 8:
                data._reply_code_data = None
            elif data._reply_code == 9:
                data._reply_code_data = None
            else:
                data._reply_code_data = CharacterReplyServerPacket.ReplyCodeDataDefault.deserialize(reader)
            reader.chunked_reading_mode = False
            data._byte_size = reader.position - reader_start_position
            return data
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterReplyServerPacket(byte_size={repr(self._byte_size)}, reply_code={repr(self._reply_code)}, reply_code_data={repr(self._reply_code_data)})"

    ReplyCodeData = Union['CharacterReplyServerPacket.ReplyCodeDataExists', 'CharacterReplyServerPacket.ReplyCodeDataFull', 'CharacterReplyServerPacket.ReplyCodeDataFull3', 'CharacterReplyServerPacket.ReplyCodeDataNotApproved', 'CharacterReplyServerPacket.ReplyCodeDataOk', 'CharacterReplyServerPacket.ReplyCodeDataDeleted', 'CharacterReplyServerPacket.ReplyCodeDataDefault', None]
    ReplyCodeData.__doc__ = \
        """
        Data associated with different values of the `reply_code` field.
        """

    class ReplyCodeDataExists:
        """
        Data associated with reply_code value CharacterReply.Exists
        """
        _byte_size: int = 0

        @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


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

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (CharacterReplyServerPacket.ReplyCodeDataExists): The data to serialize.
            """
            writer.add_string("NO")

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

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

            Returns:
                CharacterReplyServerPacket.ReplyCodeDataExists: The data to serialize.
            """
            data: CharacterReplyServerPacket.ReplyCodeDataExists = CharacterReplyServerPacket.ReplyCodeDataExists()
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.get_string()
                data._byte_size = reader.position - reader_start_position
                return data
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"CharacterReplyServerPacket.ReplyCodeDataExists(byte_size={repr(self._byte_size)})"

    class ReplyCodeDataFull:
        """
        Data associated with reply_code value CharacterReply.Full
        """
        _byte_size: int = 0

        @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


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

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (CharacterReplyServerPacket.ReplyCodeDataFull): The data to serialize.
            """
            writer.add_string("NO")

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

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

            Returns:
                CharacterReplyServerPacket.ReplyCodeDataFull: The data to serialize.
            """
            data: CharacterReplyServerPacket.ReplyCodeDataFull = CharacterReplyServerPacket.ReplyCodeDataFull()
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.get_string()
                data._byte_size = reader.position - reader_start_position
                return data
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"CharacterReplyServerPacket.ReplyCodeDataFull(byte_size={repr(self._byte_size)})"

    class ReplyCodeDataFull3:
        """
        Data associated with reply_code value CharacterReply.Full3
        """
        _byte_size: int = 0

        @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


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

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (CharacterReplyServerPacket.ReplyCodeDataFull3): The data to serialize.
            """
            writer.add_string("NO")

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

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

            Returns:
                CharacterReplyServerPacket.ReplyCodeDataFull3: The data to serialize.
            """
            data: CharacterReplyServerPacket.ReplyCodeDataFull3 = CharacterReplyServerPacket.ReplyCodeDataFull3()
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.get_string()
                data._byte_size = reader.position - reader_start_position
                return data
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"CharacterReplyServerPacket.ReplyCodeDataFull3(byte_size={repr(self._byte_size)})"

    class ReplyCodeDataNotApproved:
        """
        Data associated with reply_code value CharacterReply.NotApproved
        """
        _byte_size: int = 0

        @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


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

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (CharacterReplyServerPacket.ReplyCodeDataNotApproved): The data to serialize.
            """
            writer.add_string("NO")

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

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

            Returns:
                CharacterReplyServerPacket.ReplyCodeDataNotApproved: The data to serialize.
            """
            data: CharacterReplyServerPacket.ReplyCodeDataNotApproved = CharacterReplyServerPacket.ReplyCodeDataNotApproved()
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.get_string()
                data._byte_size = reader.position - reader_start_position
                return data
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"CharacterReplyServerPacket.ReplyCodeDataNotApproved(byte_size={repr(self._byte_size)})"

    class ReplyCodeDataOk:
        """
        Data associated with reply_code value CharacterReply.Ok
        """
        _byte_size: int = 0
        _characters_count: int = None # type: ignore [assignment]
        _characters: list[CharacterSelectionListEntry] = 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 characters(self) -> list[CharacterSelectionListEntry]:
            """
            Note:
              - Length must be 252 or less.
            """
            return self._characters

        @characters.setter
        def characters(self, characters: list[CharacterSelectionListEntry]) -> None:
            """
            Note:
              - Length must be 252 or less.
            """
            self._characters = characters
            self._characters_count = len(self._characters)

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

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (CharacterReplyServerPacket.ReplyCodeDataOk): The data to serialize.
            """
            if data._characters_count is None:
                raise SerializationError("characters_count must be provided.")
            writer.add_char(data._characters_count)
            writer.add_char(0)
            writer.add_byte(0xFF)
            if data._characters is None:
                raise SerializationError("characters must be provided.")
            if len(data._characters) > 252:
                raise SerializationError(f"Expected length of characters to be 252 or less, got {len(data._characters)}.")
            for i in range(data._characters_count):
                if i > 0:
                    writer.add_byte(0xFF)
                CharacterSelectionListEntry.serialize(writer, data._characters[i])

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

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

            Returns:
                CharacterReplyServerPacket.ReplyCodeDataOk: The data to serialize.
            """
            data: CharacterReplyServerPacket.ReplyCodeDataOk = CharacterReplyServerPacket.ReplyCodeDataOk()
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                data._characters_count = reader.get_char()
                reader.get_char()
                reader.next_chunk()
                data._characters = []
                for i in range(data._characters_count):
                    data._characters.append(CharacterSelectionListEntry.deserialize(reader))
                    if i + 1 < data._characters_count:
                        reader.next_chunk()
                data._byte_size = reader.position - reader_start_position
                return data
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"CharacterReplyServerPacket.ReplyCodeDataOk(byte_size={repr(self._byte_size)}, characters={repr(self._characters)})"

    class ReplyCodeDataDeleted:
        """
        Data associated with reply_code value CharacterReply.Deleted
        """
        _byte_size: int = 0
        _characters_count: int = None # type: ignore [assignment]
        _characters: list[CharacterSelectionListEntry] = 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 characters(self) -> list[CharacterSelectionListEntry]:
            """
            Note:
              - Length must be 252 or less.
            """
            return self._characters

        @characters.setter
        def characters(self, characters: list[CharacterSelectionListEntry]) -> None:
            """
            Note:
              - Length must be 252 or less.
            """
            self._characters = characters
            self._characters_count = len(self._characters)

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

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (CharacterReplyServerPacket.ReplyCodeDataDeleted): The data to serialize.
            """
            if data._characters_count is None:
                raise SerializationError("characters_count must be provided.")
            writer.add_char(data._characters_count)
            writer.add_byte(0xFF)
            if data._characters is None:
                raise SerializationError("characters must be provided.")
            if len(data._characters) > 252:
                raise SerializationError(f"Expected length of characters to be 252 or less, got {len(data._characters)}.")
            for i in range(data._characters_count):
                if i > 0:
                    writer.add_byte(0xFF)
                CharacterSelectionListEntry.serialize(writer, data._characters[i])

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

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

            Returns:
                CharacterReplyServerPacket.ReplyCodeDataDeleted: The data to serialize.
            """
            data: CharacterReplyServerPacket.ReplyCodeDataDeleted = CharacterReplyServerPacket.ReplyCodeDataDeleted()
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                data._characters_count = reader.get_char()
                reader.next_chunk()
                data._characters = []
                for i in range(data._characters_count):
                    data._characters.append(CharacterSelectionListEntry.deserialize(reader))
                    if i + 1 < data._characters_count:
                        reader.next_chunk()
                data._byte_size = reader.position - reader_start_position
                return data
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"CharacterReplyServerPacket.ReplyCodeDataDeleted(byte_size={repr(self._byte_size)}, characters={repr(self._characters)})"

    class ReplyCodeDataDefault:
        """
        Default data associated with reply_code

        In this case (reply_code &gt; 9), reply_code is a session ID for character creation
        """
        _byte_size: int = 0

        @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


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

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (CharacterReplyServerPacket.ReplyCodeDataDefault): The data to serialize.
            """
            writer.add_string("OK")

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

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

            Returns:
                CharacterReplyServerPacket.ReplyCodeDataDefault: The data to serialize.
            """
            data: CharacterReplyServerPacket.ReplyCodeDataDefault = CharacterReplyServerPacket.ReplyCodeDataDefault()
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.get_string()
                data._byte_size = reader.position - reader_start_position
                return data
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"CharacterReplyServerPacket.ReplyCodeDataDefault(byte_size={repr(self._byte_size)})"

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.

reply_code: CharacterReply property writable

Sometimes a CharacterReply code, sometimes a session ID for character creation

reply_code_data: 'CharacterReplyServerPacket.ReplyCodeData' property writable

CharacterReplyServerPacket.ReplyCodeData: Gets or sets the data associated with the reply_code field.

ReplyCodeData = Union['CharacterReplyServerPacket.ReplyCodeDataExists', 'CharacterReplyServerPacket.ReplyCodeDataFull', 'CharacterReplyServerPacket.ReplyCodeDataFull3', 'CharacterReplyServerPacket.ReplyCodeDataNotApproved', 'CharacterReplyServerPacket.ReplyCodeDataOk', 'CharacterReplyServerPacket.ReplyCodeDataDeleted', 'CharacterReplyServerPacket.ReplyCodeDataDefault', None] class-attribute instance-attribute

ReplyCodeDataExists

Data associated with reply_code value CharacterReply.Exists

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
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
class ReplyCodeDataExists:
    """
    Data associated with reply_code value CharacterReply.Exists
    """
    _byte_size: int = 0

    @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


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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterReplyServerPacket.ReplyCodeDataExists): The data to serialize.
        """
        writer.add_string("NO")

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

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

        Returns:
            CharacterReplyServerPacket.ReplyCodeDataExists: The data to serialize.
        """
        data: CharacterReplyServerPacket.ReplyCodeDataExists = CharacterReplyServerPacket.ReplyCodeDataExists()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            data._byte_size = reader.position - reader_start_position
            return data
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterReplyServerPacket.ReplyCodeDataExists(byte_size={repr(self._byte_size)})"

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.

serialize(writer, data) staticmethod

Serializes an instance of CharacterReplyServerPacket.ReplyCodeDataExists to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataExists

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
213
214
215
216
217
218
219
220
221
222
@staticmethod
def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataExists") -> None:
    """
    Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataExists` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterReplyServerPacket.ReplyCodeDataExists): The data to serialize.
    """
    writer.add_string("NO")

deserialize(reader) staticmethod

Deserializes an instance of CharacterReplyServerPacket.ReplyCodeDataExists from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'CharacterReplyServerPacket.ReplyCodeDataExists'

CharacterReplyServerPacket.ReplyCodeDataExists: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
@staticmethod
def deserialize(reader: EoReader) -> "CharacterReplyServerPacket.ReplyCodeDataExists":
    """
    Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataExists` from the provided `EoReader`.

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

    Returns:
        CharacterReplyServerPacket.ReplyCodeDataExists: The data to serialize.
    """
    data: CharacterReplyServerPacket.ReplyCodeDataExists = CharacterReplyServerPacket.ReplyCodeDataExists()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        data._byte_size = reader.position - reader_start_position
        return data
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataFull

Data associated with reply_code value CharacterReply.Full

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
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
class ReplyCodeDataFull:
    """
    Data associated with reply_code value CharacterReply.Full
    """
    _byte_size: int = 0

    @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


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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterReplyServerPacket.ReplyCodeDataFull): The data to serialize.
        """
        writer.add_string("NO")

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

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

        Returns:
            CharacterReplyServerPacket.ReplyCodeDataFull: The data to serialize.
        """
        data: CharacterReplyServerPacket.ReplyCodeDataFull = CharacterReplyServerPacket.ReplyCodeDataFull()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            data._byte_size = reader.position - reader_start_position
            return data
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterReplyServerPacket.ReplyCodeDataFull(byte_size={repr(self._byte_size)})"

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.

serialize(writer, data) staticmethod

Serializes an instance of CharacterReplyServerPacket.ReplyCodeDataFull to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataFull

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
265
266
267
268
269
270
271
272
273
274
@staticmethod
def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataFull") -> None:
    """
    Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataFull` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterReplyServerPacket.ReplyCodeDataFull): The data to serialize.
    """
    writer.add_string("NO")

deserialize(reader) staticmethod

Deserializes an instance of CharacterReplyServerPacket.ReplyCodeDataFull from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'CharacterReplyServerPacket.ReplyCodeDataFull'

CharacterReplyServerPacket.ReplyCodeDataFull: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
@staticmethod
def deserialize(reader: EoReader) -> "CharacterReplyServerPacket.ReplyCodeDataFull":
    """
    Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataFull` from the provided `EoReader`.

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

    Returns:
        CharacterReplyServerPacket.ReplyCodeDataFull: The data to serialize.
    """
    data: CharacterReplyServerPacket.ReplyCodeDataFull = CharacterReplyServerPacket.ReplyCodeDataFull()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        data._byte_size = reader.position - reader_start_position
        return data
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataFull3

Data associated with reply_code value CharacterReply.Full3

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
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
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
class ReplyCodeDataFull3:
    """
    Data associated with reply_code value CharacterReply.Full3
    """
    _byte_size: int = 0

    @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


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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterReplyServerPacket.ReplyCodeDataFull3): The data to serialize.
        """
        writer.add_string("NO")

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

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

        Returns:
            CharacterReplyServerPacket.ReplyCodeDataFull3: The data to serialize.
        """
        data: CharacterReplyServerPacket.ReplyCodeDataFull3 = CharacterReplyServerPacket.ReplyCodeDataFull3()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            data._byte_size = reader.position - reader_start_position
            return data
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterReplyServerPacket.ReplyCodeDataFull3(byte_size={repr(self._byte_size)})"

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.

serialize(writer, data) staticmethod

Serializes an instance of CharacterReplyServerPacket.ReplyCodeDataFull3 to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataFull3

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
317
318
319
320
321
322
323
324
325
326
@staticmethod
def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataFull3") -> None:
    """
    Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataFull3` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterReplyServerPacket.ReplyCodeDataFull3): The data to serialize.
    """
    writer.add_string("NO")

deserialize(reader) staticmethod

Deserializes an instance of CharacterReplyServerPacket.ReplyCodeDataFull3 from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'CharacterReplyServerPacket.ReplyCodeDataFull3'

CharacterReplyServerPacket.ReplyCodeDataFull3: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
@staticmethod
def deserialize(reader: EoReader) -> "CharacterReplyServerPacket.ReplyCodeDataFull3":
    """
    Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataFull3` from the provided `EoReader`.

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

    Returns:
        CharacterReplyServerPacket.ReplyCodeDataFull3: The data to serialize.
    """
    data: CharacterReplyServerPacket.ReplyCodeDataFull3 = CharacterReplyServerPacket.ReplyCodeDataFull3()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        data._byte_size = reader.position - reader_start_position
        return data
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataNotApproved

Data associated with reply_code value CharacterReply.NotApproved

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
class ReplyCodeDataNotApproved:
    """
    Data associated with reply_code value CharacterReply.NotApproved
    """
    _byte_size: int = 0

    @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


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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterReplyServerPacket.ReplyCodeDataNotApproved): The data to serialize.
        """
        writer.add_string("NO")

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

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

        Returns:
            CharacterReplyServerPacket.ReplyCodeDataNotApproved: The data to serialize.
        """
        data: CharacterReplyServerPacket.ReplyCodeDataNotApproved = CharacterReplyServerPacket.ReplyCodeDataNotApproved()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            data._byte_size = reader.position - reader_start_position
            return data
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterReplyServerPacket.ReplyCodeDataNotApproved(byte_size={repr(self._byte_size)})"

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.

serialize(writer, data) staticmethod

Serializes an instance of CharacterReplyServerPacket.ReplyCodeDataNotApproved to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataNotApproved

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
369
370
371
372
373
374
375
376
377
378
@staticmethod
def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataNotApproved") -> None:
    """
    Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataNotApproved` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterReplyServerPacket.ReplyCodeDataNotApproved): The data to serialize.
    """
    writer.add_string("NO")

deserialize(reader) staticmethod

Deserializes an instance of CharacterReplyServerPacket.ReplyCodeDataNotApproved from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'CharacterReplyServerPacket.ReplyCodeDataNotApproved'

CharacterReplyServerPacket.ReplyCodeDataNotApproved: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
@staticmethod
def deserialize(reader: EoReader) -> "CharacterReplyServerPacket.ReplyCodeDataNotApproved":
    """
    Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataNotApproved` from the provided `EoReader`.

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

    Returns:
        CharacterReplyServerPacket.ReplyCodeDataNotApproved: The data to serialize.
    """
    data: CharacterReplyServerPacket.ReplyCodeDataNotApproved = CharacterReplyServerPacket.ReplyCodeDataNotApproved()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        data._byte_size = reader.position - reader_start_position
        return data
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataOk

Data associated with reply_code value CharacterReply.Ok

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
class ReplyCodeDataOk:
    """
    Data associated with reply_code value CharacterReply.Ok
    """
    _byte_size: int = 0
    _characters_count: int = None # type: ignore [assignment]
    _characters: list[CharacterSelectionListEntry] = 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 characters(self) -> list[CharacterSelectionListEntry]:
        """
        Note:
          - Length must be 252 or less.
        """
        return self._characters

    @characters.setter
    def characters(self, characters: list[CharacterSelectionListEntry]) -> None:
        """
        Note:
          - Length must be 252 or less.
        """
        self._characters = characters
        self._characters_count = len(self._characters)

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterReplyServerPacket.ReplyCodeDataOk): The data to serialize.
        """
        if data._characters_count is None:
            raise SerializationError("characters_count must be provided.")
        writer.add_char(data._characters_count)
        writer.add_char(0)
        writer.add_byte(0xFF)
        if data._characters is None:
            raise SerializationError("characters must be provided.")
        if len(data._characters) > 252:
            raise SerializationError(f"Expected length of characters to be 252 or less, got {len(data._characters)}.")
        for i in range(data._characters_count):
            if i > 0:
                writer.add_byte(0xFF)
            CharacterSelectionListEntry.serialize(writer, data._characters[i])

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

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

        Returns:
            CharacterReplyServerPacket.ReplyCodeDataOk: The data to serialize.
        """
        data: CharacterReplyServerPacket.ReplyCodeDataOk = CharacterReplyServerPacket.ReplyCodeDataOk()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            data._characters_count = reader.get_char()
            reader.get_char()
            reader.next_chunk()
            data._characters = []
            for i in range(data._characters_count):
                data._characters.append(CharacterSelectionListEntry.deserialize(reader))
                if i + 1 < data._characters_count:
                    reader.next_chunk()
            data._byte_size = reader.position - reader_start_position
            return data
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterReplyServerPacket.ReplyCodeDataOk(byte_size={repr(self._byte_size)}, characters={repr(self._characters)})"

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.

characters: list[CharacterSelectionListEntry] property writable

Note
  • Length must be 252 or less.

serialize(writer, data) staticmethod

Serializes an instance of CharacterReplyServerPacket.ReplyCodeDataOk to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataOk

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
@staticmethod
def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataOk") -> None:
    """
    Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataOk` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterReplyServerPacket.ReplyCodeDataOk): The data to serialize.
    """
    if data._characters_count is None:
        raise SerializationError("characters_count must be provided.")
    writer.add_char(data._characters_count)
    writer.add_char(0)
    writer.add_byte(0xFF)
    if data._characters is None:
        raise SerializationError("characters must be provided.")
    if len(data._characters) > 252:
        raise SerializationError(f"Expected length of characters to be 252 or less, got {len(data._characters)}.")
    for i in range(data._characters_count):
        if i > 0:
            writer.add_byte(0xFF)
        CharacterSelectionListEntry.serialize(writer, data._characters[i])

deserialize(reader) staticmethod

Deserializes an instance of CharacterReplyServerPacket.ReplyCodeDataOk from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'CharacterReplyServerPacket.ReplyCodeDataOk'

CharacterReplyServerPacket.ReplyCodeDataOk: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
@staticmethod
def deserialize(reader: EoReader) -> "CharacterReplyServerPacket.ReplyCodeDataOk":
    """
    Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataOk` from the provided `EoReader`.

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

    Returns:
        CharacterReplyServerPacket.ReplyCodeDataOk: The data to serialize.
    """
    data: CharacterReplyServerPacket.ReplyCodeDataOk = CharacterReplyServerPacket.ReplyCodeDataOk()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        data._characters_count = reader.get_char()
        reader.get_char()
        reader.next_chunk()
        data._characters = []
        for i in range(data._characters_count):
            data._characters.append(CharacterSelectionListEntry.deserialize(reader))
            if i + 1 < data._characters_count:
                reader.next_chunk()
        data._byte_size = reader.position - reader_start_position
        return data
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataDeleted

Data associated with reply_code value CharacterReply.Deleted

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
class ReplyCodeDataDeleted:
    """
    Data associated with reply_code value CharacterReply.Deleted
    """
    _byte_size: int = 0
    _characters_count: int = None # type: ignore [assignment]
    _characters: list[CharacterSelectionListEntry] = 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 characters(self) -> list[CharacterSelectionListEntry]:
        """
        Note:
          - Length must be 252 or less.
        """
        return self._characters

    @characters.setter
    def characters(self, characters: list[CharacterSelectionListEntry]) -> None:
        """
        Note:
          - Length must be 252 or less.
        """
        self._characters = characters
        self._characters_count = len(self._characters)

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterReplyServerPacket.ReplyCodeDataDeleted): The data to serialize.
        """
        if data._characters_count is None:
            raise SerializationError("characters_count must be provided.")
        writer.add_char(data._characters_count)
        writer.add_byte(0xFF)
        if data._characters is None:
            raise SerializationError("characters must be provided.")
        if len(data._characters) > 252:
            raise SerializationError(f"Expected length of characters to be 252 or less, got {len(data._characters)}.")
        for i in range(data._characters_count):
            if i > 0:
                writer.add_byte(0xFF)
            CharacterSelectionListEntry.serialize(writer, data._characters[i])

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

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

        Returns:
            CharacterReplyServerPacket.ReplyCodeDataDeleted: The data to serialize.
        """
        data: CharacterReplyServerPacket.ReplyCodeDataDeleted = CharacterReplyServerPacket.ReplyCodeDataDeleted()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            data._characters_count = reader.get_char()
            reader.next_chunk()
            data._characters = []
            for i in range(data._characters_count):
                data._characters.append(CharacterSelectionListEntry.deserialize(reader))
                if i + 1 < data._characters_count:
                    reader.next_chunk()
            data._byte_size = reader.position - reader_start_position
            return data
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterReplyServerPacket.ReplyCodeDataDeleted(byte_size={repr(self._byte_size)}, characters={repr(self._characters)})"

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.

characters: list[CharacterSelectionListEntry] property writable

Note
  • Length must be 252 or less.

serialize(writer, data) staticmethod

Serializes an instance of CharacterReplyServerPacket.ReplyCodeDataDeleted to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataDeleted

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
@staticmethod
def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataDeleted") -> None:
    """
    Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataDeleted` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterReplyServerPacket.ReplyCodeDataDeleted): The data to serialize.
    """
    if data._characters_count is None:
        raise SerializationError("characters_count must be provided.")
    writer.add_char(data._characters_count)
    writer.add_byte(0xFF)
    if data._characters is None:
        raise SerializationError("characters must be provided.")
    if len(data._characters) > 252:
        raise SerializationError(f"Expected length of characters to be 252 or less, got {len(data._characters)}.")
    for i in range(data._characters_count):
        if i > 0:
            writer.add_byte(0xFF)
        CharacterSelectionListEntry.serialize(writer, data._characters[i])

deserialize(reader) staticmethod

Deserializes an instance of CharacterReplyServerPacket.ReplyCodeDataDeleted from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'CharacterReplyServerPacket.ReplyCodeDataDeleted'

CharacterReplyServerPacket.ReplyCodeDataDeleted: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
@staticmethod
def deserialize(reader: EoReader) -> "CharacterReplyServerPacket.ReplyCodeDataDeleted":
    """
    Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataDeleted` from the provided `EoReader`.

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

    Returns:
        CharacterReplyServerPacket.ReplyCodeDataDeleted: The data to serialize.
    """
    data: CharacterReplyServerPacket.ReplyCodeDataDeleted = CharacterReplyServerPacket.ReplyCodeDataDeleted()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        data._characters_count = reader.get_char()
        reader.next_chunk()
        data._characters = []
        for i in range(data._characters_count):
            data._characters.append(CharacterSelectionListEntry.deserialize(reader))
            if i + 1 < data._characters_count:
                reader.next_chunk()
        data._byte_size = reader.position - reader_start_position
        return data
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataDefault

Default data associated with reply_code

In this case (reply_code > 9), reply_code is a session ID for character creation

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
class ReplyCodeDataDefault:
    """
    Default data associated with reply_code

    In this case (reply_code &gt; 9), reply_code is a session ID for character creation
    """
    _byte_size: int = 0

    @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


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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterReplyServerPacket.ReplyCodeDataDefault): The data to serialize.
        """
        writer.add_string("OK")

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

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

        Returns:
            CharacterReplyServerPacket.ReplyCodeDataDefault: The data to serialize.
        """
        data: CharacterReplyServerPacket.ReplyCodeDataDefault = CharacterReplyServerPacket.ReplyCodeDataDefault()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            data._byte_size = reader.position - reader_start_position
            return data
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterReplyServerPacket.ReplyCodeDataDefault(byte_size={repr(self._byte_size)})"

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.

serialize(writer, data) staticmethod

Serializes an instance of CharacterReplyServerPacket.ReplyCodeDataDefault to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataDefault

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
599
600
601
602
603
604
605
606
607
608
@staticmethod
def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataDefault") -> None:
    """
    Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataDefault` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterReplyServerPacket.ReplyCodeDataDefault): The data to serialize.
    """
    writer.add_string("OK")

deserialize(reader) staticmethod

Deserializes an instance of CharacterReplyServerPacket.ReplyCodeDataDefault from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'CharacterReplyServerPacket.ReplyCodeDataDefault'

CharacterReplyServerPacket.ReplyCodeDataDefault: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
@staticmethod
def deserialize(reader: EoReader) -> "CharacterReplyServerPacket.ReplyCodeDataDefault":
    """
    Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataDefault` from the provided `EoReader`.

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

    Returns:
        CharacterReplyServerPacket.ReplyCodeDataDefault: The data to serialize.
    """
    data: CharacterReplyServerPacket.ReplyCodeDataDefault = CharacterReplyServerPacket.ReplyCodeDataDefault()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        data._byte_size = reader.position - reader_start_position
        return data
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

family() staticmethod

Returns the packet family associated with this packet.

Returns:

Name Type Description
PacketFamily PacketFamily

The packet family associated with this packet.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Character

action() staticmethod

Returns the packet action associated with this packet.

Returns:

Name Type Description
PacketAction PacketAction

The packet action associated with this packet.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
70
71
72
73
74
75
76
77
78
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Reply

write(writer)

Serializes and writes this packet to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

the writer that this packet will be written to.

required
Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
80
81
82
83
84
85
86
87
def write(self, writer):
    """
    Serializes and writes this packet to the provided EoWriter.

    Args:
        writer (EoWriter): the writer that this packet will be written to.
    """
    CharacterReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of CharacterReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CharacterReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "CharacterReplyServerPacket") -> None:
    """
    Serializes an instance of `CharacterReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterReplyServerPacket): The data to serialize.
    """
    if data._reply_code is None:
        raise SerializationError("reply_code must be provided.")
    writer.add_short(int(data._reply_code))
    if data._reply_code == 0:
        if data._reply_code_data is not None:
            raise SerializationError("Expected reply_code_data to be None for reply_code " + CharacterReply(data._reply_code).name + ".")
    elif data._reply_code == CharacterReply.Exists:
        if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataExists):
            raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataExists for reply_code " + CharacterReply(data._reply_code).name + ".")
        CharacterReplyServerPacket.ReplyCodeDataExists.serialize(writer, data._reply_code_data)
    elif data._reply_code == CharacterReply.Full:
        if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataFull):
            raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataFull for reply_code " + CharacterReply(data._reply_code).name + ".")
        CharacterReplyServerPacket.ReplyCodeDataFull.serialize(writer, data._reply_code_data)
    elif data._reply_code == CharacterReply.Full3:
        if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataFull3):
            raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataFull3 for reply_code " + CharacterReply(data._reply_code).name + ".")
        CharacterReplyServerPacket.ReplyCodeDataFull3.serialize(writer, data._reply_code_data)
    elif data._reply_code == CharacterReply.NotApproved:
        if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataNotApproved):
            raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataNotApproved for reply_code " + CharacterReply(data._reply_code).name + ".")
        CharacterReplyServerPacket.ReplyCodeDataNotApproved.serialize(writer, data._reply_code_data)
    elif data._reply_code == CharacterReply.Ok:
        if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataOk):
            raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataOk for reply_code " + CharacterReply(data._reply_code).name + ".")
        CharacterReplyServerPacket.ReplyCodeDataOk.serialize(writer, data._reply_code_data)
    elif data._reply_code == CharacterReply.Deleted:
        if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataDeleted):
            raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataDeleted for reply_code " + CharacterReply(data._reply_code).name + ".")
        CharacterReplyServerPacket.ReplyCodeDataDeleted.serialize(writer, data._reply_code_data)
    elif data._reply_code == 7:
        if data._reply_code_data is not None:
            raise SerializationError("Expected reply_code_data to be None for reply_code " + CharacterReply(data._reply_code).name + ".")
    elif data._reply_code == 8:
        if data._reply_code_data is not None:
            raise SerializationError("Expected reply_code_data to be None for reply_code " + CharacterReply(data._reply_code).name + ".")
    elif data._reply_code == 9:
        if data._reply_code_data is not None:
            raise SerializationError("Expected reply_code_data to be None for reply_code " + CharacterReply(data._reply_code).name + ".")
    else:
        if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataDefault):
            raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataDefault for reply_code " + CharacterReply(data._reply_code).name + ".")
        CharacterReplyServerPacket.ReplyCodeDataDefault.serialize(writer, data._reply_code_data)

deserialize(reader) staticmethod

Deserializes an instance of CharacterReplyServerPacket 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
CharacterReplyServerPacket 'CharacterReplyServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "CharacterReplyServerPacket":
    """
    Deserializes an instance of `CharacterReplyServerPacket` from the provided `EoReader`.

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

    Returns:
        CharacterReplyServerPacket: The data to serialize.
    """
    data: CharacterReplyServerPacket = CharacterReplyServerPacket()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        data._reply_code = CharacterReply(reader.get_short())
        if data._reply_code == 0:
            data._reply_code_data = None
        elif data._reply_code == CharacterReply.Exists:
            data._reply_code_data = CharacterReplyServerPacket.ReplyCodeDataExists.deserialize(reader)
        elif data._reply_code == CharacterReply.Full:
            data._reply_code_data = CharacterReplyServerPacket.ReplyCodeDataFull.deserialize(reader)
        elif data._reply_code == CharacterReply.Full3:
            data._reply_code_data = CharacterReplyServerPacket.ReplyCodeDataFull3.deserialize(reader)
        elif data._reply_code == CharacterReply.NotApproved:
            data._reply_code_data = CharacterReplyServerPacket.ReplyCodeDataNotApproved.deserialize(reader)
        elif data._reply_code == CharacterReply.Ok:
            data._reply_code_data = CharacterReplyServerPacket.ReplyCodeDataOk.deserialize(reader)
        elif data._reply_code == CharacterReply.Deleted:
            data._reply_code_data = CharacterReplyServerPacket.ReplyCodeDataDeleted.deserialize(reader)
        elif data._reply_code == 7:
            data._reply_code_data = None
        elif data._reply_code == 8:
            data._reply_code_data = None
        elif data._reply_code == 9:
            data._reply_code_data = None
        else:
            data._reply_code_data = CharacterReplyServerPacket.ReplyCodeDataDefault.deserialize(reader)
        reader.chunked_reading_mode = False
        data._byte_size = reader.position - reader_start_position
        return data
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode