Skip to content

welcome_reply_server_packet

WelcomeReplyServerPacket

Bases: Packet

Reply to selecting a character / entering game

Source code in src/eolib/protocol/_generated/net/server/welcome_reply_server_packet.py
 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
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
class WelcomeReplyServerPacket(Packet):
    """
    Reply to selecting a character / entering game
    """
    _byte_size: int = 0
    _welcome_code: WelcomeCode = None # type: ignore [assignment]
    _welcome_code_data: 'WelcomeReplyServerPacket.WelcomeCodeData' = 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 welcome_code(self) -> WelcomeCode:
        return self._welcome_code

    @welcome_code.setter
    def welcome_code(self, welcome_code: WelcomeCode) -> None:
        self._welcome_code = welcome_code

    @property
    def welcome_code_data(self) -> 'WelcomeReplyServerPacket.WelcomeCodeData':
        """
        WelcomeReplyServerPacket.WelcomeCodeData: Gets or sets the data associated with the `welcome_code` field.
        """
        return self._welcome_code_data

    @welcome_code_data.setter
    def welcome_code_data(self, welcome_code_data: 'WelcomeReplyServerPacket.WelcomeCodeData') -> None:
        self._welcome_code_data = welcome_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.Welcome

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (WelcomeReplyServerPacket): The data to serialize.
        """
        if data._welcome_code is None:
            raise SerializationError("welcome_code must be provided.")
        writer.add_short(int(data._welcome_code))
        if data._welcome_code == WelcomeCode.SelectCharacter:
            if not isinstance(data._welcome_code_data, WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter):
                raise SerializationError("Expected welcome_code_data to be type WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter for welcome_code " + WelcomeCode(data._welcome_code).name + ".")
            WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter.serialize(writer, data._welcome_code_data)
        elif data._welcome_code == WelcomeCode.EnterGame:
            if not isinstance(data._welcome_code_data, WelcomeReplyServerPacket.WelcomeCodeDataEnterGame):
                raise SerializationError("Expected welcome_code_data to be type WelcomeReplyServerPacket.WelcomeCodeDataEnterGame for welcome_code " + WelcomeCode(data._welcome_code).name + ".")
            WelcomeReplyServerPacket.WelcomeCodeDataEnterGame.serialize(writer, data._welcome_code_data)

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

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

        Returns:
            WelcomeReplyServerPacket: The data to serialize.
        """
        data: WelcomeReplyServerPacket = WelcomeReplyServerPacket()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            data._welcome_code = WelcomeCode(reader.get_short())
            reader.chunked_reading_mode = True
            if data._welcome_code == WelcomeCode.SelectCharacter:
                data._welcome_code_data = WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter.deserialize(reader)
            elif data._welcome_code == WelcomeCode.EnterGame:
                data._welcome_code_data = WelcomeReplyServerPacket.WelcomeCodeDataEnterGame.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"WelcomeReplyServerPacket(byte_size={repr(self._byte_size)}, welcome_code={repr(self._welcome_code)}, welcome_code_data={repr(self._welcome_code_data)})"

    WelcomeCodeData = Union['WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter', 'WelcomeReplyServerPacket.WelcomeCodeDataEnterGame', None]
    WelcomeCodeData.__doc__ = \
        """
        Data associated with different values of the `welcome_code` field.
        """

    class WelcomeCodeDataSelectCharacter:
        """
        Data associated with welcome_code value WelcomeCode.SelectCharacter
        """
        _byte_size: int = 0
        _session_id: int = None # type: ignore [assignment]
        _character_id: int = None # type: ignore [assignment]
        _map_id: int = None # type: ignore [assignment]
        _map_rid: list[int] = None # type: ignore [assignment]
        _map_file_size: int = None # type: ignore [assignment]
        _eif_rid: list[int] = None # type: ignore [assignment]
        _eif_length: int = None # type: ignore [assignment]
        _enf_rid: list[int] = None # type: ignore [assignment]
        _enf_length: int = None # type: ignore [assignment]
        _esf_rid: list[int] = None # type: ignore [assignment]
        _esf_length: int = None # type: ignore [assignment]
        _ecf_rid: list[int] = None # type: ignore [assignment]
        _ecf_length: int = None # type: ignore [assignment]
        _name: str = None # type: ignore [assignment]
        _title: str = None # type: ignore [assignment]
        _guild_name: str = None # type: ignore [assignment]
        _guild_rank_name: str = None # type: ignore [assignment]
        _class_id: int = None # type: ignore [assignment]
        _guild_tag: str = None # type: ignore [assignment]
        _admin: AdminLevel = None # type: ignore [assignment]
        _level: int = None # type: ignore [assignment]
        _experience: int = None # type: ignore [assignment]
        _usage: int = None # type: ignore [assignment]
        _stats: CharacterStatsWelcome = None # type: ignore [assignment]
        _equipment: EquipmentWelcome = None # type: ignore [assignment]
        _guild_rank: int = None # type: ignore [assignment]
        _settings: ServerSettings = None # type: ignore [assignment]
        _login_message_code: LoginMessageCode = 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 session_id(self) -> int:
            """
            Note:
              - Value range is 0-64008.
            """
            return self._session_id

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

        @property
        def character_id(self) -> int:
            """
            Note:
              - Value range is 0-4097152080.
            """
            return self._character_id

        @character_id.setter
        def character_id(self, character_id: int) -> None:
            """
            Note:
              - Value range is 0-4097152080.
            """
            self._character_id = character_id

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

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

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

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

        @property
        def map_file_size(self) -> int:
            """
            Note:
              - Value range is 0-16194276.
            """
            return self._map_file_size

        @map_file_size.setter
        def map_file_size(self, map_file_size: int) -> None:
            """
            Note:
              - Value range is 0-16194276.
            """
            self._map_file_size = map_file_size

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        @property
        def name(self) -> str:
            return self._name

        @name.setter
        def name(self, name: str) -> None:
            self._name = name

        @property
        def title(self) -> str:
            return self._title

        @title.setter
        def title(self, title: str) -> None:
            self._title = title

        @property
        def guild_name(self) -> str:
            return self._guild_name

        @guild_name.setter
        def guild_name(self, guild_name: str) -> None:
            self._guild_name = guild_name

        @property
        def guild_rank_name(self) -> str:
            return self._guild_rank_name

        @guild_rank_name.setter
        def guild_rank_name(self, guild_rank_name: str) -> None:
            self._guild_rank_name = guild_rank_name

        @property
        def class_id(self) -> int:
            """
            Note:
              - Value range is 0-252.
            """
            return self._class_id

        @class_id.setter
        def class_id(self, class_id: int) -> None:
            """
            Note:
              - Value range is 0-252.
            """
            self._class_id = class_id

        @property
        def guild_tag(self) -> str:
            """
            Note:
              - Length must be `3`.
            """
            return self._guild_tag

        @guild_tag.setter
        def guild_tag(self, guild_tag: str) -> None:
            """
            Note:
              - Length must be `3`.
            """
            self._guild_tag = guild_tag

        @property
        def admin(self) -> AdminLevel:
            return self._admin

        @admin.setter
        def admin(self, admin: AdminLevel) -> None:
            self._admin = admin

        @property
        def level(self) -> int:
            """
            Note:
              - Value range is 0-252.
            """
            return self._level

        @level.setter
        def level(self, level: int) -> None:
            """
            Note:
              - Value range is 0-252.
            """
            self._level = level

        @property
        def experience(self) -> int:
            """
            Note:
              - Value range is 0-4097152080.
            """
            return self._experience

        @experience.setter
        def experience(self, experience: int) -> None:
            """
            Note:
              - Value range is 0-4097152080.
            """
            self._experience = experience

        @property
        def usage(self) -> int:
            """
            Note:
              - Value range is 0-4097152080.
            """
            return self._usage

        @usage.setter
        def usage(self, usage: int) -> None:
            """
            Note:
              - Value range is 0-4097152080.
            """
            self._usage = usage

        @property
        def stats(self) -> CharacterStatsWelcome:
            return self._stats

        @stats.setter
        def stats(self, stats: CharacterStatsWelcome) -> None:
            self._stats = stats

        @property
        def equipment(self) -> EquipmentWelcome:
            return self._equipment

        @equipment.setter
        def equipment(self, equipment: EquipmentWelcome) -> None:
            self._equipment = equipment

        @property
        def guild_rank(self) -> int:
            """
            Note:
              - Value range is 0-252.
            """
            return self._guild_rank

        @guild_rank.setter
        def guild_rank(self, guild_rank: int) -> None:
            """
            Note:
              - Value range is 0-252.
            """
            self._guild_rank = guild_rank

        @property
        def settings(self) -> ServerSettings:
            return self._settings

        @settings.setter
        def settings(self, settings: ServerSettings) -> None:
            self._settings = settings

        @property
        def login_message_code(self) -> LoginMessageCode:
            return self._login_message_code

        @login_message_code.setter
        def login_message_code(self, login_message_code: LoginMessageCode) -> None:
            self._login_message_code = login_message_code

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

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter): The data to serialize.
            """
            if data._session_id is None:
                raise SerializationError("session_id must be provided.")
            writer.add_short(data._session_id)
            if data._character_id is None:
                raise SerializationError("character_id must be provided.")
            writer.add_int(data._character_id)
            if data._map_id is None:
                raise SerializationError("map_id must be provided.")
            writer.add_short(data._map_id)
            if data._map_rid is None:
                raise SerializationError("map_rid must be provided.")
            if len(data._map_rid) != 2:
                raise SerializationError(f"Expected length of map_rid to be exactly 2, got {len(data._map_rid)}.")
            for i in range(2):
                writer.add_short(data._map_rid[i])
            if data._map_file_size is None:
                raise SerializationError("map_file_size must be provided.")
            writer.add_three(data._map_file_size)
            if data._eif_rid is None:
                raise SerializationError("eif_rid must be provided.")
            if len(data._eif_rid) != 2:
                raise SerializationError(f"Expected length of eif_rid to be exactly 2, got {len(data._eif_rid)}.")
            for i in range(2):
                writer.add_short(data._eif_rid[i])
            if data._eif_length is None:
                raise SerializationError("eif_length must be provided.")
            writer.add_short(data._eif_length)
            if data._enf_rid is None:
                raise SerializationError("enf_rid must be provided.")
            if len(data._enf_rid) != 2:
                raise SerializationError(f"Expected length of enf_rid to be exactly 2, got {len(data._enf_rid)}.")
            for i in range(2):
                writer.add_short(data._enf_rid[i])
            if data._enf_length is None:
                raise SerializationError("enf_length must be provided.")
            writer.add_short(data._enf_length)
            if data._esf_rid is None:
                raise SerializationError("esf_rid must be provided.")
            if len(data._esf_rid) != 2:
                raise SerializationError(f"Expected length of esf_rid to be exactly 2, got {len(data._esf_rid)}.")
            for i in range(2):
                writer.add_short(data._esf_rid[i])
            if data._esf_length is None:
                raise SerializationError("esf_length must be provided.")
            writer.add_short(data._esf_length)
            if data._ecf_rid is None:
                raise SerializationError("ecf_rid must be provided.")
            if len(data._ecf_rid) != 2:
                raise SerializationError(f"Expected length of ecf_rid to be exactly 2, got {len(data._ecf_rid)}.")
            for i in range(2):
                writer.add_short(data._ecf_rid[i])
            if data._ecf_length is None:
                raise SerializationError("ecf_length must be provided.")
            writer.add_short(data._ecf_length)
            if data._name is None:
                raise SerializationError("name must be provided.")
            writer.add_string(data._name)
            writer.add_byte(0xFF)
            if data._title is None:
                raise SerializationError("title must be provided.")
            writer.add_string(data._title)
            writer.add_byte(0xFF)
            if data._guild_name is None:
                raise SerializationError("guild_name must be provided.")
            writer.add_string(data._guild_name)
            writer.add_byte(0xFF)
            if data._guild_rank_name is None:
                raise SerializationError("guild_rank_name must be provided.")
            writer.add_string(data._guild_rank_name)
            writer.add_byte(0xFF)
            if data._class_id is None:
                raise SerializationError("class_id must be provided.")
            writer.add_char(data._class_id)
            if data._guild_tag is None:
                raise SerializationError("guild_tag must be provided.")
            if len(data._guild_tag) != 3:
                raise SerializationError(f"Expected length of guild_tag to be exactly 3, got {len(data._guild_tag)}.")
            writer.add_fixed_string(data._guild_tag, 3, False)
            if data._admin is None:
                raise SerializationError("admin must be provided.")
            writer.add_char(int(data._admin))
            if data._level is None:
                raise SerializationError("level must be provided.")
            writer.add_char(data._level)
            if data._experience is None:
                raise SerializationError("experience must be provided.")
            writer.add_int(data._experience)
            if data._usage is None:
                raise SerializationError("usage must be provided.")
            writer.add_int(data._usage)
            if data._stats is None:
                raise SerializationError("stats must be provided.")
            CharacterStatsWelcome.serialize(writer, data._stats)
            if data._equipment is None:
                raise SerializationError("equipment must be provided.")
            EquipmentWelcome.serialize(writer, data._equipment)
            if data._guild_rank is None:
                raise SerializationError("guild_rank must be provided.")
            writer.add_char(data._guild_rank)
            if data._settings is None:
                raise SerializationError("settings must be provided.")
            ServerSettings.serialize(writer, data._settings)
            if data._login_message_code is None:
                raise SerializationError("login_message_code must be provided.")
            writer.add_char(int(data._login_message_code))
            writer.add_byte(0xFF)

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

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

            Returns:
                WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter: The data to serialize.
            """
            data: WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter = WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter()
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                data._session_id = reader.get_short()
                data._character_id = reader.get_int()
                data._map_id = reader.get_short()
                data._map_rid = []
                for i in range(2):
                    data._map_rid.append(reader.get_short())
                data._map_file_size = reader.get_three()
                data._eif_rid = []
                for i in range(2):
                    data._eif_rid.append(reader.get_short())
                data._eif_length = reader.get_short()
                data._enf_rid = []
                for i in range(2):
                    data._enf_rid.append(reader.get_short())
                data._enf_length = reader.get_short()
                data._esf_rid = []
                for i in range(2):
                    data._esf_rid.append(reader.get_short())
                data._esf_length = reader.get_short()
                data._ecf_rid = []
                for i in range(2):
                    data._ecf_rid.append(reader.get_short())
                data._ecf_length = reader.get_short()
                data._name = reader.get_string()
                reader.next_chunk()
                data._title = reader.get_string()
                reader.next_chunk()
                data._guild_name = reader.get_string()
                reader.next_chunk()
                data._guild_rank_name = reader.get_string()
                reader.next_chunk()
                data._class_id = reader.get_char()
                data._guild_tag = reader.get_fixed_string(3, False)
                data._admin = AdminLevel(reader.get_char())
                data._level = reader.get_char()
                data._experience = reader.get_int()
                data._usage = reader.get_int()
                data._stats = CharacterStatsWelcome.deserialize(reader)
                data._equipment = EquipmentWelcome.deserialize(reader)
                data._guild_rank = reader.get_char()
                data._settings = ServerSettings.deserialize(reader)
                data._login_message_code = LoginMessageCode(reader.get_char())
                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"WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter(byte_size={repr(self._byte_size)}, session_id={repr(self._session_id)}, character_id={repr(self._character_id)}, map_id={repr(self._map_id)}, map_rid={repr(self._map_rid)}, map_file_size={repr(self._map_file_size)}, eif_rid={repr(self._eif_rid)}, eif_length={repr(self._eif_length)}, enf_rid={repr(self._enf_rid)}, enf_length={repr(self._enf_length)}, esf_rid={repr(self._esf_rid)}, esf_length={repr(self._esf_length)}, ecf_rid={repr(self._ecf_rid)}, ecf_length={repr(self._ecf_length)}, name={repr(self._name)}, title={repr(self._title)}, guild_name={repr(self._guild_name)}, guild_rank_name={repr(self._guild_rank_name)}, class_id={repr(self._class_id)}, guild_tag={repr(self._guild_tag)}, admin={repr(self._admin)}, level={repr(self._level)}, experience={repr(self._experience)}, usage={repr(self._usage)}, stats={repr(self._stats)}, equipment={repr(self._equipment)}, guild_rank={repr(self._guild_rank)}, settings={repr(self._settings)}, login_message_code={repr(self._login_message_code)})"

    class WelcomeCodeDataEnterGame:
        """
        Data associated with welcome_code value WelcomeCode.EnterGame
        """
        _byte_size: int = 0
        _news: list[str] = None # type: ignore [assignment]
        _weight: Weight = None # type: ignore [assignment]
        _items: list[Item] = None # type: ignore [assignment]
        _spells: list[Spell] = None # type: ignore [assignment]
        _nearby: NearbyInfo = 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 news(self) -> list[str]:
            """
            Note:
              - Length must be `9`.
            """
            return self._news

        @news.setter
        def news(self, news: list[str]) -> None:
            """
            Note:
              - Length must be `9`.
            """
            self._news = news

        @property
        def weight(self) -> Weight:
            return self._weight

        @weight.setter
        def weight(self, weight: Weight) -> None:
            self._weight = weight

        @property
        def items(self) -> list[Item]:
            return self._items

        @items.setter
        def items(self, items: list[Item]) -> None:
            self._items = items

        @property
        def spells(self) -> list[Spell]:
            return self._spells

        @spells.setter
        def spells(self, spells: list[Spell]) -> None:
            self._spells = spells

        @property
        def nearby(self) -> NearbyInfo:
            return self._nearby

        @nearby.setter
        def nearby(self, nearby: NearbyInfo) -> None:
            self._nearby = nearby

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

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (WelcomeReplyServerPacket.WelcomeCodeDataEnterGame): The data to serialize.
            """
            writer.add_byte(0xFF)
            if data._news is None:
                raise SerializationError("news must be provided.")
            if len(data._news) != 9:
                raise SerializationError(f"Expected length of news to be exactly 9, got {len(data._news)}.")
            for i in range(9):
                if i > 0:
                    writer.add_byte(0xFF)
                writer.add_string(data._news[i])
            if data._weight is None:
                raise SerializationError("weight must be provided.")
            Weight.serialize(writer, data._weight)
            if data._items is None:
                raise SerializationError("items must be provided.")
            for i in range(len(data._items)):
                Item.serialize(writer, data._items[i])
            writer.add_byte(0xFF)
            if data._spells is None:
                raise SerializationError("spells must be provided.")
            for i in range(len(data._spells)):
                Spell.serialize(writer, data._spells[i])
            writer.add_byte(0xFF)
            if data._nearby is None:
                raise SerializationError("nearby must be provided.")
            NearbyInfo.serialize(writer, data._nearby)

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

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

            Returns:
                WelcomeReplyServerPacket.WelcomeCodeDataEnterGame: The data to serialize.
            """
            data: WelcomeReplyServerPacket.WelcomeCodeDataEnterGame = WelcomeReplyServerPacket.WelcomeCodeDataEnterGame()
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.next_chunk()
                data._news = []
                for i in range(9):
                    data._news.append(reader.get_string())
                    if i + 1 < 9:
                        reader.next_chunk()
                data._weight = Weight.deserialize(reader)
                items_length = int(reader.remaining / 6)
                data._items = []
                for i in range(items_length):
                    data._items.append(Item.deserialize(reader))
                reader.next_chunk()
                spells_length = int(reader.remaining / 4)
                data._spells = []
                for i in range(spells_length):
                    data._spells.append(Spell.deserialize(reader))
                reader.next_chunk()
                data._nearby = NearbyInfo.deserialize(reader)
                data._byte_size = reader.position - reader_start_position
                return data
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"WelcomeReplyServerPacket.WelcomeCodeDataEnterGame(byte_size={repr(self._byte_size)}, news={repr(self._news)}, weight={repr(self._weight)}, items={repr(self._items)}, spells={repr(self._spells)}, nearby={repr(self._nearby)})"

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.

welcome_code: WelcomeCode property writable

welcome_code_data: 'WelcomeReplyServerPacket.WelcomeCodeData' property writable

WelcomeReplyServerPacket.WelcomeCodeData: Gets or sets the data associated with the welcome_code field.

WelcomeCodeData = Union['WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter', 'WelcomeReplyServerPacket.WelcomeCodeDataEnterGame', None] class-attribute instance-attribute

WelcomeCodeDataSelectCharacter

Data associated with welcome_code value WelcomeCode.SelectCharacter

Source code in src/eolib/protocol/_generated/net/server/welcome_reply_server_packet.py
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
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
class WelcomeCodeDataSelectCharacter:
    """
    Data associated with welcome_code value WelcomeCode.SelectCharacter
    """
    _byte_size: int = 0
    _session_id: int = None # type: ignore [assignment]
    _character_id: int = None # type: ignore [assignment]
    _map_id: int = None # type: ignore [assignment]
    _map_rid: list[int] = None # type: ignore [assignment]
    _map_file_size: int = None # type: ignore [assignment]
    _eif_rid: list[int] = None # type: ignore [assignment]
    _eif_length: int = None # type: ignore [assignment]
    _enf_rid: list[int] = None # type: ignore [assignment]
    _enf_length: int = None # type: ignore [assignment]
    _esf_rid: list[int] = None # type: ignore [assignment]
    _esf_length: int = None # type: ignore [assignment]
    _ecf_rid: list[int] = None # type: ignore [assignment]
    _ecf_length: int = None # type: ignore [assignment]
    _name: str = None # type: ignore [assignment]
    _title: str = None # type: ignore [assignment]
    _guild_name: str = None # type: ignore [assignment]
    _guild_rank_name: str = None # type: ignore [assignment]
    _class_id: int = None # type: ignore [assignment]
    _guild_tag: str = None # type: ignore [assignment]
    _admin: AdminLevel = None # type: ignore [assignment]
    _level: int = None # type: ignore [assignment]
    _experience: int = None # type: ignore [assignment]
    _usage: int = None # type: ignore [assignment]
    _stats: CharacterStatsWelcome = None # type: ignore [assignment]
    _equipment: EquipmentWelcome = None # type: ignore [assignment]
    _guild_rank: int = None # type: ignore [assignment]
    _settings: ServerSettings = None # type: ignore [assignment]
    _login_message_code: LoginMessageCode = 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 session_id(self) -> int:
        """
        Note:
          - Value range is 0-64008.
        """
        return self._session_id

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

    @property
    def character_id(self) -> int:
        """
        Note:
          - Value range is 0-4097152080.
        """
        return self._character_id

    @character_id.setter
    def character_id(self, character_id: int) -> None:
        """
        Note:
          - Value range is 0-4097152080.
        """
        self._character_id = character_id

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

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

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

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

    @property
    def map_file_size(self) -> int:
        """
        Note:
          - Value range is 0-16194276.
        """
        return self._map_file_size

    @map_file_size.setter
    def map_file_size(self, map_file_size: int) -> None:
        """
        Note:
          - Value range is 0-16194276.
        """
        self._map_file_size = map_file_size

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    @property
    def name(self) -> str:
        return self._name

    @name.setter
    def name(self, name: str) -> None:
        self._name = name

    @property
    def title(self) -> str:
        return self._title

    @title.setter
    def title(self, title: str) -> None:
        self._title = title

    @property
    def guild_name(self) -> str:
        return self._guild_name

    @guild_name.setter
    def guild_name(self, guild_name: str) -> None:
        self._guild_name = guild_name

    @property
    def guild_rank_name(self) -> str:
        return self._guild_rank_name

    @guild_rank_name.setter
    def guild_rank_name(self, guild_rank_name: str) -> None:
        self._guild_rank_name = guild_rank_name

    @property
    def class_id(self) -> int:
        """
        Note:
          - Value range is 0-252.
        """
        return self._class_id

    @class_id.setter
    def class_id(self, class_id: int) -> None:
        """
        Note:
          - Value range is 0-252.
        """
        self._class_id = class_id

    @property
    def guild_tag(self) -> str:
        """
        Note:
          - Length must be `3`.
        """
        return self._guild_tag

    @guild_tag.setter
    def guild_tag(self, guild_tag: str) -> None:
        """
        Note:
          - Length must be `3`.
        """
        self._guild_tag = guild_tag

    @property
    def admin(self) -> AdminLevel:
        return self._admin

    @admin.setter
    def admin(self, admin: AdminLevel) -> None:
        self._admin = admin

    @property
    def level(self) -> int:
        """
        Note:
          - Value range is 0-252.
        """
        return self._level

    @level.setter
    def level(self, level: int) -> None:
        """
        Note:
          - Value range is 0-252.
        """
        self._level = level

    @property
    def experience(self) -> int:
        """
        Note:
          - Value range is 0-4097152080.
        """
        return self._experience

    @experience.setter
    def experience(self, experience: int) -> None:
        """
        Note:
          - Value range is 0-4097152080.
        """
        self._experience = experience

    @property
    def usage(self) -> int:
        """
        Note:
          - Value range is 0-4097152080.
        """
        return self._usage

    @usage.setter
    def usage(self, usage: int) -> None:
        """
        Note:
          - Value range is 0-4097152080.
        """
        self._usage = usage

    @property
    def stats(self) -> CharacterStatsWelcome:
        return self._stats

    @stats.setter
    def stats(self, stats: CharacterStatsWelcome) -> None:
        self._stats = stats

    @property
    def equipment(self) -> EquipmentWelcome:
        return self._equipment

    @equipment.setter
    def equipment(self, equipment: EquipmentWelcome) -> None:
        self._equipment = equipment

    @property
    def guild_rank(self) -> int:
        """
        Note:
          - Value range is 0-252.
        """
        return self._guild_rank

    @guild_rank.setter
    def guild_rank(self, guild_rank: int) -> None:
        """
        Note:
          - Value range is 0-252.
        """
        self._guild_rank = guild_rank

    @property
    def settings(self) -> ServerSettings:
        return self._settings

    @settings.setter
    def settings(self, settings: ServerSettings) -> None:
        self._settings = settings

    @property
    def login_message_code(self) -> LoginMessageCode:
        return self._login_message_code

    @login_message_code.setter
    def login_message_code(self, login_message_code: LoginMessageCode) -> None:
        self._login_message_code = login_message_code

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter): The data to serialize.
        """
        if data._session_id is None:
            raise SerializationError("session_id must be provided.")
        writer.add_short(data._session_id)
        if data._character_id is None:
            raise SerializationError("character_id must be provided.")
        writer.add_int(data._character_id)
        if data._map_id is None:
            raise SerializationError("map_id must be provided.")
        writer.add_short(data._map_id)
        if data._map_rid is None:
            raise SerializationError("map_rid must be provided.")
        if len(data._map_rid) != 2:
            raise SerializationError(f"Expected length of map_rid to be exactly 2, got {len(data._map_rid)}.")
        for i in range(2):
            writer.add_short(data._map_rid[i])
        if data._map_file_size is None:
            raise SerializationError("map_file_size must be provided.")
        writer.add_three(data._map_file_size)
        if data._eif_rid is None:
            raise SerializationError("eif_rid must be provided.")
        if len(data._eif_rid) != 2:
            raise SerializationError(f"Expected length of eif_rid to be exactly 2, got {len(data._eif_rid)}.")
        for i in range(2):
            writer.add_short(data._eif_rid[i])
        if data._eif_length is None:
            raise SerializationError("eif_length must be provided.")
        writer.add_short(data._eif_length)
        if data._enf_rid is None:
            raise SerializationError("enf_rid must be provided.")
        if len(data._enf_rid) != 2:
            raise SerializationError(f"Expected length of enf_rid to be exactly 2, got {len(data._enf_rid)}.")
        for i in range(2):
            writer.add_short(data._enf_rid[i])
        if data._enf_length is None:
            raise SerializationError("enf_length must be provided.")
        writer.add_short(data._enf_length)
        if data._esf_rid is None:
            raise SerializationError("esf_rid must be provided.")
        if len(data._esf_rid) != 2:
            raise SerializationError(f"Expected length of esf_rid to be exactly 2, got {len(data._esf_rid)}.")
        for i in range(2):
            writer.add_short(data._esf_rid[i])
        if data._esf_length is None:
            raise SerializationError("esf_length must be provided.")
        writer.add_short(data._esf_length)
        if data._ecf_rid is None:
            raise SerializationError("ecf_rid must be provided.")
        if len(data._ecf_rid) != 2:
            raise SerializationError(f"Expected length of ecf_rid to be exactly 2, got {len(data._ecf_rid)}.")
        for i in range(2):
            writer.add_short(data._ecf_rid[i])
        if data._ecf_length is None:
            raise SerializationError("ecf_length must be provided.")
        writer.add_short(data._ecf_length)
        if data._name is None:
            raise SerializationError("name must be provided.")
        writer.add_string(data._name)
        writer.add_byte(0xFF)
        if data._title is None:
            raise SerializationError("title must be provided.")
        writer.add_string(data._title)
        writer.add_byte(0xFF)
        if data._guild_name is None:
            raise SerializationError("guild_name must be provided.")
        writer.add_string(data._guild_name)
        writer.add_byte(0xFF)
        if data._guild_rank_name is None:
            raise SerializationError("guild_rank_name must be provided.")
        writer.add_string(data._guild_rank_name)
        writer.add_byte(0xFF)
        if data._class_id is None:
            raise SerializationError("class_id must be provided.")
        writer.add_char(data._class_id)
        if data._guild_tag is None:
            raise SerializationError("guild_tag must be provided.")
        if len(data._guild_tag) != 3:
            raise SerializationError(f"Expected length of guild_tag to be exactly 3, got {len(data._guild_tag)}.")
        writer.add_fixed_string(data._guild_tag, 3, False)
        if data._admin is None:
            raise SerializationError("admin must be provided.")
        writer.add_char(int(data._admin))
        if data._level is None:
            raise SerializationError("level must be provided.")
        writer.add_char(data._level)
        if data._experience is None:
            raise SerializationError("experience must be provided.")
        writer.add_int(data._experience)
        if data._usage is None:
            raise SerializationError("usage must be provided.")
        writer.add_int(data._usage)
        if data._stats is None:
            raise SerializationError("stats must be provided.")
        CharacterStatsWelcome.serialize(writer, data._stats)
        if data._equipment is None:
            raise SerializationError("equipment must be provided.")
        EquipmentWelcome.serialize(writer, data._equipment)
        if data._guild_rank is None:
            raise SerializationError("guild_rank must be provided.")
        writer.add_char(data._guild_rank)
        if data._settings is None:
            raise SerializationError("settings must be provided.")
        ServerSettings.serialize(writer, data._settings)
        if data._login_message_code is None:
            raise SerializationError("login_message_code must be provided.")
        writer.add_char(int(data._login_message_code))
        writer.add_byte(0xFF)

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

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

        Returns:
            WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter: The data to serialize.
        """
        data: WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter = WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            data._session_id = reader.get_short()
            data._character_id = reader.get_int()
            data._map_id = reader.get_short()
            data._map_rid = []
            for i in range(2):
                data._map_rid.append(reader.get_short())
            data._map_file_size = reader.get_three()
            data._eif_rid = []
            for i in range(2):
                data._eif_rid.append(reader.get_short())
            data._eif_length = reader.get_short()
            data._enf_rid = []
            for i in range(2):
                data._enf_rid.append(reader.get_short())
            data._enf_length = reader.get_short()
            data._esf_rid = []
            for i in range(2):
                data._esf_rid.append(reader.get_short())
            data._esf_length = reader.get_short()
            data._ecf_rid = []
            for i in range(2):
                data._ecf_rid.append(reader.get_short())
            data._ecf_length = reader.get_short()
            data._name = reader.get_string()
            reader.next_chunk()
            data._title = reader.get_string()
            reader.next_chunk()
            data._guild_name = reader.get_string()
            reader.next_chunk()
            data._guild_rank_name = reader.get_string()
            reader.next_chunk()
            data._class_id = reader.get_char()
            data._guild_tag = reader.get_fixed_string(3, False)
            data._admin = AdminLevel(reader.get_char())
            data._level = reader.get_char()
            data._experience = reader.get_int()
            data._usage = reader.get_int()
            data._stats = CharacterStatsWelcome.deserialize(reader)
            data._equipment = EquipmentWelcome.deserialize(reader)
            data._guild_rank = reader.get_char()
            data._settings = ServerSettings.deserialize(reader)
            data._login_message_code = LoginMessageCode(reader.get_char())
            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"WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter(byte_size={repr(self._byte_size)}, session_id={repr(self._session_id)}, character_id={repr(self._character_id)}, map_id={repr(self._map_id)}, map_rid={repr(self._map_rid)}, map_file_size={repr(self._map_file_size)}, eif_rid={repr(self._eif_rid)}, eif_length={repr(self._eif_length)}, enf_rid={repr(self._enf_rid)}, enf_length={repr(self._enf_length)}, esf_rid={repr(self._esf_rid)}, esf_length={repr(self._esf_length)}, ecf_rid={repr(self._ecf_rid)}, ecf_length={repr(self._ecf_length)}, name={repr(self._name)}, title={repr(self._title)}, guild_name={repr(self._guild_name)}, guild_rank_name={repr(self._guild_rank_name)}, class_id={repr(self._class_id)}, guild_tag={repr(self._guild_tag)}, admin={repr(self._admin)}, level={repr(self._level)}, experience={repr(self._experience)}, usage={repr(self._usage)}, stats={repr(self._stats)}, equipment={repr(self._equipment)}, guild_rank={repr(self._guild_rank)}, settings={repr(self._settings)}, login_message_code={repr(self._login_message_code)})"

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.

session_id: int property writable

Note
  • Value range is 0-64008.

character_id: int property writable

Note
  • Value range is 0-4097152080.

map_id: int property writable

Note
  • Value range is 0-64008.

map_rid: list[int] property writable

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

map_file_size: int property writable

Note
  • Value range is 0-16194276.

eif_rid: list[int] property writable

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

eif_length: int property writable

Note
  • Value range is 0-64008.

enf_rid: list[int] property writable

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

enf_length: int property writable

Note
  • Value range is 0-64008.

esf_rid: list[int] property writable

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

esf_length: int property writable

Note
  • Value range is 0-64008.

ecf_rid: list[int] property writable

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

ecf_length: int property writable

Note
  • Value range is 0-64008.

name: str property writable

title: str property writable

guild_name: str property writable

guild_rank_name: str property writable

class_id: int property writable

Note
  • Value range is 0-252.

guild_tag: str property writable

Note
  • Length must be 3.

admin: AdminLevel property writable

level: int property writable

Note
  • Value range is 0-252.

experience: int property writable

Note
  • Value range is 0-4097152080.

usage: int property writable

Note
  • Value range is 0-4097152080.

stats: CharacterStatsWelcome property writable

equipment: EquipmentWelcome property writable

guild_rank: int property writable

Note
  • Value range is 0-252.

settings: ServerSettings property writable

login_message_code: LoginMessageCode property writable

serialize(writer, data) staticmethod

Serializes an instance of WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data WelcomeCodeDataSelectCharacter

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/welcome_reply_server_packet.py
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
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
@staticmethod
def serialize(writer: EoWriter, data: "WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter") -> None:
    """
    Serializes an instance of `WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter): The data to serialize.
    """
    if data._session_id is None:
        raise SerializationError("session_id must be provided.")
    writer.add_short(data._session_id)
    if data._character_id is None:
        raise SerializationError("character_id must be provided.")
    writer.add_int(data._character_id)
    if data._map_id is None:
        raise SerializationError("map_id must be provided.")
    writer.add_short(data._map_id)
    if data._map_rid is None:
        raise SerializationError("map_rid must be provided.")
    if len(data._map_rid) != 2:
        raise SerializationError(f"Expected length of map_rid to be exactly 2, got {len(data._map_rid)}.")
    for i in range(2):
        writer.add_short(data._map_rid[i])
    if data._map_file_size is None:
        raise SerializationError("map_file_size must be provided.")
    writer.add_three(data._map_file_size)
    if data._eif_rid is None:
        raise SerializationError("eif_rid must be provided.")
    if len(data._eif_rid) != 2:
        raise SerializationError(f"Expected length of eif_rid to be exactly 2, got {len(data._eif_rid)}.")
    for i in range(2):
        writer.add_short(data._eif_rid[i])
    if data._eif_length is None:
        raise SerializationError("eif_length must be provided.")
    writer.add_short(data._eif_length)
    if data._enf_rid is None:
        raise SerializationError("enf_rid must be provided.")
    if len(data._enf_rid) != 2:
        raise SerializationError(f"Expected length of enf_rid to be exactly 2, got {len(data._enf_rid)}.")
    for i in range(2):
        writer.add_short(data._enf_rid[i])
    if data._enf_length is None:
        raise SerializationError("enf_length must be provided.")
    writer.add_short(data._enf_length)
    if data._esf_rid is None:
        raise SerializationError("esf_rid must be provided.")
    if len(data._esf_rid) != 2:
        raise SerializationError(f"Expected length of esf_rid to be exactly 2, got {len(data._esf_rid)}.")
    for i in range(2):
        writer.add_short(data._esf_rid[i])
    if data._esf_length is None:
        raise SerializationError("esf_length must be provided.")
    writer.add_short(data._esf_length)
    if data._ecf_rid is None:
        raise SerializationError("ecf_rid must be provided.")
    if len(data._ecf_rid) != 2:
        raise SerializationError(f"Expected length of ecf_rid to be exactly 2, got {len(data._ecf_rid)}.")
    for i in range(2):
        writer.add_short(data._ecf_rid[i])
    if data._ecf_length is None:
        raise SerializationError("ecf_length must be provided.")
    writer.add_short(data._ecf_length)
    if data._name is None:
        raise SerializationError("name must be provided.")
    writer.add_string(data._name)
    writer.add_byte(0xFF)
    if data._title is None:
        raise SerializationError("title must be provided.")
    writer.add_string(data._title)
    writer.add_byte(0xFF)
    if data._guild_name is None:
        raise SerializationError("guild_name must be provided.")
    writer.add_string(data._guild_name)
    writer.add_byte(0xFF)
    if data._guild_rank_name is None:
        raise SerializationError("guild_rank_name must be provided.")
    writer.add_string(data._guild_rank_name)
    writer.add_byte(0xFF)
    if data._class_id is None:
        raise SerializationError("class_id must be provided.")
    writer.add_char(data._class_id)
    if data._guild_tag is None:
        raise SerializationError("guild_tag must be provided.")
    if len(data._guild_tag) != 3:
        raise SerializationError(f"Expected length of guild_tag to be exactly 3, got {len(data._guild_tag)}.")
    writer.add_fixed_string(data._guild_tag, 3, False)
    if data._admin is None:
        raise SerializationError("admin must be provided.")
    writer.add_char(int(data._admin))
    if data._level is None:
        raise SerializationError("level must be provided.")
    writer.add_char(data._level)
    if data._experience is None:
        raise SerializationError("experience must be provided.")
    writer.add_int(data._experience)
    if data._usage is None:
        raise SerializationError("usage must be provided.")
    writer.add_int(data._usage)
    if data._stats is None:
        raise SerializationError("stats must be provided.")
    CharacterStatsWelcome.serialize(writer, data._stats)
    if data._equipment is None:
        raise SerializationError("equipment must be provided.")
    EquipmentWelcome.serialize(writer, data._equipment)
    if data._guild_rank is None:
        raise SerializationError("guild_rank must be provided.")
    writer.add_char(data._guild_rank)
    if data._settings is None:
        raise SerializationError("settings must be provided.")
    ServerSettings.serialize(writer, data._settings)
    if data._login_message_code is None:
        raise SerializationError("login_message_code must be provided.")
    writer.add_char(int(data._login_message_code))
    writer.add_byte(0xFF)

deserialize(reader) staticmethod

Deserializes an instance of WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter'

WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/welcome_reply_server_packet.py
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
@staticmethod
def deserialize(reader: EoReader) -> "WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter":
    """
    Deserializes an instance of `WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter` from the provided `EoReader`.

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

    Returns:
        WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter: The data to serialize.
    """
    data: WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter = WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        data._session_id = reader.get_short()
        data._character_id = reader.get_int()
        data._map_id = reader.get_short()
        data._map_rid = []
        for i in range(2):
            data._map_rid.append(reader.get_short())
        data._map_file_size = reader.get_three()
        data._eif_rid = []
        for i in range(2):
            data._eif_rid.append(reader.get_short())
        data._eif_length = reader.get_short()
        data._enf_rid = []
        for i in range(2):
            data._enf_rid.append(reader.get_short())
        data._enf_length = reader.get_short()
        data._esf_rid = []
        for i in range(2):
            data._esf_rid.append(reader.get_short())
        data._esf_length = reader.get_short()
        data._ecf_rid = []
        for i in range(2):
            data._ecf_rid.append(reader.get_short())
        data._ecf_length = reader.get_short()
        data._name = reader.get_string()
        reader.next_chunk()
        data._title = reader.get_string()
        reader.next_chunk()
        data._guild_name = reader.get_string()
        reader.next_chunk()
        data._guild_rank_name = reader.get_string()
        reader.next_chunk()
        data._class_id = reader.get_char()
        data._guild_tag = reader.get_fixed_string(3, False)
        data._admin = AdminLevel(reader.get_char())
        data._level = reader.get_char()
        data._experience = reader.get_int()
        data._usage = reader.get_int()
        data._stats = CharacterStatsWelcome.deserialize(reader)
        data._equipment = EquipmentWelcome.deserialize(reader)
        data._guild_rank = reader.get_char()
        data._settings = ServerSettings.deserialize(reader)
        data._login_message_code = LoginMessageCode(reader.get_char())
        reader.next_chunk()
        data._byte_size = reader.position - reader_start_position
        return data
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

WelcomeCodeDataEnterGame

Data associated with welcome_code value WelcomeCode.EnterGame

Source code in src/eolib/protocol/_generated/net/server/welcome_reply_server_packet.py
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
class WelcomeCodeDataEnterGame:
    """
    Data associated with welcome_code value WelcomeCode.EnterGame
    """
    _byte_size: int = 0
    _news: list[str] = None # type: ignore [assignment]
    _weight: Weight = None # type: ignore [assignment]
    _items: list[Item] = None # type: ignore [assignment]
    _spells: list[Spell] = None # type: ignore [assignment]
    _nearby: NearbyInfo = 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 news(self) -> list[str]:
        """
        Note:
          - Length must be `9`.
        """
        return self._news

    @news.setter
    def news(self, news: list[str]) -> None:
        """
        Note:
          - Length must be `9`.
        """
        self._news = news

    @property
    def weight(self) -> Weight:
        return self._weight

    @weight.setter
    def weight(self, weight: Weight) -> None:
        self._weight = weight

    @property
    def items(self) -> list[Item]:
        return self._items

    @items.setter
    def items(self, items: list[Item]) -> None:
        self._items = items

    @property
    def spells(self) -> list[Spell]:
        return self._spells

    @spells.setter
    def spells(self, spells: list[Spell]) -> None:
        self._spells = spells

    @property
    def nearby(self) -> NearbyInfo:
        return self._nearby

    @nearby.setter
    def nearby(self, nearby: NearbyInfo) -> None:
        self._nearby = nearby

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (WelcomeReplyServerPacket.WelcomeCodeDataEnterGame): The data to serialize.
        """
        writer.add_byte(0xFF)
        if data._news is None:
            raise SerializationError("news must be provided.")
        if len(data._news) != 9:
            raise SerializationError(f"Expected length of news to be exactly 9, got {len(data._news)}.")
        for i in range(9):
            if i > 0:
                writer.add_byte(0xFF)
            writer.add_string(data._news[i])
        if data._weight is None:
            raise SerializationError("weight must be provided.")
        Weight.serialize(writer, data._weight)
        if data._items is None:
            raise SerializationError("items must be provided.")
        for i in range(len(data._items)):
            Item.serialize(writer, data._items[i])
        writer.add_byte(0xFF)
        if data._spells is None:
            raise SerializationError("spells must be provided.")
        for i in range(len(data._spells)):
            Spell.serialize(writer, data._spells[i])
        writer.add_byte(0xFF)
        if data._nearby is None:
            raise SerializationError("nearby must be provided.")
        NearbyInfo.serialize(writer, data._nearby)

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

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

        Returns:
            WelcomeReplyServerPacket.WelcomeCodeDataEnterGame: The data to serialize.
        """
        data: WelcomeReplyServerPacket.WelcomeCodeDataEnterGame = WelcomeReplyServerPacket.WelcomeCodeDataEnterGame()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.next_chunk()
            data._news = []
            for i in range(9):
                data._news.append(reader.get_string())
                if i + 1 < 9:
                    reader.next_chunk()
            data._weight = Weight.deserialize(reader)
            items_length = int(reader.remaining / 6)
            data._items = []
            for i in range(items_length):
                data._items.append(Item.deserialize(reader))
            reader.next_chunk()
            spells_length = int(reader.remaining / 4)
            data._spells = []
            for i in range(spells_length):
                data._spells.append(Spell.deserialize(reader))
            reader.next_chunk()
            data._nearby = NearbyInfo.deserialize(reader)
            data._byte_size = reader.position - reader_start_position
            return data
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"WelcomeReplyServerPacket.WelcomeCodeDataEnterGame(byte_size={repr(self._byte_size)}, news={repr(self._news)}, weight={repr(self._weight)}, items={repr(self._items)}, spells={repr(self._spells)}, nearby={repr(self._nearby)})"

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.

news: list[str] property writable

Note
  • Length must be 9.

weight: Weight property writable

items: list[Item] property writable

spells: list[Spell] property writable

nearby: NearbyInfo property writable

serialize(writer, data) staticmethod

Serializes an instance of WelcomeReplyServerPacket.WelcomeCodeDataEnterGame to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data WelcomeCodeDataEnterGame

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/welcome_reply_server_packet.py
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
@staticmethod
def serialize(writer: EoWriter, data: "WelcomeReplyServerPacket.WelcomeCodeDataEnterGame") -> None:
    """
    Serializes an instance of `WelcomeReplyServerPacket.WelcomeCodeDataEnterGame` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (WelcomeReplyServerPacket.WelcomeCodeDataEnterGame): The data to serialize.
    """
    writer.add_byte(0xFF)
    if data._news is None:
        raise SerializationError("news must be provided.")
    if len(data._news) != 9:
        raise SerializationError(f"Expected length of news to be exactly 9, got {len(data._news)}.")
    for i in range(9):
        if i > 0:
            writer.add_byte(0xFF)
        writer.add_string(data._news[i])
    if data._weight is None:
        raise SerializationError("weight must be provided.")
    Weight.serialize(writer, data._weight)
    if data._items is None:
        raise SerializationError("items must be provided.")
    for i in range(len(data._items)):
        Item.serialize(writer, data._items[i])
    writer.add_byte(0xFF)
    if data._spells is None:
        raise SerializationError("spells must be provided.")
    for i in range(len(data._spells)):
        Spell.serialize(writer, data._spells[i])
    writer.add_byte(0xFF)
    if data._nearby is None:
        raise SerializationError("nearby must be provided.")
    NearbyInfo.serialize(writer, data._nearby)

deserialize(reader) staticmethod

Deserializes an instance of WelcomeReplyServerPacket.WelcomeCodeDataEnterGame from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'WelcomeReplyServerPacket.WelcomeCodeDataEnterGame'

WelcomeReplyServerPacket.WelcomeCodeDataEnterGame: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/welcome_reply_server_packet.py
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
@staticmethod
def deserialize(reader: EoReader) -> "WelcomeReplyServerPacket.WelcomeCodeDataEnterGame":
    """
    Deserializes an instance of `WelcomeReplyServerPacket.WelcomeCodeDataEnterGame` from the provided `EoReader`.

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

    Returns:
        WelcomeReplyServerPacket.WelcomeCodeDataEnterGame: The data to serialize.
    """
    data: WelcomeReplyServerPacket.WelcomeCodeDataEnterGame = WelcomeReplyServerPacket.WelcomeCodeDataEnterGame()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.next_chunk()
        data._news = []
        for i in range(9):
            data._news.append(reader.get_string())
            if i + 1 < 9:
                reader.next_chunk()
        data._weight = Weight.deserialize(reader)
        items_length = int(reader.remaining / 6)
        data._items = []
        for i in range(items_length):
            data._items.append(Item.deserialize(reader))
        reader.next_chunk()
        spells_length = int(reader.remaining / 4)
        data._spells = []
        for i in range(spells_length):
            data._spells.append(Spell.deserialize(reader))
        reader.next_chunk()
        data._nearby = NearbyInfo.deserialize(reader)
        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/welcome_reply_server_packet.py
62
63
64
65
66
67
68
69
70
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/welcome_reply_server_packet.py
72
73
74
75
76
77
78
79
80
@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/welcome_reply_server_packet.py
82
83
84
85
86
87
88
89
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.
    """
    WelcomeReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of WelcomeReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data WelcomeReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/welcome_reply_server_packet.py
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
@staticmethod
def serialize(writer: EoWriter, data: "WelcomeReplyServerPacket") -> None:
    """
    Serializes an instance of `WelcomeReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (WelcomeReplyServerPacket): The data to serialize.
    """
    if data._welcome_code is None:
        raise SerializationError("welcome_code must be provided.")
    writer.add_short(int(data._welcome_code))
    if data._welcome_code == WelcomeCode.SelectCharacter:
        if not isinstance(data._welcome_code_data, WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter):
            raise SerializationError("Expected welcome_code_data to be type WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter for welcome_code " + WelcomeCode(data._welcome_code).name + ".")
        WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter.serialize(writer, data._welcome_code_data)
    elif data._welcome_code == WelcomeCode.EnterGame:
        if not isinstance(data._welcome_code_data, WelcomeReplyServerPacket.WelcomeCodeDataEnterGame):
            raise SerializationError("Expected welcome_code_data to be type WelcomeReplyServerPacket.WelcomeCodeDataEnterGame for welcome_code " + WelcomeCode(data._welcome_code).name + ".")
        WelcomeReplyServerPacket.WelcomeCodeDataEnterGame.serialize(writer, data._welcome_code_data)

deserialize(reader) staticmethod

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

The data to serialize.

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

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

    Returns:
        WelcomeReplyServerPacket: The data to serialize.
    """
    data: WelcomeReplyServerPacket = WelcomeReplyServerPacket()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        data._welcome_code = WelcomeCode(reader.get_short())
        reader.chunked_reading_mode = True
        if data._welcome_code == WelcomeCode.SelectCharacter:
            data._welcome_code_data = WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter.deserialize(reader)
        elif data._welcome_code == WelcomeCode.EnterGame:
            data._welcome_code_data = WelcomeReplyServerPacket.WelcomeCodeDataEnterGame.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