Skip to content

account_reply_server_packet

AccountReplyServerPacket

Bases: Packet

Reply to client Account-family packets

Source code in src/eolib/protocol/_generated/net/server/account_reply_server_packet.py
 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
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
633
634
635
class AccountReplyServerPacket(Packet):
    """
    Reply to client Account-family packets
    """
    _byte_size: int = 0
    _reply_code: AccountReply
    _reply_code_data: 'AccountReplyServerPacket.ReplyCodeData'

    def __init__(self, *, reply_code: AccountReply, reply_code_data: 'AccountReplyServerPacket.ReplyCodeData' = None):
        """
        Create a new instance of AccountReplyServerPacket.

        Args:
            reply_code (AccountReply): Sometimes an AccountReply code, sometimes a session ID for account creation
            reply_code_data (AccountReplyServerPacket.ReplyCodeData): Data associated with the `reply_code` field.
        """
        self._reply_code = reply_code
        self._reply_code_data = reply_code_data

    @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) -> AccountReply:
        """
        Sometimes an AccountReply code, sometimes a session ID for account creation
        """
        return self._reply_code

    @property
    def reply_code_data(self) -> 'AccountReplyServerPacket.ReplyCodeData':
        """
        AccountReplyServerPacket.ReplyCodeData: Data associated with the `reply_code` field.
        """
        return self._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.Account

    @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.
        """
        AccountReplyServerPacket.serialize(writer, self)

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AccountReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            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 " + AccountReply(data._reply_code).name + ".")
            elif data._reply_code == AccountReply.Exists:
                if not isinstance(data._reply_code_data, AccountReplyServerPacket.ReplyCodeDataExists):
                    raise SerializationError("Expected reply_code_data to be type AccountReplyServerPacket.ReplyCodeDataExists for reply_code " + AccountReply(data._reply_code).name + ".")
                AccountReplyServerPacket.ReplyCodeDataExists.serialize(writer, data._reply_code_data)
            elif data._reply_code == AccountReply.NotApproved:
                if not isinstance(data._reply_code_data, AccountReplyServerPacket.ReplyCodeDataNotApproved):
                    raise SerializationError("Expected reply_code_data to be type AccountReplyServerPacket.ReplyCodeDataNotApproved for reply_code " + AccountReply(data._reply_code).name + ".")
                AccountReplyServerPacket.ReplyCodeDataNotApproved.serialize(writer, data._reply_code_data)
            elif data._reply_code == AccountReply.Created:
                if not isinstance(data._reply_code_data, AccountReplyServerPacket.ReplyCodeDataCreated):
                    raise SerializationError("Expected reply_code_data to be type AccountReplyServerPacket.ReplyCodeDataCreated for reply_code " + AccountReply(data._reply_code).name + ".")
                AccountReplyServerPacket.ReplyCodeDataCreated.serialize(writer, data._reply_code_data)
            elif data._reply_code == 4:
                if data._reply_code_data is not None:
                    raise SerializationError("Expected reply_code_data to be None for reply_code " + AccountReply(data._reply_code).name + ".")
            elif data._reply_code == AccountReply.ChangeFailed:
                if not isinstance(data._reply_code_data, AccountReplyServerPacket.ReplyCodeDataChangeFailed):
                    raise SerializationError("Expected reply_code_data to be type AccountReplyServerPacket.ReplyCodeDataChangeFailed for reply_code " + AccountReply(data._reply_code).name + ".")
                AccountReplyServerPacket.ReplyCodeDataChangeFailed.serialize(writer, data._reply_code_data)
            elif data._reply_code == AccountReply.Changed:
                if not isinstance(data._reply_code_data, AccountReplyServerPacket.ReplyCodeDataChanged):
                    raise SerializationError("Expected reply_code_data to be type AccountReplyServerPacket.ReplyCodeDataChanged for reply_code " + AccountReply(data._reply_code).name + ".")
                AccountReplyServerPacket.ReplyCodeDataChanged.serialize(writer, data._reply_code_data)
            elif data._reply_code == AccountReply.RequestDenied:
                if not isinstance(data._reply_code_data, AccountReplyServerPacket.ReplyCodeDataRequestDenied):
                    raise SerializationError("Expected reply_code_data to be type AccountReplyServerPacket.ReplyCodeDataRequestDenied for reply_code " + AccountReply(data._reply_code).name + ".")
                AccountReplyServerPacket.ReplyCodeDataRequestDenied.serialize(writer, data._reply_code_data)
            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 " + AccountReply(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 " + AccountReply(data._reply_code).name + ".")
            else:
                if not isinstance(data._reply_code_data, AccountReplyServerPacket.ReplyCodeDataDefault):
                    raise SerializationError("Expected reply_code_data to be type AccountReplyServerPacket.ReplyCodeDataDefault for reply_code " + AccountReply(data._reply_code).name + ".")
                AccountReplyServerPacket.ReplyCodeDataDefault.serialize(writer, data._reply_code_data)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            AccountReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reply_code = AccountReply(reader.get_short())
            reply_code_data: AccountReplyServerPacket.ReplyCodeData = None
            if reply_code == 0:
                reply_code_data = None
            elif reply_code == AccountReply.Exists:
                reply_code_data = AccountReplyServerPacket.ReplyCodeDataExists.deserialize(reader)
            elif reply_code == AccountReply.NotApproved:
                reply_code_data = AccountReplyServerPacket.ReplyCodeDataNotApproved.deserialize(reader)
            elif reply_code == AccountReply.Created:
                reply_code_data = AccountReplyServerPacket.ReplyCodeDataCreated.deserialize(reader)
            elif reply_code == 4:
                reply_code_data = None
            elif reply_code == AccountReply.ChangeFailed:
                reply_code_data = AccountReplyServerPacket.ReplyCodeDataChangeFailed.deserialize(reader)
            elif reply_code == AccountReply.Changed:
                reply_code_data = AccountReplyServerPacket.ReplyCodeDataChanged.deserialize(reader)
            elif reply_code == AccountReply.RequestDenied:
                reply_code_data = AccountReplyServerPacket.ReplyCodeDataRequestDenied.deserialize(reader)
            elif reply_code == 8:
                reply_code_data = None
            elif reply_code == 9:
                reply_code_data = None
            else:
                reply_code_data = AccountReplyServerPacket.ReplyCodeDataDefault.deserialize(reader)
            result = AccountReplyServerPacket(reply_code=reply_code, reply_code_data=reply_code_data)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

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

    ReplyCodeData = Union['AccountReplyServerPacket.ReplyCodeDataExists', 'AccountReplyServerPacket.ReplyCodeDataNotApproved', 'AccountReplyServerPacket.ReplyCodeDataCreated', 'AccountReplyServerPacket.ReplyCodeDataChangeFailed', 'AccountReplyServerPacket.ReplyCodeDataChanged', 'AccountReplyServerPacket.ReplyCodeDataRequestDenied', 'AccountReplyServerPacket.ReplyCodeDataDefault', None]
    """
    Data associated with different values of the `reply_code` field.
    """

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

        def __init__(self):
            """
            Create a new instance of AccountReplyServerPacket.ReplyCodeDataExists.
            """

        @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: "AccountReplyServerPacket.ReplyCodeDataExists") -> None:
            """
            Serializes an instance of `AccountReplyServerPacket.ReplyCodeDataExists` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (AccountReplyServerPacket.ReplyCodeDataExists): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                writer.add_string("NO")
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

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

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

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

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

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

        def __init__(self):
            """
            Create a new instance of AccountReplyServerPacket.ReplyCodeDataNotApproved.
            """

        @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: "AccountReplyServerPacket.ReplyCodeDataNotApproved") -> None:
            """
            Serializes an instance of `AccountReplyServerPacket.ReplyCodeDataNotApproved` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (AccountReplyServerPacket.ReplyCodeDataNotApproved): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                writer.add_string("NO")
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

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

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

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

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

    class ReplyCodeDataCreated:
        """
        Data associated with reply_code value AccountReply.Created
        """
        _byte_size: int = 0

        def __init__(self):
            """
            Create a new instance of AccountReplyServerPacket.ReplyCodeDataCreated.
            """

        @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: "AccountReplyServerPacket.ReplyCodeDataCreated") -> None:
            """
            Serializes an instance of `AccountReplyServerPacket.ReplyCodeDataCreated` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (AccountReplyServerPacket.ReplyCodeDataCreated): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                writer.add_string("GO")
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

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

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

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

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

    class ReplyCodeDataChangeFailed:
        """
        Data associated with reply_code value AccountReply.ChangeFailed
        """
        _byte_size: int = 0

        def __init__(self):
            """
            Create a new instance of AccountReplyServerPacket.ReplyCodeDataChangeFailed.
            """

        @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: "AccountReplyServerPacket.ReplyCodeDataChangeFailed") -> None:
            """
            Serializes an instance of `AccountReplyServerPacket.ReplyCodeDataChangeFailed` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (AccountReplyServerPacket.ReplyCodeDataChangeFailed): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                writer.add_string("NO")
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

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

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

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

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

    class ReplyCodeDataChanged:
        """
        Data associated with reply_code value AccountReply.Changed
        """
        _byte_size: int = 0

        def __init__(self):
            """
            Create a new instance of AccountReplyServerPacket.ReplyCodeDataChanged.
            """

        @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: "AccountReplyServerPacket.ReplyCodeDataChanged") -> None:
            """
            Serializes an instance of `AccountReplyServerPacket.ReplyCodeDataChanged` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (AccountReplyServerPacket.ReplyCodeDataChanged): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                writer.add_string("OK")
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

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

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

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

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

    class ReplyCodeDataRequestDenied:
        """
        Data associated with reply_code value AccountReply.RequestDenied
        """
        _byte_size: int = 0

        def __init__(self):
            """
            Create a new instance of AccountReplyServerPacket.ReplyCodeDataRequestDenied.
            """

        @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: "AccountReplyServerPacket.ReplyCodeDataRequestDenied") -> None:
            """
            Serializes an instance of `AccountReplyServerPacket.ReplyCodeDataRequestDenied` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (AccountReplyServerPacket.ReplyCodeDataRequestDenied): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                writer.add_string("NO")
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

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

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

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

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

    class ReplyCodeDataDefault:
        """
        Default data associated with reply_code

        In this case (reply_code > 9), reply_code is a session ID for account creation
        """
        _byte_size: int = 0
        _sequence_start: int

        def __init__(self, *, sequence_start: int):
            """
            Create a new instance of AccountReplyServerPacket.ReplyCodeDataDefault.

            Args:
                sequence_start (int): (Value range is 0-252.)
            """
            self._sequence_start = sequence_start

        @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 sequence_start(self) -> int:
            return self._sequence_start

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

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (AccountReplyServerPacket.ReplyCodeDataDefault): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._sequence_start is None:
                    raise SerializationError("sequence_start must be provided.")
                writer.add_char(data._sequence_start)
                writer.add_string("OK")
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

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

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

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

        def __repr__(self):
            return f"AccountReplyServerPacket.ReplyCodeDataDefault(byte_size={repr(self._byte_size)}, sequence_start={repr(self._sequence_start)})"

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: AccountReply property

Sometimes an AccountReply code, sometimes a session ID for account creation

reply_code_data: AccountReplyServerPacket.ReplyCodeData property

AccountReplyServerPacket.ReplyCodeData: Data associated with the reply_code field.

ReplyCodeData = Union['AccountReplyServerPacket.ReplyCodeDataExists', 'AccountReplyServerPacket.ReplyCodeDataNotApproved', 'AccountReplyServerPacket.ReplyCodeDataCreated', 'AccountReplyServerPacket.ReplyCodeDataChangeFailed', 'AccountReplyServerPacket.ReplyCodeDataChanged', 'AccountReplyServerPacket.ReplyCodeDataRequestDenied', 'AccountReplyServerPacket.ReplyCodeDataDefault', None] class-attribute instance-attribute

Data associated with different values of the reply_code field.

ReplyCodeDataExists

Data associated with reply_code value AccountReply.Exists

Source code in src/eolib/protocol/_generated/net/server/account_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
247
248
249
250
251
252
253
254
255
class ReplyCodeDataExists:
    """
    Data associated with reply_code value AccountReply.Exists
    """
    _byte_size: int = 0

    def __init__(self):
        """
        Create a new instance of AccountReplyServerPacket.ReplyCodeDataExists.
        """

    @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: "AccountReplyServerPacket.ReplyCodeDataExists") -> None:
        """
        Serializes an instance of `AccountReplyServerPacket.ReplyCodeDataExists` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AccountReplyServerPacket.ReplyCodeDataExists): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.add_string("NO")
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

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

    def __repr__(self):
        return f"AccountReplyServerPacket.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.

__init__()

Create a new instance of AccountReplyServerPacket.ReplyCodeDataExists.

Source code in src/eolib/protocol/_generated/net/server/account_reply_server_packet.py
202
203
204
205
def __init__(self):
    """
    Create a new instance of AccountReplyServerPacket.ReplyCodeDataExists.
    """

serialize(writer, data) staticmethod

Serializes an instance of AccountReplyServerPacket.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/account_reply_server_packet.py
218
219
220
221
222
223
224
225
226
227
228
229
230
231
@staticmethod
def serialize(writer: EoWriter, data: "AccountReplyServerPacket.ReplyCodeDataExists") -> None:
    """
    Serializes an instance of `AccountReplyServerPacket.ReplyCodeDataExists` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AccountReplyServerPacket.ReplyCodeDataExists): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.add_string("NO")
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AccountReplyServerPacket.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
ReplyCodeDataExists

AccountReplyServerPacket.ReplyCodeDataExists: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/account_reply_server_packet.py
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
@staticmethod
def deserialize(reader: EoReader) -> "AccountReplyServerPacket.ReplyCodeDataExists":
    """
    Deserializes an instance of `AccountReplyServerPacket.ReplyCodeDataExists` from the provided `EoReader`.

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

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

ReplyCodeDataNotApproved

Data associated with reply_code value AccountReply.NotApproved

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

    def __init__(self):
        """
        Create a new instance of AccountReplyServerPacket.ReplyCodeDataNotApproved.
        """

    @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: "AccountReplyServerPacket.ReplyCodeDataNotApproved") -> None:
        """
        Serializes an instance of `AccountReplyServerPacket.ReplyCodeDataNotApproved` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AccountReplyServerPacket.ReplyCodeDataNotApproved): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.add_string("NO")
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

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

    def __repr__(self):
        return f"AccountReplyServerPacket.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.

__init__()

Create a new instance of AccountReplyServerPacket.ReplyCodeDataNotApproved.

Source code in src/eolib/protocol/_generated/net/server/account_reply_server_packet.py
263
264
265
266
def __init__(self):
    """
    Create a new instance of AccountReplyServerPacket.ReplyCodeDataNotApproved.
    """

serialize(writer, data) staticmethod

Serializes an instance of AccountReplyServerPacket.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/account_reply_server_packet.py
279
280
281
282
283
284
285
286
287
288
289
290
291
292
@staticmethod
def serialize(writer: EoWriter, data: "AccountReplyServerPacket.ReplyCodeDataNotApproved") -> None:
    """
    Serializes an instance of `AccountReplyServerPacket.ReplyCodeDataNotApproved` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AccountReplyServerPacket.ReplyCodeDataNotApproved): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.add_string("NO")
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AccountReplyServerPacket.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
ReplyCodeDataNotApproved

AccountReplyServerPacket.ReplyCodeDataNotApproved: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/account_reply_server_packet.py
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
@staticmethod
def deserialize(reader: EoReader) -> "AccountReplyServerPacket.ReplyCodeDataNotApproved":
    """
    Deserializes an instance of `AccountReplyServerPacket.ReplyCodeDataNotApproved` from the provided `EoReader`.

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

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

ReplyCodeDataCreated

Data associated with reply_code value AccountReply.Created

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

    def __init__(self):
        """
        Create a new instance of AccountReplyServerPacket.ReplyCodeDataCreated.
        """

    @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: "AccountReplyServerPacket.ReplyCodeDataCreated") -> None:
        """
        Serializes an instance of `AccountReplyServerPacket.ReplyCodeDataCreated` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AccountReplyServerPacket.ReplyCodeDataCreated): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.add_string("GO")
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

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

    def __repr__(self):
        return f"AccountReplyServerPacket.ReplyCodeDataCreated(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.

__init__()

Create a new instance of AccountReplyServerPacket.ReplyCodeDataCreated.

Source code in src/eolib/protocol/_generated/net/server/account_reply_server_packet.py
324
325
326
327
def __init__(self):
    """
    Create a new instance of AccountReplyServerPacket.ReplyCodeDataCreated.
    """

serialize(writer, data) staticmethod

Serializes an instance of AccountReplyServerPacket.ReplyCodeDataCreated to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataCreated

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/account_reply_server_packet.py
340
341
342
343
344
345
346
347
348
349
350
351
352
353
@staticmethod
def serialize(writer: EoWriter, data: "AccountReplyServerPacket.ReplyCodeDataCreated") -> None:
    """
    Serializes an instance of `AccountReplyServerPacket.ReplyCodeDataCreated` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AccountReplyServerPacket.ReplyCodeDataCreated): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.add_string("GO")
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AccountReplyServerPacket.ReplyCodeDataCreated from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataCreated

AccountReplyServerPacket.ReplyCodeDataCreated: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/account_reply_server_packet.py
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
@staticmethod
def deserialize(reader: EoReader) -> "AccountReplyServerPacket.ReplyCodeDataCreated":
    """
    Deserializes an instance of `AccountReplyServerPacket.ReplyCodeDataCreated` from the provided `EoReader`.

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

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

ReplyCodeDataChangeFailed

Data associated with reply_code value AccountReply.ChangeFailed

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

    def __init__(self):
        """
        Create a new instance of AccountReplyServerPacket.ReplyCodeDataChangeFailed.
        """

    @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: "AccountReplyServerPacket.ReplyCodeDataChangeFailed") -> None:
        """
        Serializes an instance of `AccountReplyServerPacket.ReplyCodeDataChangeFailed` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AccountReplyServerPacket.ReplyCodeDataChangeFailed): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.add_string("NO")
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

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

    def __repr__(self):
        return f"AccountReplyServerPacket.ReplyCodeDataChangeFailed(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.

__init__()

Create a new instance of AccountReplyServerPacket.ReplyCodeDataChangeFailed.

Source code in src/eolib/protocol/_generated/net/server/account_reply_server_packet.py
385
386
387
388
def __init__(self):
    """
    Create a new instance of AccountReplyServerPacket.ReplyCodeDataChangeFailed.
    """

serialize(writer, data) staticmethod

Serializes an instance of AccountReplyServerPacket.ReplyCodeDataChangeFailed to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataChangeFailed

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/account_reply_server_packet.py
401
402
403
404
405
406
407
408
409
410
411
412
413
414
@staticmethod
def serialize(writer: EoWriter, data: "AccountReplyServerPacket.ReplyCodeDataChangeFailed") -> None:
    """
    Serializes an instance of `AccountReplyServerPacket.ReplyCodeDataChangeFailed` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AccountReplyServerPacket.ReplyCodeDataChangeFailed): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.add_string("NO")
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AccountReplyServerPacket.ReplyCodeDataChangeFailed from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataChangeFailed

AccountReplyServerPacket.ReplyCodeDataChangeFailed: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/account_reply_server_packet.py
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
@staticmethod
def deserialize(reader: EoReader) -> "AccountReplyServerPacket.ReplyCodeDataChangeFailed":
    """
    Deserializes an instance of `AccountReplyServerPacket.ReplyCodeDataChangeFailed` from the provided `EoReader`.

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

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

ReplyCodeDataChanged

Data associated with reply_code value AccountReply.Changed

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

    def __init__(self):
        """
        Create a new instance of AccountReplyServerPacket.ReplyCodeDataChanged.
        """

    @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: "AccountReplyServerPacket.ReplyCodeDataChanged") -> None:
        """
        Serializes an instance of `AccountReplyServerPacket.ReplyCodeDataChanged` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AccountReplyServerPacket.ReplyCodeDataChanged): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.add_string("OK")
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

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

    def __repr__(self):
        return f"AccountReplyServerPacket.ReplyCodeDataChanged(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.

__init__()

Create a new instance of AccountReplyServerPacket.ReplyCodeDataChanged.

Source code in src/eolib/protocol/_generated/net/server/account_reply_server_packet.py
446
447
448
449
def __init__(self):
    """
    Create a new instance of AccountReplyServerPacket.ReplyCodeDataChanged.
    """

serialize(writer, data) staticmethod

Serializes an instance of AccountReplyServerPacket.ReplyCodeDataChanged to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataChanged

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/account_reply_server_packet.py
462
463
464
465
466
467
468
469
470
471
472
473
474
475
@staticmethod
def serialize(writer: EoWriter, data: "AccountReplyServerPacket.ReplyCodeDataChanged") -> None:
    """
    Serializes an instance of `AccountReplyServerPacket.ReplyCodeDataChanged` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AccountReplyServerPacket.ReplyCodeDataChanged): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.add_string("OK")
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AccountReplyServerPacket.ReplyCodeDataChanged from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataChanged

AccountReplyServerPacket.ReplyCodeDataChanged: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/account_reply_server_packet.py
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
@staticmethod
def deserialize(reader: EoReader) -> "AccountReplyServerPacket.ReplyCodeDataChanged":
    """
    Deserializes an instance of `AccountReplyServerPacket.ReplyCodeDataChanged` from the provided `EoReader`.

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

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

ReplyCodeDataRequestDenied

Data associated with reply_code value AccountReply.RequestDenied

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

    def __init__(self):
        """
        Create a new instance of AccountReplyServerPacket.ReplyCodeDataRequestDenied.
        """

    @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: "AccountReplyServerPacket.ReplyCodeDataRequestDenied") -> None:
        """
        Serializes an instance of `AccountReplyServerPacket.ReplyCodeDataRequestDenied` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AccountReplyServerPacket.ReplyCodeDataRequestDenied): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.add_string("NO")
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

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

    def __repr__(self):
        return f"AccountReplyServerPacket.ReplyCodeDataRequestDenied(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.

__init__()

Create a new instance of AccountReplyServerPacket.ReplyCodeDataRequestDenied.

Source code in src/eolib/protocol/_generated/net/server/account_reply_server_packet.py
507
508
509
510
def __init__(self):
    """
    Create a new instance of AccountReplyServerPacket.ReplyCodeDataRequestDenied.
    """

serialize(writer, data) staticmethod

Serializes an instance of AccountReplyServerPacket.ReplyCodeDataRequestDenied to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataRequestDenied

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/account_reply_server_packet.py
523
524
525
526
527
528
529
530
531
532
533
534
535
536
@staticmethod
def serialize(writer: EoWriter, data: "AccountReplyServerPacket.ReplyCodeDataRequestDenied") -> None:
    """
    Serializes an instance of `AccountReplyServerPacket.ReplyCodeDataRequestDenied` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AccountReplyServerPacket.ReplyCodeDataRequestDenied): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.add_string("NO")
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AccountReplyServerPacket.ReplyCodeDataRequestDenied from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataRequestDenied

AccountReplyServerPacket.ReplyCodeDataRequestDenied: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/account_reply_server_packet.py
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
@staticmethod
def deserialize(reader: EoReader) -> "AccountReplyServerPacket.ReplyCodeDataRequestDenied":
    """
    Deserializes an instance of `AccountReplyServerPacket.ReplyCodeDataRequestDenied` from the provided `EoReader`.

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

    Returns:
        AccountReplyServerPacket.ReplyCodeDataRequestDenied: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        result = AccountReplyServerPacket.ReplyCodeDataRequestDenied()
        result._byte_size = reader.position - reader_start_position
        return result
    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 account creation

Source code in src/eolib/protocol/_generated/net/server/account_reply_server_packet.py
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
633
634
635
class ReplyCodeDataDefault:
    """
    Default data associated with reply_code

    In this case (reply_code > 9), reply_code is a session ID for account creation
    """
    _byte_size: int = 0
    _sequence_start: int

    def __init__(self, *, sequence_start: int):
        """
        Create a new instance of AccountReplyServerPacket.ReplyCodeDataDefault.

        Args:
            sequence_start (int): (Value range is 0-252.)
        """
        self._sequence_start = sequence_start

    @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 sequence_start(self) -> int:
        return self._sequence_start

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AccountReplyServerPacket.ReplyCodeDataDefault): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._sequence_start is None:
                raise SerializationError("sequence_start must be provided.")
            writer.add_char(data._sequence_start)
            writer.add_string("OK")
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

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

    def __repr__(self):
        return f"AccountReplyServerPacket.ReplyCodeDataDefault(byte_size={repr(self._byte_size)}, sequence_start={repr(self._sequence_start)})"

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.

sequence_start: int property

__init__(*, sequence_start)

Create a new instance of AccountReplyServerPacket.ReplyCodeDataDefault.

Parameters:

Name Type Description Default
sequence_start int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/account_reply_server_packet.py
571
572
573
574
575
576
577
578
def __init__(self, *, sequence_start: int):
    """
    Create a new instance of AccountReplyServerPacket.ReplyCodeDataDefault.

    Args:
        sequence_start (int): (Value range is 0-252.)
    """
    self._sequence_start = sequence_start

serialize(writer, data) staticmethod

Serializes an instance of AccountReplyServerPacket.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/account_reply_server_packet.py
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
@staticmethod
def serialize(writer: EoWriter, data: "AccountReplyServerPacket.ReplyCodeDataDefault") -> None:
    """
    Serializes an instance of `AccountReplyServerPacket.ReplyCodeDataDefault` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AccountReplyServerPacket.ReplyCodeDataDefault): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._sequence_start is None:
            raise SerializationError("sequence_start must be provided.")
        writer.add_char(data._sequence_start)
        writer.add_string("OK")
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AccountReplyServerPacket.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
ReplyCodeDataDefault

AccountReplyServerPacket.ReplyCodeDataDefault: The data to serialize.

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

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

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

__init__(*, reply_code, reply_code_data=None)

Create a new instance of AccountReplyServerPacket.

Parameters:

Name Type Description Default
reply_code AccountReply

Sometimes an AccountReply code, sometimes a session ID for account creation

required
reply_code_data ReplyCodeData

Data associated with the reply_code field.

None
Source code in src/eolib/protocol/_generated/net/server/account_reply_server_packet.py
23
24
25
26
27
28
29
30
31
32
def __init__(self, *, reply_code: AccountReply, reply_code_data: 'AccountReplyServerPacket.ReplyCodeData' = None):
    """
    Create a new instance of AccountReplyServerPacket.

    Args:
        reply_code (AccountReply): Sometimes an AccountReply code, sometimes a session ID for account creation
        reply_code_data (AccountReplyServerPacket.ReplyCodeData): Data associated with the `reply_code` field.
    """
    self._reply_code = reply_code
    self._reply_code_data = reply_code_data

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/account_reply_server_packet.py
58
59
60
61
62
63
64
65
66
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/account_reply_server_packet.py
68
69
70
71
72
73
74
75
76
@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/account_reply_server_packet.py
78
79
80
81
82
83
84
85
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.
    """
    AccountReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of AccountReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data AccountReplyServerPacket

The data to serialize.

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

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AccountReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        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 " + AccountReply(data._reply_code).name + ".")
        elif data._reply_code == AccountReply.Exists:
            if not isinstance(data._reply_code_data, AccountReplyServerPacket.ReplyCodeDataExists):
                raise SerializationError("Expected reply_code_data to be type AccountReplyServerPacket.ReplyCodeDataExists for reply_code " + AccountReply(data._reply_code).name + ".")
            AccountReplyServerPacket.ReplyCodeDataExists.serialize(writer, data._reply_code_data)
        elif data._reply_code == AccountReply.NotApproved:
            if not isinstance(data._reply_code_data, AccountReplyServerPacket.ReplyCodeDataNotApproved):
                raise SerializationError("Expected reply_code_data to be type AccountReplyServerPacket.ReplyCodeDataNotApproved for reply_code " + AccountReply(data._reply_code).name + ".")
            AccountReplyServerPacket.ReplyCodeDataNotApproved.serialize(writer, data._reply_code_data)
        elif data._reply_code == AccountReply.Created:
            if not isinstance(data._reply_code_data, AccountReplyServerPacket.ReplyCodeDataCreated):
                raise SerializationError("Expected reply_code_data to be type AccountReplyServerPacket.ReplyCodeDataCreated for reply_code " + AccountReply(data._reply_code).name + ".")
            AccountReplyServerPacket.ReplyCodeDataCreated.serialize(writer, data._reply_code_data)
        elif data._reply_code == 4:
            if data._reply_code_data is not None:
                raise SerializationError("Expected reply_code_data to be None for reply_code " + AccountReply(data._reply_code).name + ".")
        elif data._reply_code == AccountReply.ChangeFailed:
            if not isinstance(data._reply_code_data, AccountReplyServerPacket.ReplyCodeDataChangeFailed):
                raise SerializationError("Expected reply_code_data to be type AccountReplyServerPacket.ReplyCodeDataChangeFailed for reply_code " + AccountReply(data._reply_code).name + ".")
            AccountReplyServerPacket.ReplyCodeDataChangeFailed.serialize(writer, data._reply_code_data)
        elif data._reply_code == AccountReply.Changed:
            if not isinstance(data._reply_code_data, AccountReplyServerPacket.ReplyCodeDataChanged):
                raise SerializationError("Expected reply_code_data to be type AccountReplyServerPacket.ReplyCodeDataChanged for reply_code " + AccountReply(data._reply_code).name + ".")
            AccountReplyServerPacket.ReplyCodeDataChanged.serialize(writer, data._reply_code_data)
        elif data._reply_code == AccountReply.RequestDenied:
            if not isinstance(data._reply_code_data, AccountReplyServerPacket.ReplyCodeDataRequestDenied):
                raise SerializationError("Expected reply_code_data to be type AccountReplyServerPacket.ReplyCodeDataRequestDenied for reply_code " + AccountReply(data._reply_code).name + ".")
            AccountReplyServerPacket.ReplyCodeDataRequestDenied.serialize(writer, data._reply_code_data)
        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 " + AccountReply(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 " + AccountReply(data._reply_code).name + ".")
        else:
            if not isinstance(data._reply_code_data, AccountReplyServerPacket.ReplyCodeDataDefault):
                raise SerializationError("Expected reply_code_data to be type AccountReplyServerPacket.ReplyCodeDataDefault for reply_code " + AccountReply(data._reply_code).name + ".")
            AccountReplyServerPacket.ReplyCodeDataDefault.serialize(writer, data._reply_code_data)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

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

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

    Returns:
        AccountReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reply_code = AccountReply(reader.get_short())
        reply_code_data: AccountReplyServerPacket.ReplyCodeData = None
        if reply_code == 0:
            reply_code_data = None
        elif reply_code == AccountReply.Exists:
            reply_code_data = AccountReplyServerPacket.ReplyCodeDataExists.deserialize(reader)
        elif reply_code == AccountReply.NotApproved:
            reply_code_data = AccountReplyServerPacket.ReplyCodeDataNotApproved.deserialize(reader)
        elif reply_code == AccountReply.Created:
            reply_code_data = AccountReplyServerPacket.ReplyCodeDataCreated.deserialize(reader)
        elif reply_code == 4:
            reply_code_data = None
        elif reply_code == AccountReply.ChangeFailed:
            reply_code_data = AccountReplyServerPacket.ReplyCodeDataChangeFailed.deserialize(reader)
        elif reply_code == AccountReply.Changed:
            reply_code_data = AccountReplyServerPacket.ReplyCodeDataChanged.deserialize(reader)
        elif reply_code == AccountReply.RequestDenied:
            reply_code_data = AccountReplyServerPacket.ReplyCodeDataRequestDenied.deserialize(reader)
        elif reply_code == 8:
            reply_code_data = None
        elif reply_code == 9:
            reply_code_data = None
        else:
            reply_code_data = AccountReplyServerPacket.ReplyCodeDataDefault.deserialize(reader)
        result = AccountReplyServerPacket(reply_code=reply_code, reply_code_data=reply_code_data)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode