Skip to content

server

Data structures generated from the eo-protocol XML specification.

Warning

WelcomeReplyServerPacket

Bases: Packet

Reply to selecting a character / entering game

Source code in src/eolib/protocol/_generated/net/server/welcome_reply_server_packet.py
 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
class WelcomeReplyServerPacket(Packet):
    """
    Reply to selecting a character / entering game
    """
    _byte_size: int = 0
    _welcome_code: WelcomeCode
    _welcome_code_data: 'WelcomeReplyServerPacket.WelcomeCodeData'

    def __init__(self, *, welcome_code: WelcomeCode, welcome_code_data: 'WelcomeReplyServerPacket.WelcomeCodeData' = None):
        """
        Create a new instance of WelcomeReplyServerPacket.

        Args:
            welcome_code (WelcomeCode): 
            welcome_code_data (WelcomeReplyServerPacket.WelcomeCodeData): Data associated with the `welcome_code` field.
        """
        self._welcome_code = welcome_code
        self._welcome_code_data = welcome_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 welcome_code(self) -> WelcomeCode:
        return self._welcome_code

    @property
    def welcome_code_data(self) -> 'WelcomeReplyServerPacket.WelcomeCodeData':
        """
        WelcomeReplyServerPacket.WelcomeCodeData: Data associated with the `welcome_code` field.
        """
        return self._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.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            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)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @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.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            welcome_code = WelcomeCode(reader.get_short())
            welcome_code_data: WelcomeReplyServerPacket.WelcomeCodeData = None
            if welcome_code == WelcomeCode.SelectCharacter:
                welcome_code_data = WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter.deserialize(reader)
            elif welcome_code == WelcomeCode.EnterGame:
                welcome_code_data = WelcomeReplyServerPacket.WelcomeCodeDataEnterGame.deserialize(reader)
            result = WelcomeReplyServerPacket(welcome_code=welcome_code, welcome_code_data=welcome_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"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]
    """
    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
        _character_id: int
        _map_id: int
        _map_rid: tuple[int, ...]
        _map_file_size: int
        _eif_rid: tuple[int, ...]
        _eif_length: int
        _enf_rid: tuple[int, ...]
        _enf_length: int
        _esf_rid: tuple[int, ...]
        _esf_length: int
        _ecf_rid: tuple[int, ...]
        _ecf_length: int
        _name: str
        _title: str
        _guild_name: str
        _guild_rank_name: str
        _class_id: int
        _guild_tag: str
        _admin: AdminLevel
        _level: int
        _experience: int
        _usage: int
        _stats: CharacterStatsWelcome
        _equipment: EquipmentWelcome
        _guild_rank: int
        _settings: ServerSettings
        _login_message_code: LoginMessageCode

        def __init__(self, *, session_id: int, character_id: int, map_id: int, map_rid: Iterable[int], map_file_size: int, eif_rid: Iterable[int], eif_length: int, enf_rid: Iterable[int], enf_length: int, esf_rid: Iterable[int], esf_length: int, ecf_rid: Iterable[int], ecf_length: int, name: str, title: str, guild_name: str, guild_rank_name: str, class_id: int, guild_tag: str, admin: AdminLevel, level: int, experience: int, usage: int, stats: CharacterStatsWelcome, equipment: EquipmentWelcome, guild_rank: int, settings: ServerSettings, login_message_code: LoginMessageCode):
            """
            Create a new instance of WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter.

            Args:
                session_id (int): (Value range is 0-64008.)
                character_id (int): (Value range is 0-4097152080.)
                map_id (int): (Value range is 0-64008.)
                map_rid (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
                map_file_size (int): (Value range is 0-16194276.)
                eif_rid (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
                eif_length (int): (Value range is 0-64008.)
                enf_rid (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
                enf_length (int): (Value range is 0-64008.)
                esf_rid (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
                esf_length (int): (Value range is 0-64008.)
                ecf_rid (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
                ecf_length (int): (Value range is 0-64008.)
                name (str): 
                title (str): 
                guild_name (str): 
                guild_rank_name (str): 
                class_id (int): (Value range is 0-252.)
                guild_tag (str): (Length must be `3`.)
                admin (AdminLevel): 
                level (int): (Value range is 0-252.)
                experience (int): (Value range is 0-4097152080.)
                usage (int): (Value range is 0-4097152080.)
                stats (CharacterStatsWelcome): 
                equipment (EquipmentWelcome): 
                guild_rank (int): (Value range is 0-252.)
                settings (ServerSettings): 
                login_message_code (LoginMessageCode): 
            """
            self._session_id = session_id
            self._character_id = character_id
            self._map_id = map_id
            self._map_rid = tuple(map_rid)
            self._map_file_size = map_file_size
            self._eif_rid = tuple(eif_rid)
            self._eif_length = eif_length
            self._enf_rid = tuple(enf_rid)
            self._enf_length = enf_length
            self._esf_rid = tuple(esf_rid)
            self._esf_length = esf_length
            self._ecf_rid = tuple(ecf_rid)
            self._ecf_length = ecf_length
            self._name = name
            self._title = title
            self._guild_name = guild_name
            self._guild_rank_name = guild_rank_name
            self._class_id = class_id
            self._guild_tag = guild_tag
            self._admin = admin
            self._level = level
            self._experience = experience
            self._usage = usage
            self._stats = stats
            self._equipment = equipment
            self._guild_rank = guild_rank
            self._settings = settings
            self._login_message_code = login_message_code

        @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:
            return self._session_id

        @property
        def character_id(self) -> int:
            return self._character_id

        @property
        def map_id(self) -> int:
            return self._map_id

        @property
        def map_rid(self) -> tuple[int, ...]:
            return self._map_rid

        @property
        def map_file_size(self) -> int:
            return self._map_file_size

        @property
        def eif_rid(self) -> tuple[int, ...]:
            return self._eif_rid

        @property
        def eif_length(self) -> int:
            return self._eif_length

        @property
        def enf_rid(self) -> tuple[int, ...]:
            return self._enf_rid

        @property
        def enf_length(self) -> int:
            return self._enf_length

        @property
        def esf_rid(self) -> tuple[int, ...]:
            return self._esf_rid

        @property
        def esf_length(self) -> int:
            return self._esf_length

        @property
        def ecf_rid(self) -> tuple[int, ...]:
            return self._ecf_rid

        @property
        def ecf_length(self) -> int:
            return self._ecf_length

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

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

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

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

        @property
        def class_id(self) -> int:
            return self._class_id

        @property
        def guild_tag(self) -> str:
            return self._guild_tag

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

        @property
        def level(self) -> int:
            return self._level

        @property
        def experience(self) -> int:
            return self._experience

        @property
        def usage(self) -> int:
            return self._usage

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

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

        @property
        def guild_rank(self) -> int:
            return self._guild_rank

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

        @property
        def login_message_code(self) -> LoginMessageCode:
            return self._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.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                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)
                writer.string_sanitization_mode = True
                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)
                writer.string_sanitization_mode = False
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @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.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                session_id = reader.get_short()
                character_id = reader.get_int()
                map_id = reader.get_short()
                map_rid = []
                for i in range(2):
                    map_rid.append(reader.get_short())
                map_file_size = reader.get_three()
                eif_rid = []
                for i in range(2):
                    eif_rid.append(reader.get_short())
                eif_length = reader.get_short()
                enf_rid = []
                for i in range(2):
                    enf_rid.append(reader.get_short())
                enf_length = reader.get_short()
                esf_rid = []
                for i in range(2):
                    esf_rid.append(reader.get_short())
                esf_length = reader.get_short()
                ecf_rid = []
                for i in range(2):
                    ecf_rid.append(reader.get_short())
                ecf_length = reader.get_short()
                reader.chunked_reading_mode = True
                name = reader.get_string()
                reader.next_chunk()
                title = reader.get_string()
                reader.next_chunk()
                guild_name = reader.get_string()
                reader.next_chunk()
                guild_rank_name = reader.get_string()
                reader.next_chunk()
                class_id = reader.get_char()
                guild_tag = reader.get_fixed_string(3, False)
                admin = AdminLevel(reader.get_char())
                level = reader.get_char()
                experience = reader.get_int()
                usage = reader.get_int()
                stats = CharacterStatsWelcome.deserialize(reader)
                equipment = EquipmentWelcome.deserialize(reader)
                guild_rank = reader.get_char()
                settings = ServerSettings.deserialize(reader)
                login_message_code = LoginMessageCode(reader.get_char())
                reader.next_chunk()
                reader.chunked_reading_mode = False
                result = WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter(session_id=session_id, character_id=character_id, map_id=map_id, map_rid=map_rid, map_file_size=map_file_size, eif_rid=eif_rid, eif_length=eif_length, enf_rid=enf_rid, enf_length=enf_length, esf_rid=esf_rid, esf_length=esf_length, ecf_rid=ecf_rid, ecf_length=ecf_length, name=name, title=title, guild_name=guild_name, guild_rank_name=guild_rank_name, class_id=class_id, guild_tag=guild_tag, admin=admin, level=level, experience=experience, usage=usage, stats=stats, equipment=equipment, guild_rank=guild_rank, settings=settings, login_message_code=login_message_code)
                result._byte_size = reader.position - reader_start_position
                return result
            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: tuple[str, ...]
        _weight: Weight
        _items: tuple[Item, ...]
        _spells: tuple[Spell, ...]
        _nearby: NearbyInfo

        def __init__(self, *, news: Iterable[str], weight: Weight, items: Iterable[Item], spells: Iterable[Spell], nearby: NearbyInfo):
            """
            Create a new instance of WelcomeReplyServerPacket.WelcomeCodeDataEnterGame.

            Args:
                news (Iterable[str]): (Length must be `9`.)
                weight (Weight): 
                items (Iterable[Item]): 
                spells (Iterable[Spell]): 
                nearby (NearbyInfo): 
            """
            self._news = tuple(news)
            self._weight = weight
            self._items = tuple(items)
            self._spells = tuple(spells)
            self._nearby = nearby

        @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) -> tuple[str, ...]:
            return self._news

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

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

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

        @property
        def nearby(self) -> NearbyInfo:
            return self._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.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                writer.string_sanitization_mode = True
                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):
                    writer.add_string(data._news[i])
                    writer.add_byte(0xFF)
                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)
                writer.string_sanitization_mode = False
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @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.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.chunked_reading_mode = True
                reader.next_chunk()
                news = []
                for i in range(9):
                    news.append(reader.get_string())
                    reader.next_chunk()
                weight = Weight.deserialize(reader)
                items_length = int(reader.remaining / 6)
                items = []
                for i in range(items_length):
                    items.append(Item.deserialize(reader))
                reader.next_chunk()
                spells_length = int(reader.remaining / 4)
                spells = []
                for i in range(spells_length):
                    spells.append(Spell.deserialize(reader))
                reader.next_chunk()
                nearby = NearbyInfo.deserialize(reader)
                reader.chunked_reading_mode = False
                result = WelcomeReplyServerPacket.WelcomeCodeDataEnterGame(news=news, weight=weight, items=items, spells=spells, nearby=nearby)
                result._byte_size = reader.position - reader_start_position
                return result
            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

welcome_code_data: 'WelcomeReplyServerPacket.WelcomeCodeData' property

WelcomeReplyServerPacket.WelcomeCodeData: Data associated with the welcome_code field.

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

Data associated with different values of the welcome_code field.

WelcomeCodeDataSelectCharacter

Data associated with welcome_code value WelcomeCode.SelectCharacter

Source code in src/eolib/protocol/_generated/net/server/welcome_reply_server_packet.py
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
class WelcomeCodeDataSelectCharacter:
    """
    Data associated with welcome_code value WelcomeCode.SelectCharacter
    """
    _byte_size: int = 0
    _session_id: int
    _character_id: int
    _map_id: int
    _map_rid: tuple[int, ...]
    _map_file_size: int
    _eif_rid: tuple[int, ...]
    _eif_length: int
    _enf_rid: tuple[int, ...]
    _enf_length: int
    _esf_rid: tuple[int, ...]
    _esf_length: int
    _ecf_rid: tuple[int, ...]
    _ecf_length: int
    _name: str
    _title: str
    _guild_name: str
    _guild_rank_name: str
    _class_id: int
    _guild_tag: str
    _admin: AdminLevel
    _level: int
    _experience: int
    _usage: int
    _stats: CharacterStatsWelcome
    _equipment: EquipmentWelcome
    _guild_rank: int
    _settings: ServerSettings
    _login_message_code: LoginMessageCode

    def __init__(self, *, session_id: int, character_id: int, map_id: int, map_rid: Iterable[int], map_file_size: int, eif_rid: Iterable[int], eif_length: int, enf_rid: Iterable[int], enf_length: int, esf_rid: Iterable[int], esf_length: int, ecf_rid: Iterable[int], ecf_length: int, name: str, title: str, guild_name: str, guild_rank_name: str, class_id: int, guild_tag: str, admin: AdminLevel, level: int, experience: int, usage: int, stats: CharacterStatsWelcome, equipment: EquipmentWelcome, guild_rank: int, settings: ServerSettings, login_message_code: LoginMessageCode):
        """
        Create a new instance of WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter.

        Args:
            session_id (int): (Value range is 0-64008.)
            character_id (int): (Value range is 0-4097152080.)
            map_id (int): (Value range is 0-64008.)
            map_rid (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
            map_file_size (int): (Value range is 0-16194276.)
            eif_rid (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
            eif_length (int): (Value range is 0-64008.)
            enf_rid (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
            enf_length (int): (Value range is 0-64008.)
            esf_rid (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
            esf_length (int): (Value range is 0-64008.)
            ecf_rid (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
            ecf_length (int): (Value range is 0-64008.)
            name (str): 
            title (str): 
            guild_name (str): 
            guild_rank_name (str): 
            class_id (int): (Value range is 0-252.)
            guild_tag (str): (Length must be `3`.)
            admin (AdminLevel): 
            level (int): (Value range is 0-252.)
            experience (int): (Value range is 0-4097152080.)
            usage (int): (Value range is 0-4097152080.)
            stats (CharacterStatsWelcome): 
            equipment (EquipmentWelcome): 
            guild_rank (int): (Value range is 0-252.)
            settings (ServerSettings): 
            login_message_code (LoginMessageCode): 
        """
        self._session_id = session_id
        self._character_id = character_id
        self._map_id = map_id
        self._map_rid = tuple(map_rid)
        self._map_file_size = map_file_size
        self._eif_rid = tuple(eif_rid)
        self._eif_length = eif_length
        self._enf_rid = tuple(enf_rid)
        self._enf_length = enf_length
        self._esf_rid = tuple(esf_rid)
        self._esf_length = esf_length
        self._ecf_rid = tuple(ecf_rid)
        self._ecf_length = ecf_length
        self._name = name
        self._title = title
        self._guild_name = guild_name
        self._guild_rank_name = guild_rank_name
        self._class_id = class_id
        self._guild_tag = guild_tag
        self._admin = admin
        self._level = level
        self._experience = experience
        self._usage = usage
        self._stats = stats
        self._equipment = equipment
        self._guild_rank = guild_rank
        self._settings = settings
        self._login_message_code = login_message_code

    @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:
        return self._session_id

    @property
    def character_id(self) -> int:
        return self._character_id

    @property
    def map_id(self) -> int:
        return self._map_id

    @property
    def map_rid(self) -> tuple[int, ...]:
        return self._map_rid

    @property
    def map_file_size(self) -> int:
        return self._map_file_size

    @property
    def eif_rid(self) -> tuple[int, ...]:
        return self._eif_rid

    @property
    def eif_length(self) -> int:
        return self._eif_length

    @property
    def enf_rid(self) -> tuple[int, ...]:
        return self._enf_rid

    @property
    def enf_length(self) -> int:
        return self._enf_length

    @property
    def esf_rid(self) -> tuple[int, ...]:
        return self._esf_rid

    @property
    def esf_length(self) -> int:
        return self._esf_length

    @property
    def ecf_rid(self) -> tuple[int, ...]:
        return self._ecf_rid

    @property
    def ecf_length(self) -> int:
        return self._ecf_length

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

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

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

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

    @property
    def class_id(self) -> int:
        return self._class_id

    @property
    def guild_tag(self) -> str:
        return self._guild_tag

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

    @property
    def level(self) -> int:
        return self._level

    @property
    def experience(self) -> int:
        return self._experience

    @property
    def usage(self) -> int:
        return self._usage

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

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

    @property
    def guild_rank(self) -> int:
        return self._guild_rank

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

    @property
    def login_message_code(self) -> LoginMessageCode:
        return self._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.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            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)
            writer.string_sanitization_mode = True
            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)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @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.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            session_id = reader.get_short()
            character_id = reader.get_int()
            map_id = reader.get_short()
            map_rid = []
            for i in range(2):
                map_rid.append(reader.get_short())
            map_file_size = reader.get_three()
            eif_rid = []
            for i in range(2):
                eif_rid.append(reader.get_short())
            eif_length = reader.get_short()
            enf_rid = []
            for i in range(2):
                enf_rid.append(reader.get_short())
            enf_length = reader.get_short()
            esf_rid = []
            for i in range(2):
                esf_rid.append(reader.get_short())
            esf_length = reader.get_short()
            ecf_rid = []
            for i in range(2):
                ecf_rid.append(reader.get_short())
            ecf_length = reader.get_short()
            reader.chunked_reading_mode = True
            name = reader.get_string()
            reader.next_chunk()
            title = reader.get_string()
            reader.next_chunk()
            guild_name = reader.get_string()
            reader.next_chunk()
            guild_rank_name = reader.get_string()
            reader.next_chunk()
            class_id = reader.get_char()
            guild_tag = reader.get_fixed_string(3, False)
            admin = AdminLevel(reader.get_char())
            level = reader.get_char()
            experience = reader.get_int()
            usage = reader.get_int()
            stats = CharacterStatsWelcome.deserialize(reader)
            equipment = EquipmentWelcome.deserialize(reader)
            guild_rank = reader.get_char()
            settings = ServerSettings.deserialize(reader)
            login_message_code = LoginMessageCode(reader.get_char())
            reader.next_chunk()
            reader.chunked_reading_mode = False
            result = WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter(session_id=session_id, character_id=character_id, map_id=map_id, map_rid=map_rid, map_file_size=map_file_size, eif_rid=eif_rid, eif_length=eif_length, enf_rid=enf_rid, enf_length=enf_length, esf_rid=esf_rid, esf_length=esf_length, ecf_rid=ecf_rid, ecf_length=ecf_length, name=name, title=title, guild_name=guild_name, guild_rank_name=guild_rank_name, class_id=class_id, guild_tag=guild_tag, admin=admin, level=level, experience=experience, usage=usage, stats=stats, equipment=equipment, guild_rank=guild_rank, settings=settings, login_message_code=login_message_code)
            result._byte_size = reader.position - reader_start_position
            return result
        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

character_id: int property

map_id: int property

map_rid: tuple[int, ...] property

map_file_size: int property

eif_rid: tuple[int, ...] property

eif_length: int property

enf_rid: tuple[int, ...] property

enf_length: int property

esf_rid: tuple[int, ...] property

esf_length: int property

ecf_rid: tuple[int, ...] property

ecf_length: int property

name: str property

title: str property

guild_name: str property

guild_rank_name: str property

class_id: int property

guild_tag: str property

admin: AdminLevel property

level: int property

experience: int property

usage: int property

stats: CharacterStatsWelcome property

equipment: EquipmentWelcome property

guild_rank: int property

settings: ServerSettings property

login_message_code: LoginMessageCode property

__init__(*, session_id, character_id, map_id, map_rid, map_file_size, eif_rid, eif_length, enf_rid, enf_length, esf_rid, esf_length, ecf_rid, ecf_length, name, title, guild_name, guild_rank_name, class_id, guild_tag, admin, level, experience, usage, stats, equipment, guild_rank, settings, login_message_code)

Create a new instance of WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter.

Parameters:

Name Type Description Default
session_id int

(Value range is 0-64008.)

required
character_id int

(Value range is 0-4097152080.)

required
map_id int

(Value range is 0-64008.)

required
map_rid Iterable[int]

(Length must be 2.) (Element value range is 0-64008.)

required
map_file_size int

(Value range is 0-16194276.)

required
eif_rid Iterable[int]

(Length must be 2.) (Element value range is 0-64008.)

required
eif_length int

(Value range is 0-64008.)

required
enf_rid Iterable[int]

(Length must be 2.) (Element value range is 0-64008.)

required
enf_length int

(Value range is 0-64008.)

required
esf_rid Iterable[int]

(Length must be 2.) (Element value range is 0-64008.)

required
esf_length int

(Value range is 0-64008.)

required
ecf_rid Iterable[int]

(Length must be 2.) (Element value range is 0-64008.)

required
ecf_length int

(Value range is 0-64008.)

required
name str
required
title str
required
guild_name str
required
guild_rank_name str
required
class_id int

(Value range is 0-252.)

required
guild_tag str

(Length must be 3.)

required
admin AdminLevel
required
level int

(Value range is 0-252.)

required
experience int

(Value range is 0-4097152080.)

required
usage int

(Value range is 0-4097152080.)

required
stats CharacterStatsWelcome
required
equipment EquipmentWelcome
required
guild_rank int

(Value range is 0-252.)

required
settings ServerSettings
required
login_message_code LoginMessageCode
required
Source code in src/eolib/protocol/_generated/net/server/welcome_reply_server_packet.py
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
def __init__(self, *, session_id: int, character_id: int, map_id: int, map_rid: Iterable[int], map_file_size: int, eif_rid: Iterable[int], eif_length: int, enf_rid: Iterable[int], enf_length: int, esf_rid: Iterable[int], esf_length: int, ecf_rid: Iterable[int], ecf_length: int, name: str, title: str, guild_name: str, guild_rank_name: str, class_id: int, guild_tag: str, admin: AdminLevel, level: int, experience: int, usage: int, stats: CharacterStatsWelcome, equipment: EquipmentWelcome, guild_rank: int, settings: ServerSettings, login_message_code: LoginMessageCode):
    """
    Create a new instance of WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter.

    Args:
        session_id (int): (Value range is 0-64008.)
        character_id (int): (Value range is 0-4097152080.)
        map_id (int): (Value range is 0-64008.)
        map_rid (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
        map_file_size (int): (Value range is 0-16194276.)
        eif_rid (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
        eif_length (int): (Value range is 0-64008.)
        enf_rid (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
        enf_length (int): (Value range is 0-64008.)
        esf_rid (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
        esf_length (int): (Value range is 0-64008.)
        ecf_rid (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
        ecf_length (int): (Value range is 0-64008.)
        name (str): 
        title (str): 
        guild_name (str): 
        guild_rank_name (str): 
        class_id (int): (Value range is 0-252.)
        guild_tag (str): (Length must be `3`.)
        admin (AdminLevel): 
        level (int): (Value range is 0-252.)
        experience (int): (Value range is 0-4097152080.)
        usage (int): (Value range is 0-4097152080.)
        stats (CharacterStatsWelcome): 
        equipment (EquipmentWelcome): 
        guild_rank (int): (Value range is 0-252.)
        settings (ServerSettings): 
        login_message_code (LoginMessageCode): 
    """
    self._session_id = session_id
    self._character_id = character_id
    self._map_id = map_id
    self._map_rid = tuple(map_rid)
    self._map_file_size = map_file_size
    self._eif_rid = tuple(eif_rid)
    self._eif_length = eif_length
    self._enf_rid = tuple(enf_rid)
    self._enf_length = enf_length
    self._esf_rid = tuple(esf_rid)
    self._esf_length = esf_length
    self._ecf_rid = tuple(ecf_rid)
    self._ecf_length = ecf_length
    self._name = name
    self._title = title
    self._guild_name = guild_name
    self._guild_rank_name = guild_rank_name
    self._class_id = class_id
    self._guild_tag = guild_tag
    self._admin = admin
    self._level = level
    self._experience = experience
    self._usage = usage
    self._stats = stats
    self._equipment = equipment
    self._guild_rank = guild_rank
    self._settings = settings
    self._login_message_code = login_message_code

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
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
@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.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        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)
        writer.string_sanitization_mode = True
        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)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

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
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
@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.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        session_id = reader.get_short()
        character_id = reader.get_int()
        map_id = reader.get_short()
        map_rid = []
        for i in range(2):
            map_rid.append(reader.get_short())
        map_file_size = reader.get_three()
        eif_rid = []
        for i in range(2):
            eif_rid.append(reader.get_short())
        eif_length = reader.get_short()
        enf_rid = []
        for i in range(2):
            enf_rid.append(reader.get_short())
        enf_length = reader.get_short()
        esf_rid = []
        for i in range(2):
            esf_rid.append(reader.get_short())
        esf_length = reader.get_short()
        ecf_rid = []
        for i in range(2):
            ecf_rid.append(reader.get_short())
        ecf_length = reader.get_short()
        reader.chunked_reading_mode = True
        name = reader.get_string()
        reader.next_chunk()
        title = reader.get_string()
        reader.next_chunk()
        guild_name = reader.get_string()
        reader.next_chunk()
        guild_rank_name = reader.get_string()
        reader.next_chunk()
        class_id = reader.get_char()
        guild_tag = reader.get_fixed_string(3, False)
        admin = AdminLevel(reader.get_char())
        level = reader.get_char()
        experience = reader.get_int()
        usage = reader.get_int()
        stats = CharacterStatsWelcome.deserialize(reader)
        equipment = EquipmentWelcome.deserialize(reader)
        guild_rank = reader.get_char()
        settings = ServerSettings.deserialize(reader)
        login_message_code = LoginMessageCode(reader.get_char())
        reader.next_chunk()
        reader.chunked_reading_mode = False
        result = WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter(session_id=session_id, character_id=character_id, map_id=map_id, map_rid=map_rid, map_file_size=map_file_size, eif_rid=eif_rid, eif_length=eif_length, enf_rid=enf_rid, enf_length=enf_length, esf_rid=esf_rid, esf_length=esf_length, ecf_rid=ecf_rid, ecf_length=ecf_length, name=name, title=title, guild_name=guild_name, guild_rank_name=guild_rank_name, class_id=class_id, guild_tag=guild_tag, admin=admin, level=level, experience=experience, usage=usage, stats=stats, equipment=equipment, guild_rank=guild_rank, settings=settings, login_message_code=login_message_code)
        result._byte_size = reader.position - reader_start_position
        return result
    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
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
class WelcomeCodeDataEnterGame:
    """
    Data associated with welcome_code value WelcomeCode.EnterGame
    """
    _byte_size: int = 0
    _news: tuple[str, ...]
    _weight: Weight
    _items: tuple[Item, ...]
    _spells: tuple[Spell, ...]
    _nearby: NearbyInfo

    def __init__(self, *, news: Iterable[str], weight: Weight, items: Iterable[Item], spells: Iterable[Spell], nearby: NearbyInfo):
        """
        Create a new instance of WelcomeReplyServerPacket.WelcomeCodeDataEnterGame.

        Args:
            news (Iterable[str]): (Length must be `9`.)
            weight (Weight): 
            items (Iterable[Item]): 
            spells (Iterable[Spell]): 
            nearby (NearbyInfo): 
        """
        self._news = tuple(news)
        self._weight = weight
        self._items = tuple(items)
        self._spells = tuple(spells)
        self._nearby = nearby

    @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) -> tuple[str, ...]:
        return self._news

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

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

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

    @property
    def nearby(self) -> NearbyInfo:
        return self._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.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            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):
                writer.add_string(data._news[i])
                writer.add_byte(0xFF)
            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)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @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.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            reader.next_chunk()
            news = []
            for i in range(9):
                news.append(reader.get_string())
                reader.next_chunk()
            weight = Weight.deserialize(reader)
            items_length = int(reader.remaining / 6)
            items = []
            for i in range(items_length):
                items.append(Item.deserialize(reader))
            reader.next_chunk()
            spells_length = int(reader.remaining / 4)
            spells = []
            for i in range(spells_length):
                spells.append(Spell.deserialize(reader))
            reader.next_chunk()
            nearby = NearbyInfo.deserialize(reader)
            reader.chunked_reading_mode = False
            result = WelcomeReplyServerPacket.WelcomeCodeDataEnterGame(news=news, weight=weight, items=items, spells=spells, nearby=nearby)
            result._byte_size = reader.position - reader_start_position
            return result
        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: tuple[str, ...] property

weight: Weight property

items: tuple[Item, ...] property

spells: tuple[Spell, ...] property

nearby: NearbyInfo property

__init__(*, news, weight, items, spells, nearby)

Create a new instance of WelcomeReplyServerPacket.WelcomeCodeDataEnterGame.

Parameters:

Name Type Description Default
news Iterable[str]

(Length must be 9.)

required
weight Weight
required
items Iterable[Item]
required
spells Iterable[Spell]
required
nearby NearbyInfo
required
Source code in src/eolib/protocol/_generated/net/server/welcome_reply_server_packet.py
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
def __init__(self, *, news: Iterable[str], weight: Weight, items: Iterable[Item], spells: Iterable[Spell], nearby: NearbyInfo):
    """
    Create a new instance of WelcomeReplyServerPacket.WelcomeCodeDataEnterGame.

    Args:
        news (Iterable[str]): (Length must be `9`.)
        weight (Weight): 
        items (Iterable[Item]): 
        spells (Iterable[Spell]): 
        nearby (NearbyInfo): 
    """
    self._news = tuple(news)
    self._weight = weight
    self._items = tuple(items)
    self._spells = tuple(spells)
    self._nearby = nearby

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
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
@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.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        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):
            writer.add_string(data._news[i])
            writer.add_byte(0xFF)
        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)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

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
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
@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.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        reader.next_chunk()
        news = []
        for i in range(9):
            news.append(reader.get_string())
            reader.next_chunk()
        weight = Weight.deserialize(reader)
        items_length = int(reader.remaining / 6)
        items = []
        for i in range(items_length):
            items.append(Item.deserialize(reader))
        reader.next_chunk()
        spells_length = int(reader.remaining / 4)
        spells = []
        for i in range(spells_length):
            spells.append(Spell.deserialize(reader))
        reader.next_chunk()
        nearby = NearbyInfo.deserialize(reader)
        reader.chunked_reading_mode = False
        result = WelcomeReplyServerPacket.WelcomeCodeDataEnterGame(news=news, weight=weight, items=items, spells=spells, nearby=nearby)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

__init__(*, welcome_code, welcome_code_data=None)

Create a new instance of WelcomeReplyServerPacket.

Parameters:

Name Type Description Default
welcome_code WelcomeCode
required
welcome_code_data WelcomeCodeData

Data associated with the welcome_code field.

None
Source code in src/eolib/protocol/_generated/net/server/welcome_reply_server_packet.py
34
35
36
37
38
39
40
41
42
43
def __init__(self, *, welcome_code: WelcomeCode, welcome_code_data: 'WelcomeReplyServerPacket.WelcomeCodeData' = None):
    """
    Create a new instance of WelcomeReplyServerPacket.

    Args:
        welcome_code (WelcomeCode): 
        welcome_code_data (WelcomeReplyServerPacket.WelcomeCodeData): Data associated with the `welcome_code` field.
    """
    self._welcome_code = welcome_code
    self._welcome_code_data = welcome_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/welcome_reply_server_packet.py
66
67
68
69
70
71
72
73
74
@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
76
77
78
79
80
81
82
83
84
@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
86
87
88
89
90
91
92
93
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
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
@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.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        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)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

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
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
@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.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        welcome_code = WelcomeCode(reader.get_short())
        welcome_code_data: WelcomeReplyServerPacket.WelcomeCodeData = None
        if welcome_code == WelcomeCode.SelectCharacter:
            welcome_code_data = WelcomeReplyServerPacket.WelcomeCodeDataSelectCharacter.deserialize(reader)
        elif welcome_code == WelcomeCode.EnterGame:
            welcome_code_data = WelcomeReplyServerPacket.WelcomeCodeDataEnterGame.deserialize(reader)
        result = WelcomeReplyServerPacket(welcome_code=welcome_code, welcome_code_data=welcome_code_data)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

WelcomePongServerPacket

Bases: Packet

Equivalent to INIT_INIT with InitReply.FileEif

Source code in src/eolib/protocol/_generated/net/server/welcome_pong_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
class WelcomePongServerPacket(Packet):
    """
    Equivalent to INIT_INIT with InitReply.FileEif
    """
    _byte_size: int = 0
    _pub_file: PubFile

    def __init__(self, *, pub_file: PubFile):
        """
        Create a new instance of WelcomePongServerPacket.

        Args:
            pub_file (PubFile): 
        """
        self._pub_file = pub_file

    @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 pub_file(self) -> PubFile:
        return self._pub_file

    @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.Pong

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (WelcomePongServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._pub_file is None:
                raise SerializationError("pub_file must be provided.")
            PubFile.serialize(writer, data._pub_file)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            WelcomePongServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            pub_file = PubFile.deserialize(reader)
            result = WelcomePongServerPacket(pub_file=pub_file)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"WelcomePongServerPacket(byte_size={repr(self._byte_size)}, pub_file={repr(self._pub_file)})"

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.

pub_file: PubFile property

__init__(*, pub_file)

Create a new instance of WelcomePongServerPacket.

Parameters:

Name Type Description Default
pub_file PubFile
required
Source code in src/eolib/protocol/_generated/net/server/welcome_pong_server_packet.py
21
22
23
24
25
26
27
28
def __init__(self, *, pub_file: PubFile):
    """
    Create a new instance of WelcomePongServerPacket.

    Args:
        pub_file (PubFile): 
    """
    self._pub_file = pub_file

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_pong_server_packet.py
44
45
46
47
48
49
50
51
52
@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_pong_server_packet.py
54
55
56
57
58
59
60
61
62
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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_pong_server_packet.py
64
65
66
67
68
69
70
71
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.
    """
    WelcomePongServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of WelcomePongServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data WelcomePongServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/welcome_pong_server_packet.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@staticmethod
def serialize(writer: EoWriter, data: "WelcomePongServerPacket") -> None:
    """
    Serializes an instance of `WelcomePongServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (WelcomePongServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._pub_file is None:
            raise SerializationError("pub_file must be provided.")
        PubFile.serialize(writer, data._pub_file)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/welcome_pong_server_packet.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@staticmethod
def deserialize(reader: EoReader) -> "WelcomePongServerPacket":
    """
    Deserializes an instance of `WelcomePongServerPacket` from the provided `EoReader`.

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

    Returns:
        WelcomePongServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        pub_file = PubFile.deserialize(reader)
        result = WelcomePongServerPacket(pub_file=pub_file)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

WelcomePingServerPacket

Bases: Packet

Equivalent to INIT_INIT with InitReply.FileMap

Source code in src/eolib/protocol/_generated/net/server/welcome_ping_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
class WelcomePingServerPacket(Packet):
    """
    Equivalent to INIT_INIT with InitReply.FileMap
    """
    _byte_size: int = 0
    _map_file: MapFile

    def __init__(self, *, map_file: MapFile):
        """
        Create a new instance of WelcomePingServerPacket.

        Args:
            map_file (MapFile): 
        """
        self._map_file = map_file

    @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 map_file(self) -> MapFile:
        return self._map_file

    @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.Ping

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (WelcomePingServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._map_file is None:
                raise SerializationError("map_file must be provided.")
            MapFile.serialize(writer, data._map_file)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            WelcomePingServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            map_file = MapFile.deserialize(reader)
            result = WelcomePingServerPacket(map_file=map_file)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"WelcomePingServerPacket(byte_size={repr(self._byte_size)}, map_file={repr(self._map_file)})"

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.

map_file: MapFile property

__init__(*, map_file)

Create a new instance of WelcomePingServerPacket.

Parameters:

Name Type Description Default
map_file MapFile
required
Source code in src/eolib/protocol/_generated/net/server/welcome_ping_server_packet.py
21
22
23
24
25
26
27
28
def __init__(self, *, map_file: MapFile):
    """
    Create a new instance of WelcomePingServerPacket.

    Args:
        map_file (MapFile): 
    """
    self._map_file = map_file

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_ping_server_packet.py
44
45
46
47
48
49
50
51
52
@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_ping_server_packet.py
54
55
56
57
58
59
60
61
62
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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_ping_server_packet.py
64
65
66
67
68
69
70
71
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.
    """
    WelcomePingServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of WelcomePingServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data WelcomePingServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/welcome_ping_server_packet.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@staticmethod
def serialize(writer: EoWriter, data: "WelcomePingServerPacket") -> None:
    """
    Serializes an instance of `WelcomePingServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (WelcomePingServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._map_file is None:
            raise SerializationError("map_file must be provided.")
        MapFile.serialize(writer, data._map_file)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/welcome_ping_server_packet.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@staticmethod
def deserialize(reader: EoReader) -> "WelcomePingServerPacket":
    """
    Deserializes an instance of `WelcomePingServerPacket` from the provided `EoReader`.

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

    Returns:
        WelcomePingServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        map_file = MapFile.deserialize(reader)
        result = WelcomePingServerPacket(map_file=map_file)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

WelcomeNet244ServerPacket

Bases: Packet

Equivalent to INIT_INIT with InitReply.FileEcf

Source code in src/eolib/protocol/_generated/net/server/welcome_net244_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
class WelcomeNet244ServerPacket(Packet):
    """
    Equivalent to INIT_INIT with InitReply.FileEcf
    """
    _byte_size: int = 0
    _pub_file: PubFile

    def __init__(self, *, pub_file: PubFile):
        """
        Create a new instance of WelcomeNet244ServerPacket.

        Args:
            pub_file (PubFile): 
        """
        self._pub_file = pub_file

    @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 pub_file(self) -> PubFile:
        return self._pub_file

    @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.Net244

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (WelcomeNet244ServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._pub_file is None:
                raise SerializationError("pub_file must be provided.")
            PubFile.serialize(writer, data._pub_file)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            WelcomeNet244ServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            pub_file = PubFile.deserialize(reader)
            result = WelcomeNet244ServerPacket(pub_file=pub_file)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"WelcomeNet244ServerPacket(byte_size={repr(self._byte_size)}, pub_file={repr(self._pub_file)})"

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.

pub_file: PubFile property

__init__(*, pub_file)

Create a new instance of WelcomeNet244ServerPacket.

Parameters:

Name Type Description Default
pub_file PubFile
required
Source code in src/eolib/protocol/_generated/net/server/welcome_net244_server_packet.py
21
22
23
24
25
26
27
28
def __init__(self, *, pub_file: PubFile):
    """
    Create a new instance of WelcomeNet244ServerPacket.

    Args:
        pub_file (PubFile): 
    """
    self._pub_file = pub_file

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_net244_server_packet.py
44
45
46
47
48
49
50
51
52
@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_net244_server_packet.py
54
55
56
57
58
59
60
61
62
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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_net244_server_packet.py
64
65
66
67
68
69
70
71
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.
    """
    WelcomeNet244ServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of WelcomeNet244ServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data WelcomeNet244ServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/welcome_net244_server_packet.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@staticmethod
def serialize(writer: EoWriter, data: "WelcomeNet244ServerPacket") -> None:
    """
    Serializes an instance of `WelcomeNet244ServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (WelcomeNet244ServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._pub_file is None:
            raise SerializationError("pub_file must be provided.")
        PubFile.serialize(writer, data._pub_file)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/welcome_net244_server_packet.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@staticmethod
def deserialize(reader: EoReader) -> "WelcomeNet244ServerPacket":
    """
    Deserializes an instance of `WelcomeNet244ServerPacket` from the provided `EoReader`.

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

    Returns:
        WelcomeNet244ServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        pub_file = PubFile.deserialize(reader)
        result = WelcomeNet244ServerPacket(pub_file=pub_file)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

WelcomeNet243ServerPacket

Bases: Packet

Equivalent to INIT_INIT with InitReply.FileEsf

Source code in src/eolib/protocol/_generated/net/server/welcome_net243_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
class WelcomeNet243ServerPacket(Packet):
    """
    Equivalent to INIT_INIT with InitReply.FileEsf
    """
    _byte_size: int = 0
    _pub_file: PubFile

    def __init__(self, *, pub_file: PubFile):
        """
        Create a new instance of WelcomeNet243ServerPacket.

        Args:
            pub_file (PubFile): 
        """
        self._pub_file = pub_file

    @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 pub_file(self) -> PubFile:
        return self._pub_file

    @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.Net243

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (WelcomeNet243ServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._pub_file is None:
                raise SerializationError("pub_file must be provided.")
            PubFile.serialize(writer, data._pub_file)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            WelcomeNet243ServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            pub_file = PubFile.deserialize(reader)
            result = WelcomeNet243ServerPacket(pub_file=pub_file)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"WelcomeNet243ServerPacket(byte_size={repr(self._byte_size)}, pub_file={repr(self._pub_file)})"

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.

pub_file: PubFile property

__init__(*, pub_file)

Create a new instance of WelcomeNet243ServerPacket.

Parameters:

Name Type Description Default
pub_file PubFile
required
Source code in src/eolib/protocol/_generated/net/server/welcome_net243_server_packet.py
21
22
23
24
25
26
27
28
def __init__(self, *, pub_file: PubFile):
    """
    Create a new instance of WelcomeNet243ServerPacket.

    Args:
        pub_file (PubFile): 
    """
    self._pub_file = pub_file

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_net243_server_packet.py
44
45
46
47
48
49
50
51
52
@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_net243_server_packet.py
54
55
56
57
58
59
60
61
62
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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_net243_server_packet.py
64
65
66
67
68
69
70
71
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.
    """
    WelcomeNet243ServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of WelcomeNet243ServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data WelcomeNet243ServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/welcome_net243_server_packet.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@staticmethod
def serialize(writer: EoWriter, data: "WelcomeNet243ServerPacket") -> None:
    """
    Serializes an instance of `WelcomeNet243ServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (WelcomeNet243ServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._pub_file is None:
            raise SerializationError("pub_file must be provided.")
        PubFile.serialize(writer, data._pub_file)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/welcome_net243_server_packet.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@staticmethod
def deserialize(reader: EoReader) -> "WelcomeNet243ServerPacket":
    """
    Deserializes an instance of `WelcomeNet243ServerPacket` from the provided `EoReader`.

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

    Returns:
        WelcomeNet243ServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        pub_file = PubFile.deserialize(reader)
        result = WelcomeNet243ServerPacket(pub_file=pub_file)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

WelcomeNet242ServerPacket

Bases: Packet

Equivalent to INIT_INIT with InitReply.FileEnf

Source code in src/eolib/protocol/_generated/net/server/welcome_net242_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
class WelcomeNet242ServerPacket(Packet):
    """
    Equivalent to INIT_INIT with InitReply.FileEnf
    """
    _byte_size: int = 0
    _pub_file: PubFile

    def __init__(self, *, pub_file: PubFile):
        """
        Create a new instance of WelcomeNet242ServerPacket.

        Args:
            pub_file (PubFile): 
        """
        self._pub_file = pub_file

    @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 pub_file(self) -> PubFile:
        return self._pub_file

    @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.Net242

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (WelcomeNet242ServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._pub_file is None:
                raise SerializationError("pub_file must be provided.")
            PubFile.serialize(writer, data._pub_file)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            WelcomeNet242ServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            pub_file = PubFile.deserialize(reader)
            result = WelcomeNet242ServerPacket(pub_file=pub_file)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"WelcomeNet242ServerPacket(byte_size={repr(self._byte_size)}, pub_file={repr(self._pub_file)})"

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.

pub_file: PubFile property

__init__(*, pub_file)

Create a new instance of WelcomeNet242ServerPacket.

Parameters:

Name Type Description Default
pub_file PubFile
required
Source code in src/eolib/protocol/_generated/net/server/welcome_net242_server_packet.py
21
22
23
24
25
26
27
28
def __init__(self, *, pub_file: PubFile):
    """
    Create a new instance of WelcomeNet242ServerPacket.

    Args:
        pub_file (PubFile): 
    """
    self._pub_file = pub_file

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_net242_server_packet.py
44
45
46
47
48
49
50
51
52
@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_net242_server_packet.py
54
55
56
57
58
59
60
61
62
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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_net242_server_packet.py
64
65
66
67
68
69
70
71
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.
    """
    WelcomeNet242ServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of WelcomeNet242ServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data WelcomeNet242ServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/welcome_net242_server_packet.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@staticmethod
def serialize(writer: EoWriter, data: "WelcomeNet242ServerPacket") -> None:
    """
    Serializes an instance of `WelcomeNet242ServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (WelcomeNet242ServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._pub_file is None:
            raise SerializationError("pub_file must be provided.")
        PubFile.serialize(writer, data._pub_file)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/welcome_net242_server_packet.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@staticmethod
def deserialize(reader: EoReader) -> "WelcomeNet242ServerPacket":
    """
    Deserializes an instance of `WelcomeNet242ServerPacket` from the provided `EoReader`.

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

    Returns:
        WelcomeNet242ServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        pub_file = PubFile.deserialize(reader)
        result = WelcomeNet242ServerPacket(pub_file=pub_file)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

WelcomeCode

Bases: IntEnum

Reply code sent with WELCOME_REPLY packet

Source code in src/eolib/protocol/_generated/net/server/welcome_code.py
 9
10
11
12
13
14
15
16
class WelcomeCode(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Reply code sent with WELCOME_REPLY packet
    """
    SelectCharacter = 1
    EnterGame = 2
    ServerBusy = 3
    LoggedIn = 4

SelectCharacter = 1 class-attribute instance-attribute

EnterGame = 2 class-attribute instance-attribute

ServerBusy = 3 class-attribute instance-attribute

LoggedIn = 4 class-attribute instance-attribute

WarpRequestServerPacket

Bases: Packet

Warp request from server

Source code in src/eolib/protocol/_generated/net/server/warp_request_server_packet.py
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
class WarpRequestServerPacket(Packet):
    """
    Warp request from server
    """
    _byte_size: int = 0
    _warp_type: WarpType
    _map_id: int
    _warp_type_data: 'WarpRequestServerPacket.WarpTypeData'
    _session_id: int

    def __init__(self, *, warp_type: WarpType, map_id: int, warp_type_data: 'WarpRequestServerPacket.WarpTypeData' = None, session_id: int):
        """
        Create a new instance of WarpRequestServerPacket.

        Args:
            warp_type (WarpType): 
            map_id (int): (Value range is 0-64008.)
            warp_type_data (WarpRequestServerPacket.WarpTypeData): Data associated with the `warp_type` field.
            session_id (int): (Value range is 0-64008.)
        """
        self._warp_type = warp_type
        self._map_id = map_id
        self._warp_type_data = warp_type_data
        self._session_id = session_id

    @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 warp_type(self) -> WarpType:
        return self._warp_type

    @property
    def map_id(self) -> int:
        return self._map_id

    @property
    def warp_type_data(self) -> 'WarpRequestServerPacket.WarpTypeData':
        """
        WarpRequestServerPacket.WarpTypeData: Data associated with the `warp_type` field.
        """
        return self._warp_type_data

    @property
    def session_id(self) -> int:
        return self._session_id

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (WarpRequestServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._warp_type is None:
                raise SerializationError("warp_type must be provided.")
            writer.add_char(int(data._warp_type))
            if data._map_id is None:
                raise SerializationError("map_id must be provided.")
            writer.add_short(data._map_id)
            if data._warp_type == WarpType.MapSwitch:
                if not isinstance(data._warp_type_data, WarpRequestServerPacket.WarpTypeDataMapSwitch):
                    raise SerializationError("Expected warp_type_data to be type WarpRequestServerPacket.WarpTypeDataMapSwitch for warp_type " + WarpType(data._warp_type).name + ".")
                WarpRequestServerPacket.WarpTypeDataMapSwitch.serialize(writer, data._warp_type_data)
            if data._session_id is None:
                raise SerializationError("session_id must be provided.")
            writer.add_short(data._session_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            WarpRequestServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            warp_type = WarpType(reader.get_char())
            map_id = reader.get_short()
            warp_type_data: WarpRequestServerPacket.WarpTypeData = None
            if warp_type == WarpType.MapSwitch:
                warp_type_data = WarpRequestServerPacket.WarpTypeDataMapSwitch.deserialize(reader)
            session_id = reader.get_short()
            result = WarpRequestServerPacket(warp_type=warp_type, map_id=map_id, warp_type_data=warp_type_data, session_id=session_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"WarpRequestServerPacket(byte_size={repr(self._byte_size)}, warp_type={repr(self._warp_type)}, map_id={repr(self._map_id)}, warp_type_data={repr(self._warp_type_data)}, session_id={repr(self._session_id)})"

    WarpTypeData = Union['WarpRequestServerPacket.WarpTypeDataMapSwitch', None]
    """
    Data associated with different values of the `warp_type` field.
    """

    class WarpTypeDataMapSwitch:
        """
        Data associated with warp_type value WarpType.MapSwitch
        """
        _byte_size: int = 0
        _map_rid: tuple[int, ...]
        _map_file_size: int

        def __init__(self, *, map_rid: Iterable[int], map_file_size: int):
            """
            Create a new instance of WarpRequestServerPacket.WarpTypeDataMapSwitch.

            Args:
                map_rid (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
                map_file_size (int): (Value range is 0-16194276.)
            """
            self._map_rid = tuple(map_rid)
            self._map_file_size = map_file_size

        @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 map_rid(self) -> tuple[int, ...]:
            return self._map_rid

        @property
        def map_file_size(self) -> int:
            return self._map_file_size

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

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (WarpRequestServerPacket.WarpTypeDataMapSwitch): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                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)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

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

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

            Returns:
                WarpRequestServerPacket.WarpTypeDataMapSwitch: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                map_rid = []
                for i in range(2):
                    map_rid.append(reader.get_short())
                map_file_size = reader.get_three()
                result = WarpRequestServerPacket.WarpTypeDataMapSwitch(map_rid=map_rid, map_file_size=map_file_size)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"WarpRequestServerPacket.WarpTypeDataMapSwitch(byte_size={repr(self._byte_size)}, map_rid={repr(self._map_rid)}, map_file_size={repr(self._map_file_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.

warp_type: WarpType property

map_id: int property

warp_type_data: 'WarpRequestServerPacket.WarpTypeData' property

WarpRequestServerPacket.WarpTypeData: Data associated with the warp_type field.

session_id: int property

WarpTypeData = Union['WarpRequestServerPacket.WarpTypeDataMapSwitch', None] class-attribute instance-attribute

Data associated with different values of the warp_type field.

WarpTypeDataMapSwitch

Data associated with warp_type value WarpType.MapSwitch

Source code in src/eolib/protocol/_generated/net/server/warp_request_server_packet.py
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
class WarpTypeDataMapSwitch:
    """
    Data associated with warp_type value WarpType.MapSwitch
    """
    _byte_size: int = 0
    _map_rid: tuple[int, ...]
    _map_file_size: int

    def __init__(self, *, map_rid: Iterable[int], map_file_size: int):
        """
        Create a new instance of WarpRequestServerPacket.WarpTypeDataMapSwitch.

        Args:
            map_rid (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
            map_file_size (int): (Value range is 0-16194276.)
        """
        self._map_rid = tuple(map_rid)
        self._map_file_size = map_file_size

    @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 map_rid(self) -> tuple[int, ...]:
        return self._map_rid

    @property
    def map_file_size(self) -> int:
        return self._map_file_size

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (WarpRequestServerPacket.WarpTypeDataMapSwitch): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            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)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            WarpRequestServerPacket.WarpTypeDataMapSwitch: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            map_rid = []
            for i in range(2):
                map_rid.append(reader.get_short())
            map_file_size = reader.get_three()
            result = WarpRequestServerPacket.WarpTypeDataMapSwitch(map_rid=map_rid, map_file_size=map_file_size)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"WarpRequestServerPacket.WarpTypeDataMapSwitch(byte_size={repr(self._byte_size)}, map_rid={repr(self._map_rid)}, map_file_size={repr(self._map_file_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.

map_rid: tuple[int, ...] property

map_file_size: int property

__init__(*, map_rid, map_file_size)

Create a new instance of WarpRequestServerPacket.WarpTypeDataMapSwitch.

Parameters:

Name Type Description Default
map_rid Iterable[int]

(Length must be 2.) (Element value range is 0-64008.)

required
map_file_size int

(Value range is 0-16194276.)

required
Source code in src/eolib/protocol/_generated/net/server/warp_request_server_packet.py
169
170
171
172
173
174
175
176
177
178
def __init__(self, *, map_rid: Iterable[int], map_file_size: int):
    """
    Create a new instance of WarpRequestServerPacket.WarpTypeDataMapSwitch.

    Args:
        map_rid (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
        map_file_size (int): (Value range is 0-16194276.)
    """
    self._map_rid = tuple(map_rid)
    self._map_file_size = map_file_size

serialize(writer, data) staticmethod

Serializes an instance of WarpRequestServerPacket.WarpTypeDataMapSwitch to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data WarpTypeDataMapSwitch

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/warp_request_server_packet.py
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
@staticmethod
def serialize(writer: EoWriter, data: "WarpRequestServerPacket.WarpTypeDataMapSwitch") -> None:
    """
    Serializes an instance of `WarpRequestServerPacket.WarpTypeDataMapSwitch` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (WarpRequestServerPacket.WarpTypeDataMapSwitch): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        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)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of WarpRequestServerPacket.WarpTypeDataMapSwitch from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'WarpRequestServerPacket.WarpTypeDataMapSwitch'

WarpRequestServerPacket.WarpTypeDataMapSwitch: The data to serialize.

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

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

    Returns:
        WarpRequestServerPacket.WarpTypeDataMapSwitch: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        map_rid = []
        for i in range(2):
            map_rid.append(reader.get_short())
        map_file_size = reader.get_three()
        result = WarpRequestServerPacket.WarpTypeDataMapSwitch(map_rid=map_rid, map_file_size=map_file_size)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

__init__(*, warp_type, map_id, warp_type_data=None, session_id)

Create a new instance of WarpRequestServerPacket.

Parameters:

Name Type Description Default
warp_type WarpType
required
map_id int

(Value range is 0-64008.)

required
warp_type_data WarpTypeData

Data associated with the warp_type field.

None
session_id int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/warp_request_server_packet.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
def __init__(self, *, warp_type: WarpType, map_id: int, warp_type_data: 'WarpRequestServerPacket.WarpTypeData' = None, session_id: int):
    """
    Create a new instance of WarpRequestServerPacket.

    Args:
        warp_type (WarpType): 
        map_id (int): (Value range is 0-64008.)
        warp_type_data (WarpRequestServerPacket.WarpTypeData): Data associated with the `warp_type` field.
        session_id (int): (Value range is 0-64008.)
    """
    self._warp_type = warp_type
    self._map_id = map_id
    self._warp_type_data = warp_type_data
    self._session_id = session_id

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/warp_request_server_packet.py
71
72
73
74
75
76
77
78
79
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/warp_request_server_packet.py
81
82
83
84
85
86
87
88
89
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/warp_request_server_packet.py
91
92
93
94
95
96
97
98
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.
    """
    WarpRequestServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of WarpRequestServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data WarpRequestServerPacket

The data to serialize.

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

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (WarpRequestServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._warp_type is None:
            raise SerializationError("warp_type must be provided.")
        writer.add_char(int(data._warp_type))
        if data._map_id is None:
            raise SerializationError("map_id must be provided.")
        writer.add_short(data._map_id)
        if data._warp_type == WarpType.MapSwitch:
            if not isinstance(data._warp_type_data, WarpRequestServerPacket.WarpTypeDataMapSwitch):
                raise SerializationError("Expected warp_type_data to be type WarpRequestServerPacket.WarpTypeDataMapSwitch for warp_type " + WarpType(data._warp_type).name + ".")
            WarpRequestServerPacket.WarpTypeDataMapSwitch.serialize(writer, data._warp_type_data)
        if data._session_id is None:
            raise SerializationError("session_id must be provided.")
        writer.add_short(data._session_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

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

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

    Returns:
        WarpRequestServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        warp_type = WarpType(reader.get_char())
        map_id = reader.get_short()
        warp_type_data: WarpRequestServerPacket.WarpTypeData = None
        if warp_type == WarpType.MapSwitch:
            warp_type_data = WarpRequestServerPacket.WarpTypeDataMapSwitch.deserialize(reader)
        session_id = reader.get_short()
        result = WarpRequestServerPacket(warp_type=warp_type, map_id=map_id, warp_type_data=warp_type_data, session_id=session_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

WarpPlayerServerPacket

Bases: Packet

Equivalent to INIT_INIT with InitReply.WarpMap

Source code in src/eolib/protocol/_generated/net/server/warp_player_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
class WarpPlayerServerPacket(Packet):
    """
    Equivalent to INIT_INIT with InitReply.WarpMap
    """
    _byte_size: int = 0
    _map_file: MapFile

    def __init__(self, *, map_file: MapFile):
        """
        Create a new instance of WarpPlayerServerPacket.

        Args:
            map_file (MapFile): 
        """
        self._map_file = map_file

    @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 map_file(self) -> MapFile:
        return self._map_file

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (WarpPlayerServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._map_file is None:
                raise SerializationError("map_file must be provided.")
            MapFile.serialize(writer, data._map_file)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            WarpPlayerServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            map_file = MapFile.deserialize(reader)
            result = WarpPlayerServerPacket(map_file=map_file)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"WarpPlayerServerPacket(byte_size={repr(self._byte_size)}, map_file={repr(self._map_file)})"

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.

map_file: MapFile property

__init__(*, map_file)

Create a new instance of WarpPlayerServerPacket.

Parameters:

Name Type Description Default
map_file MapFile
required
Source code in src/eolib/protocol/_generated/net/server/warp_player_server_packet.py
21
22
23
24
25
26
27
28
def __init__(self, *, map_file: MapFile):
    """
    Create a new instance of WarpPlayerServerPacket.

    Args:
        map_file (MapFile): 
    """
    self._map_file = map_file

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/warp_player_server_packet.py
44
45
46
47
48
49
50
51
52
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/warp_player_server_packet.py
54
55
56
57
58
59
60
61
62
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/warp_player_server_packet.py
64
65
66
67
68
69
70
71
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.
    """
    WarpPlayerServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of WarpPlayerServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data WarpPlayerServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/warp_player_server_packet.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@staticmethod
def serialize(writer: EoWriter, data: "WarpPlayerServerPacket") -> None:
    """
    Serializes an instance of `WarpPlayerServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (WarpPlayerServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._map_file is None:
            raise SerializationError("map_file must be provided.")
        MapFile.serialize(writer, data._map_file)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/warp_player_server_packet.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@staticmethod
def deserialize(reader: EoReader) -> "WarpPlayerServerPacket":
    """
    Deserializes an instance of `WarpPlayerServerPacket` from the provided `EoReader`.

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

    Returns:
        WarpPlayerServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        map_file = MapFile.deserialize(reader)
        result = WarpPlayerServerPacket(map_file=map_file)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

WarpCreateServerPacket

Bases: Packet

Equivalent to INIT_INIT with InitReply.MapMutation

Source code in src/eolib/protocol/_generated/net/server/warp_create_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
class WarpCreateServerPacket(Packet):
    """
    Equivalent to INIT_INIT with InitReply.MapMutation
    """
    _byte_size: int = 0
    _map_file: MapFile

    def __init__(self, *, map_file: MapFile):
        """
        Create a new instance of WarpCreateServerPacket.

        Args:
            map_file (MapFile): 
        """
        self._map_file = map_file

    @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 map_file(self) -> MapFile:
        return self._map_file

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (WarpCreateServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._map_file is None:
                raise SerializationError("map_file must be provided.")
            MapFile.serialize(writer, data._map_file)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            WarpCreateServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            map_file = MapFile.deserialize(reader)
            result = WarpCreateServerPacket(map_file=map_file)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"WarpCreateServerPacket(byte_size={repr(self._byte_size)}, map_file={repr(self._map_file)})"

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.

map_file: MapFile property

__init__(*, map_file)

Create a new instance of WarpCreateServerPacket.

Parameters:

Name Type Description Default
map_file MapFile
required
Source code in src/eolib/protocol/_generated/net/server/warp_create_server_packet.py
21
22
23
24
25
26
27
28
def __init__(self, *, map_file: MapFile):
    """
    Create a new instance of WarpCreateServerPacket.

    Args:
        map_file (MapFile): 
    """
    self._map_file = map_file

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/warp_create_server_packet.py
44
45
46
47
48
49
50
51
52
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/warp_create_server_packet.py
54
55
56
57
58
59
60
61
62
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/warp_create_server_packet.py
64
65
66
67
68
69
70
71
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.
    """
    WarpCreateServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of WarpCreateServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data WarpCreateServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/warp_create_server_packet.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@staticmethod
def serialize(writer: EoWriter, data: "WarpCreateServerPacket") -> None:
    """
    Serializes an instance of `WarpCreateServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (WarpCreateServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._map_file is None:
            raise SerializationError("map_file must be provided.")
        MapFile.serialize(writer, data._map_file)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/warp_create_server_packet.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@staticmethod
def deserialize(reader: EoReader) -> "WarpCreateServerPacket":
    """
    Deserializes an instance of `WarpCreateServerPacket` from the provided `EoReader`.

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

    Returns:
        WarpCreateServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        map_file = MapFile.deserialize(reader)
        result = WarpCreateServerPacket(map_file=map_file)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

WarpType

Bases: IntEnum

Indicates whether a warp is within the current map, or switching to another map

Source code in src/eolib/protocol/_generated/net/server/warp_type.py
 9
10
11
12
13
14
class WarpType(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Indicates whether a warp is within the current map, or switching to another map
    """
    Local = 1
    MapSwitch = 2

Local = 1 class-attribute instance-attribute

MapSwitch = 2 class-attribute instance-attribute

WarpAgreeServerPacket

Bases: Packet

Reply after accepting a warp

Source code in src/eolib/protocol/_generated/net/server/warp_agree_server_packet.py
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
class WarpAgreeServerPacket(Packet):
    """
    Reply after accepting a warp
    """
    _byte_size: int = 0
    _warp_type: WarpType
    _warp_type_data: 'WarpAgreeServerPacket.WarpTypeData'
    _nearby: NearbyInfo

    def __init__(self, *, warp_type: WarpType, warp_type_data: 'WarpAgreeServerPacket.WarpTypeData' = None, nearby: NearbyInfo):
        """
        Create a new instance of WarpAgreeServerPacket.

        Args:
            warp_type (WarpType): 
            warp_type_data (WarpAgreeServerPacket.WarpTypeData): Data associated with the `warp_type` field.
            nearby (NearbyInfo): 
        """
        self._warp_type = warp_type
        self._warp_type_data = warp_type_data
        self._nearby = nearby

    @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 warp_type(self) -> WarpType:
        return self._warp_type

    @property
    def warp_type_data(self) -> 'WarpAgreeServerPacket.WarpTypeData':
        """
        WarpAgreeServerPacket.WarpTypeData: Data associated with the `warp_type` field.
        """
        return self._warp_type_data

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

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (WarpAgreeServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._warp_type is None:
                raise SerializationError("warp_type must be provided.")
            writer.add_char(int(data._warp_type))
            if data._warp_type == WarpType.MapSwitch:
                if not isinstance(data._warp_type_data, WarpAgreeServerPacket.WarpTypeDataMapSwitch):
                    raise SerializationError("Expected warp_type_data to be type WarpAgreeServerPacket.WarpTypeDataMapSwitch for warp_type " + WarpType(data._warp_type).name + ".")
                WarpAgreeServerPacket.WarpTypeDataMapSwitch.serialize(writer, data._warp_type_data)
            if data._nearby is None:
                raise SerializationError("nearby must be provided.")
            NearbyInfo.serialize(writer, data._nearby)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            WarpAgreeServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            warp_type = WarpType(reader.get_char())
            warp_type_data: WarpAgreeServerPacket.WarpTypeData = None
            if warp_type == WarpType.MapSwitch:
                warp_type_data = WarpAgreeServerPacket.WarpTypeDataMapSwitch.deserialize(reader)
            nearby = NearbyInfo.deserialize(reader)
            reader.chunked_reading_mode = False
            result = WarpAgreeServerPacket(warp_type=warp_type, warp_type_data=warp_type_data, nearby=nearby)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"WarpAgreeServerPacket(byte_size={repr(self._byte_size)}, warp_type={repr(self._warp_type)}, warp_type_data={repr(self._warp_type_data)}, nearby={repr(self._nearby)})"

    WarpTypeData = Union['WarpAgreeServerPacket.WarpTypeDataMapSwitch', None]
    """
    Data associated with different values of the `warp_type` field.
    """

    class WarpTypeDataMapSwitch:
        """
        Data associated with warp_type value WarpType.MapSwitch
        """
        _byte_size: int = 0
        _map_id: int
        _warp_effect: WarpEffect

        def __init__(self, *, map_id: int, warp_effect: WarpEffect):
            """
            Create a new instance of WarpAgreeServerPacket.WarpTypeDataMapSwitch.

            Args:
                map_id (int): (Value range is 0-64008.)
                warp_effect (WarpEffect): 
            """
            self._map_id = map_id
            self._warp_effect = warp_effect

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

        @property
        def warp_effect(self) -> WarpEffect:
            return self._warp_effect

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

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (WarpAgreeServerPacket.WarpTypeDataMapSwitch): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._map_id is None:
                    raise SerializationError("map_id must be provided.")
                writer.add_short(data._map_id)
                if data._warp_effect is None:
                    raise SerializationError("warp_effect must be provided.")
                writer.add_char(int(data._warp_effect))
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

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

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

            Returns:
                WarpAgreeServerPacket.WarpTypeDataMapSwitch: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                map_id = reader.get_short()
                warp_effect = WarpEffect(reader.get_char())
                result = WarpAgreeServerPacket.WarpTypeDataMapSwitch(map_id=map_id, warp_effect=warp_effect)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"WarpAgreeServerPacket.WarpTypeDataMapSwitch(byte_size={repr(self._byte_size)}, map_id={repr(self._map_id)}, warp_effect={repr(self._warp_effect)})"

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.

warp_type: WarpType property

warp_type_data: WarpAgreeServerPacket.WarpTypeData property

WarpAgreeServerPacket.WarpTypeData: Data associated with the warp_type field.

nearby: NearbyInfo property

WarpTypeData = Union['WarpAgreeServerPacket.WarpTypeDataMapSwitch', None] class-attribute instance-attribute

Data associated with different values of the warp_type field.

WarpTypeDataMapSwitch

Data associated with warp_type value WarpType.MapSwitch

Source code in src/eolib/protocol/_generated/net/server/warp_agree_server_packet.py
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
class WarpTypeDataMapSwitch:
    """
    Data associated with warp_type value WarpType.MapSwitch
    """
    _byte_size: int = 0
    _map_id: int
    _warp_effect: WarpEffect

    def __init__(self, *, map_id: int, warp_effect: WarpEffect):
        """
        Create a new instance of WarpAgreeServerPacket.WarpTypeDataMapSwitch.

        Args:
            map_id (int): (Value range is 0-64008.)
            warp_effect (WarpEffect): 
        """
        self._map_id = map_id
        self._warp_effect = warp_effect

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

    @property
    def warp_effect(self) -> WarpEffect:
        return self._warp_effect

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (WarpAgreeServerPacket.WarpTypeDataMapSwitch): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._map_id is None:
                raise SerializationError("map_id must be provided.")
            writer.add_short(data._map_id)
            if data._warp_effect is None:
                raise SerializationError("warp_effect must be provided.")
            writer.add_char(int(data._warp_effect))
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            WarpAgreeServerPacket.WarpTypeDataMapSwitch: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            map_id = reader.get_short()
            warp_effect = WarpEffect(reader.get_char())
            result = WarpAgreeServerPacket.WarpTypeDataMapSwitch(map_id=map_id, warp_effect=warp_effect)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"WarpAgreeServerPacket.WarpTypeDataMapSwitch(byte_size={repr(self._byte_size)}, map_id={repr(self._map_id)}, warp_effect={repr(self._warp_effect)})"

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.

map_id: int property

warp_effect: WarpEffect property

__init__(*, map_id, warp_effect)

Create a new instance of WarpAgreeServerPacket.WarpTypeDataMapSwitch.

Parameters:

Name Type Description Default
map_id int

(Value range is 0-64008.)

required
warp_effect WarpEffect
required
Source code in src/eolib/protocol/_generated/net/server/warp_agree_server_packet.py
162
163
164
165
166
167
168
169
170
171
def __init__(self, *, map_id: int, warp_effect: WarpEffect):
    """
    Create a new instance of WarpAgreeServerPacket.WarpTypeDataMapSwitch.

    Args:
        map_id (int): (Value range is 0-64008.)
        warp_effect (WarpEffect): 
    """
    self._map_id = map_id
    self._warp_effect = warp_effect

serialize(writer, data) staticmethod

Serializes an instance of WarpAgreeServerPacket.WarpTypeDataMapSwitch to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data WarpTypeDataMapSwitch

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/warp_agree_server_packet.py
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
@staticmethod
def serialize(writer: EoWriter, data: "WarpAgreeServerPacket.WarpTypeDataMapSwitch") -> None:
    """
    Serializes an instance of `WarpAgreeServerPacket.WarpTypeDataMapSwitch` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (WarpAgreeServerPacket.WarpTypeDataMapSwitch): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._map_id is None:
            raise SerializationError("map_id must be provided.")
        writer.add_short(data._map_id)
        if data._warp_effect is None:
            raise SerializationError("warp_effect must be provided.")
        writer.add_char(int(data._warp_effect))
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of WarpAgreeServerPacket.WarpTypeDataMapSwitch from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
WarpTypeDataMapSwitch

WarpAgreeServerPacket.WarpTypeDataMapSwitch: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/warp_agree_server_packet.py
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
@staticmethod
def deserialize(reader: EoReader) -> "WarpAgreeServerPacket.WarpTypeDataMapSwitch":
    """
    Deserializes an instance of `WarpAgreeServerPacket.WarpTypeDataMapSwitch` from the provided `EoReader`.

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

    Returns:
        WarpAgreeServerPacket.WarpTypeDataMapSwitch: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        map_id = reader.get_short()
        warp_effect = WarpEffect(reader.get_char())
        result = WarpAgreeServerPacket.WarpTypeDataMapSwitch(map_id=map_id, warp_effect=warp_effect)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

__init__(*, warp_type, warp_type_data=None, nearby)

Create a new instance of WarpAgreeServerPacket.

Parameters:

Name Type Description Default
warp_type WarpType
required
warp_type_data WarpTypeData

Data associated with the warp_type field.

None
nearby NearbyInfo
required
Source code in src/eolib/protocol/_generated/net/server/warp_agree_server_packet.py
26
27
28
29
30
31
32
33
34
35
36
37
def __init__(self, *, warp_type: WarpType, warp_type_data: 'WarpAgreeServerPacket.WarpTypeData' = None, nearby: NearbyInfo):
    """
    Create a new instance of WarpAgreeServerPacket.

    Args:
        warp_type (WarpType): 
        warp_type_data (WarpAgreeServerPacket.WarpTypeData): Data associated with the `warp_type` field.
        nearby (NearbyInfo): 
    """
    self._warp_type = warp_type
    self._warp_type_data = warp_type_data
    self._nearby = nearby

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/warp_agree_server_packet.py
64
65
66
67
68
69
70
71
72
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/warp_agree_server_packet.py
74
75
76
77
78
79
80
81
82
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/warp_agree_server_packet.py
84
85
86
87
88
89
90
91
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.
    """
    WarpAgreeServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of WarpAgreeServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data WarpAgreeServerPacket

The data to serialize.

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

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (WarpAgreeServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._warp_type is None:
            raise SerializationError("warp_type must be provided.")
        writer.add_char(int(data._warp_type))
        if data._warp_type == WarpType.MapSwitch:
            if not isinstance(data._warp_type_data, WarpAgreeServerPacket.WarpTypeDataMapSwitch):
                raise SerializationError("Expected warp_type_data to be type WarpAgreeServerPacket.WarpTypeDataMapSwitch for warp_type " + WarpType(data._warp_type).name + ".")
            WarpAgreeServerPacket.WarpTypeDataMapSwitch.serialize(writer, data._warp_type_data)
        if data._nearby is None:
            raise SerializationError("nearby must be provided.")
        NearbyInfo.serialize(writer, data._nearby)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

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

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

    Returns:
        WarpAgreeServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        warp_type = WarpType(reader.get_char())
        warp_type_data: WarpAgreeServerPacket.WarpTypeData = None
        if warp_type == WarpType.MapSwitch:
            warp_type_data = WarpAgreeServerPacket.WarpTypeDataMapSwitch.deserialize(reader)
        nearby = NearbyInfo.deserialize(reader)
        reader.chunked_reading_mode = False
        result = WarpAgreeServerPacket(warp_type=warp_type, warp_type_data=warp_type_data, nearby=nearby)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

WalkReplyServerPacket

Bases: Packet

Players, NPCs, and Items appearing in nearby view

Source code in src/eolib/protocol/_generated/net/server/walk_reply_server_packet.py
 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
class WalkReplyServerPacket(Packet):
    """
    Players, NPCs, and Items appearing in nearby view
    """
    _byte_size: int = 0
    _player_ids: tuple[int, ...]
    _npc_indexes: tuple[int, ...]
    _items: tuple[ItemMapInfo, ...]

    def __init__(self, *, player_ids: Iterable[int], npc_indexes: Iterable[int], items: Iterable[ItemMapInfo]):
        """
        Create a new instance of WalkReplyServerPacket.

        Args:
            player_ids (Iterable[int]): (Element value range is 0-64008.)
            npc_indexes (Iterable[int]): (Element value range is 0-252.)
            items (Iterable[ItemMapInfo]): 
        """
        self._player_ids = tuple(player_ids)
        self._npc_indexes = tuple(npc_indexes)
        self._items = tuple(items)

    @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 player_ids(self) -> tuple[int, ...]:
        return self._player_ids

    @property
    def npc_indexes(self) -> tuple[int, ...]:
        return self._npc_indexes

    @property
    def items(self) -> tuple[ItemMapInfo, ...]:
        return self._items

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (WalkReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._player_ids is None:
                raise SerializationError("player_ids must be provided.")
            for i in range(len(data._player_ids)):
                writer.add_short(data._player_ids[i])
            writer.add_byte(0xFF)
            if data._npc_indexes is None:
                raise SerializationError("npc_indexes must be provided.")
            for i in range(len(data._npc_indexes)):
                writer.add_char(data._npc_indexes[i])
            writer.add_byte(0xFF)
            if data._items is None:
                raise SerializationError("items must be provided.")
            for i in range(len(data._items)):
                ItemMapInfo.serialize(writer, data._items[i])
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            WalkReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            player_ids_length = int(reader.remaining / 2)
            player_ids = []
            for i in range(player_ids_length):
                player_ids.append(reader.get_short())
            reader.next_chunk()
            npc_indexes_length = int(reader.remaining / 1)
            npc_indexes = []
            for i in range(npc_indexes_length):
                npc_indexes.append(reader.get_char())
            reader.next_chunk()
            items_length = int(reader.remaining / 9)
            items = []
            for i in range(items_length):
                items.append(ItemMapInfo.deserialize(reader))
            reader.chunked_reading_mode = False
            result = WalkReplyServerPacket(player_ids=player_ids, npc_indexes=npc_indexes, items=items)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"WalkReplyServerPacket(byte_size={repr(self._byte_size)}, player_ids={repr(self._player_ids)}, npc_indexes={repr(self._npc_indexes)}, items={repr(self._items)})"

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.

player_ids: tuple[int, ...] property

npc_indexes: tuple[int, ...] property

items: tuple[ItemMapInfo, ...] property

__init__(*, player_ids, npc_indexes, items)

Create a new instance of WalkReplyServerPacket.

Parameters:

Name Type Description Default
player_ids Iterable[int]

(Element value range is 0-64008.)

required
npc_indexes Iterable[int]

(Element value range is 0-252.)

required
items Iterable[ItemMapInfo]
required
Source code in src/eolib/protocol/_generated/net/server/walk_reply_server_packet.py
25
26
27
28
29
30
31
32
33
34
35
36
def __init__(self, *, player_ids: Iterable[int], npc_indexes: Iterable[int], items: Iterable[ItemMapInfo]):
    """
    Create a new instance of WalkReplyServerPacket.

    Args:
        player_ids (Iterable[int]): (Element value range is 0-64008.)
        npc_indexes (Iterable[int]): (Element value range is 0-252.)
        items (Iterable[ItemMapInfo]): 
    """
    self._player_ids = tuple(player_ids)
    self._npc_indexes = tuple(npc_indexes)
    self._items = tuple(items)

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

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

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/walk_reply_server_packet.py
70
71
72
73
74
75
76
77
78
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

write(writer)

Serializes and writes this packet to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

the writer that this packet will be written to.

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

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

serialize(writer, data) staticmethod

Serializes an instance of WalkReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data WalkReplyServerPacket

The data to serialize.

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

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (WalkReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._player_ids is None:
            raise SerializationError("player_ids must be provided.")
        for i in range(len(data._player_ids)):
            writer.add_short(data._player_ids[i])
        writer.add_byte(0xFF)
        if data._npc_indexes is None:
            raise SerializationError("npc_indexes must be provided.")
        for i in range(len(data._npc_indexes)):
            writer.add_char(data._npc_indexes[i])
        writer.add_byte(0xFF)
        if data._items is None:
            raise SerializationError("items must be provided.")
        for i in range(len(data._items)):
            ItemMapInfo.serialize(writer, data._items[i])
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

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

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

    Returns:
        WalkReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        player_ids_length = int(reader.remaining / 2)
        player_ids = []
        for i in range(player_ids_length):
            player_ids.append(reader.get_short())
        reader.next_chunk()
        npc_indexes_length = int(reader.remaining / 1)
        npc_indexes = []
        for i in range(npc_indexes_length):
            npc_indexes.append(reader.get_char())
        reader.next_chunk()
        items_length = int(reader.remaining / 9)
        items = []
        for i in range(items_length):
            items.append(ItemMapInfo.deserialize(reader))
        reader.chunked_reading_mode = False
        result = WalkReplyServerPacket(player_ids=player_ids, npc_indexes=npc_indexes, items=items)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

WalkPlayerServerPacket

Bases: Packet

Nearby player has walked

Source code in src/eolib/protocol/_generated/net/server/walk_player_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
class WalkPlayerServerPacket(Packet):
    """
    Nearby player has walked
    """
    _byte_size: int = 0
    _player_id: int
    _direction: Direction
    _coords: Coords

    def __init__(self, *, player_id: int, direction: Direction, coords: Coords):
        """
        Create a new instance of WalkPlayerServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            direction (Direction): 
            coords (Coords): 
        """
        self._player_id = player_id
        self._direction = direction
        self._coords = coords

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

    @property
    def direction(self) -> Direction:
        return self._direction

    @property
    def coords(self) -> Coords:
        return self._coords

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (WalkPlayerServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._direction is None:
                raise SerializationError("direction must be provided.")
            writer.add_char(int(data._direction))
            if data._coords is None:
                raise SerializationError("coords must be provided.")
            Coords.serialize(writer, data._coords)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            WalkPlayerServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            direction = Direction(reader.get_char())
            coords = Coords.deserialize(reader)
            result = WalkPlayerServerPacket(player_id=player_id, direction=direction, coords=coords)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"WalkPlayerServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, direction={repr(self._direction)}, coords={repr(self._coords)})"

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.

player_id: int property

direction: Direction property

coords: Coords property

__init__(*, player_id, direction, coords)

Create a new instance of WalkPlayerServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
direction Direction
required
coords Coords
required
Source code in src/eolib/protocol/_generated/net/server/walk_player_server_packet.py
24
25
26
27
28
29
30
31
32
33
34
35
def __init__(self, *, player_id: int, direction: Direction, coords: Coords):
    """
    Create a new instance of WalkPlayerServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        direction (Direction): 
        coords (Coords): 
    """
    self._player_id = player_id
    self._direction = direction
    self._coords = coords

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

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

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/walk_player_server_packet.py
69
70
71
72
73
74
75
76
77
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/walk_player_server_packet.py
79
80
81
82
83
84
85
86
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.
    """
    WalkPlayerServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of WalkPlayerServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data WalkPlayerServerPacket

The data to serialize.

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

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (WalkPlayerServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._direction is None:
            raise SerializationError("direction must be provided.")
        writer.add_char(int(data._direction))
        if data._coords is None:
            raise SerializationError("coords must be provided.")
        Coords.serialize(writer, data._coords)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/walk_player_server_packet.py
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
@staticmethod
def deserialize(reader: EoReader) -> "WalkPlayerServerPacket":
    """
    Deserializes an instance of `WalkPlayerServerPacket` from the provided `EoReader`.

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

    Returns:
        WalkPlayerServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        direction = Direction(reader.get_char())
        coords = Coords.deserialize(reader)
        result = WalkPlayerServerPacket(player_id=player_id, direction=direction, coords=coords)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

WalkOpenServerPacket

Bases: Packet

Your character has been unfrozen

Source code in src/eolib/protocol/_generated/net/server/walk_open_server_packet.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
class WalkOpenServerPacket(Packet):
    """
    Your character has been unfrozen
    """
    _byte_size: int = 0

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

    @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 family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

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

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

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

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

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

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

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

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

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

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

Source code in src/eolib/protocol/_generated/net/server/walk_open_server_packet.py
18
19
20
21
def __init__(self):
    """
    Create a new instance of WalkOpenServerPacket.
    """

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/walk_open_server_packet.py
33
34
35
36
37
38
39
40
41
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/walk_open_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/walk_open_server_packet.py
53
54
55
56
57
58
59
60
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.
    """
    WalkOpenServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of WalkOpenServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data WalkOpenServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/walk_open_server_packet.py
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@staticmethod
def serialize(writer: EoWriter, data: "WalkOpenServerPacket") -> None:
    """
    Serializes an instance of `WalkOpenServerPacket` to the provided `EoWriter`.

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

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/walk_open_server_packet.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@staticmethod
def deserialize(reader: EoReader) -> "WalkOpenServerPacket":
    """
    Deserializes an instance of `WalkOpenServerPacket` from the provided `EoReader`.

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

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

WalkCloseServerPacket

Bases: Packet

Your character has been frozen

Source code in src/eolib/protocol/_generated/net/server/walk_close_server_packet.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
class WalkCloseServerPacket(Packet):
    """
    Your character has been frozen
    """
    _byte_size: int = 0

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

    @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 family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

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

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

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

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

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

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

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

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

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

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

Source code in src/eolib/protocol/_generated/net/server/walk_close_server_packet.py
18
19
20
21
def __init__(self):
    """
    Create a new instance of WalkCloseServerPacket.
    """

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/walk_close_server_packet.py
33
34
35
36
37
38
39
40
41
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/walk_close_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/walk_close_server_packet.py
53
54
55
56
57
58
59
60
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.
    """
    WalkCloseServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of WalkCloseServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data WalkCloseServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/walk_close_server_packet.py
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@staticmethod
def serialize(writer: EoWriter, data: "WalkCloseServerPacket") -> None:
    """
    Serializes an instance of `WalkCloseServerPacket` to the provided `EoWriter`.

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

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/walk_close_server_packet.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@staticmethod
def deserialize(reader: EoReader) -> "WalkCloseServerPacket":
    """
    Deserializes an instance of `WalkCloseServerPacket` from the provided `EoReader`.

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

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

TradeUseServerPacket

Bases: Packet

Trade completed

Source code in src/eolib/protocol/_generated/net/server/trade_use_server_packet.py
 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
class TradeUseServerPacket(Packet):
    """
    Trade completed
    """
    _byte_size: int = 0
    _trade_data: tuple[TradeItemData, ...]

    def __init__(self, *, trade_data: Iterable[TradeItemData]):
        """
        Create a new instance of TradeUseServerPacket.

        Args:
            trade_data (Iterable[TradeItemData]): (Length must be `2`.)
        """
        self._trade_data = tuple(trade_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 trade_data(self) -> tuple[TradeItemData, ...]:
        return self._trade_data

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (TradeUseServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._trade_data is None:
                raise SerializationError("trade_data must be provided.")
            if len(data._trade_data) != 2:
                raise SerializationError(f"Expected length of trade_data to be exactly 2, got {len(data._trade_data)}.")
            for i in range(2):
                TradeItemData.serialize(writer, data._trade_data[i])
                writer.add_byte(0xFF)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            TradeUseServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            trade_data = []
            for i in range(2):
                trade_data.append(TradeItemData.deserialize(reader))
                reader.next_chunk()
            reader.chunked_reading_mode = False
            result = TradeUseServerPacket(trade_data=trade_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"TradeUseServerPacket(byte_size={repr(self._byte_size)}, trade_data={repr(self._trade_data)})"

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.

trade_data: tuple[TradeItemData, ...] property

__init__(*, trade_data)

Create a new instance of TradeUseServerPacket.

Parameters:

Name Type Description Default
trade_data Iterable[TradeItemData]

(Length must be 2.)

required
Source code in src/eolib/protocol/_generated/net/server/trade_use_server_packet.py
23
24
25
26
27
28
29
30
def __init__(self, *, trade_data: Iterable[TradeItemData]):
    """
    Create a new instance of TradeUseServerPacket.

    Args:
        trade_data (Iterable[TradeItemData]): (Length must be `2`.)
    """
    self._trade_data = tuple(trade_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/trade_use_server_packet.py
46
47
48
49
50
51
52
53
54
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/trade_use_server_packet.py
56
57
58
59
60
61
62
63
64
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/trade_use_server_packet.py
66
67
68
69
70
71
72
73
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.
    """
    TradeUseServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of TradeUseServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data TradeUseServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/trade_use_server_packet.py
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@staticmethod
def serialize(writer: EoWriter, data: "TradeUseServerPacket") -> None:
    """
    Serializes an instance of `TradeUseServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (TradeUseServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._trade_data is None:
            raise SerializationError("trade_data must be provided.")
        if len(data._trade_data) != 2:
            raise SerializationError(f"Expected length of trade_data to be exactly 2, got {len(data._trade_data)}.")
        for i in range(2):
            TradeItemData.serialize(writer, data._trade_data[i])
            writer.add_byte(0xFF)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

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

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

    Returns:
        TradeUseServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        trade_data = []
        for i in range(2):
            trade_data.append(TradeItemData.deserialize(reader))
            reader.next_chunk()
        reader.chunked_reading_mode = False
        result = TradeUseServerPacket(trade_data=trade_data)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

TradeSpecServerPacket

Bases: Packet

Own agree state updated

Source code in src/eolib/protocol/_generated/net/server/trade_spec_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class TradeSpecServerPacket(Packet):
    """
    Own agree state updated
    """
    _byte_size: int = 0
    _agree: bool

    def __init__(self, *, agree: bool):
        """
        Create a new instance of TradeSpecServerPacket.

        Args:
            agree (bool): 
        """
        self._agree = agree

    @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 agree(self) -> bool:
        return self._agree

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (TradeSpecServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._agree is None:
                raise SerializationError("agree must be provided.")
            writer.add_char(1 if data._agree else 0)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            TradeSpecServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            agree = reader.get_char() != 0
            result = TradeSpecServerPacket(agree=agree)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"TradeSpecServerPacket(byte_size={repr(self._byte_size)}, agree={repr(self._agree)})"

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.

agree: bool property

__init__(*, agree)

Create a new instance of TradeSpecServerPacket.

Parameters:

Name Type Description Default
agree bool
required
Source code in src/eolib/protocol/_generated/net/server/trade_spec_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, agree: bool):
    """
    Create a new instance of TradeSpecServerPacket.

    Args:
        agree (bool): 
    """
    self._agree = agree

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/trade_spec_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/trade_spec_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/trade_spec_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    TradeSpecServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of TradeSpecServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data TradeSpecServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/trade_spec_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "TradeSpecServerPacket") -> None:
    """
    Serializes an instance of `TradeSpecServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (TradeSpecServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._agree is None:
            raise SerializationError("agree must be provided.")
        writer.add_char(1 if data._agree else 0)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/trade_spec_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "TradeSpecServerPacket":
    """
    Deserializes an instance of `TradeSpecServerPacket` from the provided `EoReader`.

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

    Returns:
        TradeSpecServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        agree = reader.get_char() != 0
        result = TradeSpecServerPacket(agree=agree)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

TradeRequestServerPacket

Bases: Packet

Trade request from another player

Source code in src/eolib/protocol/_generated/net/server/trade_request_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
class TradeRequestServerPacket(Packet):
    """
    Trade request from another player
    """
    _byte_size: int = 0
    _partner_player_id: int
    _partner_player_name: str

    def __init__(self, *, partner_player_id: int, partner_player_name: str):
        """
        Create a new instance of TradeRequestServerPacket.

        Args:
            partner_player_id (int): (Value range is 0-64008.)
            partner_player_name (str): 
        """
        self._partner_player_id = partner_player_id
        self._partner_player_name = partner_player_name

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

    @property
    def partner_player_name(self) -> str:
        return self._partner_player_name

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (TradeRequestServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.add_char(138)
            if data._partner_player_id is None:
                raise SerializationError("partner_player_id must be provided.")
            writer.add_short(data._partner_player_id)
            if data._partner_player_name is None:
                raise SerializationError("partner_player_name must be provided.")
            writer.add_string(data._partner_player_name)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            TradeRequestServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_char()
            partner_player_id = reader.get_short()
            partner_player_name = reader.get_string()
            result = TradeRequestServerPacket(partner_player_id=partner_player_id, partner_player_name=partner_player_name)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"TradeRequestServerPacket(byte_size={repr(self._byte_size)}, partner_player_id={repr(self._partner_player_id)}, partner_player_name={repr(self._partner_player_name)})"

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.

partner_player_id: int property

partner_player_name: str property

__init__(*, partner_player_id, partner_player_name)

Create a new instance of TradeRequestServerPacket.

Parameters:

Name Type Description Default
partner_player_id int

(Value range is 0-64008.)

required
partner_player_name str
required
Source code in src/eolib/protocol/_generated/net/server/trade_request_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, partner_player_id: int, partner_player_name: str):
    """
    Create a new instance of TradeRequestServerPacket.

    Args:
        partner_player_id (int): (Value range is 0-64008.)
        partner_player_name (str): 
    """
    self._partner_player_id = partner_player_id
    self._partner_player_name = partner_player_name

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/trade_request_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/trade_request_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/trade_request_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    TradeRequestServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of TradeRequestServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data TradeRequestServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/trade_request_server_packet.py
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@staticmethod
def serialize(writer: EoWriter, data: "TradeRequestServerPacket") -> None:
    """
    Serializes an instance of `TradeRequestServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (TradeRequestServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.add_char(138)
        if data._partner_player_id is None:
            raise SerializationError("partner_player_id must be provided.")
        writer.add_short(data._partner_player_id)
        if data._partner_player_name is None:
            raise SerializationError("partner_player_name must be provided.")
        writer.add_string(data._partner_player_name)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/trade_request_server_packet.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
@staticmethod
def deserialize(reader: EoReader) -> "TradeRequestServerPacket":
    """
    Deserializes an instance of `TradeRequestServerPacket` from the provided `EoReader`.

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

    Returns:
        TradeRequestServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_char()
        partner_player_id = reader.get_short()
        partner_player_name = reader.get_string()
        result = TradeRequestServerPacket(partner_player_id=partner_player_id, partner_player_name=partner_player_name)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

TradeReplyServerPacket

Bases: Packet

Trade updated (items changed)

Source code in src/eolib/protocol/_generated/net/server/trade_reply_server_packet.py
 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
class TradeReplyServerPacket(Packet):
    """
    Trade updated (items changed)
    """
    _byte_size: int = 0
    _trade_data: tuple[TradeItemData, ...]

    def __init__(self, *, trade_data: Iterable[TradeItemData]):
        """
        Create a new instance of TradeReplyServerPacket.

        Args:
            trade_data (Iterable[TradeItemData]): (Length must be `2`.)
        """
        self._trade_data = tuple(trade_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 trade_data(self) -> tuple[TradeItemData, ...]:
        return self._trade_data

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (TradeReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._trade_data is None:
                raise SerializationError("trade_data must be provided.")
            if len(data._trade_data) != 2:
                raise SerializationError(f"Expected length of trade_data to be exactly 2, got {len(data._trade_data)}.")
            for i in range(2):
                TradeItemData.serialize(writer, data._trade_data[i])
                writer.add_byte(0xFF)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            TradeReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            trade_data = []
            for i in range(2):
                trade_data.append(TradeItemData.deserialize(reader))
                reader.next_chunk()
            reader.chunked_reading_mode = False
            result = TradeReplyServerPacket(trade_data=trade_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"TradeReplyServerPacket(byte_size={repr(self._byte_size)}, trade_data={repr(self._trade_data)})"

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.

trade_data: tuple[TradeItemData, ...] property

__init__(*, trade_data)

Create a new instance of TradeReplyServerPacket.

Parameters:

Name Type Description Default
trade_data Iterable[TradeItemData]

(Length must be 2.)

required
Source code in src/eolib/protocol/_generated/net/server/trade_reply_server_packet.py
23
24
25
26
27
28
29
30
def __init__(self, *, trade_data: Iterable[TradeItemData]):
    """
    Create a new instance of TradeReplyServerPacket.

    Args:
        trade_data (Iterable[TradeItemData]): (Length must be `2`.)
    """
    self._trade_data = tuple(trade_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/trade_reply_server_packet.py
46
47
48
49
50
51
52
53
54
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/trade_reply_server_packet.py
56
57
58
59
60
61
62
63
64
@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/trade_reply_server_packet.py
66
67
68
69
70
71
72
73
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.
    """
    TradeReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of TradeReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data TradeReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/trade_reply_server_packet.py
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@staticmethod
def serialize(writer: EoWriter, data: "TradeReplyServerPacket") -> None:
    """
    Serializes an instance of `TradeReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (TradeReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._trade_data is None:
            raise SerializationError("trade_data must be provided.")
        if len(data._trade_data) != 2:
            raise SerializationError(f"Expected length of trade_data to be exactly 2, got {len(data._trade_data)}.")
        for i in range(2):
            TradeItemData.serialize(writer, data._trade_data[i])
            writer.add_byte(0xFF)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

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

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

    Returns:
        TradeReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        trade_data = []
        for i in range(2):
            trade_data.append(TradeItemData.deserialize(reader))
            reader.next_chunk()
        reader.chunked_reading_mode = False
        result = TradeReplyServerPacket(trade_data=trade_data)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

TradeOpenServerPacket

Bases: Packet

Trade window opens

Source code in src/eolib/protocol/_generated/net/server/trade_open_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
class TradeOpenServerPacket(Packet):
    """
    Trade window opens
    """
    _byte_size: int = 0
    _partner_player_id: int
    _partner_player_name: str
    _your_player_id: int
    _your_player_name: str

    def __init__(self, *, partner_player_id: int, partner_player_name: str, your_player_id: int, your_player_name: str):
        """
        Create a new instance of TradeOpenServerPacket.

        Args:
            partner_player_id (int): (Value range is 0-64008.)
            partner_player_name (str): 
            your_player_id (int): (Value range is 0-64008.)
            your_player_name (str): 
        """
        self._partner_player_id = partner_player_id
        self._partner_player_name = partner_player_name
        self._your_player_id = your_player_id
        self._your_player_name = your_player_name

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

    @property
    def partner_player_name(self) -> str:
        return self._partner_player_name

    @property
    def your_player_id(self) -> int:
        return self._your_player_id

    @property
    def your_player_name(self) -> str:
        return self._your_player_name

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (TradeOpenServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._partner_player_id is None:
                raise SerializationError("partner_player_id must be provided.")
            writer.add_short(data._partner_player_id)
            if data._partner_player_name is None:
                raise SerializationError("partner_player_name must be provided.")
            writer.add_string(data._partner_player_name)
            writer.add_byte(0xFF)
            if data._your_player_id is None:
                raise SerializationError("your_player_id must be provided.")
            writer.add_short(data._your_player_id)
            if data._your_player_name is None:
                raise SerializationError("your_player_name must be provided.")
            writer.add_string(data._your_player_name)
            writer.add_byte(0xFF)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            TradeOpenServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            partner_player_id = reader.get_short()
            partner_player_name = reader.get_string()
            reader.next_chunk()
            your_player_id = reader.get_short()
            your_player_name = reader.get_string()
            reader.next_chunk()
            reader.chunked_reading_mode = False
            result = TradeOpenServerPacket(partner_player_id=partner_player_id, partner_player_name=partner_player_name, your_player_id=your_player_id, your_player_name=your_player_name)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"TradeOpenServerPacket(byte_size={repr(self._byte_size)}, partner_player_id={repr(self._partner_player_id)}, partner_player_name={repr(self._partner_player_name)}, your_player_id={repr(self._your_player_id)}, your_player_name={repr(self._your_player_name)})"

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.

partner_player_id: int property

partner_player_name: str property

your_player_id: int property

your_player_name: str property

__init__(*, partner_player_id, partner_player_name, your_player_id, your_player_name)

Create a new instance of TradeOpenServerPacket.

Parameters:

Name Type Description Default
partner_player_id int

(Value range is 0-64008.)

required
partner_player_name str
required
your_player_id int

(Value range is 0-64008.)

required
your_player_name str
required
Source code in src/eolib/protocol/_generated/net/server/trade_open_server_packet.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
def __init__(self, *, partner_player_id: int, partner_player_name: str, your_player_id: int, your_player_name: str):
    """
    Create a new instance of TradeOpenServerPacket.

    Args:
        partner_player_id (int): (Value range is 0-64008.)
        partner_player_name (str): 
        your_player_id (int): (Value range is 0-64008.)
        your_player_name (str): 
    """
    self._partner_player_id = partner_player_id
    self._partner_player_name = partner_player_name
    self._your_player_id = your_player_id
    self._your_player_name = your_player_name

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/trade_open_server_packet.py
64
65
66
67
68
69
70
71
72
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/trade_open_server_packet.py
74
75
76
77
78
79
80
81
82
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/trade_open_server_packet.py
84
85
86
87
88
89
90
91
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.
    """
    TradeOpenServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of TradeOpenServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data TradeOpenServerPacket

The data to serialize.

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

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (TradeOpenServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._partner_player_id is None:
            raise SerializationError("partner_player_id must be provided.")
        writer.add_short(data._partner_player_id)
        if data._partner_player_name is None:
            raise SerializationError("partner_player_name must be provided.")
        writer.add_string(data._partner_player_name)
        writer.add_byte(0xFF)
        if data._your_player_id is None:
            raise SerializationError("your_player_id must be provided.")
        writer.add_short(data._your_player_id)
        if data._your_player_name is None:
            raise SerializationError("your_player_name must be provided.")
        writer.add_string(data._your_player_name)
        writer.add_byte(0xFF)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

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

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

    Returns:
        TradeOpenServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        partner_player_id = reader.get_short()
        partner_player_name = reader.get_string()
        reader.next_chunk()
        your_player_id = reader.get_short()
        your_player_name = reader.get_string()
        reader.next_chunk()
        reader.chunked_reading_mode = False
        result = TradeOpenServerPacket(partner_player_id=partner_player_id, partner_player_name=partner_player_name, your_player_id=your_player_id, your_player_name=your_player_name)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

TradeCloseServerPacket

Bases: Packet

Partner closed trade window

Source code in src/eolib/protocol/_generated/net/server/trade_close_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class TradeCloseServerPacket(Packet):
    """
    Partner closed trade window
    """
    _byte_size: int = 0
    _partner_player_id: int

    def __init__(self, *, partner_player_id: int):
        """
        Create a new instance of TradeCloseServerPacket.

        Args:
            partner_player_id (int): (Value range is 0-64008.)
        """
        self._partner_player_id = partner_player_id

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

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (TradeCloseServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._partner_player_id is None:
                raise SerializationError("partner_player_id must be provided.")
            writer.add_short(data._partner_player_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

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

    def __repr__(self):
        return f"TradeCloseServerPacket(byte_size={repr(self._byte_size)}, partner_player_id={repr(self._partner_player_id)})"

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.

partner_player_id: int property

__init__(*, partner_player_id)

Create a new instance of TradeCloseServerPacket.

Parameters:

Name Type Description Default
partner_player_id int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/trade_close_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, partner_player_id: int):
    """
    Create a new instance of TradeCloseServerPacket.

    Args:
        partner_player_id (int): (Value range is 0-64008.)
    """
    self._partner_player_id = partner_player_id

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/trade_close_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/trade_close_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/trade_close_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    TradeCloseServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of TradeCloseServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data TradeCloseServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/trade_close_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "TradeCloseServerPacket") -> None:
    """
    Serializes an instance of `TradeCloseServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (TradeCloseServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._partner_player_id is None:
            raise SerializationError("partner_player_id must be provided.")
        writer.add_short(data._partner_player_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/trade_close_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "TradeCloseServerPacket":
    """
    Deserializes an instance of `TradeCloseServerPacket` from the provided `EoReader`.

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

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

TradeAgreeServerPacket

Bases: Packet

Partner agree state updated

Source code in src/eolib/protocol/_generated/net/server/trade_agree_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
class TradeAgreeServerPacket(Packet):
    """
    Partner agree state updated
    """
    _byte_size: int = 0
    _partner_player_id: int
    _agree: bool

    def __init__(self, *, partner_player_id: int, agree: bool):
        """
        Create a new instance of TradeAgreeServerPacket.

        Args:
            partner_player_id (int): (Value range is 0-64008.)
            agree (bool): 
        """
        self._partner_player_id = partner_player_id
        self._agree = agree

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

    @property
    def agree(self) -> bool:
        return self._agree

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (TradeAgreeServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._partner_player_id is None:
                raise SerializationError("partner_player_id must be provided.")
            writer.add_short(data._partner_player_id)
            if data._agree is None:
                raise SerializationError("agree must be provided.")
            writer.add_char(1 if data._agree else 0)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            TradeAgreeServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            partner_player_id = reader.get_short()
            agree = reader.get_char() != 0
            result = TradeAgreeServerPacket(partner_player_id=partner_player_id, agree=agree)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"TradeAgreeServerPacket(byte_size={repr(self._byte_size)}, partner_player_id={repr(self._partner_player_id)}, agree={repr(self._agree)})"

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.

partner_player_id: int property

agree: bool property

__init__(*, partner_player_id, agree)

Create a new instance of TradeAgreeServerPacket.

Parameters:

Name Type Description Default
partner_player_id int

(Value range is 0-64008.)

required
agree bool
required
Source code in src/eolib/protocol/_generated/net/server/trade_agree_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, partner_player_id: int, agree: bool):
    """
    Create a new instance of TradeAgreeServerPacket.

    Args:
        partner_player_id (int): (Value range is 0-64008.)
        agree (bool): 
    """
    self._partner_player_id = partner_player_id
    self._agree = agree

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/trade_agree_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/trade_agree_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/trade_agree_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    TradeAgreeServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of TradeAgreeServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data TradeAgreeServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/trade_agree_server_packet.py
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@staticmethod
def serialize(writer: EoWriter, data: "TradeAgreeServerPacket") -> None:
    """
    Serializes an instance of `TradeAgreeServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (TradeAgreeServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._partner_player_id is None:
            raise SerializationError("partner_player_id must be provided.")
        writer.add_short(data._partner_player_id)
        if data._agree is None:
            raise SerializationError("agree must be provided.")
        writer.add_char(1 if data._agree else 0)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/trade_agree_server_packet.py
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@staticmethod
def deserialize(reader: EoReader) -> "TradeAgreeServerPacket":
    """
    Deserializes an instance of `TradeAgreeServerPacket` from the provided `EoReader`.

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

    Returns:
        TradeAgreeServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        partner_player_id = reader.get_short()
        agree = reader.get_char() != 0
        result = TradeAgreeServerPacket(partner_player_id=partner_player_id, agree=agree)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

TradeItemData

Trade window item data

Source code in src/eolib/protocol/_generated/net/server/trade_item_data.py
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
class TradeItemData:
    """
    Trade window item data
    """
    _byte_size: int = 0
    _player_id: int
    _items: tuple[Item, ...]

    def __init__(self, *, player_id: int, items: Iterable[Item]):
        """
        Create a new instance of TradeItemData.

        Args:
            player_id (int): (Value range is 0-64008.)
            items (Iterable[Item]): 
        """
        self._player_id = player_id
        self._items = tuple(items)

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (TradeItemData): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._items is None:
                raise SerializationError("items must be provided.")
            for i in range(len(data._items)):
                Item.serialize(writer, data._items[i])
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            TradeItemData: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            items_length = int(reader.remaining / 6)
            items = []
            for i in range(items_length):
                items.append(Item.deserialize(reader))
            result = TradeItemData(player_id=player_id, items=items)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"TradeItemData(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, items={repr(self._items)})"

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.

player_id: int property

items: tuple[Item, ...] property

__init__(*, player_id, items)

Create a new instance of TradeItemData.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
items Iterable[Item]
required
Source code in src/eolib/protocol/_generated/net/server/trade_item_data.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, player_id: int, items: Iterable[Item]):
    """
    Create a new instance of TradeItemData.

    Args:
        player_id (int): (Value range is 0-64008.)
        items (Iterable[Item]): 
    """
    self._player_id = player_id
    self._items = tuple(items)

serialize(writer, data) staticmethod

Serializes an instance of TradeItemData to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data TradeItemData

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/trade_item_data.py
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
@staticmethod
def serialize(writer: EoWriter, data: "TradeItemData") -> None:
    """
    Serializes an instance of `TradeItemData` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (TradeItemData): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._items is None:
            raise SerializationError("items must be provided.")
        for i in range(len(data._items)):
            Item.serialize(writer, data._items[i])
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/trade_item_data.py
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
@staticmethod
def deserialize(reader: EoReader) -> "TradeItemData":
    """
    Deserializes an instance of `TradeItemData` from the provided `EoReader`.

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

    Returns:
        TradeItemData: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        items_length = int(reader.remaining / 6)
        items = []
        for i in range(items_length):
            items.append(Item.deserialize(reader))
        result = TradeItemData(player_id=player_id, items=items)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

TradeAdminServerPacket

Bases: Packet

Trade updated (items changed while trade was accepted)

Source code in src/eolib/protocol/_generated/net/server/trade_admin_server_packet.py
 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
class TradeAdminServerPacket(Packet):
    """
    Trade updated (items changed while trade was accepted)
    """
    _byte_size: int = 0
    _trade_data: tuple[TradeItemData, ...]

    def __init__(self, *, trade_data: Iterable[TradeItemData]):
        """
        Create a new instance of TradeAdminServerPacket.

        Args:
            trade_data (Iterable[TradeItemData]): (Length must be `2`.)
        """
        self._trade_data = tuple(trade_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 trade_data(self) -> tuple[TradeItemData, ...]:
        return self._trade_data

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (TradeAdminServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._trade_data is None:
                raise SerializationError("trade_data must be provided.")
            if len(data._trade_data) != 2:
                raise SerializationError(f"Expected length of trade_data to be exactly 2, got {len(data._trade_data)}.")
            for i in range(2):
                TradeItemData.serialize(writer, data._trade_data[i])
                writer.add_byte(0xFF)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            TradeAdminServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            trade_data = []
            for i in range(2):
                trade_data.append(TradeItemData.deserialize(reader))
                reader.next_chunk()
            reader.chunked_reading_mode = False
            result = TradeAdminServerPacket(trade_data=trade_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"TradeAdminServerPacket(byte_size={repr(self._byte_size)}, trade_data={repr(self._trade_data)})"

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.

trade_data: tuple[TradeItemData, ...] property

__init__(*, trade_data)

Create a new instance of TradeAdminServerPacket.

Parameters:

Name Type Description Default
trade_data Iterable[TradeItemData]

(Length must be 2.)

required
Source code in src/eolib/protocol/_generated/net/server/trade_admin_server_packet.py
23
24
25
26
27
28
29
30
def __init__(self, *, trade_data: Iterable[TradeItemData]):
    """
    Create a new instance of TradeAdminServerPacket.

    Args:
        trade_data (Iterable[TradeItemData]): (Length must be `2`.)
    """
    self._trade_data = tuple(trade_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/trade_admin_server_packet.py
46
47
48
49
50
51
52
53
54
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/trade_admin_server_packet.py
56
57
58
59
60
61
62
63
64
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/trade_admin_server_packet.py
66
67
68
69
70
71
72
73
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.
    """
    TradeAdminServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of TradeAdminServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data TradeAdminServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/trade_admin_server_packet.py
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@staticmethod
def serialize(writer: EoWriter, data: "TradeAdminServerPacket") -> None:
    """
    Serializes an instance of `TradeAdminServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (TradeAdminServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._trade_data is None:
            raise SerializationError("trade_data must be provided.")
        if len(data._trade_data) != 2:
            raise SerializationError(f"Expected length of trade_data to be exactly 2, got {len(data._trade_data)}.")
        for i in range(2):
            TradeItemData.serialize(writer, data._trade_data[i])
            writer.add_byte(0xFF)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

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

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

    Returns:
        TradeAdminServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        trade_data = []
        for i in range(2):
            trade_data.append(TradeItemData.deserialize(reader))
            reader.next_chunk()
        reader.chunked_reading_mode = False
        result = TradeAdminServerPacket(trade_data=trade_data)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

TalkTellServerPacket

Bases: Packet

Private chat message

Source code in src/eolib/protocol/_generated/net/server/talk_tell_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
class TalkTellServerPacket(Packet):
    """
    Private chat message
    """
    _byte_size: int = 0
    _player_name: str
    _message: str

    def __init__(self, *, player_name: str, message: str):
        """
        Create a new instance of TalkTellServerPacket.

        Args:
            player_name (str): 
            message (str): 
        """
        self._player_name = player_name
        self._message = message

    @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 player_name(self) -> str:
        return self._player_name

    @property
    def message(self) -> str:
        return self._message

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (TalkTellServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._player_name is None:
                raise SerializationError("player_name must be provided.")
            writer.add_string(data._player_name)
            writer.add_byte(0xFF)
            if data._message is None:
                raise SerializationError("message must be provided.")
            writer.add_string(data._message)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            TalkTellServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            player_name = reader.get_string()
            reader.next_chunk()
            message = reader.get_string()
            reader.chunked_reading_mode = False
            result = TalkTellServerPacket(player_name=player_name, message=message)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"TalkTellServerPacket(byte_size={repr(self._byte_size)}, player_name={repr(self._player_name)}, message={repr(self._message)})"

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.

player_name: str property

message: str property

__init__(*, player_name, message)

Create a new instance of TalkTellServerPacket.

Parameters:

Name Type Description Default
player_name str
required
message str
required
Source code in src/eolib/protocol/_generated/net/server/talk_tell_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, player_name: str, message: str):
    """
    Create a new instance of TalkTellServerPacket.

    Args:
        player_name (str): 
        message (str): 
    """
    self._player_name = player_name
    self._message = message

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/talk_tell_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/talk_tell_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/talk_tell_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    TalkTellServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of TalkTellServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data TalkTellServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/talk_tell_server_packet.py
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
@staticmethod
def serialize(writer: EoWriter, data: "TalkTellServerPacket") -> None:
    """
    Serializes an instance of `TalkTellServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (TalkTellServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._player_name is None:
            raise SerializationError("player_name must be provided.")
        writer.add_string(data._player_name)
        writer.add_byte(0xFF)
        if data._message is None:
            raise SerializationError("message must be provided.")
        writer.add_string(data._message)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/talk_tell_server_packet.py
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
@staticmethod
def deserialize(reader: EoReader) -> "TalkTellServerPacket":
    """
    Deserializes an instance of `TalkTellServerPacket` from the provided `EoReader`.

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

    Returns:
        TalkTellServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        player_name = reader.get_string()
        reader.next_chunk()
        message = reader.get_string()
        reader.chunked_reading_mode = False
        result = TalkTellServerPacket(player_name=player_name, message=message)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

TalkSpecServerPacket

Bases: Packet

Temporary mute applied

Source code in src/eolib/protocol/_generated/net/server/talk_spec_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class TalkSpecServerPacket(Packet):
    """
    Temporary mute applied
    """
    _byte_size: int = 0
    _admin_name: str

    def __init__(self, *, admin_name: str):
        """
        Create a new instance of TalkSpecServerPacket.

        Args:
            admin_name (str): 
        """
        self._admin_name = admin_name

    @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 admin_name(self) -> str:
        return self._admin_name

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (TalkSpecServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._admin_name is None:
                raise SerializationError("admin_name must be provided.")
            writer.add_string(data._admin_name)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

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

    def __repr__(self):
        return f"TalkSpecServerPacket(byte_size={repr(self._byte_size)}, admin_name={repr(self._admin_name)})"

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.

admin_name: str property

__init__(*, admin_name)

Create a new instance of TalkSpecServerPacket.

Parameters:

Name Type Description Default
admin_name str
required
Source code in src/eolib/protocol/_generated/net/server/talk_spec_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, admin_name: str):
    """
    Create a new instance of TalkSpecServerPacket.

    Args:
        admin_name (str): 
    """
    self._admin_name = admin_name

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/talk_spec_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/talk_spec_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/talk_spec_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    TalkSpecServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of TalkSpecServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data TalkSpecServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/talk_spec_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "TalkSpecServerPacket") -> None:
    """
    Serializes an instance of `TalkSpecServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (TalkSpecServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._admin_name is None:
            raise SerializationError("admin_name must be provided.")
        writer.add_string(data._admin_name)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/talk_spec_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "TalkSpecServerPacket":
    """
    Deserializes an instance of `TalkSpecServerPacket` from the provided `EoReader`.

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

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

TalkServerServerPacket

Bases: Packet

Server message

Source code in src/eolib/protocol/_generated/net/server/talk_server_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class TalkServerServerPacket(Packet):
    """
    Server message
    """
    _byte_size: int = 0
    _message: str

    def __init__(self, *, message: str):
        """
        Create a new instance of TalkServerServerPacket.

        Args:
            message (str): 
        """
        self._message = message

    @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 message(self) -> str:
        return self._message

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (TalkServerServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._message is None:
                raise SerializationError("message must be provided.")
            writer.add_string(data._message)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

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

    def __repr__(self):
        return f"TalkServerServerPacket(byte_size={repr(self._byte_size)}, message={repr(self._message)})"

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.

message: str property

__init__(*, message)

Create a new instance of TalkServerServerPacket.

Parameters:

Name Type Description Default
message str
required
Source code in src/eolib/protocol/_generated/net/server/talk_server_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, message: str):
    """
    Create a new instance of TalkServerServerPacket.

    Args:
        message (str): 
    """
    self._message = message

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/talk_server_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/talk_server_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/talk_server_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    TalkServerServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of TalkServerServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data TalkServerServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/talk_server_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "TalkServerServerPacket") -> None:
    """
    Serializes an instance of `TalkServerServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (TalkServerServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._message is None:
            raise SerializationError("message must be provided.")
        writer.add_string(data._message)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/talk_server_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "TalkServerServerPacket":
    """
    Deserializes an instance of `TalkServerServerPacket` from the provided `EoReader`.

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

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

TalkRequestServerPacket

Bases: Packet

Guild chat message

Source code in src/eolib/protocol/_generated/net/server/talk_request_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
class TalkRequestServerPacket(Packet):
    """
    Guild chat message
    """
    _byte_size: int = 0
    _player_name: str
    _message: str

    def __init__(self, *, player_name: str, message: str):
        """
        Create a new instance of TalkRequestServerPacket.

        Args:
            player_name (str): 
            message (str): 
        """
        self._player_name = player_name
        self._message = message

    @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 player_name(self) -> str:
        return self._player_name

    @property
    def message(self) -> str:
        return self._message

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (TalkRequestServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._player_name is None:
                raise SerializationError("player_name must be provided.")
            writer.add_string(data._player_name)
            writer.add_byte(0xFF)
            if data._message is None:
                raise SerializationError("message must be provided.")
            writer.add_string(data._message)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            TalkRequestServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            player_name = reader.get_string()
            reader.next_chunk()
            message = reader.get_string()
            reader.chunked_reading_mode = False
            result = TalkRequestServerPacket(player_name=player_name, message=message)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"TalkRequestServerPacket(byte_size={repr(self._byte_size)}, player_name={repr(self._player_name)}, message={repr(self._message)})"

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.

player_name: str property

message: str property

__init__(*, player_name, message)

Create a new instance of TalkRequestServerPacket.

Parameters:

Name Type Description Default
player_name str
required
message str
required
Source code in src/eolib/protocol/_generated/net/server/talk_request_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, player_name: str, message: str):
    """
    Create a new instance of TalkRequestServerPacket.

    Args:
        player_name (str): 
        message (str): 
    """
    self._player_name = player_name
    self._message = message

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/talk_request_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/talk_request_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/talk_request_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    TalkRequestServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of TalkRequestServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data TalkRequestServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/talk_request_server_packet.py
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
@staticmethod
def serialize(writer: EoWriter, data: "TalkRequestServerPacket") -> None:
    """
    Serializes an instance of `TalkRequestServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (TalkRequestServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._player_name is None:
            raise SerializationError("player_name must be provided.")
        writer.add_string(data._player_name)
        writer.add_byte(0xFF)
        if data._message is None:
            raise SerializationError("message must be provided.")
        writer.add_string(data._message)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/talk_request_server_packet.py
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
@staticmethod
def deserialize(reader: EoReader) -> "TalkRequestServerPacket":
    """
    Deserializes an instance of `TalkRequestServerPacket` from the provided `EoReader`.

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

    Returns:
        TalkRequestServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        player_name = reader.get_string()
        reader.next_chunk()
        message = reader.get_string()
        reader.chunked_reading_mode = False
        result = TalkRequestServerPacket(player_name=player_name, message=message)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

TalkReplyServerPacket

Bases: Packet

Reply to trying to send a private message

Source code in src/eolib/protocol/_generated/net/server/talk_reply_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class TalkReplyServerPacket(Packet):
    """
    Reply to trying to send a private message
    """
    _byte_size: int = 0
    _reply_code: TalkReply
    _name: str

    def __init__(self, *, reply_code: TalkReply, name: str):
        """
        Create a new instance of TalkReplyServerPacket.

        Args:
            reply_code (TalkReply): 
            name (str): 
        """
        self._reply_code = reply_code
        self._name = name

    @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) -> TalkReply:
        return self._reply_code

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (TalkReplyServerPacket): 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._name is None:
                raise SerializationError("name must be provided.")
            writer.add_string(data._name)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            TalkReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reply_code = TalkReply(reader.get_short())
            name = reader.get_string()
            result = TalkReplyServerPacket(reply_code=reply_code, name=name)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"TalkReplyServerPacket(byte_size={repr(self._byte_size)}, reply_code={repr(self._reply_code)}, name={repr(self._name)})"

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

name: str property

__init__(*, reply_code, name)

Create a new instance of TalkReplyServerPacket.

Parameters:

Name Type Description Default
reply_code TalkReply
required
name str
required
Source code in src/eolib/protocol/_generated/net/server/talk_reply_server_packet.py
22
23
24
25
26
27
28
29
30
31
def __init__(self, *, reply_code: TalkReply, name: str):
    """
    Create a new instance of TalkReplyServerPacket.

    Args:
        reply_code (TalkReply): 
        name (str): 
    """
    self._reply_code = reply_code
    self._name = name

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/talk_reply_server_packet.py
51
52
53
54
55
56
57
58
59
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/talk_reply_server_packet.py
61
62
63
64
65
66
67
68
69
@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/talk_reply_server_packet.py
71
72
73
74
75
76
77
78
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.
    """
    TalkReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of TalkReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data TalkReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/talk_reply_server_packet.py
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@staticmethod
def serialize(writer: EoWriter, data: "TalkReplyServerPacket") -> None:
    """
    Serializes an instance of `TalkReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (TalkReplyServerPacket): 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._name is None:
            raise SerializationError("name must be provided.")
        writer.add_string(data._name)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/talk_reply_server_packet.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@staticmethod
def deserialize(reader: EoReader) -> "TalkReplyServerPacket":
    """
    Deserializes an instance of `TalkReplyServerPacket` from the provided `EoReader`.

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

    Returns:
        TalkReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reply_code = TalkReply(reader.get_short())
        name = reader.get_string()
        result = TalkReplyServerPacket(reply_code=reply_code, name=name)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

TalkReply

Bases: IntEnum

Reply code sent with TALK_REPLY packet

Source code in src/eolib/protocol/_generated/net/server/talk_reply.py
 9
10
11
12
13
class TalkReply(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Reply code sent with TALK_REPLY packet
    """
    NotFound = 1

NotFound = 1 class-attribute instance-attribute

TalkPlayerServerPacket

Bases: Packet

Public chat message

Source code in src/eolib/protocol/_generated/net/server/talk_player_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
class TalkPlayerServerPacket(Packet):
    """
    Public chat message
    """
    _byte_size: int = 0
    _player_id: int
    _message: str

    def __init__(self, *, player_id: int, message: str):
        """
        Create a new instance of TalkPlayerServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            message (str): 
        """
        self._player_id = player_id
        self._message = message

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

    @property
    def message(self) -> str:
        return self._message

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (TalkPlayerServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._message is None:
                raise SerializationError("message must be provided.")
            writer.add_string(data._message)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            TalkPlayerServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            message = reader.get_string()
            result = TalkPlayerServerPacket(player_id=player_id, message=message)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"TalkPlayerServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, message={repr(self._message)})"

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.

player_id: int property

message: str property

__init__(*, player_id, message)

Create a new instance of TalkPlayerServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
message str
required
Source code in src/eolib/protocol/_generated/net/server/talk_player_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, player_id: int, message: str):
    """
    Create a new instance of TalkPlayerServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        message (str): 
    """
    self._player_id = player_id
    self._message = message

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/talk_player_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/talk_player_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/talk_player_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    TalkPlayerServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of TalkPlayerServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data TalkPlayerServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/talk_player_server_packet.py
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@staticmethod
def serialize(writer: EoWriter, data: "TalkPlayerServerPacket") -> None:
    """
    Serializes an instance of `TalkPlayerServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (TalkPlayerServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._message is None:
            raise SerializationError("message must be provided.")
        writer.add_string(data._message)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/talk_player_server_packet.py
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@staticmethod
def deserialize(reader: EoReader) -> "TalkPlayerServerPacket":
    """
    Deserializes an instance of `TalkPlayerServerPacket` from the provided `EoReader`.

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

    Returns:
        TalkPlayerServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        message = reader.get_string()
        result = TalkPlayerServerPacket(player_id=player_id, message=message)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

TalkOpenServerPacket

Bases: Packet

Party chat message

Source code in src/eolib/protocol/_generated/net/server/talk_open_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
class TalkOpenServerPacket(Packet):
    """
    Party chat message
    """
    _byte_size: int = 0
    _player_id: int
    _message: str

    def __init__(self, *, player_id: int, message: str):
        """
        Create a new instance of TalkOpenServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            message (str): 
        """
        self._player_id = player_id
        self._message = message

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

    @property
    def message(self) -> str:
        return self._message

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (TalkOpenServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._message is None:
                raise SerializationError("message must be provided.")
            writer.add_string(data._message)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            TalkOpenServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            message = reader.get_string()
            result = TalkOpenServerPacket(player_id=player_id, message=message)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"TalkOpenServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, message={repr(self._message)})"

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.

player_id: int property

message: str property

__init__(*, player_id, message)

Create a new instance of TalkOpenServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
message str
required
Source code in src/eolib/protocol/_generated/net/server/talk_open_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, player_id: int, message: str):
    """
    Create a new instance of TalkOpenServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        message (str): 
    """
    self._player_id = player_id
    self._message = message

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/talk_open_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/talk_open_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/talk_open_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    TalkOpenServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of TalkOpenServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data TalkOpenServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/talk_open_server_packet.py
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@staticmethod
def serialize(writer: EoWriter, data: "TalkOpenServerPacket") -> None:
    """
    Serializes an instance of `TalkOpenServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (TalkOpenServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._message is None:
            raise SerializationError("message must be provided.")
        writer.add_string(data._message)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/talk_open_server_packet.py
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@staticmethod
def deserialize(reader: EoReader) -> "TalkOpenServerPacket":
    """
    Deserializes an instance of `TalkOpenServerPacket` from the provided `EoReader`.

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

    Returns:
        TalkOpenServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        message = reader.get_string()
        result = TalkOpenServerPacket(player_id=player_id, message=message)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

TalkMsgServerPacket

Bases: Packet

Global chat message

Source code in src/eolib/protocol/_generated/net/server/talk_msg_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
class TalkMsgServerPacket(Packet):
    """
    Global chat message
    """
    _byte_size: int = 0
    _player_name: str
    _message: str

    def __init__(self, *, player_name: str, message: str):
        """
        Create a new instance of TalkMsgServerPacket.

        Args:
            player_name (str): 
            message (str): 
        """
        self._player_name = player_name
        self._message = message

    @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 player_name(self) -> str:
        return self._player_name

    @property
    def message(self) -> str:
        return self._message

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (TalkMsgServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._player_name is None:
                raise SerializationError("player_name must be provided.")
            writer.add_string(data._player_name)
            writer.add_byte(0xFF)
            if data._message is None:
                raise SerializationError("message must be provided.")
            writer.add_string(data._message)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            TalkMsgServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            player_name = reader.get_string()
            reader.next_chunk()
            message = reader.get_string()
            reader.chunked_reading_mode = False
            result = TalkMsgServerPacket(player_name=player_name, message=message)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"TalkMsgServerPacket(byte_size={repr(self._byte_size)}, player_name={repr(self._player_name)}, message={repr(self._message)})"

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.

player_name: str property

message: str property

__init__(*, player_name, message)

Create a new instance of TalkMsgServerPacket.

Parameters:

Name Type Description Default
player_name str
required
message str
required
Source code in src/eolib/protocol/_generated/net/server/talk_msg_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, player_name: str, message: str):
    """
    Create a new instance of TalkMsgServerPacket.

    Args:
        player_name (str): 
        message (str): 
    """
    self._player_name = player_name
    self._message = message

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/talk_msg_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/talk_msg_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/talk_msg_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    TalkMsgServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of TalkMsgServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data TalkMsgServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/talk_msg_server_packet.py
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
@staticmethod
def serialize(writer: EoWriter, data: "TalkMsgServerPacket") -> None:
    """
    Serializes an instance of `TalkMsgServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (TalkMsgServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._player_name is None:
            raise SerializationError("player_name must be provided.")
        writer.add_string(data._player_name)
        writer.add_byte(0xFF)
        if data._message is None:
            raise SerializationError("message must be provided.")
        writer.add_string(data._message)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/talk_msg_server_packet.py
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
@staticmethod
def deserialize(reader: EoReader) -> "TalkMsgServerPacket":
    """
    Deserializes an instance of `TalkMsgServerPacket` from the provided `EoReader`.

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

    Returns:
        TalkMsgServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        player_name = reader.get_string()
        reader.next_chunk()
        message = reader.get_string()
        reader.chunked_reading_mode = False
        result = TalkMsgServerPacket(player_name=player_name, message=message)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

TalkListServerPacket

Bases: Packet

Global chat backfill. Sent by the official game server when a player opens the global chat tab.

Source code in src/eolib/protocol/_generated/net/server/talk_list_server_packet.py
 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
class TalkListServerPacket(Packet):
    """
    Global chat backfill.
    Sent by the official game server when a player opens the global chat tab.
    """
    _byte_size: int = 0
    _messages: tuple[GlobalBackfillMessage, ...]

    def __init__(self, *, messages: Iterable[GlobalBackfillMessage]):
        """
        Create a new instance of TalkListServerPacket.

        Args:
            messages (Iterable[GlobalBackfillMessage]): 
        """
        self._messages = tuple(messages)

    @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 messages(self) -> tuple[GlobalBackfillMessage, ...]:
        return self._messages

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (TalkListServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._messages is None:
                raise SerializationError("messages must be provided.")
            for i in range(len(data._messages)):
                GlobalBackfillMessage.serialize(writer, data._messages[i])
                writer.add_byte(0xFF)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            TalkListServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            messages = []
            while reader.remaining > 0:
                messages.append(GlobalBackfillMessage.deserialize(reader))
                reader.next_chunk()
            reader.chunked_reading_mode = False
            result = TalkListServerPacket(messages=messages)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"TalkListServerPacket(byte_size={repr(self._byte_size)}, messages={repr(self._messages)})"

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.

messages: tuple[GlobalBackfillMessage, ...] property

__init__(*, messages)

Create a new instance of TalkListServerPacket.

Parameters:

Name Type Description Default
messages Iterable[GlobalBackfillMessage]
required
Source code in src/eolib/protocol/_generated/net/server/talk_list_server_packet.py
24
25
26
27
28
29
30
31
def __init__(self, *, messages: Iterable[GlobalBackfillMessage]):
    """
    Create a new instance of TalkListServerPacket.

    Args:
        messages (Iterable[GlobalBackfillMessage]): 
    """
    self._messages = tuple(messages)

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/talk_list_server_packet.py
47
48
49
50
51
52
53
54
55
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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

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

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/talk_list_server_packet.py
67
68
69
70
71
72
73
74
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.
    """
    TalkListServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of TalkListServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data TalkListServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/talk_list_server_packet.py
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
@staticmethod
def serialize(writer: EoWriter, data: "TalkListServerPacket") -> None:
    """
    Serializes an instance of `TalkListServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (TalkListServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._messages is None:
            raise SerializationError("messages must be provided.")
        for i in range(len(data._messages)):
            GlobalBackfillMessage.serialize(writer, data._messages[i])
            writer.add_byte(0xFF)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

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

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

    Returns:
        TalkListServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        messages = []
        while reader.remaining > 0:
            messages.append(GlobalBackfillMessage.deserialize(reader))
            reader.next_chunk()
        reader.chunked_reading_mode = False
        result = TalkListServerPacket(messages=messages)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

TalkAnnounceServerPacket

Bases: Packet

Admin announcement

Source code in src/eolib/protocol/_generated/net/server/talk_announce_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
class TalkAnnounceServerPacket(Packet):
    """
    Admin announcement
    """
    _byte_size: int = 0
    _player_name: str
    _message: str

    def __init__(self, *, player_name: str, message: str):
        """
        Create a new instance of TalkAnnounceServerPacket.

        Args:
            player_name (str): 
            message (str): 
        """
        self._player_name = player_name
        self._message = message

    @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 player_name(self) -> str:
        return self._player_name

    @property
    def message(self) -> str:
        return self._message

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (TalkAnnounceServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._player_name is None:
                raise SerializationError("player_name must be provided.")
            writer.add_string(data._player_name)
            writer.add_byte(0xFF)
            if data._message is None:
                raise SerializationError("message must be provided.")
            writer.add_string(data._message)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            TalkAnnounceServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            player_name = reader.get_string()
            reader.next_chunk()
            message = reader.get_string()
            reader.chunked_reading_mode = False
            result = TalkAnnounceServerPacket(player_name=player_name, message=message)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"TalkAnnounceServerPacket(byte_size={repr(self._byte_size)}, player_name={repr(self._player_name)}, message={repr(self._message)})"

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.

player_name: str property

message: str property

__init__(*, player_name, message)

Create a new instance of TalkAnnounceServerPacket.

Parameters:

Name Type Description Default
player_name str
required
message str
required
Source code in src/eolib/protocol/_generated/net/server/talk_announce_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, player_name: str, message: str):
    """
    Create a new instance of TalkAnnounceServerPacket.

    Args:
        player_name (str): 
        message (str): 
    """
    self._player_name = player_name
    self._message = message

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/talk_announce_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/talk_announce_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/talk_announce_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    TalkAnnounceServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of TalkAnnounceServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data TalkAnnounceServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/talk_announce_server_packet.py
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
@staticmethod
def serialize(writer: EoWriter, data: "TalkAnnounceServerPacket") -> None:
    """
    Serializes an instance of `TalkAnnounceServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (TalkAnnounceServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._player_name is None:
            raise SerializationError("player_name must be provided.")
        writer.add_string(data._player_name)
        writer.add_byte(0xFF)
        if data._message is None:
            raise SerializationError("message must be provided.")
        writer.add_string(data._message)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/talk_announce_server_packet.py
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
@staticmethod
def deserialize(reader: EoReader) -> "TalkAnnounceServerPacket":
    """
    Deserializes an instance of `TalkAnnounceServerPacket` from the provided `EoReader`.

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

    Returns:
        TalkAnnounceServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        player_name = reader.get_string()
        reader.next_chunk()
        message = reader.get_string()
        reader.chunked_reading_mode = False
        result = TalkAnnounceServerPacket(player_name=player_name, message=message)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

TalkAdminServerPacket

Bases: Packet

Admin chat message

Source code in src/eolib/protocol/_generated/net/server/talk_admin_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
class TalkAdminServerPacket(Packet):
    """
    Admin chat message
    """
    _byte_size: int = 0
    _player_name: str
    _message: str

    def __init__(self, *, player_name: str, message: str):
        """
        Create a new instance of TalkAdminServerPacket.

        Args:
            player_name (str): 
            message (str): 
        """
        self._player_name = player_name
        self._message = message

    @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 player_name(self) -> str:
        return self._player_name

    @property
    def message(self) -> str:
        return self._message

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (TalkAdminServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._player_name is None:
                raise SerializationError("player_name must be provided.")
            writer.add_string(data._player_name)
            writer.add_byte(0xFF)
            if data._message is None:
                raise SerializationError("message must be provided.")
            writer.add_string(data._message)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            TalkAdminServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            player_name = reader.get_string()
            reader.next_chunk()
            message = reader.get_string()
            reader.chunked_reading_mode = False
            result = TalkAdminServerPacket(player_name=player_name, message=message)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"TalkAdminServerPacket(byte_size={repr(self._byte_size)}, player_name={repr(self._player_name)}, message={repr(self._message)})"

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.

player_name: str property

message: str property

__init__(*, player_name, message)

Create a new instance of TalkAdminServerPacket.

Parameters:

Name Type Description Default
player_name str
required
message str
required
Source code in src/eolib/protocol/_generated/net/server/talk_admin_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, player_name: str, message: str):
    """
    Create a new instance of TalkAdminServerPacket.

    Args:
        player_name (str): 
        message (str): 
    """
    self._player_name = player_name
    self._message = message

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/talk_admin_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/talk_admin_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/talk_admin_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    TalkAdminServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of TalkAdminServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data TalkAdminServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/talk_admin_server_packet.py
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
@staticmethod
def serialize(writer: EoWriter, data: "TalkAdminServerPacket") -> None:
    """
    Serializes an instance of `TalkAdminServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (TalkAdminServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._player_name is None:
            raise SerializationError("player_name must be provided.")
        writer.add_string(data._player_name)
        writer.add_byte(0xFF)
        if data._message is None:
            raise SerializationError("message must be provided.")
        writer.add_string(data._message)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/talk_admin_server_packet.py
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
@staticmethod
def deserialize(reader: EoReader) -> "TalkAdminServerPacket":
    """
    Deserializes an instance of `TalkAdminServerPacket` from the provided `EoReader`.

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

    Returns:
        TalkAdminServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        player_name = reader.get_string()
        reader.next_chunk()
        message = reader.get_string()
        reader.chunked_reading_mode = False
        result = TalkAdminServerPacket(player_name=player_name, message=message)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

StatSkillTakeServerPacket

Bases: Packet

Response from learning a skill from a skill master

Source code in src/eolib/protocol/_generated/net/server/stat_skill_take_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
class StatSkillTakeServerPacket(Packet):
    """
    Response from learning a skill from a skill master
    """
    _byte_size: int = 0
    _spell_id: int
    _gold_amount: int

    def __init__(self, *, spell_id: int, gold_amount: int):
        """
        Create a new instance of StatSkillTakeServerPacket.

        Args:
            spell_id (int): (Value range is 0-64008.)
            gold_amount (int): (Value range is 0-4097152080.)
        """
        self._spell_id = spell_id
        self._gold_amount = gold_amount

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

    @property
    def gold_amount(self) -> int:
        return self._gold_amount

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (StatSkillTakeServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._spell_id is None:
                raise SerializationError("spell_id must be provided.")
            writer.add_short(data._spell_id)
            if data._gold_amount is None:
                raise SerializationError("gold_amount must be provided.")
            writer.add_int(data._gold_amount)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            StatSkillTakeServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            spell_id = reader.get_short()
            gold_amount = reader.get_int()
            result = StatSkillTakeServerPacket(spell_id=spell_id, gold_amount=gold_amount)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"StatSkillTakeServerPacket(byte_size={repr(self._byte_size)}, spell_id={repr(self._spell_id)}, gold_amount={repr(self._gold_amount)})"

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.

spell_id: int property

gold_amount: int property

__init__(*, spell_id, gold_amount)

Create a new instance of StatSkillTakeServerPacket.

Parameters:

Name Type Description Default
spell_id int

(Value range is 0-64008.)

required
gold_amount int

(Value range is 0-4097152080.)

required
Source code in src/eolib/protocol/_generated/net/server/stat_skill_take_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, spell_id: int, gold_amount: int):
    """
    Create a new instance of StatSkillTakeServerPacket.

    Args:
        spell_id (int): (Value range is 0-64008.)
        gold_amount (int): (Value range is 0-4097152080.)
    """
    self._spell_id = spell_id
    self._gold_amount = gold_amount

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/stat_skill_take_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/stat_skill_take_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/stat_skill_take_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    StatSkillTakeServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of StatSkillTakeServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data StatSkillTakeServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/stat_skill_take_server_packet.py
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@staticmethod
def serialize(writer: EoWriter, data: "StatSkillTakeServerPacket") -> None:
    """
    Serializes an instance of `StatSkillTakeServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (StatSkillTakeServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._spell_id is None:
            raise SerializationError("spell_id must be provided.")
        writer.add_short(data._spell_id)
        if data._gold_amount is None:
            raise SerializationError("gold_amount must be provided.")
        writer.add_int(data._gold_amount)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/stat_skill_take_server_packet.py
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@staticmethod
def deserialize(reader: EoReader) -> "StatSkillTakeServerPacket":
    """
    Deserializes an instance of `StatSkillTakeServerPacket` from the provided `EoReader`.

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

    Returns:
        StatSkillTakeServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        spell_id = reader.get_short()
        gold_amount = reader.get_int()
        result = StatSkillTakeServerPacket(spell_id=spell_id, gold_amount=gold_amount)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

StatSkillReplyServerPacket

Bases: Packet

Response from unsuccessful action at a skill master

Source code in src/eolib/protocol/_generated/net/server/stat_skill_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
class StatSkillReplyServerPacket(Packet):
    """
    Response from unsuccessful action at a skill master
    """
    _byte_size: int = 0
    _reply_code: SkillMasterReply
    _reply_code_data: 'StatSkillReplyServerPacket.ReplyCodeData'

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

        Args:
            reply_code (SkillMasterReply): 
            reply_code_data (StatSkillReplyServerPacket.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) -> SkillMasterReply:
        return self._reply_code

    @property
    def reply_code_data(self) -> 'StatSkillReplyServerPacket.ReplyCodeData':
        """
        StatSkillReplyServerPacket.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.StatSkill

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (StatSkillReplyServerPacket): 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 == SkillMasterReply.WrongClass:
                if not isinstance(data._reply_code_data, StatSkillReplyServerPacket.ReplyCodeDataWrongClass):
                    raise SerializationError("Expected reply_code_data to be type StatSkillReplyServerPacket.ReplyCodeDataWrongClass for reply_code " + SkillMasterReply(data._reply_code).name + ".")
                StatSkillReplyServerPacket.ReplyCodeDataWrongClass.serialize(writer, data._reply_code_data)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            StatSkillReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reply_code = SkillMasterReply(reader.get_short())
            reply_code_data: StatSkillReplyServerPacket.ReplyCodeData = None
            if reply_code == SkillMasterReply.WrongClass:
                reply_code_data = StatSkillReplyServerPacket.ReplyCodeDataWrongClass.deserialize(reader)
            result = StatSkillReplyServerPacket(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"StatSkillReplyServerPacket(byte_size={repr(self._byte_size)}, reply_code={repr(self._reply_code)}, reply_code_data={repr(self._reply_code_data)})"

    ReplyCodeData = Union['StatSkillReplyServerPacket.ReplyCodeDataWrongClass', None]
    """
    Data associated with different values of the `reply_code` field.
    """

    class ReplyCodeDataWrongClass:
        """
        Data associated with reply_code value SkillMasterReply.WrongClass
        """
        _byte_size: int = 0
        _class_id: int

        def __init__(self, *, class_id: int):
            """
            Create a new instance of StatSkillReplyServerPacket.ReplyCodeDataWrongClass.

            Args:
                class_id (int): (Value range is 0-252.)
            """
            self._class_id = class_id

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

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

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (StatSkillReplyServerPacket.ReplyCodeDataWrongClass): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._class_id is None:
                    raise SerializationError("class_id must be provided.")
                writer.add_char(data._class_id)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

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

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

            Returns:
                StatSkillReplyServerPacket.ReplyCodeDataWrongClass: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                class_id = reader.get_char()
                result = StatSkillReplyServerPacket.ReplyCodeDataWrongClass(class_id=class_id)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"StatSkillReplyServerPacket.ReplyCodeDataWrongClass(byte_size={repr(self._byte_size)}, class_id={repr(self._class_id)})"

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

reply_code_data: StatSkillReplyServerPacket.ReplyCodeData property

StatSkillReplyServerPacket.ReplyCodeData: Data associated with the reply_code field.

ReplyCodeData = Union['StatSkillReplyServerPacket.ReplyCodeDataWrongClass', None] class-attribute instance-attribute

Data associated with different values of the reply_code field.

ReplyCodeDataWrongClass

Data associated with reply_code value SkillMasterReply.WrongClass

Source code in src/eolib/protocol/_generated/net/server/stat_skill_reply_server_packet.py
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
class ReplyCodeDataWrongClass:
    """
    Data associated with reply_code value SkillMasterReply.WrongClass
    """
    _byte_size: int = 0
    _class_id: int

    def __init__(self, *, class_id: int):
        """
        Create a new instance of StatSkillReplyServerPacket.ReplyCodeDataWrongClass.

        Args:
            class_id (int): (Value range is 0-252.)
        """
        self._class_id = class_id

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (StatSkillReplyServerPacket.ReplyCodeDataWrongClass): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._class_id is None:
                raise SerializationError("class_id must be provided.")
            writer.add_char(data._class_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            StatSkillReplyServerPacket.ReplyCodeDataWrongClass: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            class_id = reader.get_char()
            result = StatSkillReplyServerPacket.ReplyCodeDataWrongClass(class_id=class_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"StatSkillReplyServerPacket.ReplyCodeDataWrongClass(byte_size={repr(self._byte_size)}, class_id={repr(self._class_id)})"

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.

class_id: int property

__init__(*, class_id)

Create a new instance of StatSkillReplyServerPacket.ReplyCodeDataWrongClass.

Parameters:

Name Type Description Default
class_id int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/stat_skill_reply_server_packet.py
144
145
146
147
148
149
150
151
def __init__(self, *, class_id: int):
    """
    Create a new instance of StatSkillReplyServerPacket.ReplyCodeDataWrongClass.

    Args:
        class_id (int): (Value range is 0-252.)
    """
    self._class_id = class_id

serialize(writer, data) staticmethod

Serializes an instance of StatSkillReplyServerPacket.ReplyCodeDataWrongClass to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataWrongClass

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/stat_skill_reply_server_packet.py
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
@staticmethod
def serialize(writer: EoWriter, data: "StatSkillReplyServerPacket.ReplyCodeDataWrongClass") -> None:
    """
    Serializes an instance of `StatSkillReplyServerPacket.ReplyCodeDataWrongClass` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (StatSkillReplyServerPacket.ReplyCodeDataWrongClass): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._class_id is None:
            raise SerializationError("class_id must be provided.")
        writer.add_char(data._class_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of StatSkillReplyServerPacket.ReplyCodeDataWrongClass from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataWrongClass

StatSkillReplyServerPacket.ReplyCodeDataWrongClass: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/stat_skill_reply_server_packet.py
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
@staticmethod
def deserialize(reader: EoReader) -> "StatSkillReplyServerPacket.ReplyCodeDataWrongClass":
    """
    Deserializes an instance of `StatSkillReplyServerPacket.ReplyCodeDataWrongClass` from the provided `EoReader`.

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

    Returns:
        StatSkillReplyServerPacket.ReplyCodeDataWrongClass: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        class_id = reader.get_char()
        result = StatSkillReplyServerPacket.ReplyCodeDataWrongClass(class_id=class_id)
        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 StatSkillReplyServerPacket.

Parameters:

Name Type Description Default
reply_code SkillMasterReply
required
reply_code_data ReplyCodeData

Data associated with the reply_code field.

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

    Args:
        reply_code (SkillMasterReply): 
        reply_code_data (StatSkillReplyServerPacket.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/stat_skill_reply_server_packet.py
55
56
57
58
59
60
61
62
63
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/stat_skill_reply_server_packet.py
65
66
67
68
69
70
71
72
73
@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/stat_skill_reply_server_packet.py
75
76
77
78
79
80
81
82
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.
    """
    StatSkillReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of StatSkillReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data StatSkillReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/stat_skill_reply_server_packet.py
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
@staticmethod
def serialize(writer: EoWriter, data: "StatSkillReplyServerPacket") -> None:
    """
    Serializes an instance of `StatSkillReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (StatSkillReplyServerPacket): 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 == SkillMasterReply.WrongClass:
            if not isinstance(data._reply_code_data, StatSkillReplyServerPacket.ReplyCodeDataWrongClass):
                raise SerializationError("Expected reply_code_data to be type StatSkillReplyServerPacket.ReplyCodeDataWrongClass for reply_code " + SkillMasterReply(data._reply_code).name + ".")
            StatSkillReplyServerPacket.ReplyCodeDataWrongClass.serialize(writer, data._reply_code_data)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/stat_skill_reply_server_packet.py
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
@staticmethod
def deserialize(reader: EoReader) -> "StatSkillReplyServerPacket":
    """
    Deserializes an instance of `StatSkillReplyServerPacket` from the provided `EoReader`.

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

    Returns:
        StatSkillReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reply_code = SkillMasterReply(reader.get_short())
        reply_code_data: StatSkillReplyServerPacket.ReplyCodeData = None
        if reply_code == SkillMasterReply.WrongClass:
            reply_code_data = StatSkillReplyServerPacket.ReplyCodeDataWrongClass.deserialize(reader)
        result = StatSkillReplyServerPacket(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

StatSkillRemoveServerPacket

Bases: Packet

Response to forgetting a skill at a skill master

Source code in src/eolib/protocol/_generated/net/server/stat_skill_remove_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class StatSkillRemoveServerPacket(Packet):
    """
    Response to forgetting a skill at a skill master
    """
    _byte_size: int = 0
    _spell_id: int

    def __init__(self, *, spell_id: int):
        """
        Create a new instance of StatSkillRemoveServerPacket.

        Args:
            spell_id (int): (Value range is 0-64008.)
        """
        self._spell_id = spell_id

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

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (StatSkillRemoveServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._spell_id is None:
                raise SerializationError("spell_id must be provided.")
            writer.add_short(data._spell_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

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

    def __repr__(self):
        return f"StatSkillRemoveServerPacket(byte_size={repr(self._byte_size)}, spell_id={repr(self._spell_id)})"

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.

spell_id: int property

__init__(*, spell_id)

Create a new instance of StatSkillRemoveServerPacket.

Parameters:

Name Type Description Default
spell_id int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/stat_skill_remove_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, spell_id: int):
    """
    Create a new instance of StatSkillRemoveServerPacket.

    Args:
        spell_id (int): (Value range is 0-64008.)
    """
    self._spell_id = spell_id

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/stat_skill_remove_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/stat_skill_remove_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/stat_skill_remove_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    StatSkillRemoveServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of StatSkillRemoveServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data StatSkillRemoveServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/stat_skill_remove_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "StatSkillRemoveServerPacket") -> None:
    """
    Serializes an instance of `StatSkillRemoveServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (StatSkillRemoveServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._spell_id is None:
            raise SerializationError("spell_id must be provided.")
        writer.add_short(data._spell_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/stat_skill_remove_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "StatSkillRemoveServerPacket":
    """
    Deserializes an instance of `StatSkillRemoveServerPacket` from the provided `EoReader`.

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

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

StatSkillPlayerServerPacket

Bases: Packet

Response to spending stat points

Source code in src/eolib/protocol/_generated/net/server/stat_skill_player_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class StatSkillPlayerServerPacket(Packet):
    """
    Response to spending stat points
    """
    _byte_size: int = 0
    _stat_points: int
    _stats: CharacterStatsUpdate

    def __init__(self, *, stat_points: int, stats: CharacterStatsUpdate):
        """
        Create a new instance of StatSkillPlayerServerPacket.

        Args:
            stat_points (int): (Value range is 0-64008.)
            stats (CharacterStatsUpdate): 
        """
        self._stat_points = stat_points
        self._stats = stats

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

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

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (StatSkillPlayerServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._stat_points is None:
                raise SerializationError("stat_points must be provided.")
            writer.add_short(data._stat_points)
            if data._stats is None:
                raise SerializationError("stats must be provided.")
            CharacterStatsUpdate.serialize(writer, data._stats)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            StatSkillPlayerServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            stat_points = reader.get_short()
            stats = CharacterStatsUpdate.deserialize(reader)
            result = StatSkillPlayerServerPacket(stat_points=stat_points, stats=stats)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"StatSkillPlayerServerPacket(byte_size={repr(self._byte_size)}, stat_points={repr(self._stat_points)}, stats={repr(self._stats)})"

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.

stat_points: int property

stats: CharacterStatsUpdate property

__init__(*, stat_points, stats)

Create a new instance of StatSkillPlayerServerPacket.

Parameters:

Name Type Description Default
stat_points int

(Value range is 0-64008.)

required
stats CharacterStatsUpdate
required
Source code in src/eolib/protocol/_generated/net/server/stat_skill_player_server_packet.py
22
23
24
25
26
27
28
29
30
31
def __init__(self, *, stat_points: int, stats: CharacterStatsUpdate):
    """
    Create a new instance of StatSkillPlayerServerPacket.

    Args:
        stat_points (int): (Value range is 0-64008.)
        stats (CharacterStatsUpdate): 
    """
    self._stat_points = stat_points
    self._stats = stats

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/stat_skill_player_server_packet.py
51
52
53
54
55
56
57
58
59
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/stat_skill_player_server_packet.py
61
62
63
64
65
66
67
68
69
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/stat_skill_player_server_packet.py
71
72
73
74
75
76
77
78
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.
    """
    StatSkillPlayerServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of StatSkillPlayerServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data StatSkillPlayerServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/stat_skill_player_server_packet.py
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@staticmethod
def serialize(writer: EoWriter, data: "StatSkillPlayerServerPacket") -> None:
    """
    Serializes an instance of `StatSkillPlayerServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (StatSkillPlayerServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._stat_points is None:
            raise SerializationError("stat_points must be provided.")
        writer.add_short(data._stat_points)
        if data._stats is None:
            raise SerializationError("stats must be provided.")
        CharacterStatsUpdate.serialize(writer, data._stats)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/stat_skill_player_server_packet.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@staticmethod
def deserialize(reader: EoReader) -> "StatSkillPlayerServerPacket":
    """
    Deserializes an instance of `StatSkillPlayerServerPacket` from the provided `EoReader`.

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

    Returns:
        StatSkillPlayerServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        stat_points = reader.get_short()
        stats = CharacterStatsUpdate.deserialize(reader)
        result = StatSkillPlayerServerPacket(stat_points=stat_points, stats=stats)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

StatSkillOpenServerPacket

Bases: Packet

Response from talking to a skill master NPC

Source code in src/eolib/protocol/_generated/net/server/stat_skill_open_server_packet.py
 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
class StatSkillOpenServerPacket(Packet):
    """
    Response from talking to a skill master NPC
    """
    _byte_size: int = 0
    _session_id: int
    _shop_name: str
    _skills: tuple[SkillLearn, ...]

    def __init__(self, *, session_id: int, shop_name: str, skills: Iterable[SkillLearn]):
        """
        Create a new instance of StatSkillOpenServerPacket.

        Args:
            session_id (int): (Value range is 0-64008.)
            shop_name (str): 
            skills (Iterable[SkillLearn]): 
        """
        self._session_id = session_id
        self._shop_name = shop_name
        self._skills = tuple(skills)

    @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:
        return self._session_id

    @property
    def shop_name(self) -> str:
        return self._shop_name

    @property
    def skills(self) -> tuple[SkillLearn, ...]:
        return self._skills

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (StatSkillOpenServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._session_id is None:
                raise SerializationError("session_id must be provided.")
            writer.add_short(data._session_id)
            if data._shop_name is None:
                raise SerializationError("shop_name must be provided.")
            writer.add_string(data._shop_name)
            writer.add_byte(0xFF)
            if data._skills is None:
                raise SerializationError("skills must be provided.")
            for i in range(len(data._skills)):
                SkillLearn.serialize(writer, data._skills[i])
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            StatSkillOpenServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            session_id = reader.get_short()
            shop_name = reader.get_string()
            reader.next_chunk()
            skills_length = int(reader.remaining / 28)
            skills = []
            for i in range(skills_length):
                skills.append(SkillLearn.deserialize(reader))
            reader.chunked_reading_mode = False
            result = StatSkillOpenServerPacket(session_id=session_id, shop_name=shop_name, skills=skills)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"StatSkillOpenServerPacket(byte_size={repr(self._byte_size)}, session_id={repr(self._session_id)}, shop_name={repr(self._shop_name)}, skills={repr(self._skills)})"

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

shop_name: str property

skills: tuple[SkillLearn, ...] property

__init__(*, session_id, shop_name, skills)

Create a new instance of StatSkillOpenServerPacket.

Parameters:

Name Type Description Default
session_id int

(Value range is 0-64008.)

required
shop_name str
required
skills Iterable[SkillLearn]
required
Source code in src/eolib/protocol/_generated/net/server/stat_skill_open_server_packet.py
25
26
27
28
29
30
31
32
33
34
35
36
def __init__(self, *, session_id: int, shop_name: str, skills: Iterable[SkillLearn]):
    """
    Create a new instance of StatSkillOpenServerPacket.

    Args:
        session_id (int): (Value range is 0-64008.)
        shop_name (str): 
        skills (Iterable[SkillLearn]): 
    """
    self._session_id = session_id
    self._shop_name = shop_name
    self._skills = tuple(skills)

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

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

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/stat_skill_open_server_packet.py
70
71
72
73
74
75
76
77
78
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/stat_skill_open_server_packet.py
80
81
82
83
84
85
86
87
def write(self, writer):
    """
    Serializes and writes this packet to the provided EoWriter.

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

serialize(writer, data) staticmethod

Serializes an instance of StatSkillOpenServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data StatSkillOpenServerPacket

The data to serialize.

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

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (StatSkillOpenServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._session_id is None:
            raise SerializationError("session_id must be provided.")
        writer.add_short(data._session_id)
        if data._shop_name is None:
            raise SerializationError("shop_name must be provided.")
        writer.add_string(data._shop_name)
        writer.add_byte(0xFF)
        if data._skills is None:
            raise SerializationError("skills must be provided.")
        for i in range(len(data._skills)):
            SkillLearn.serialize(writer, data._skills[i])
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

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

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

    Returns:
        StatSkillOpenServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        session_id = reader.get_short()
        shop_name = reader.get_string()
        reader.next_chunk()
        skills_length = int(reader.remaining / 28)
        skills = []
        for i in range(skills_length):
            skills.append(SkillLearn.deserialize(reader))
        reader.chunked_reading_mode = False
        result = StatSkillOpenServerPacket(session_id=session_id, shop_name=shop_name, skills=skills)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

StatSkillJunkServerPacket

Bases: Packet

Response to resetting stats and skills at a skill master

Source code in src/eolib/protocol/_generated/net/server/stat_skill_junk_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
class StatSkillJunkServerPacket(Packet):
    """
    Response to resetting stats and skills at a skill master
    """
    _byte_size: int = 0
    _stats: CharacterStatsReset

    def __init__(self, *, stats: CharacterStatsReset):
        """
        Create a new instance of StatSkillJunkServerPacket.

        Args:
            stats (CharacterStatsReset): 
        """
        self._stats = stats

    @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 stats(self) -> CharacterStatsReset:
        return self._stats

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (StatSkillJunkServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._stats is None:
                raise SerializationError("stats must be provided.")
            CharacterStatsReset.serialize(writer, data._stats)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            StatSkillJunkServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            stats = CharacterStatsReset.deserialize(reader)
            result = StatSkillJunkServerPacket(stats=stats)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"StatSkillJunkServerPacket(byte_size={repr(self._byte_size)}, stats={repr(self._stats)})"

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.

stats: CharacterStatsReset property

__init__(*, stats)

Create a new instance of StatSkillJunkServerPacket.

Parameters:

Name Type Description Default
stats CharacterStatsReset
required
Source code in src/eolib/protocol/_generated/net/server/stat_skill_junk_server_packet.py
21
22
23
24
25
26
27
28
def __init__(self, *, stats: CharacterStatsReset):
    """
    Create a new instance of StatSkillJunkServerPacket.

    Args:
        stats (CharacterStatsReset): 
    """
    self._stats = stats

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/stat_skill_junk_server_packet.py
44
45
46
47
48
49
50
51
52
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/stat_skill_junk_server_packet.py
54
55
56
57
58
59
60
61
62
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/stat_skill_junk_server_packet.py
64
65
66
67
68
69
70
71
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.
    """
    StatSkillJunkServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of StatSkillJunkServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data StatSkillJunkServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/stat_skill_junk_server_packet.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@staticmethod
def serialize(writer: EoWriter, data: "StatSkillJunkServerPacket") -> None:
    """
    Serializes an instance of `StatSkillJunkServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (StatSkillJunkServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._stats is None:
            raise SerializationError("stats must be provided.")
        CharacterStatsReset.serialize(writer, data._stats)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/stat_skill_junk_server_packet.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@staticmethod
def deserialize(reader: EoReader) -> "StatSkillJunkServerPacket":
    """
    Deserializes an instance of `StatSkillJunkServerPacket` from the provided `EoReader`.

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

    Returns:
        StatSkillJunkServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        stats = CharacterStatsReset.deserialize(reader)
        result = StatSkillJunkServerPacket(stats=stats)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

Spell

A spell known by the player

Source code in src/eolib/protocol/_generated/net/spell.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
class Spell:
    """
    A spell known by the player
    """
    _byte_size: int = 0
    _id: int
    _level: int

    def __init__(self, *, id: int, level: int):
        """
        Create a new instance of Spell.

        Args:
            id (int): (Value range is 0-64008.)
            level (int): (Value range is 0-64008.)
        """
        self._id = id
        self._level = level

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

    @property
    def level(self) -> int:
        return self._level

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (Spell): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._id is None:
                raise SerializationError("id must be provided.")
            writer.add_short(data._id)
            if data._level is None:
                raise SerializationError("level must be provided.")
            writer.add_short(data._level)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            Spell: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            id = reader.get_short()
            level = reader.get_short()
            result = Spell(id=id, level=level)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"Spell(byte_size={repr(self._byte_size)}, id={repr(self._id)}, level={repr(self._level)})"

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.

id: int property

level: int property

__init__(*, id, level)

Create a new instance of Spell.

Parameters:

Name Type Description Default
id int

(Value range is 0-64008.)

required
level int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/spell.py
18
19
20
21
22
23
24
25
26
27
def __init__(self, *, id: int, level: int):
    """
    Create a new instance of Spell.

    Args:
        id (int): (Value range is 0-64008.)
        level (int): (Value range is 0-64008.)
    """
    self._id = id
    self._level = level

serialize(writer, data) staticmethod

Serializes an instance of Spell to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data Spell

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/spell.py
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@staticmethod
def serialize(writer: EoWriter, data: "Spell") -> None:
    """
    Serializes an instance of `Spell` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (Spell): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._id is None:
            raise SerializationError("id must be provided.")
        writer.add_short(data._id)
        if data._level is None:
            raise SerializationError("level must be provided.")
        writer.add_short(data._level)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/spell.py
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def deserialize(reader: EoReader) -> "Spell":
    """
    Deserializes an instance of `Spell` from the provided `EoReader`.

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

    Returns:
        Spell: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        id = reader.get_short()
        level = reader.get_short()
        result = Spell(id=id, level=level)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

StatSkillAcceptServerPacket

Bases: Packet

Response to spending skill points

Source code in src/eolib/protocol/_generated/net/server/stat_skill_accept_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class StatSkillAcceptServerPacket(Packet):
    """
    Response to spending skill points
    """
    _byte_size: int = 0
    _skill_points: int
    _spell: Spell

    def __init__(self, *, skill_points: int, spell: Spell):
        """
        Create a new instance of StatSkillAcceptServerPacket.

        Args:
            skill_points (int): (Value range is 0-64008.)
            spell (Spell): 
        """
        self._skill_points = skill_points
        self._spell = spell

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

    @property
    def spell(self) -> Spell:
        return self._spell

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (StatSkillAcceptServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._skill_points is None:
                raise SerializationError("skill_points must be provided.")
            writer.add_short(data._skill_points)
            if data._spell is None:
                raise SerializationError("spell must be provided.")
            Spell.serialize(writer, data._spell)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            StatSkillAcceptServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            skill_points = reader.get_short()
            spell = Spell.deserialize(reader)
            result = StatSkillAcceptServerPacket(skill_points=skill_points, spell=spell)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"StatSkillAcceptServerPacket(byte_size={repr(self._byte_size)}, skill_points={repr(self._skill_points)}, spell={repr(self._spell)})"

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.

skill_points: int property

spell: Spell property

__init__(*, skill_points, spell)

Create a new instance of StatSkillAcceptServerPacket.

Parameters:

Name Type Description Default
skill_points int

(Value range is 0-64008.)

required
spell Spell
required
Source code in src/eolib/protocol/_generated/net/server/stat_skill_accept_server_packet.py
22
23
24
25
26
27
28
29
30
31
def __init__(self, *, skill_points: int, spell: Spell):
    """
    Create a new instance of StatSkillAcceptServerPacket.

    Args:
        skill_points (int): (Value range is 0-64008.)
        spell (Spell): 
    """
    self._skill_points = skill_points
    self._spell = spell

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/stat_skill_accept_server_packet.py
51
52
53
54
55
56
57
58
59
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/stat_skill_accept_server_packet.py
61
62
63
64
65
66
67
68
69
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/stat_skill_accept_server_packet.py
71
72
73
74
75
76
77
78
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.
    """
    StatSkillAcceptServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of StatSkillAcceptServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data StatSkillAcceptServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/stat_skill_accept_server_packet.py
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@staticmethod
def serialize(writer: EoWriter, data: "StatSkillAcceptServerPacket") -> None:
    """
    Serializes an instance of `StatSkillAcceptServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (StatSkillAcceptServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._skill_points is None:
            raise SerializationError("skill_points must be provided.")
        writer.add_short(data._skill_points)
        if data._spell is None:
            raise SerializationError("spell must be provided.")
        Spell.serialize(writer, data._spell)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/stat_skill_accept_server_packet.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@staticmethod
def deserialize(reader: EoReader) -> "StatSkillAcceptServerPacket":
    """
    Deserializes an instance of `StatSkillAcceptServerPacket` from the provided `EoReader`.

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

    Returns:
        StatSkillAcceptServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        skill_points = reader.get_short()
        spell = Spell.deserialize(reader)
        result = StatSkillAcceptServerPacket(skill_points=skill_points, spell=spell)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

SpellTargetSelfServerPacket

Bases: Packet

Nearby player self-casted a spell

Source code in src/eolib/protocol/_generated/net/server/spell_target_self_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
class SpellTargetSelfServerPacket(Packet):
    """
    Nearby player self-casted a spell
    """
    _byte_size: int = 0
    _player_id: int
    _spell_id: int
    _spell_heal_hp: int
    _hp_percentage: int
    _hp: Optional[int]
    _tp: Optional[int]

    def __init__(self, *, player_id: int, spell_id: int, spell_heal_hp: int, hp_percentage: int, hp: Optional[int] = None, tp: Optional[int] = None):
        """
        Create a new instance of SpellTargetSelfServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            spell_id (int): (Value range is 0-64008.)
            spell_heal_hp (int): (Value range is 0-4097152080.)
            hp_percentage (int): (Value range is 0-252.)
            hp (Optional[int]): The official client reads this if the packet is larger than 12 bytes (Value range is 0-64008.)
            tp (Optional[int]): The official client reads this if the packet is larger than 12 bytes (Value range is 0-64008.)
        """
        self._player_id = player_id
        self._spell_id = spell_id
        self._spell_heal_hp = spell_heal_hp
        self._hp_percentage = hp_percentage
        self._hp = hp
        self._tp = tp

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

    @property
    def spell_id(self) -> int:
        return self._spell_id

    @property
    def spell_heal_hp(self) -> int:
        return self._spell_heal_hp

    @property
    def hp_percentage(self) -> int:
        return self._hp_percentage

    @property
    def hp(self) -> Optional[int]:
        """
        The official client reads this if the packet is larger than 12 bytes
        """
        return self._hp

    @property
    def tp(self) -> Optional[int]:
        """
        The official client reads this if the packet is larger than 12 bytes
        """
        return self._tp

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (SpellTargetSelfServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._spell_id is None:
                raise SerializationError("spell_id must be provided.")
            writer.add_short(data._spell_id)
            if data._spell_heal_hp is None:
                raise SerializationError("spell_heal_hp must be provided.")
            writer.add_int(data._spell_heal_hp)
            if data._hp_percentage is None:
                raise SerializationError("hp_percentage must be provided.")
            writer.add_char(data._hp_percentage)
            reached_missing_optional = data._hp is None
            if not reached_missing_optional:
                writer.add_short(cast(int, data._hp))
            reached_missing_optional = reached_missing_optional or data._tp is None
            if not reached_missing_optional:
                writer.add_short(cast(int, data._tp))
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            SpellTargetSelfServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            spell_id = reader.get_short()
            spell_heal_hp = reader.get_int()
            hp_percentage = reader.get_char()
            hp: Optional[int] = None
            if reader.remaining > 0:
                hp = reader.get_short()
            tp: Optional[int] = None
            if reader.remaining > 0:
                tp = reader.get_short()
            result = SpellTargetSelfServerPacket(player_id=player_id, spell_id=spell_id, spell_heal_hp=spell_heal_hp, hp_percentage=hp_percentage, hp=hp, tp=tp)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"SpellTargetSelfServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, spell_id={repr(self._spell_id)}, spell_heal_hp={repr(self._spell_heal_hp)}, hp_percentage={repr(self._hp_percentage)}, hp={repr(self._hp)}, tp={repr(self._tp)})"

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.

player_id: int property

spell_id: int property

spell_heal_hp: int property

hp_percentage: int property

hp: Optional[int] property

The official client reads this if the packet is larger than 12 bytes

tp: Optional[int] property

The official client reads this if the packet is larger than 12 bytes

__init__(*, player_id, spell_id, spell_heal_hp, hp_percentage, hp=None, tp=None)

Create a new instance of SpellTargetSelfServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
spell_id int

(Value range is 0-64008.)

required
spell_heal_hp int

(Value range is 0-4097152080.)

required
hp_percentage int

(Value range is 0-252.)

required
hp Optional[int]

The official client reads this if the packet is larger than 12 bytes (Value range is 0-64008.)

None
tp Optional[int]

The official client reads this if the packet is larger than 12 bytes (Value range is 0-64008.)

None
Source code in src/eolib/protocol/_generated/net/server/spell_target_self_server_packet.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
def __init__(self, *, player_id: int, spell_id: int, spell_heal_hp: int, hp_percentage: int, hp: Optional[int] = None, tp: Optional[int] = None):
    """
    Create a new instance of SpellTargetSelfServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        spell_id (int): (Value range is 0-64008.)
        spell_heal_hp (int): (Value range is 0-4097152080.)
        hp_percentage (int): (Value range is 0-252.)
        hp (Optional[int]): The official client reads this if the packet is larger than 12 bytes (Value range is 0-64008.)
        tp (Optional[int]): The official client reads this if the packet is larger than 12 bytes (Value range is 0-64008.)
    """
    self._player_id = player_id
    self._spell_id = spell_id
    self._spell_heal_hp = spell_heal_hp
    self._hp_percentage = hp_percentage
    self._hp = hp
    self._tp = tp

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/spell_target_self_server_packet.py
86
87
88
89
90
91
92
93
94
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/spell_target_self_server_packet.py
 96
 97
 98
 99
100
101
102
103
104
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/spell_target_self_server_packet.py
106
107
108
109
110
111
112
113
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.
    """
    SpellTargetSelfServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of SpellTargetSelfServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data SpellTargetSelfServerPacket

The data to serialize.

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

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (SpellTargetSelfServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._spell_id is None:
            raise SerializationError("spell_id must be provided.")
        writer.add_short(data._spell_id)
        if data._spell_heal_hp is None:
            raise SerializationError("spell_heal_hp must be provided.")
        writer.add_int(data._spell_heal_hp)
        if data._hp_percentage is None:
            raise SerializationError("hp_percentage must be provided.")
        writer.add_char(data._hp_percentage)
        reached_missing_optional = data._hp is None
        if not reached_missing_optional:
            writer.add_short(cast(int, data._hp))
        reached_missing_optional = reached_missing_optional or data._tp is None
        if not reached_missing_optional:
            writer.add_short(cast(int, data._tp))
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

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

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

    Returns:
        SpellTargetSelfServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        spell_id = reader.get_short()
        spell_heal_hp = reader.get_int()
        hp_percentage = reader.get_char()
        hp: Optional[int] = None
        if reader.remaining > 0:
            hp = reader.get_short()
        tp: Optional[int] = None
        if reader.remaining > 0:
            tp = reader.get_short()
        result = SpellTargetSelfServerPacket(player_id=player_id, spell_id=spell_id, spell_heal_hp=spell_heal_hp, hp_percentage=hp_percentage, hp=hp, tp=tp)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

SpellTargetOtherServerPacket

Bases: Packet

Nearby player hit by a heal spell from a player

Source code in src/eolib/protocol/_generated/net/server/spell_target_other_server_packet.py
 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
class SpellTargetOtherServerPacket(Packet):
    """
    Nearby player hit by a heal spell from a player
    """
    _byte_size: int = 0
    _victim_id: int
    _caster_id: int
    _caster_direction: Direction
    _spell_id: int
    _spell_heal_hp: int
    _hp_percentage: int
    _hp: Optional[int]

    def __init__(self, *, victim_id: int, caster_id: int, caster_direction: Direction, spell_id: int, spell_heal_hp: int, hp_percentage: int, hp: Optional[int] = None):
        """
        Create a new instance of SpellTargetOtherServerPacket.

        Args:
            victim_id (int): (Value range is 0-64008.)
            caster_id (int): (Value range is 0-64008.)
            caster_direction (Direction): 
            spell_id (int): (Value range is 0-64008.)
            spell_heal_hp (int): (Value range is 0-4097152080.)
            hp_percentage (int): (Value range is 0-252.)
            hp (Optional[int]): (Value range is 0-64008.)
        """
        self._victim_id = victim_id
        self._caster_id = caster_id
        self._caster_direction = caster_direction
        self._spell_id = spell_id
        self._spell_heal_hp = spell_heal_hp
        self._hp_percentage = hp_percentage
        self._hp = hp

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

    @property
    def caster_id(self) -> int:
        return self._caster_id

    @property
    def caster_direction(self) -> Direction:
        return self._caster_direction

    @property
    def spell_id(self) -> int:
        return self._spell_id

    @property
    def spell_heal_hp(self) -> int:
        return self._spell_heal_hp

    @property
    def hp_percentage(self) -> int:
        return self._hp_percentage

    @property
    def hp(self) -> Optional[int]:
        return self._hp

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (SpellTargetOtherServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._victim_id is None:
                raise SerializationError("victim_id must be provided.")
            writer.add_short(data._victim_id)
            if data._caster_id is None:
                raise SerializationError("caster_id must be provided.")
            writer.add_short(data._caster_id)
            if data._caster_direction is None:
                raise SerializationError("caster_direction must be provided.")
            writer.add_char(int(data._caster_direction))
            if data._spell_id is None:
                raise SerializationError("spell_id must be provided.")
            writer.add_short(data._spell_id)
            if data._spell_heal_hp is None:
                raise SerializationError("spell_heal_hp must be provided.")
            writer.add_int(data._spell_heal_hp)
            if data._hp_percentage is None:
                raise SerializationError("hp_percentage must be provided.")
            writer.add_char(data._hp_percentage)
            reached_missing_optional = data._hp is None
            if not reached_missing_optional:
                writer.add_short(cast(int, data._hp))
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            SpellTargetOtherServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            victim_id = reader.get_short()
            caster_id = reader.get_short()
            caster_direction = Direction(reader.get_char())
            spell_id = reader.get_short()
            spell_heal_hp = reader.get_int()
            hp_percentage = reader.get_char()
            hp: Optional[int] = None
            if reader.remaining > 0:
                hp = reader.get_short()
            result = SpellTargetOtherServerPacket(victim_id=victim_id, caster_id=caster_id, caster_direction=caster_direction, spell_id=spell_id, spell_heal_hp=spell_heal_hp, hp_percentage=hp_percentage, hp=hp)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"SpellTargetOtherServerPacket(byte_size={repr(self._byte_size)}, victim_id={repr(self._victim_id)}, caster_id={repr(self._caster_id)}, caster_direction={repr(self._caster_direction)}, spell_id={repr(self._spell_id)}, spell_heal_hp={repr(self._spell_heal_hp)}, hp_percentage={repr(self._hp_percentage)}, hp={repr(self._hp)})"

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.

victim_id: int property

caster_id: int property

caster_direction: Direction property

spell_id: int property

spell_heal_hp: int property

hp_percentage: int property

hp: Optional[int] property

__init__(*, victim_id, caster_id, caster_direction, spell_id, spell_heal_hp, hp_percentage, hp=None)

Create a new instance of SpellTargetOtherServerPacket.

Parameters:

Name Type Description Default
victim_id int

(Value range is 0-64008.)

required
caster_id int

(Value range is 0-64008.)

required
caster_direction Direction
required
spell_id int

(Value range is 0-64008.)

required
spell_heal_hp int

(Value range is 0-4097152080.)

required
hp_percentage int

(Value range is 0-252.)

required
hp Optional[int]

(Value range is 0-64008.)

None
Source code in src/eolib/protocol/_generated/net/server/spell_target_other_server_packet.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
def __init__(self, *, victim_id: int, caster_id: int, caster_direction: Direction, spell_id: int, spell_heal_hp: int, hp_percentage: int, hp: Optional[int] = None):
    """
    Create a new instance of SpellTargetOtherServerPacket.

    Args:
        victim_id (int): (Value range is 0-64008.)
        caster_id (int): (Value range is 0-64008.)
        caster_direction (Direction): 
        spell_id (int): (Value range is 0-64008.)
        spell_heal_hp (int): (Value range is 0-4097152080.)
        hp_percentage (int): (Value range is 0-252.)
        hp (Optional[int]): (Value range is 0-64008.)
    """
    self._victim_id = victim_id
    self._caster_id = caster_id
    self._caster_direction = caster_direction
    self._spell_id = spell_id
    self._spell_heal_hp = spell_heal_hp
    self._hp_percentage = hp_percentage
    self._hp = hp

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/spell_target_other_server_packet.py
88
89
90
91
92
93
94
95
96
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/spell_target_other_server_packet.py
 98
 99
100
101
102
103
104
105
106
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/spell_target_other_server_packet.py
108
109
110
111
112
113
114
115
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.
    """
    SpellTargetOtherServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of SpellTargetOtherServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data SpellTargetOtherServerPacket

The data to serialize.

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

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (SpellTargetOtherServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._victim_id is None:
            raise SerializationError("victim_id must be provided.")
        writer.add_short(data._victim_id)
        if data._caster_id is None:
            raise SerializationError("caster_id must be provided.")
        writer.add_short(data._caster_id)
        if data._caster_direction is None:
            raise SerializationError("caster_direction must be provided.")
        writer.add_char(int(data._caster_direction))
        if data._spell_id is None:
            raise SerializationError("spell_id must be provided.")
        writer.add_short(data._spell_id)
        if data._spell_heal_hp is None:
            raise SerializationError("spell_heal_hp must be provided.")
        writer.add_int(data._spell_heal_hp)
        if data._hp_percentage is None:
            raise SerializationError("hp_percentage must be provided.")
        writer.add_char(data._hp_percentage)
        reached_missing_optional = data._hp is None
        if not reached_missing_optional:
            writer.add_short(cast(int, data._hp))
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

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

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

    Returns:
        SpellTargetOtherServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        victim_id = reader.get_short()
        caster_id = reader.get_short()
        caster_direction = Direction(reader.get_char())
        spell_id = reader.get_short()
        spell_heal_hp = reader.get_int()
        hp_percentage = reader.get_char()
        hp: Optional[int] = None
        if reader.remaining > 0:
            hp = reader.get_short()
        result = SpellTargetOtherServerPacket(victim_id=victim_id, caster_id=caster_id, caster_direction=caster_direction, spell_id=spell_id, spell_heal_hp=spell_heal_hp, hp_percentage=hp_percentage, hp=hp)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

SpellTargetGroupServerPacket

Bases: Packet

Nearby player(s) hit by a group heal spell from a player

Source code in src/eolib/protocol/_generated/net/server/spell_target_group_server_packet.py
 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
class SpellTargetGroupServerPacket(Packet):
    """
    Nearby player(s) hit by a group heal spell from a player
    """
    _byte_size: int = 0
    _spell_id: int
    _caster_id: int
    _caster_tp: int
    _spell_heal_hp: int
    _players: tuple[GroupHealTargetPlayer, ...]

    def __init__(self, *, spell_id: int, caster_id: int, caster_tp: int, spell_heal_hp: int, players: Iterable[GroupHealTargetPlayer]):
        """
        Create a new instance of SpellTargetGroupServerPacket.

        Args:
            spell_id (int): (Value range is 0-64008.)
            caster_id (int): (Value range is 0-64008.)
            caster_tp (int): (Value range is 0-64008.)
            spell_heal_hp (int): (Value range is 0-64008.)
            players (Iterable[GroupHealTargetPlayer]): 
        """
        self._spell_id = spell_id
        self._caster_id = caster_id
        self._caster_tp = caster_tp
        self._spell_heal_hp = spell_heal_hp
        self._players = tuple(players)

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

    @property
    def caster_id(self) -> int:
        return self._caster_id

    @property
    def caster_tp(self) -> int:
        return self._caster_tp

    @property
    def spell_heal_hp(self) -> int:
        return self._spell_heal_hp

    @property
    def players(self) -> tuple[GroupHealTargetPlayer, ...]:
        return self._players

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (SpellTargetGroupServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._spell_id is None:
                raise SerializationError("spell_id must be provided.")
            writer.add_short(data._spell_id)
            if data._caster_id is None:
                raise SerializationError("caster_id must be provided.")
            writer.add_short(data._caster_id)
            if data._caster_tp is None:
                raise SerializationError("caster_tp must be provided.")
            writer.add_short(data._caster_tp)
            if data._spell_heal_hp is None:
                raise SerializationError("spell_heal_hp must be provided.")
            writer.add_short(data._spell_heal_hp)
            if data._players is None:
                raise SerializationError("players must be provided.")
            for i in range(len(data._players)):
                GroupHealTargetPlayer.serialize(writer, data._players[i])
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            SpellTargetGroupServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            spell_id = reader.get_short()
            caster_id = reader.get_short()
            caster_tp = reader.get_short()
            spell_heal_hp = reader.get_short()
            players_length = int(reader.remaining / 5)
            players = []
            for i in range(players_length):
                players.append(GroupHealTargetPlayer.deserialize(reader))
            result = SpellTargetGroupServerPacket(spell_id=spell_id, caster_id=caster_id, caster_tp=caster_tp, spell_heal_hp=spell_heal_hp, players=players)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"SpellTargetGroupServerPacket(byte_size={repr(self._byte_size)}, spell_id={repr(self._spell_id)}, caster_id={repr(self._caster_id)}, caster_tp={repr(self._caster_tp)}, spell_heal_hp={repr(self._spell_heal_hp)}, players={repr(self._players)})"

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.

spell_id: int property

caster_id: int property

caster_tp: int property

spell_heal_hp: int property

players: tuple[GroupHealTargetPlayer, ...] property

__init__(*, spell_id, caster_id, caster_tp, spell_heal_hp, players)

Create a new instance of SpellTargetGroupServerPacket.

Parameters:

Name Type Description Default
spell_id int

(Value range is 0-64008.)

required
caster_id int

(Value range is 0-64008.)

required
caster_tp int

(Value range is 0-64008.)

required
spell_heal_hp int

(Value range is 0-64008.)

required
players Iterable[GroupHealTargetPlayer]
required
Source code in src/eolib/protocol/_generated/net/server/spell_target_group_server_packet.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
def __init__(self, *, spell_id: int, caster_id: int, caster_tp: int, spell_heal_hp: int, players: Iterable[GroupHealTargetPlayer]):
    """
    Create a new instance of SpellTargetGroupServerPacket.

    Args:
        spell_id (int): (Value range is 0-64008.)
        caster_id (int): (Value range is 0-64008.)
        caster_tp (int): (Value range is 0-64008.)
        spell_heal_hp (int): (Value range is 0-64008.)
        players (Iterable[GroupHealTargetPlayer]): 
    """
    self._spell_id = spell_id
    self._caster_id = caster_id
    self._caster_tp = caster_tp
    self._spell_heal_hp = spell_heal_hp
    self._players = tuple(players)

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/spell_target_group_server_packet.py
74
75
76
77
78
79
80
81
82
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/spell_target_group_server_packet.py
84
85
86
87
88
89
90
91
92
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/spell_target_group_server_packet.py
 94
 95
 96
 97
 98
 99
100
101
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.
    """
    SpellTargetGroupServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of SpellTargetGroupServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data SpellTargetGroupServerPacket

The data to serialize.

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

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (SpellTargetGroupServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._spell_id is None:
            raise SerializationError("spell_id must be provided.")
        writer.add_short(data._spell_id)
        if data._caster_id is None:
            raise SerializationError("caster_id must be provided.")
        writer.add_short(data._caster_id)
        if data._caster_tp is None:
            raise SerializationError("caster_tp must be provided.")
        writer.add_short(data._caster_tp)
        if data._spell_heal_hp is None:
            raise SerializationError("spell_heal_hp must be provided.")
        writer.add_short(data._spell_heal_hp)
        if data._players is None:
            raise SerializationError("players must be provided.")
        for i in range(len(data._players)):
            GroupHealTargetPlayer.serialize(writer, data._players[i])
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

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

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

    Returns:
        SpellTargetGroupServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        spell_id = reader.get_short()
        caster_id = reader.get_short()
        caster_tp = reader.get_short()
        spell_heal_hp = reader.get_short()
        players_length = int(reader.remaining / 5)
        players = []
        for i in range(players_length):
            players.append(GroupHealTargetPlayer.deserialize(reader))
        result = SpellTargetGroupServerPacket(spell_id=spell_id, caster_id=caster_id, caster_tp=caster_tp, spell_heal_hp=spell_heal_hp, players=players)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

SpellRequestServerPacket

Bases: Packet

Nearby player chanting a spell

Source code in src/eolib/protocol/_generated/net/server/spell_request_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
class SpellRequestServerPacket(Packet):
    """
    Nearby player chanting a spell
    """
    _byte_size: int = 0
    _player_id: int
    _spell_id: int

    def __init__(self, *, player_id: int, spell_id: int):
        """
        Create a new instance of SpellRequestServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            spell_id (int): (Value range is 0-64008.)
        """
        self._player_id = player_id
        self._spell_id = spell_id

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

    @property
    def spell_id(self) -> int:
        return self._spell_id

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (SpellRequestServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._spell_id is None:
                raise SerializationError("spell_id must be provided.")
            writer.add_short(data._spell_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            SpellRequestServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            spell_id = reader.get_short()
            result = SpellRequestServerPacket(player_id=player_id, spell_id=spell_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"SpellRequestServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, spell_id={repr(self._spell_id)})"

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.

player_id: int property

spell_id: int property

__init__(*, player_id, spell_id)

Create a new instance of SpellRequestServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
spell_id int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/spell_request_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, player_id: int, spell_id: int):
    """
    Create a new instance of SpellRequestServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        spell_id (int): (Value range is 0-64008.)
    """
    self._player_id = player_id
    self._spell_id = spell_id

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/spell_request_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/spell_request_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/spell_request_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    SpellRequestServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of SpellRequestServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data SpellRequestServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/spell_request_server_packet.py
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@staticmethod
def serialize(writer: EoWriter, data: "SpellRequestServerPacket") -> None:
    """
    Serializes an instance of `SpellRequestServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (SpellRequestServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._spell_id is None:
            raise SerializationError("spell_id must be provided.")
        writer.add_short(data._spell_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/spell_request_server_packet.py
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@staticmethod
def deserialize(reader: EoReader) -> "SpellRequestServerPacket":
    """
    Deserializes an instance of `SpellRequestServerPacket` from the provided `EoReader`.

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

    Returns:
        SpellRequestServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        spell_id = reader.get_short()
        result = SpellRequestServerPacket(player_id=player_id, spell_id=spell_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

SpellReplyServerPacket

Bases: Packet

Your character self-cast a targetable heal spell

Source code in src/eolib/protocol/_generated/net/server/spell_reply_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
class SpellReplyServerPacket(Packet):
    """
    Your character self-cast a targetable heal spell
    """
    _byte_size: int = 0
    _spell_id: int
    _hp: int
    _tp: int

    def __init__(self, *, spell_id: int, hp: int, tp: int):
        """
        Create a new instance of SpellReplyServerPacket.

        Args:
            spell_id (int): (Value range is 0-64008.)
            hp (int): (Value range is 0-64008.)
            tp (int): (Value range is 0-64008.)
        """
        self._spell_id = spell_id
        self._hp = hp
        self._tp = tp

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

    @property
    def hp(self) -> int:
        return self._hp

    @property
    def tp(self) -> int:
        return self._tp

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (SpellReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._spell_id is None:
                raise SerializationError("spell_id must be provided.")
            writer.add_short(data._spell_id)
            if data._hp is None:
                raise SerializationError("hp must be provided.")
            writer.add_short(data._hp)
            if data._tp is None:
                raise SerializationError("tp must be provided.")
            writer.add_short(data._tp)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            SpellReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            spell_id = reader.get_short()
            hp = reader.get_short()
            tp = reader.get_short()
            result = SpellReplyServerPacket(spell_id=spell_id, hp=hp, tp=tp)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"SpellReplyServerPacket(byte_size={repr(self._byte_size)}, spell_id={repr(self._spell_id)}, hp={repr(self._hp)}, tp={repr(self._tp)})"

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.

spell_id: int property

hp: int property

tp: int property

__init__(*, spell_id, hp, tp)

Create a new instance of SpellReplyServerPacket.

Parameters:

Name Type Description Default
spell_id int

(Value range is 0-64008.)

required
hp int

(Value range is 0-64008.)

required
tp int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/spell_reply_server_packet.py
22
23
24
25
26
27
28
29
30
31
32
33
def __init__(self, *, spell_id: int, hp: int, tp: int):
    """
    Create a new instance of SpellReplyServerPacket.

    Args:
        spell_id (int): (Value range is 0-64008.)
        hp (int): (Value range is 0-64008.)
        tp (int): (Value range is 0-64008.)
    """
    self._spell_id = spell_id
    self._hp = hp
    self._tp = tp

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

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

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

serialize(writer, data) staticmethod

Serializes an instance of SpellReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data SpellReplyServerPacket

The data to serialize.

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

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (SpellReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._spell_id is None:
            raise SerializationError("spell_id must be provided.")
        writer.add_short(data._spell_id)
        if data._hp is None:
            raise SerializationError("hp must be provided.")
        writer.add_short(data._hp)
        if data._tp is None:
            raise SerializationError("tp must be provided.")
        writer.add_short(data._tp)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/spell_reply_server_packet.py
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
@staticmethod
def deserialize(reader: EoReader) -> "SpellReplyServerPacket":
    """
    Deserializes an instance of `SpellReplyServerPacket` from the provided `EoReader`.

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

    Returns:
        SpellReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        spell_id = reader.get_short()
        hp = reader.get_short()
        tp = reader.get_short()
        result = SpellReplyServerPacket(spell_id=spell_id, hp=hp, tp=tp)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

SpellPlayerServerPacket

Bases: Packet

Nearby player raising their arm to cast a spell (vestigial)

Source code in src/eolib/protocol/_generated/net/server/spell_player_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class SpellPlayerServerPacket(Packet):
    """
    Nearby player raising their arm to cast a spell (vestigial)
    """
    _byte_size: int = 0
    _player_id: int
    _direction: Direction

    def __init__(self, *, player_id: int, direction: Direction):
        """
        Create a new instance of SpellPlayerServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            direction (Direction): 
        """
        self._player_id = player_id
        self._direction = direction

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

    @property
    def direction(self) -> Direction:
        return self._direction

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (SpellPlayerServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._direction is None:
                raise SerializationError("direction must be provided.")
            writer.add_char(int(data._direction))
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            SpellPlayerServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            direction = Direction(reader.get_char())
            result = SpellPlayerServerPacket(player_id=player_id, direction=direction)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"SpellPlayerServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, direction={repr(self._direction)})"

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.

player_id: int property

direction: Direction property

__init__(*, player_id, direction)

Create a new instance of SpellPlayerServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
direction Direction
required
Source code in src/eolib/protocol/_generated/net/server/spell_player_server_packet.py
22
23
24
25
26
27
28
29
30
31
def __init__(self, *, player_id: int, direction: Direction):
    """
    Create a new instance of SpellPlayerServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        direction (Direction): 
    """
    self._player_id = player_id
    self._direction = direction

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/spell_player_server_packet.py
51
52
53
54
55
56
57
58
59
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/spell_player_server_packet.py
61
62
63
64
65
66
67
68
69
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/spell_player_server_packet.py
71
72
73
74
75
76
77
78
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.
    """
    SpellPlayerServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of SpellPlayerServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data SpellPlayerServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/spell_player_server_packet.py
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@staticmethod
def serialize(writer: EoWriter, data: "SpellPlayerServerPacket") -> None:
    """
    Serializes an instance of `SpellPlayerServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (SpellPlayerServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._direction is None:
            raise SerializationError("direction must be provided.")
        writer.add_char(int(data._direction))
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/spell_player_server_packet.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@staticmethod
def deserialize(reader: EoReader) -> "SpellPlayerServerPacket":
    """
    Deserializes an instance of `SpellPlayerServerPacket` from the provided `EoReader`.

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

    Returns:
        SpellPlayerServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        direction = Direction(reader.get_char())
        result = SpellPlayerServerPacket(player_id=player_id, direction=direction)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

SpellErrorServerPacket

Bases: Packet

Show flood protection message (vestigial)

Source code in src/eolib/protocol/_generated/net/server/spell_error_server_packet.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
class SpellErrorServerPacket(Packet):
    """
    Show flood protection message (vestigial)
    """
    _byte_size: int = 0

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

    @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 family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (SpellErrorServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.add_byte(255)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

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

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

Source code in src/eolib/protocol/_generated/net/server/spell_error_server_packet.py
18
19
20
21
def __init__(self):
    """
    Create a new instance of SpellErrorServerPacket.
    """

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/spell_error_server_packet.py
33
34
35
36
37
38
39
40
41
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/spell_error_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/spell_error_server_packet.py
53
54
55
56
57
58
59
60
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.
    """
    SpellErrorServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of SpellErrorServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data SpellErrorServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/spell_error_server_packet.py
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@staticmethod
def serialize(writer: EoWriter, data: "SpellErrorServerPacket") -> None:
    """
    Serializes an instance of `SpellErrorServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (SpellErrorServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.add_byte(255)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/spell_error_server_packet.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@staticmethod
def deserialize(reader: EoReader) -> "SpellErrorServerPacket":
    """
    Deserializes an instance of `SpellErrorServerPacket` from the provided `EoReader`.

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

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

SkillMasterReply

Bases: IntEnum

Reply code sent with STATSKILL_REPLY packet. Indicates why an action was unsuccessful.

Source code in src/eolib/protocol/_generated/net/server/skill_master_reply.py
 9
10
11
12
13
14
15
class SkillMasterReply(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Reply code sent with STATSKILL_REPLY packet.
    Indicates why an action was unsuccessful.
    """
    RemoveItems = 1
    WrongClass = 2

RemoveItems = 1 class-attribute instance-attribute

WrongClass = 2 class-attribute instance-attribute

SkillLearn

A skill that can be learned from a skill master NPC

Source code in src/eolib/protocol/_generated/net/server/skill_learn.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
class SkillLearn:
    """
    A skill that can be learned from a skill master NPC
    """
    _byte_size: int = 0
    _id: int
    _level_requirement: int
    _class_requirement: int
    _cost: int
    _skill_requirements: tuple[int, ...]
    _stat_requirements: SkillStatRequirements

    def __init__(self, *, id: int, level_requirement: int, class_requirement: int, cost: int, skill_requirements: Iterable[int], stat_requirements: SkillStatRequirements):
        """
        Create a new instance of SkillLearn.

        Args:
            id (int): (Value range is 0-64008.)
            level_requirement (int): (Value range is 0-252.)
            class_requirement (int): (Value range is 0-252.)
            cost (int): (Value range is 0-4097152080.)
            skill_requirements (Iterable[int]): (Length must be `4`.) (Element value range is 0-64008.)
            stat_requirements (SkillStatRequirements): 
        """
        self._id = id
        self._level_requirement = level_requirement
        self._class_requirement = class_requirement
        self._cost = cost
        self._skill_requirements = tuple(skill_requirements)
        self._stat_requirements = stat_requirements

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

    @property
    def level_requirement(self) -> int:
        return self._level_requirement

    @property
    def class_requirement(self) -> int:
        return self._class_requirement

    @property
    def cost(self) -> int:
        return self._cost

    @property
    def skill_requirements(self) -> tuple[int, ...]:
        return self._skill_requirements

    @property
    def stat_requirements(self) -> SkillStatRequirements:
        return self._stat_requirements

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (SkillLearn): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._id is None:
                raise SerializationError("id must be provided.")
            writer.add_short(data._id)
            if data._level_requirement is None:
                raise SerializationError("level_requirement must be provided.")
            writer.add_char(data._level_requirement)
            if data._class_requirement is None:
                raise SerializationError("class_requirement must be provided.")
            writer.add_char(data._class_requirement)
            if data._cost is None:
                raise SerializationError("cost must be provided.")
            writer.add_int(data._cost)
            if data._skill_requirements is None:
                raise SerializationError("skill_requirements must be provided.")
            if len(data._skill_requirements) != 4:
                raise SerializationError(f"Expected length of skill_requirements to be exactly 4, got {len(data._skill_requirements)}.")
            for i in range(4):
                writer.add_short(data._skill_requirements[i])
            if data._stat_requirements is None:
                raise SerializationError("stat_requirements must be provided.")
            SkillStatRequirements.serialize(writer, data._stat_requirements)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            SkillLearn: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            id = reader.get_short()
            level_requirement = reader.get_char()
            class_requirement = reader.get_char()
            cost = reader.get_int()
            skill_requirements = []
            for i in range(4):
                skill_requirements.append(reader.get_short())
            stat_requirements = SkillStatRequirements.deserialize(reader)
            result = SkillLearn(id=id, level_requirement=level_requirement, class_requirement=class_requirement, cost=cost, skill_requirements=skill_requirements, stat_requirements=stat_requirements)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"SkillLearn(byte_size={repr(self._byte_size)}, id={repr(self._id)}, level_requirement={repr(self._level_requirement)}, class_requirement={repr(self._class_requirement)}, cost={repr(self._cost)}, skill_requirements={repr(self._skill_requirements)}, stat_requirements={repr(self._stat_requirements)})"

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.

id: int property

level_requirement: int property

class_requirement: int property

cost: int property

skill_requirements: tuple[int, ...] property

stat_requirements: SkillStatRequirements property

__init__(*, id, level_requirement, class_requirement, cost, skill_requirements, stat_requirements)

Create a new instance of SkillLearn.

Parameters:

Name Type Description Default
id int

(Value range is 0-64008.)

required
level_requirement int

(Value range is 0-252.)

required
class_requirement int

(Value range is 0-252.)

required
cost int

(Value range is 0-4097152080.)

required
skill_requirements Iterable[int]

(Length must be 4.) (Element value range is 0-64008.)

required
stat_requirements SkillStatRequirements
required
Source code in src/eolib/protocol/_generated/net/server/skill_learn.py
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
def __init__(self, *, id: int, level_requirement: int, class_requirement: int, cost: int, skill_requirements: Iterable[int], stat_requirements: SkillStatRequirements):
    """
    Create a new instance of SkillLearn.

    Args:
        id (int): (Value range is 0-64008.)
        level_requirement (int): (Value range is 0-252.)
        class_requirement (int): (Value range is 0-252.)
        cost (int): (Value range is 0-4097152080.)
        skill_requirements (Iterable[int]): (Length must be `4`.) (Element value range is 0-64008.)
        stat_requirements (SkillStatRequirements): 
    """
    self._id = id
    self._level_requirement = level_requirement
    self._class_requirement = class_requirement
    self._cost = cost
    self._skill_requirements = tuple(skill_requirements)
    self._stat_requirements = stat_requirements

serialize(writer, data) staticmethod

Serializes an instance of SkillLearn to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data SkillLearn

The data to serialize.

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

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (SkillLearn): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._id is None:
            raise SerializationError("id must be provided.")
        writer.add_short(data._id)
        if data._level_requirement is None:
            raise SerializationError("level_requirement must be provided.")
        writer.add_char(data._level_requirement)
        if data._class_requirement is None:
            raise SerializationError("class_requirement must be provided.")
        writer.add_char(data._class_requirement)
        if data._cost is None:
            raise SerializationError("cost must be provided.")
        writer.add_int(data._cost)
        if data._skill_requirements is None:
            raise SerializationError("skill_requirements must be provided.")
        if len(data._skill_requirements) != 4:
            raise SerializationError(f"Expected length of skill_requirements to be exactly 4, got {len(data._skill_requirements)}.")
        for i in range(4):
            writer.add_short(data._skill_requirements[i])
        if data._stat_requirements is None:
            raise SerializationError("stat_requirements must be provided.")
        SkillStatRequirements.serialize(writer, data._stat_requirements)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

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

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

    Returns:
        SkillLearn: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        id = reader.get_short()
        level_requirement = reader.get_char()
        class_requirement = reader.get_char()
        cost = reader.get_int()
        skill_requirements = []
        for i in range(4):
            skill_requirements.append(reader.get_short())
        stat_requirements = SkillStatRequirements.deserialize(reader)
        result = SkillLearn(id=id, level_requirement=level_requirement, class_requirement=class_requirement, cost=cost, skill_requirements=skill_requirements, stat_requirements=stat_requirements)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

SkillStatRequirements

Stat requirements to learn a skill from a skill master NPC

Source code in src/eolib/protocol/_generated/net/server/skill_stat_requirements.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
class SkillStatRequirements:
    """
    Stat requirements to learn a skill from a skill master NPC
    """
    _byte_size: int = 0
    _str: int
    _wis: int
    _intl: int
    _agi: int
    _con: int
    _cha: int

    def __init__(self, *, str: int, wis: int, intl: int, agi: int, con: int, cha: int):
        """
        Create a new instance of SkillStatRequirements.

        Args:
            str (int): (Value range is 0-64008.)
            wis (int): (Value range is 0-64008.)
            intl (int): (Value range is 0-64008.)
            agi (int): (Value range is 0-64008.)
            con (int): (Value range is 0-64008.)
            cha (int): (Value range is 0-64008.)
        """
        self._str = str
        self._wis = wis
        self._intl = intl
        self._agi = agi
        self._con = con
        self._cha = cha

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

    @property
    def wis(self) -> int:
        return self._wis

    @property
    def intl(self) -> int:
        return self._intl

    @property
    def agi(self) -> int:
        return self._agi

    @property
    def con(self) -> int:
        return self._con

    @property
    def cha(self) -> int:
        return self._cha

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (SkillStatRequirements): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._str is None:
                raise SerializationError("str must be provided.")
            writer.add_short(data._str)
            if data._wis is None:
                raise SerializationError("wis must be provided.")
            writer.add_short(data._wis)
            if data._intl is None:
                raise SerializationError("intl must be provided.")
            writer.add_short(data._intl)
            if data._agi is None:
                raise SerializationError("agi must be provided.")
            writer.add_short(data._agi)
            if data._con is None:
                raise SerializationError("con must be provided.")
            writer.add_short(data._con)
            if data._cha is None:
                raise SerializationError("cha must be provided.")
            writer.add_short(data._cha)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            SkillStatRequirements: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            str = reader.get_short()
            wis = reader.get_short()
            intl = reader.get_short()
            agi = reader.get_short()
            con = reader.get_short()
            cha = reader.get_short()
            result = SkillStatRequirements(str=str, wis=wis, intl=intl, agi=agi, con=con, cha=cha)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"SkillStatRequirements(byte_size={repr(self._byte_size)}, str={repr(self._str)}, wis={repr(self._wis)}, intl={repr(self._intl)}, agi={repr(self._agi)}, con={repr(self._con)}, cha={repr(self._cha)})"

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.

str: int property

wis: int property

intl: int property

agi: int property

con: int property

cha: int property

__init__(*, str, wis, intl, agi, con, cha)

Create a new instance of SkillStatRequirements.

Parameters:

Name Type Description Default
str int

(Value range is 0-64008.)

required
wis int

(Value range is 0-64008.)

required
intl int

(Value range is 0-64008.)

required
agi int

(Value range is 0-64008.)

required
con int

(Value range is 0-64008.)

required
cha int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/skill_stat_requirements.py
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
def __init__(self, *, str: int, wis: int, intl: int, agi: int, con: int, cha: int):
    """
    Create a new instance of SkillStatRequirements.

    Args:
        str (int): (Value range is 0-64008.)
        wis (int): (Value range is 0-64008.)
        intl (int): (Value range is 0-64008.)
        agi (int): (Value range is 0-64008.)
        con (int): (Value range is 0-64008.)
        cha (int): (Value range is 0-64008.)
    """
    self._str = str
    self._wis = wis
    self._intl = intl
    self._agi = agi
    self._con = con
    self._cha = cha

serialize(writer, data) staticmethod

Serializes an instance of SkillStatRequirements to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data SkillStatRequirements

The data to serialize.

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

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (SkillStatRequirements): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._str is None:
            raise SerializationError("str must be provided.")
        writer.add_short(data._str)
        if data._wis is None:
            raise SerializationError("wis must be provided.")
        writer.add_short(data._wis)
        if data._intl is None:
            raise SerializationError("intl must be provided.")
        writer.add_short(data._intl)
        if data._agi is None:
            raise SerializationError("agi must be provided.")
        writer.add_short(data._agi)
        if data._con is None:
            raise SerializationError("con must be provided.")
        writer.add_short(data._con)
        if data._cha is None:
            raise SerializationError("cha must be provided.")
        writer.add_short(data._cha)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

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

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

    Returns:
        SkillStatRequirements: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        str = reader.get_short()
        wis = reader.get_short()
        intl = reader.get_short()
        agi = reader.get_short()
        con = reader.get_short()
        cha = reader.get_short()
        result = SkillStatRequirements(str=str, wis=wis, intl=intl, agi=agi, con=con, cha=cha)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

SitReplyServerPacket

Bases: Packet

Your character sitting down

Source code in src/eolib/protocol/_generated/net/server/sit_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
class SitReplyServerPacket(Packet):
    """
    Your character sitting down
    """
    _byte_size: int = 0
    _player_id: int
    _coords: Coords
    _direction: Direction

    def __init__(self, *, player_id: int, coords: Coords, direction: Direction):
        """
        Create a new instance of SitReplyServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            coords (Coords): 
            direction (Direction): 
        """
        self._player_id = player_id
        self._coords = coords
        self._direction = direction

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

    @property
    def coords(self) -> Coords:
        return self._coords

    @property
    def direction(self) -> Direction:
        return self._direction

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (SitReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._coords is None:
                raise SerializationError("coords must be provided.")
            Coords.serialize(writer, data._coords)
            if data._direction is None:
                raise SerializationError("direction must be provided.")
            writer.add_char(int(data._direction))
            writer.add_char(0)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            SitReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            coords = Coords.deserialize(reader)
            direction = Direction(reader.get_char())
            reader.get_char()
            result = SitReplyServerPacket(player_id=player_id, coords=coords, direction=direction)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"SitReplyServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, coords={repr(self._coords)}, direction={repr(self._direction)})"

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.

player_id: int property

coords: Coords property

direction: Direction property

__init__(*, player_id, coords, direction)

Create a new instance of SitReplyServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
coords Coords
required
direction Direction
required
Source code in src/eolib/protocol/_generated/net/server/sit_reply_server_packet.py
24
25
26
27
28
29
30
31
32
33
34
35
def __init__(self, *, player_id: int, coords: Coords, direction: Direction):
    """
    Create a new instance of SitReplyServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        coords (Coords): 
        direction (Direction): 
    """
    self._player_id = player_id
    self._coords = coords
    self._direction = direction

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

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

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

serialize(writer, data) staticmethod

Serializes an instance of SitReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data SitReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/sit_reply_server_packet.py
 88
 89
 90
 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: "SitReplyServerPacket") -> None:
    """
    Serializes an instance of `SitReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (SitReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._coords is None:
            raise SerializationError("coords must be provided.")
        Coords.serialize(writer, data._coords)
        if data._direction is None:
            raise SerializationError("direction must be provided.")
        writer.add_char(int(data._direction))
        writer.add_char(0)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

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

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

    Returns:
        SitReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        coords = Coords.deserialize(reader)
        direction = Direction(reader.get_char())
        reader.get_char()
        result = SitReplyServerPacket(player_id=player_id, coords=coords, direction=direction)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

SitRemoveServerPacket

Bases: Packet

Nearby player standing up

Source code in src/eolib/protocol/_generated/net/server/sit_remove_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class SitRemoveServerPacket(Packet):
    """
    Nearby player standing up
    """
    _byte_size: int = 0
    _player_id: int
    _coords: Coords

    def __init__(self, *, player_id: int, coords: Coords):
        """
        Create a new instance of SitRemoveServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            coords (Coords): 
        """
        self._player_id = player_id
        self._coords = coords

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

    @property
    def coords(self) -> Coords:
        return self._coords

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (SitRemoveServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._coords is None:
                raise SerializationError("coords must be provided.")
            Coords.serialize(writer, data._coords)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            SitRemoveServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            coords = Coords.deserialize(reader)
            result = SitRemoveServerPacket(player_id=player_id, coords=coords)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"SitRemoveServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, coords={repr(self._coords)})"

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.

player_id: int property

coords: Coords property

__init__(*, player_id, coords)

Create a new instance of SitRemoveServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
coords Coords
required
Source code in src/eolib/protocol/_generated/net/server/sit_remove_server_packet.py
22
23
24
25
26
27
28
29
30
31
def __init__(self, *, player_id: int, coords: Coords):
    """
    Create a new instance of SitRemoveServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        coords (Coords): 
    """
    self._player_id = player_id
    self._coords = coords

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/sit_remove_server_packet.py
51
52
53
54
55
56
57
58
59
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/sit_remove_server_packet.py
61
62
63
64
65
66
67
68
69
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/sit_remove_server_packet.py
71
72
73
74
75
76
77
78
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.
    """
    SitRemoveServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of SitRemoveServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data SitRemoveServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/sit_remove_server_packet.py
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@staticmethod
def serialize(writer: EoWriter, data: "SitRemoveServerPacket") -> None:
    """
    Serializes an instance of `SitRemoveServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (SitRemoveServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._coords is None:
            raise SerializationError("coords must be provided.")
        Coords.serialize(writer, data._coords)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/sit_remove_server_packet.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@staticmethod
def deserialize(reader: EoReader) -> "SitRemoveServerPacket":
    """
    Deserializes an instance of `SitRemoveServerPacket` from the provided `EoReader`.

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

    Returns:
        SitRemoveServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        coords = Coords.deserialize(reader)
        result = SitRemoveServerPacket(player_id=player_id, coords=coords)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

SitPlayerServerPacket

Bases: Packet

Nearby player sitting down

Source code in src/eolib/protocol/_generated/net/server/sit_player_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
class SitPlayerServerPacket(Packet):
    """
    Nearby player sitting down
    """
    _byte_size: int = 0
    _player_id: int
    _coords: Coords
    _direction: Direction

    def __init__(self, *, player_id: int, coords: Coords, direction: Direction):
        """
        Create a new instance of SitPlayerServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            coords (Coords): 
            direction (Direction): 
        """
        self._player_id = player_id
        self._coords = coords
        self._direction = direction

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

    @property
    def coords(self) -> Coords:
        return self._coords

    @property
    def direction(self) -> Direction:
        return self._direction

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (SitPlayerServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._coords is None:
                raise SerializationError("coords must be provided.")
            Coords.serialize(writer, data._coords)
            if data._direction is None:
                raise SerializationError("direction must be provided.")
            writer.add_char(int(data._direction))
            writer.add_char(0)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            SitPlayerServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            coords = Coords.deserialize(reader)
            direction = Direction(reader.get_char())
            reader.get_char()
            result = SitPlayerServerPacket(player_id=player_id, coords=coords, direction=direction)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"SitPlayerServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, coords={repr(self._coords)}, direction={repr(self._direction)})"

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.

player_id: int property

coords: Coords property

direction: Direction property

__init__(*, player_id, coords, direction)

Create a new instance of SitPlayerServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
coords Coords
required
direction Direction
required
Source code in src/eolib/protocol/_generated/net/server/sit_player_server_packet.py
24
25
26
27
28
29
30
31
32
33
34
35
def __init__(self, *, player_id: int, coords: Coords, direction: Direction):
    """
    Create a new instance of SitPlayerServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        coords (Coords): 
        direction (Direction): 
    """
    self._player_id = player_id
    self._coords = coords
    self._direction = direction

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

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

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/sit_player_server_packet.py
69
70
71
72
73
74
75
76
77
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/sit_player_server_packet.py
79
80
81
82
83
84
85
86
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.
    """
    SitPlayerServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of SitPlayerServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data SitPlayerServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/sit_player_server_packet.py
 88
 89
 90
 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: "SitPlayerServerPacket") -> None:
    """
    Serializes an instance of `SitPlayerServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (SitPlayerServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._coords is None:
            raise SerializationError("coords must be provided.")
        Coords.serialize(writer, data._coords)
        if data._direction is None:
            raise SerializationError("direction must be provided.")
        writer.add_char(int(data._direction))
        writer.add_char(0)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

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

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

    Returns:
        SitPlayerServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        coords = Coords.deserialize(reader)
        direction = Direction(reader.get_char())
        reader.get_char()
        result = SitPlayerServerPacket(player_id=player_id, coords=coords, direction=direction)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

SitCloseServerPacket

Bases: Packet

Your character standing up

Source code in src/eolib/protocol/_generated/net/server/sit_close_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class SitCloseServerPacket(Packet):
    """
    Your character standing up
    """
    _byte_size: int = 0
    _player_id: int
    _coords: Coords

    def __init__(self, *, player_id: int, coords: Coords):
        """
        Create a new instance of SitCloseServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            coords (Coords): 
        """
        self._player_id = player_id
        self._coords = coords

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

    @property
    def coords(self) -> Coords:
        return self._coords

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (SitCloseServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._coords is None:
                raise SerializationError("coords must be provided.")
            Coords.serialize(writer, data._coords)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            SitCloseServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            coords = Coords.deserialize(reader)
            result = SitCloseServerPacket(player_id=player_id, coords=coords)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"SitCloseServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, coords={repr(self._coords)})"

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.

player_id: int property

coords: Coords property

__init__(*, player_id, coords)

Create a new instance of SitCloseServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
coords Coords
required
Source code in src/eolib/protocol/_generated/net/server/sit_close_server_packet.py
22
23
24
25
26
27
28
29
30
31
def __init__(self, *, player_id: int, coords: Coords):
    """
    Create a new instance of SitCloseServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        coords (Coords): 
    """
    self._player_id = player_id
    self._coords = coords

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/sit_close_server_packet.py
51
52
53
54
55
56
57
58
59
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/sit_close_server_packet.py
61
62
63
64
65
66
67
68
69
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/sit_close_server_packet.py
71
72
73
74
75
76
77
78
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.
    """
    SitCloseServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of SitCloseServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data SitCloseServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/sit_close_server_packet.py
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@staticmethod
def serialize(writer: EoWriter, data: "SitCloseServerPacket") -> None:
    """
    Serializes an instance of `SitCloseServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (SitCloseServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._coords is None:
            raise SerializationError("coords must be provided.")
        Coords.serialize(writer, data._coords)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/sit_close_server_packet.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@staticmethod
def deserialize(reader: EoReader) -> "SitCloseServerPacket":
    """
    Deserializes an instance of `SitCloseServerPacket` from the provided `EoReader`.

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

    Returns:
        SitCloseServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        coords = Coords.deserialize(reader)
        result = SitCloseServerPacket(player_id=player_id, coords=coords)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ShopSoldItem

A sold item when selling an item to a shop

Source code in src/eolib/protocol/_generated/net/server/shop_sold_item.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
class ShopSoldItem:
    """
    A sold item when selling an item to a shop
    """
    _byte_size: int = 0
    _amount: int
    _id: int

    def __init__(self, *, amount: int, id: int):
        """
        Create a new instance of ShopSoldItem.

        Args:
            amount (int): (Value range is 0-4097152080.)
            id (int): (Value range is 0-64008.)
        """
        self._amount = amount
        self._id = id

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

    @property
    def id(self) -> int:
        return self._id

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ShopSoldItem): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._amount is None:
                raise SerializationError("amount must be provided.")
            writer.add_int(data._amount)
            if data._id is None:
                raise SerializationError("id must be provided.")
            writer.add_short(data._id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            ShopSoldItem: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            amount = reader.get_int()
            id = reader.get_short()
            result = ShopSoldItem(amount=amount, id=id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ShopSoldItem(byte_size={repr(self._byte_size)}, amount={repr(self._amount)}, id={repr(self._id)})"

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.

amount: int property

id: int property

__init__(*, amount, id)

Create a new instance of ShopSoldItem.

Parameters:

Name Type Description Default
amount int

(Value range is 0-4097152080.)

required
id int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/shop_sold_item.py
18
19
20
21
22
23
24
25
26
27
def __init__(self, *, amount: int, id: int):
    """
    Create a new instance of ShopSoldItem.

    Args:
        amount (int): (Value range is 0-4097152080.)
        id (int): (Value range is 0-64008.)
    """
    self._amount = amount
    self._id = id

serialize(writer, data) staticmethod

Serializes an instance of ShopSoldItem to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ShopSoldItem

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/shop_sold_item.py
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@staticmethod
def serialize(writer: EoWriter, data: "ShopSoldItem") -> None:
    """
    Serializes an instance of `ShopSoldItem` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ShopSoldItem): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._amount is None:
            raise SerializationError("amount must be provided.")
        writer.add_int(data._amount)
        if data._id is None:
            raise SerializationError("id must be provided.")
        writer.add_short(data._id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/shop_sold_item.py
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def deserialize(reader: EoReader) -> "ShopSoldItem":
    """
    Deserializes an instance of `ShopSoldItem` from the provided `EoReader`.

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

    Returns:
        ShopSoldItem: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        amount = reader.get_int()
        id = reader.get_short()
        result = ShopSoldItem(amount=amount, id=id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ShopSellServerPacket

Bases: Packet

Response to selling an item to a shop

Source code in src/eolib/protocol/_generated/net/server/shop_sell_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
class ShopSellServerPacket(Packet):
    """
    Response to selling an item to a shop
    """
    _byte_size: int = 0
    _sold_item: ShopSoldItem
    _gold_amount: int
    _weight: Weight

    def __init__(self, *, sold_item: ShopSoldItem, gold_amount: int, weight: Weight):
        """
        Create a new instance of ShopSellServerPacket.

        Args:
            sold_item (ShopSoldItem): 
            gold_amount (int): (Value range is 0-4097152080.)
            weight (Weight): 
        """
        self._sold_item = sold_item
        self._gold_amount = gold_amount
        self._weight = weight

    @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 sold_item(self) -> ShopSoldItem:
        return self._sold_item

    @property
    def gold_amount(self) -> int:
        return self._gold_amount

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

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ShopSellServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._sold_item is None:
                raise SerializationError("sold_item must be provided.")
            ShopSoldItem.serialize(writer, data._sold_item)
            if data._gold_amount is None:
                raise SerializationError("gold_amount must be provided.")
            writer.add_int(data._gold_amount)
            if data._weight is None:
                raise SerializationError("weight must be provided.")
            Weight.serialize(writer, data._weight)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            ShopSellServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            sold_item = ShopSoldItem.deserialize(reader)
            gold_amount = reader.get_int()
            weight = Weight.deserialize(reader)
            result = ShopSellServerPacket(sold_item=sold_item, gold_amount=gold_amount, weight=weight)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ShopSellServerPacket(byte_size={repr(self._byte_size)}, sold_item={repr(self._sold_item)}, gold_amount={repr(self._gold_amount)}, weight={repr(self._weight)})"

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.

sold_item: ShopSoldItem property

gold_amount: int property

weight: Weight property

__init__(*, sold_item, gold_amount, weight)

Create a new instance of ShopSellServerPacket.

Parameters:

Name Type Description Default
sold_item ShopSoldItem
required
gold_amount int

(Value range is 0-4097152080.)

required
weight Weight
required
Source code in src/eolib/protocol/_generated/net/server/shop_sell_server_packet.py
24
25
26
27
28
29
30
31
32
33
34
35
def __init__(self, *, sold_item: ShopSoldItem, gold_amount: int, weight: Weight):
    """
    Create a new instance of ShopSellServerPacket.

    Args:
        sold_item (ShopSoldItem): 
        gold_amount (int): (Value range is 0-4097152080.)
        weight (Weight): 
    """
    self._sold_item = sold_item
    self._gold_amount = gold_amount
    self._weight = weight

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

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

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/shop_sell_server_packet.py
69
70
71
72
73
74
75
76
77
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/shop_sell_server_packet.py
79
80
81
82
83
84
85
86
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.
    """
    ShopSellServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ShopSellServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ShopSellServerPacket

The data to serialize.

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

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ShopSellServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._sold_item is None:
            raise SerializationError("sold_item must be provided.")
        ShopSoldItem.serialize(writer, data._sold_item)
        if data._gold_amount is None:
            raise SerializationError("gold_amount must be provided.")
        writer.add_int(data._gold_amount)
        if data._weight is None:
            raise SerializationError("weight must be provided.")
        Weight.serialize(writer, data._weight)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/shop_sell_server_packet.py
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
@staticmethod
def deserialize(reader: EoReader) -> "ShopSellServerPacket":
    """
    Deserializes an instance of `ShopSellServerPacket` from the provided `EoReader`.

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

    Returns:
        ShopSellServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        sold_item = ShopSoldItem.deserialize(reader)
        gold_amount = reader.get_int()
        weight = Weight.deserialize(reader)
        result = ShopSellServerPacket(sold_item=sold_item, gold_amount=gold_amount, weight=weight)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ShopTradeItem

An item that a shop can buy or sell

Source code in src/eolib/protocol/_generated/net/server/shop_trade_item.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
class ShopTradeItem:
    """
    An item that a shop can buy or sell
    """
    _byte_size: int = 0
    _item_id: int
    _buy_price: int
    _sell_price: int
    _max_buy_amount: int

    def __init__(self, *, item_id: int, buy_price: int, sell_price: int, max_buy_amount: int):
        """
        Create a new instance of ShopTradeItem.

        Args:
            item_id (int): (Value range is 0-64008.)
            buy_price (int): (Value range is 0-16194276.)
            sell_price (int): (Value range is 0-16194276.)
            max_buy_amount (int): (Value range is 0-252.)
        """
        self._item_id = item_id
        self._buy_price = buy_price
        self._sell_price = sell_price
        self._max_buy_amount = max_buy_amount

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

    @property
    def buy_price(self) -> int:
        return self._buy_price

    @property
    def sell_price(self) -> int:
        return self._sell_price

    @property
    def max_buy_amount(self) -> int:
        return self._max_buy_amount

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ShopTradeItem): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._item_id is None:
                raise SerializationError("item_id must be provided.")
            writer.add_short(data._item_id)
            if data._buy_price is None:
                raise SerializationError("buy_price must be provided.")
            writer.add_three(data._buy_price)
            if data._sell_price is None:
                raise SerializationError("sell_price must be provided.")
            writer.add_three(data._sell_price)
            if data._max_buy_amount is None:
                raise SerializationError("max_buy_amount must be provided.")
            writer.add_char(data._max_buy_amount)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            ShopTradeItem: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            item_id = reader.get_short()
            buy_price = reader.get_three()
            sell_price = reader.get_three()
            max_buy_amount = reader.get_char()
            result = ShopTradeItem(item_id=item_id, buy_price=buy_price, sell_price=sell_price, max_buy_amount=max_buy_amount)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ShopTradeItem(byte_size={repr(self._byte_size)}, item_id={repr(self._item_id)}, buy_price={repr(self._buy_price)}, sell_price={repr(self._sell_price)}, max_buy_amount={repr(self._max_buy_amount)})"

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.

item_id: int property

buy_price: int property

sell_price: int property

max_buy_amount: int property

__init__(*, item_id, buy_price, sell_price, max_buy_amount)

Create a new instance of ShopTradeItem.

Parameters:

Name Type Description Default
item_id int

(Value range is 0-64008.)

required
buy_price int

(Value range is 0-16194276.)

required
sell_price int

(Value range is 0-16194276.)

required
max_buy_amount int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/shop_trade_item.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
def __init__(self, *, item_id: int, buy_price: int, sell_price: int, max_buy_amount: int):
    """
    Create a new instance of ShopTradeItem.

    Args:
        item_id (int): (Value range is 0-64008.)
        buy_price (int): (Value range is 0-16194276.)
        sell_price (int): (Value range is 0-16194276.)
        max_buy_amount (int): (Value range is 0-252.)
    """
    self._item_id = item_id
    self._buy_price = buy_price
    self._sell_price = sell_price
    self._max_buy_amount = max_buy_amount

serialize(writer, data) staticmethod

Serializes an instance of ShopTradeItem to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ShopTradeItem

The data to serialize.

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

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ShopTradeItem): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._item_id is None:
            raise SerializationError("item_id must be provided.")
        writer.add_short(data._item_id)
        if data._buy_price is None:
            raise SerializationError("buy_price must be provided.")
        writer.add_three(data._buy_price)
        if data._sell_price is None:
            raise SerializationError("sell_price must be provided.")
        writer.add_three(data._sell_price)
        if data._max_buy_amount is None:
            raise SerializationError("max_buy_amount must be provided.")
        writer.add_char(data._max_buy_amount)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/shop_trade_item.py
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@staticmethod
def deserialize(reader: EoReader) -> "ShopTradeItem":
    """
    Deserializes an instance of `ShopTradeItem` from the provided `EoReader`.

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

    Returns:
        ShopTradeItem: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        item_id = reader.get_short()
        buy_price = reader.get_three()
        sell_price = reader.get_three()
        max_buy_amount = reader.get_char()
        result = ShopTradeItem(item_id=item_id, buy_price=buy_price, sell_price=sell_price, max_buy_amount=max_buy_amount)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ShopOpenServerPacket

Bases: Packet

Response from talking to a shop NPC

Source code in src/eolib/protocol/_generated/net/server/shop_open_server_packet.py
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
class ShopOpenServerPacket(Packet):
    """
    Response from talking to a shop NPC
    """
    _byte_size: int = 0
    _session_id: int
    _shop_name: str
    _trade_items: tuple[ShopTradeItem, ...]
    _craft_items: tuple[ShopCraftItem, ...]

    def __init__(self, *, session_id: int, shop_name: str, trade_items: Iterable[ShopTradeItem], craft_items: Iterable[ShopCraftItem]):
        """
        Create a new instance of ShopOpenServerPacket.

        Args:
            session_id (int): (Value range is 0-64008.)
            shop_name (str): 
            trade_items (Iterable[ShopTradeItem]): 
            craft_items (Iterable[ShopCraftItem]): 
        """
        self._session_id = session_id
        self._shop_name = shop_name
        self._trade_items = tuple(trade_items)
        self._craft_items = tuple(craft_items)

    @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:
        return self._session_id

    @property
    def shop_name(self) -> str:
        return self._shop_name

    @property
    def trade_items(self) -> tuple[ShopTradeItem, ...]:
        return self._trade_items

    @property
    def craft_items(self) -> tuple[ShopCraftItem, ...]:
        return self._craft_items

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ShopOpenServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._session_id is None:
                raise SerializationError("session_id must be provided.")
            writer.add_short(data._session_id)
            if data._shop_name is None:
                raise SerializationError("shop_name must be provided.")
            writer.add_string(data._shop_name)
            writer.add_byte(0xFF)
            if data._trade_items is None:
                raise SerializationError("trade_items must be provided.")
            for i in range(len(data._trade_items)):
                ShopTradeItem.serialize(writer, data._trade_items[i])
            writer.add_byte(0xFF)
            if data._craft_items is None:
                raise SerializationError("craft_items must be provided.")
            for i in range(len(data._craft_items)):
                ShopCraftItem.serialize(writer, data._craft_items[i])
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            ShopOpenServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            session_id = reader.get_short()
            shop_name = reader.get_string()
            reader.next_chunk()
            trade_items_length = int(reader.remaining / 9)
            trade_items = []
            for i in range(trade_items_length):
                trade_items.append(ShopTradeItem.deserialize(reader))
            reader.next_chunk()
            craft_items_length = int(reader.remaining / 14)
            craft_items = []
            for i in range(craft_items_length):
                craft_items.append(ShopCraftItem.deserialize(reader))
            reader.chunked_reading_mode = False
            result = ShopOpenServerPacket(session_id=session_id, shop_name=shop_name, trade_items=trade_items, craft_items=craft_items)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ShopOpenServerPacket(byte_size={repr(self._byte_size)}, session_id={repr(self._session_id)}, shop_name={repr(self._shop_name)}, trade_items={repr(self._trade_items)}, craft_items={repr(self._craft_items)})"

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

shop_name: str property

trade_items: tuple[ShopTradeItem, ...] property

craft_items: tuple[ShopCraftItem, ...] property

__init__(*, session_id, shop_name, trade_items, craft_items)

Create a new instance of ShopOpenServerPacket.

Parameters:

Name Type Description Default
session_id int

(Value range is 0-64008.)

required
shop_name str
required
trade_items Iterable[ShopTradeItem]
required
craft_items Iterable[ShopCraftItem]
required
Source code in src/eolib/protocol/_generated/net/server/shop_open_server_packet.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
def __init__(self, *, session_id: int, shop_name: str, trade_items: Iterable[ShopTradeItem], craft_items: Iterable[ShopCraftItem]):
    """
    Create a new instance of ShopOpenServerPacket.

    Args:
        session_id (int): (Value range is 0-64008.)
        shop_name (str): 
        trade_items (Iterable[ShopTradeItem]): 
        craft_items (Iterable[ShopCraftItem]): 
    """
    self._session_id = session_id
    self._shop_name = shop_name
    self._trade_items = tuple(trade_items)
    self._craft_items = tuple(craft_items)

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/shop_open_server_packet.py
68
69
70
71
72
73
74
75
76
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

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

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/shop_open_server_packet.py
78
79
80
81
82
83
84
85
86
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/shop_open_server_packet.py
88
89
90
91
92
93
94
95
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.
    """
    ShopOpenServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ShopOpenServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ShopOpenServerPacket

The data to serialize.

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

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ShopOpenServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._session_id is None:
            raise SerializationError("session_id must be provided.")
        writer.add_short(data._session_id)
        if data._shop_name is None:
            raise SerializationError("shop_name must be provided.")
        writer.add_string(data._shop_name)
        writer.add_byte(0xFF)
        if data._trade_items is None:
            raise SerializationError("trade_items must be provided.")
        for i in range(len(data._trade_items)):
            ShopTradeItem.serialize(writer, data._trade_items[i])
        writer.add_byte(0xFF)
        if data._craft_items is None:
            raise SerializationError("craft_items must be provided.")
        for i in range(len(data._craft_items)):
            ShopCraftItem.serialize(writer, data._craft_items[i])
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

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

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

    Returns:
        ShopOpenServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        session_id = reader.get_short()
        shop_name = reader.get_string()
        reader.next_chunk()
        trade_items_length = int(reader.remaining / 9)
        trade_items = []
        for i in range(trade_items_length):
            trade_items.append(ShopTradeItem.deserialize(reader))
        reader.next_chunk()
        craft_items_length = int(reader.remaining / 14)
        craft_items = []
        for i in range(craft_items_length):
            craft_items.append(ShopCraftItem.deserialize(reader))
        reader.chunked_reading_mode = False
        result = ShopOpenServerPacket(session_id=session_id, shop_name=shop_name, trade_items=trade_items, craft_items=craft_items)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ShopCreateServerPacket

Bases: Packet

Response to crafting an item from a shop

Source code in src/eolib/protocol/_generated/net/server/shop_create_server_packet.py
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
class ShopCreateServerPacket(Packet):
    """
    Response to crafting an item from a shop
    """
    _byte_size: int = 0
    _craft_item_id: int
    _weight: Weight
    _ingredients: tuple[Item, ...]

    def __init__(self, *, craft_item_id: int, weight: Weight, ingredients: Iterable[Item]):
        """
        Create a new instance of ShopCreateServerPacket.

        Args:
            craft_item_id (int): (Value range is 0-64008.)
            weight (Weight): 
            ingredients (Iterable[Item]): (Length must be `4`.)
        """
        self._craft_item_id = craft_item_id
        self._weight = weight
        self._ingredients = tuple(ingredients)

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

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

    @property
    def ingredients(self) -> tuple[Item, ...]:
        return self._ingredients

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ShopCreateServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._craft_item_id is None:
                raise SerializationError("craft_item_id must be provided.")
            writer.add_short(data._craft_item_id)
            if data._weight is None:
                raise SerializationError("weight must be provided.")
            Weight.serialize(writer, data._weight)
            if data._ingredients is None:
                raise SerializationError("ingredients must be provided.")
            if len(data._ingredients) != 4:
                raise SerializationError(f"Expected length of ingredients to be exactly 4, got {len(data._ingredients)}.")
            for i in range(4):
                Item.serialize(writer, data._ingredients[i])
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            ShopCreateServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            craft_item_id = reader.get_short()
            weight = Weight.deserialize(reader)
            ingredients = []
            for i in range(4):
                ingredients.append(Item.deserialize(reader))
            result = ShopCreateServerPacket(craft_item_id=craft_item_id, weight=weight, ingredients=ingredients)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ShopCreateServerPacket(byte_size={repr(self._byte_size)}, craft_item_id={repr(self._craft_item_id)}, weight={repr(self._weight)}, ingredients={repr(self._ingredients)})"

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.

craft_item_id: int property

weight: Weight property

ingredients: tuple[Item, ...] property

__init__(*, craft_item_id, weight, ingredients)

Create a new instance of ShopCreateServerPacket.

Parameters:

Name Type Description Default
craft_item_id int

(Value range is 0-64008.)

required
weight Weight
required
ingredients Iterable[Item]

(Length must be 4.)

required
Source code in src/eolib/protocol/_generated/net/server/shop_create_server_packet.py
26
27
28
29
30
31
32
33
34
35
36
37
def __init__(self, *, craft_item_id: int, weight: Weight, ingredients: Iterable[Item]):
    """
    Create a new instance of ShopCreateServerPacket.

    Args:
        craft_item_id (int): (Value range is 0-64008.)
        weight (Weight): 
        ingredients (Iterable[Item]): (Length must be `4`.)
    """
    self._craft_item_id = craft_item_id
    self._weight = weight
    self._ingredients = tuple(ingredients)

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

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

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/shop_create_server_packet.py
71
72
73
74
75
76
77
78
79
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

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

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/shop_create_server_packet.py
81
82
83
84
85
86
87
88
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.
    """
    ShopCreateServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ShopCreateServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ShopCreateServerPacket

The data to serialize.

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

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ShopCreateServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._craft_item_id is None:
            raise SerializationError("craft_item_id must be provided.")
        writer.add_short(data._craft_item_id)
        if data._weight is None:
            raise SerializationError("weight must be provided.")
        Weight.serialize(writer, data._weight)
        if data._ingredients is None:
            raise SerializationError("ingredients must be provided.")
        if len(data._ingredients) != 4:
            raise SerializationError(f"Expected length of ingredients to be exactly 4, got {len(data._ingredients)}.")
        for i in range(4):
            Item.serialize(writer, data._ingredients[i])
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/shop_create_server_packet.py
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
@staticmethod
def deserialize(reader: EoReader) -> "ShopCreateServerPacket":
    """
    Deserializes an instance of `ShopCreateServerPacket` from the provided `EoReader`.

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

    Returns:
        ShopCreateServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        craft_item_id = reader.get_short()
        weight = Weight.deserialize(reader)
        ingredients = []
        for i in range(4):
            ingredients.append(Item.deserialize(reader))
        result = ShopCreateServerPacket(craft_item_id=craft_item_id, weight=weight, ingredients=ingredients)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ShopCraftItem

An item that a shop can craft

Source code in src/eolib/protocol/_generated/net/server/shop_craft_item.py
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
class ShopCraftItem:
    """
    An item that a shop can craft
    """
    _byte_size: int = 0
    _item_id: int
    _ingredients: tuple[CharItem, ...]

    def __init__(self, *, item_id: int, ingredients: Iterable[CharItem]):
        """
        Create a new instance of ShopCraftItem.

        Args:
            item_id (int): (Value range is 0-64008.)
            ingredients (Iterable[CharItem]): (Length must be `4`.)
        """
        self._item_id = item_id
        self._ingredients = tuple(ingredients)

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

    @property
    def ingredients(self) -> tuple[CharItem, ...]:
        return self._ingredients

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ShopCraftItem): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._item_id is None:
                raise SerializationError("item_id must be provided.")
            writer.add_short(data._item_id)
            if data._ingredients is None:
                raise SerializationError("ingredients must be provided.")
            if len(data._ingredients) != 4:
                raise SerializationError(f"Expected length of ingredients to be exactly 4, got {len(data._ingredients)}.")
            for i in range(4):
                CharItem.serialize(writer, data._ingredients[i])
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            ShopCraftItem: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            item_id = reader.get_short()
            ingredients = []
            for i in range(4):
                ingredients.append(CharItem.deserialize(reader))
            result = ShopCraftItem(item_id=item_id, ingredients=ingredients)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ShopCraftItem(byte_size={repr(self._byte_size)}, item_id={repr(self._item_id)}, ingredients={repr(self._ingredients)})"

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.

item_id: int property

ingredients: tuple[CharItem, ...] property

__init__(*, item_id, ingredients)

Create a new instance of ShopCraftItem.

Parameters:

Name Type Description Default
item_id int

(Value range is 0-64008.)

required
ingredients Iterable[CharItem]

(Length must be 4.)

required
Source code in src/eolib/protocol/_generated/net/server/shop_craft_item.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, item_id: int, ingredients: Iterable[CharItem]):
    """
    Create a new instance of ShopCraftItem.

    Args:
        item_id (int): (Value range is 0-64008.)
        ingredients (Iterable[CharItem]): (Length must be `4`.)
    """
    self._item_id = item_id
    self._ingredients = tuple(ingredients)

serialize(writer, data) staticmethod

Serializes an instance of ShopCraftItem to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ShopCraftItem

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/shop_craft_item.py
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
@staticmethod
def serialize(writer: EoWriter, data: "ShopCraftItem") -> None:
    """
    Serializes an instance of `ShopCraftItem` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ShopCraftItem): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._item_id is None:
            raise SerializationError("item_id must be provided.")
        writer.add_short(data._item_id)
        if data._ingredients is None:
            raise SerializationError("ingredients must be provided.")
        if len(data._ingredients) != 4:
            raise SerializationError(f"Expected length of ingredients to be exactly 4, got {len(data._ingredients)}.")
        for i in range(4):
            CharItem.serialize(writer, data._ingredients[i])
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/shop_craft_item.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
@staticmethod
def deserialize(reader: EoReader) -> "ShopCraftItem":
    """
    Deserializes an instance of `ShopCraftItem` from the provided `EoReader`.

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

    Returns:
        ShopCraftItem: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        item_id = reader.get_short()
        ingredients = []
        for i in range(4):
            ingredients.append(CharItem.deserialize(reader))
        result = ShopCraftItem(item_id=item_id, ingredients=ingredients)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

CharItem

An item reference with a 1-byte amount. Used for craft ingredients.

Source code in src/eolib/protocol/_generated/net/char_item.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
class CharItem:
    """
    An item reference with a 1-byte amount.
    Used for craft ingredients.
    """
    _byte_size: int = 0
    _id: int
    _amount: int

    def __init__(self, *, id: int, amount: int):
        """
        Create a new instance of CharItem.

        Args:
            id (int): (Value range is 0-64008.)
            amount (int): (Value range is 0-252.)
        """
        self._id = id
        self._amount = amount

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

    @property
    def amount(self) -> int:
        return self._amount

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharItem): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._id is None:
                raise SerializationError("id must be provided.")
            writer.add_short(data._id)
            if data._amount is None:
                raise SerializationError("amount must be provided.")
            writer.add_char(data._amount)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            CharItem: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            id = reader.get_short()
            amount = reader.get_char()
            result = CharItem(id=id, amount=amount)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharItem(byte_size={repr(self._byte_size)}, id={repr(self._id)}, amount={repr(self._amount)})"

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.

id: int property

amount: int property

__init__(*, id, amount)

Create a new instance of CharItem.

Parameters:

Name Type Description Default
id int

(Value range is 0-64008.)

required
amount int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/char_item.py
19
20
21
22
23
24
25
26
27
28
def __init__(self, *, id: int, amount: int):
    """
    Create a new instance of CharItem.

    Args:
        id (int): (Value range is 0-64008.)
        amount (int): (Value range is 0-252.)
    """
    self._id = id
    self._amount = amount

serialize(writer, data) staticmethod

Serializes an instance of CharItem to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CharItem

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/char_item.py
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
@staticmethod
def serialize(writer: EoWriter, data: "CharItem") -> None:
    """
    Serializes an instance of `CharItem` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharItem): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._id is None:
            raise SerializationError("id must be provided.")
        writer.add_short(data._id)
        if data._amount is None:
            raise SerializationError("amount must be provided.")
        writer.add_char(data._amount)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

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

The data to serialize.

Source code in src/eolib/protocol/_generated/net/char_item.py
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@staticmethod
def deserialize(reader: EoReader) -> "CharItem":
    """
    Deserializes an instance of `CharItem` from the provided `EoReader`.

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

    Returns:
        CharItem: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        id = reader.get_short()
        amount = reader.get_char()
        result = CharItem(id=id, amount=amount)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ShopBuyServerPacket

Bases: Packet

Response to purchasing an item from a shop

Source code in src/eolib/protocol/_generated/net/server/shop_buy_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
class ShopBuyServerPacket(Packet):
    """
    Response to purchasing an item from a shop
    """
    _byte_size: int = 0
    _gold_amount: int
    _bought_item: Item
    _weight: Weight

    def __init__(self, *, gold_amount: int, bought_item: Item, weight: Weight):
        """
        Create a new instance of ShopBuyServerPacket.

        Args:
            gold_amount (int): (Value range is 0-4097152080.)
            bought_item (Item): 
            weight (Weight): 
        """
        self._gold_amount = gold_amount
        self._bought_item = bought_item
        self._weight = weight

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

    @property
    def bought_item(self) -> Item:
        return self._bought_item

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

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

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

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

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

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

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

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ShopBuyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._gold_amount is None:
                raise SerializationError("gold_amount must be provided.")
            writer.add_int(data._gold_amount)
            if data._bought_item is None:
                raise SerializationError("bought_item must be provided.")
            Item.serialize(writer, data._bought_item)
            if data._weight is None:
                raise SerializationError("weight must be provided.")
            Weight.serialize(writer, data._weight)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

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

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

        Returns:
            ShopBuyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            gold_amount = reader.get_int()
            bought_item = Item.deserialize(reader)
            weight = Weight.deserialize(reader)
            result = ShopBuyServerPacket(gold_amount=gold_amount, bought_item=bought_item, weight=weight)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ShopBuyServerPacket(byte_size={repr(self._byte_size)}, gold_amount={repr(self._gold_amount)}, bought_item={repr(self._bought_item)}, weight={repr(self._weight)})"

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.

gold_amount: int property

bought_item: Item property

weight: Weight property

__init__(*, gold_amount, bought_item, weight)

Create a new instance of ShopBuyServerPacket.

Parameters:

Name Type Description Default
gold_amount int

(Value range is 0-4097152080.)

required
bought_item Item
required
weight Weight
required
Source code in src/eolib/protocol/_generated/net/server/shop_buy_server_packet.py
24
25
26
27
28
29
30
31
32
33
34
35
def __init__(self, *, gold_amount: int, bought_item: Item, weight: Weight):
    """
    Create a new instance of ShopBuyServerPacket.

    Args:
        gold_amount (int): (Value range is 0-4097152080.)
        bought_item (Item): 
        weight (Weight): 
    """
    self._gold_amount = gold_amount
    self._bought_item = bought_item
    self._weight = weight

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

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Shop

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/shop_buy_server_packet.py
69
70
71
72
73
74
75
76
77
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Buy

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/shop_buy_server_packet.py
79
80
81
82
83
84
85
86
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.
    """
    ShopBuyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ShopBuyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ShopBuyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/shop_buy_server_packet.py
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@staticmethod
def serialize(writer: EoWriter, data: "ShopBuyServerPacket") -> None:
    """
    Serializes an instance of `ShopBuyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ShopBuyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._gold_amount is None:
            raise SerializationError("gold_amount must be provided.")
        writer.add_int(data._gold_amount)
        if data._bought_item is None:
            raise SerializationError("bought_item must be provided.")
        Item.serialize(writer, data._bought_item)
        if data._weight is None:
            raise SerializationError("weight must be provided.")
        Weight.serialize(writer, data._weight)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ShopBuyServerPacket 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
ShopBuyServerPacket ShopBuyServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/shop_buy_server_packet.py
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
@staticmethod
def deserialize(reader: EoReader) -> "ShopBuyServerPacket":
    """
    Deserializes an instance of `ShopBuyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ShopBuyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        gold_amount = reader.get_int()
        bought_item = Item.deserialize(reader)
        weight = Weight.deserialize(reader)
        result = ShopBuyServerPacket(gold_amount=gold_amount, bought_item=bought_item, weight=weight)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ServerSettings

Settings sent with WELCOME_REPLY packet

Source code in src/eolib/protocol/_generated/net/server/server_settings.py
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
class ServerSettings:
    """
    Settings sent with WELCOME_REPLY packet
    """
    _byte_size: int = 0
    _jail_map: int
    _rescue_map: int
    _rescue_coords: Coords
    _spy_and_light_guide_flood_rate: int
    _guardian_flood_rate: int
    _game_master_flood_rate: int
    _high_game_master_flood_rate: int

    def __init__(self, *, jail_map: int, rescue_map: int, rescue_coords: Coords, spy_and_light_guide_flood_rate: int, guardian_flood_rate: int, game_master_flood_rate: int, high_game_master_flood_rate: int):
        """
        Create a new instance of ServerSettings.

        Args:
            jail_map (int): (Value range is 0-64008.)
            rescue_map (int): (Value range is 0-64008.)
            rescue_coords (Coords): 
            spy_and_light_guide_flood_rate (int): (Value range is 0-64008.)
            guardian_flood_rate (int): (Value range is 0-64008.)
            game_master_flood_rate (int): (Value range is 0-64008.)
            high_game_master_flood_rate (int): (Value range is 0-64008.)
        """
        self._jail_map = jail_map
        self._rescue_map = rescue_map
        self._rescue_coords = rescue_coords
        self._spy_and_light_guide_flood_rate = spy_and_light_guide_flood_rate
        self._guardian_flood_rate = guardian_flood_rate
        self._game_master_flood_rate = game_master_flood_rate
        self._high_game_master_flood_rate = high_game_master_flood_rate

    @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 jail_map(self) -> int:
        return self._jail_map

    @property
    def rescue_map(self) -> int:
        return self._rescue_map

    @property
    def rescue_coords(self) -> Coords:
        return self._rescue_coords

    @property
    def spy_and_light_guide_flood_rate(self) -> int:
        return self._spy_and_light_guide_flood_rate

    @property
    def guardian_flood_rate(self) -> int:
        return self._guardian_flood_rate

    @property
    def game_master_flood_rate(self) -> int:
        return self._game_master_flood_rate

    @property
    def high_game_master_flood_rate(self) -> int:
        return self._high_game_master_flood_rate

    @staticmethod
    def serialize(writer: EoWriter, data: "ServerSettings") -> None:
        """
        Serializes an instance of `ServerSettings` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ServerSettings): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._jail_map is None:
                raise SerializationError("jail_map must be provided.")
            writer.add_short(data._jail_map)
            if data._rescue_map is None:
                raise SerializationError("rescue_map must be provided.")
            writer.add_short(data._rescue_map)
            if data._rescue_coords is None:
                raise SerializationError("rescue_coords must be provided.")
            Coords.serialize(writer, data._rescue_coords)
            if data._spy_and_light_guide_flood_rate is None:
                raise SerializationError("spy_and_light_guide_flood_rate must be provided.")
            writer.add_short(data._spy_and_light_guide_flood_rate)
            if data._guardian_flood_rate is None:
                raise SerializationError("guardian_flood_rate must be provided.")
            writer.add_short(data._guardian_flood_rate)
            if data._game_master_flood_rate is None:
                raise SerializationError("game_master_flood_rate must be provided.")
            writer.add_short(data._game_master_flood_rate)
            if data._high_game_master_flood_rate is None:
                raise SerializationError("high_game_master_flood_rate must be provided.")
            writer.add_short(data._high_game_master_flood_rate)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ServerSettings":
        """
        Deserializes an instance of `ServerSettings` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ServerSettings: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            jail_map = reader.get_short()
            rescue_map = reader.get_short()
            rescue_coords = Coords.deserialize(reader)
            spy_and_light_guide_flood_rate = reader.get_short()
            guardian_flood_rate = reader.get_short()
            game_master_flood_rate = reader.get_short()
            high_game_master_flood_rate = reader.get_short()
            result = ServerSettings(jail_map=jail_map, rescue_map=rescue_map, rescue_coords=rescue_coords, spy_and_light_guide_flood_rate=spy_and_light_guide_flood_rate, guardian_flood_rate=guardian_flood_rate, game_master_flood_rate=game_master_flood_rate, high_game_master_flood_rate=high_game_master_flood_rate)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ServerSettings(byte_size={repr(self._byte_size)}, jail_map={repr(self._jail_map)}, rescue_map={repr(self._rescue_map)}, rescue_coords={repr(self._rescue_coords)}, spy_and_light_guide_flood_rate={repr(self._spy_and_light_guide_flood_rate)}, guardian_flood_rate={repr(self._guardian_flood_rate)}, game_master_flood_rate={repr(self._game_master_flood_rate)}, high_game_master_flood_rate={repr(self._high_game_master_flood_rate)})"

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.

jail_map: int property

rescue_map: int property

rescue_coords: Coords property

spy_and_light_guide_flood_rate: int property

guardian_flood_rate: int property

game_master_flood_rate: int property

high_game_master_flood_rate: int property

__init__(*, jail_map, rescue_map, rescue_coords, spy_and_light_guide_flood_rate, guardian_flood_rate, game_master_flood_rate, high_game_master_flood_rate)

Create a new instance of ServerSettings.

Parameters:

Name Type Description Default
jail_map int

(Value range is 0-64008.)

required
rescue_map int

(Value range is 0-64008.)

required
rescue_coords Coords
required
spy_and_light_guide_flood_rate int

(Value range is 0-64008.)

required
guardian_flood_rate int

(Value range is 0-64008.)

required
game_master_flood_rate int

(Value range is 0-64008.)

required
high_game_master_flood_rate int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/server_settings.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
def __init__(self, *, jail_map: int, rescue_map: int, rescue_coords: Coords, spy_and_light_guide_flood_rate: int, guardian_flood_rate: int, game_master_flood_rate: int, high_game_master_flood_rate: int):
    """
    Create a new instance of ServerSettings.

    Args:
        jail_map (int): (Value range is 0-64008.)
        rescue_map (int): (Value range is 0-64008.)
        rescue_coords (Coords): 
        spy_and_light_guide_flood_rate (int): (Value range is 0-64008.)
        guardian_flood_rate (int): (Value range is 0-64008.)
        game_master_flood_rate (int): (Value range is 0-64008.)
        high_game_master_flood_rate (int): (Value range is 0-64008.)
    """
    self._jail_map = jail_map
    self._rescue_map = rescue_map
    self._rescue_coords = rescue_coords
    self._spy_and_light_guide_flood_rate = spy_and_light_guide_flood_rate
    self._guardian_flood_rate = guardian_flood_rate
    self._game_master_flood_rate = game_master_flood_rate
    self._high_game_master_flood_rate = high_game_master_flood_rate

serialize(writer, data) staticmethod

Serializes an instance of ServerSettings to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ServerSettings

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/server_settings.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "ServerSettings") -> None:
    """
    Serializes an instance of `ServerSettings` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ServerSettings): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._jail_map is None:
            raise SerializationError("jail_map must be provided.")
        writer.add_short(data._jail_map)
        if data._rescue_map is None:
            raise SerializationError("rescue_map must be provided.")
        writer.add_short(data._rescue_map)
        if data._rescue_coords is None:
            raise SerializationError("rescue_coords must be provided.")
        Coords.serialize(writer, data._rescue_coords)
        if data._spy_and_light_guide_flood_rate is None:
            raise SerializationError("spy_and_light_guide_flood_rate must be provided.")
        writer.add_short(data._spy_and_light_guide_flood_rate)
        if data._guardian_flood_rate is None:
            raise SerializationError("guardian_flood_rate must be provided.")
        writer.add_short(data._guardian_flood_rate)
        if data._game_master_flood_rate is None:
            raise SerializationError("game_master_flood_rate must be provided.")
        writer.add_short(data._game_master_flood_rate)
        if data._high_game_master_flood_rate is None:
            raise SerializationError("high_game_master_flood_rate must be provided.")
        writer.add_short(data._high_game_master_flood_rate)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ServerSettings 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
ServerSettings ServerSettings

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/server_settings.py
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
@staticmethod
def deserialize(reader: EoReader) -> "ServerSettings":
    """
    Deserializes an instance of `ServerSettings` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ServerSettings: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        jail_map = reader.get_short()
        rescue_map = reader.get_short()
        rescue_coords = Coords.deserialize(reader)
        spy_and_light_guide_flood_rate = reader.get_short()
        guardian_flood_rate = reader.get_short()
        game_master_flood_rate = reader.get_short()
        high_game_master_flood_rate = reader.get_short()
        result = ServerSettings(jail_map=jail_map, rescue_map=rescue_map, rescue_coords=rescue_coords, spy_and_light_guide_flood_rate=spy_and_light_guide_flood_rate, guardian_flood_rate=guardian_flood_rate, game_master_flood_rate=game_master_flood_rate, high_game_master_flood_rate=high_game_master_flood_rate)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

RefreshReplyServerPacket

Bases: Packet

Reply to request for new info about nearby objects

Source code in src/eolib/protocol/_generated/net/server/refresh_reply_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
class RefreshReplyServerPacket(Packet):
    """
    Reply to request for new info about nearby objects
    """
    _byte_size: int = 0
    _nearby: NearbyInfo

    def __init__(self, *, nearby: NearbyInfo):
        """
        Create a new instance of RefreshReplyServerPacket.

        Args:
            nearby (NearbyInfo): 
        """
        self._nearby = nearby

    @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 nearby(self) -> NearbyInfo:
        return self._nearby

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Refresh

    @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.
        """
        RefreshReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "RefreshReplyServerPacket") -> None:
        """
        Serializes an instance of `RefreshReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (RefreshReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._nearby is None:
                raise SerializationError("nearby must be provided.")
            NearbyInfo.serialize(writer, data._nearby)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "RefreshReplyServerPacket":
        """
        Deserializes an instance of `RefreshReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            RefreshReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            nearby = NearbyInfo.deserialize(reader)
            result = RefreshReplyServerPacket(nearby=nearby)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"RefreshReplyServerPacket(byte_size={repr(self._byte_size)}, 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.

nearby: NearbyInfo property

__init__(*, nearby)

Create a new instance of RefreshReplyServerPacket.

Parameters:

Name Type Description Default
nearby NearbyInfo
required
Source code in src/eolib/protocol/_generated/net/server/refresh_reply_server_packet.py
21
22
23
24
25
26
27
28
def __init__(self, *, nearby: NearbyInfo):
    """
    Create a new instance of RefreshReplyServerPacket.

    Args:
        nearby (NearbyInfo): 
    """
    self._nearby = nearby

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/refresh_reply_server_packet.py
44
45
46
47
48
49
50
51
52
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Refresh

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/refresh_reply_server_packet.py
54
55
56
57
58
59
60
61
62
@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/refresh_reply_server_packet.py
64
65
66
67
68
69
70
71
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.
    """
    RefreshReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of RefreshReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data RefreshReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/refresh_reply_server_packet.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@staticmethod
def serialize(writer: EoWriter, data: "RefreshReplyServerPacket") -> None:
    """
    Serializes an instance of `RefreshReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (RefreshReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._nearby is None:
            raise SerializationError("nearby must be provided.")
        NearbyInfo.serialize(writer, data._nearby)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of RefreshReplyServerPacket 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
RefreshReplyServerPacket RefreshReplyServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/refresh_reply_server_packet.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@staticmethod
def deserialize(reader: EoReader) -> "RefreshReplyServerPacket":
    """
    Deserializes an instance of `RefreshReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        RefreshReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        nearby = NearbyInfo.deserialize(reader)
        result = RefreshReplyServerPacket(nearby=nearby)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

RecoverTargetGroupServerPacket

Bases: Packet

Updated stats when levelling up from party experience

Source code in src/eolib/protocol/_generated/net/server/recover_target_group_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
class RecoverTargetGroupServerPacket(Packet):
    """
    Updated stats when levelling up from party experience
    """
    _byte_size: int = 0
    _stat_points: int
    _skill_points: int
    _max_hp: int
    _max_tp: int
    _max_sp: int

    def __init__(self, *, stat_points: int, skill_points: int, max_hp: int, max_tp: int, max_sp: int):
        """
        Create a new instance of RecoverTargetGroupServerPacket.

        Args:
            stat_points (int): (Value range is 0-64008.)
            skill_points (int): (Value range is 0-64008.)
            max_hp (int): (Value range is 0-64008.)
            max_tp (int): (Value range is 0-64008.)
            max_sp (int): (Value range is 0-64008.)
        """
        self._stat_points = stat_points
        self._skill_points = skill_points
        self._max_hp = max_hp
        self._max_tp = max_tp
        self._max_sp = max_sp

    @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 stat_points(self) -> int:
        return self._stat_points

    @property
    def skill_points(self) -> int:
        return self._skill_points

    @property
    def max_hp(self) -> int:
        return self._max_hp

    @property
    def max_tp(self) -> int:
        return self._max_tp

    @property
    def max_sp(self) -> int:
        return self._max_sp

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Recover

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.TargetGroup

    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.
        """
        RecoverTargetGroupServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "RecoverTargetGroupServerPacket") -> None:
        """
        Serializes an instance of `RecoverTargetGroupServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (RecoverTargetGroupServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._stat_points is None:
                raise SerializationError("stat_points must be provided.")
            writer.add_short(data._stat_points)
            if data._skill_points is None:
                raise SerializationError("skill_points must be provided.")
            writer.add_short(data._skill_points)
            if data._max_hp is None:
                raise SerializationError("max_hp must be provided.")
            writer.add_short(data._max_hp)
            if data._max_tp is None:
                raise SerializationError("max_tp must be provided.")
            writer.add_short(data._max_tp)
            if data._max_sp is None:
                raise SerializationError("max_sp must be provided.")
            writer.add_short(data._max_sp)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "RecoverTargetGroupServerPacket":
        """
        Deserializes an instance of `RecoverTargetGroupServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            RecoverTargetGroupServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            stat_points = reader.get_short()
            skill_points = reader.get_short()
            max_hp = reader.get_short()
            max_tp = reader.get_short()
            max_sp = reader.get_short()
            result = RecoverTargetGroupServerPacket(stat_points=stat_points, skill_points=skill_points, max_hp=max_hp, max_tp=max_tp, max_sp=max_sp)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"RecoverTargetGroupServerPacket(byte_size={repr(self._byte_size)}, stat_points={repr(self._stat_points)}, skill_points={repr(self._skill_points)}, max_hp={repr(self._max_hp)}, max_tp={repr(self._max_tp)}, max_sp={repr(self._max_sp)})"

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.

stat_points: int property

skill_points: int property

max_hp: int property

max_tp: int property

max_sp: int property

__init__(*, stat_points, skill_points, max_hp, max_tp, max_sp)

Create a new instance of RecoverTargetGroupServerPacket.

Parameters:

Name Type Description Default
stat_points int

(Value range is 0-64008.)

required
skill_points int

(Value range is 0-64008.)

required
max_hp int

(Value range is 0-64008.)

required
max_tp int

(Value range is 0-64008.)

required
max_sp int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/recover_target_group_server_packet.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
def __init__(self, *, stat_points: int, skill_points: int, max_hp: int, max_tp: int, max_sp: int):
    """
    Create a new instance of RecoverTargetGroupServerPacket.

    Args:
        stat_points (int): (Value range is 0-64008.)
        skill_points (int): (Value range is 0-64008.)
        max_hp (int): (Value range is 0-64008.)
        max_tp (int): (Value range is 0-64008.)
        max_sp (int): (Value range is 0-64008.)
    """
    self._stat_points = stat_points
    self._skill_points = skill_points
    self._max_hp = max_hp
    self._max_tp = max_tp
    self._max_sp = max_sp

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/recover_target_group_server_packet.py
71
72
73
74
75
76
77
78
79
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Recover

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/recover_target_group_server_packet.py
81
82
83
84
85
86
87
88
89
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.TargetGroup

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/recover_target_group_server_packet.py
91
92
93
94
95
96
97
98
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.
    """
    RecoverTargetGroupServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of RecoverTargetGroupServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data RecoverTargetGroupServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/recover_target_group_server_packet.py
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
@staticmethod
def serialize(writer: EoWriter, data: "RecoverTargetGroupServerPacket") -> None:
    """
    Serializes an instance of `RecoverTargetGroupServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (RecoverTargetGroupServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._stat_points is None:
            raise SerializationError("stat_points must be provided.")
        writer.add_short(data._stat_points)
        if data._skill_points is None:
            raise SerializationError("skill_points must be provided.")
        writer.add_short(data._skill_points)
        if data._max_hp is None:
            raise SerializationError("max_hp must be provided.")
        writer.add_short(data._max_hp)
        if data._max_tp is None:
            raise SerializationError("max_tp must be provided.")
        writer.add_short(data._max_tp)
        if data._max_sp is None:
            raise SerializationError("max_sp must be provided.")
        writer.add_short(data._max_sp)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of RecoverTargetGroupServerPacket 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
RecoverTargetGroupServerPacket RecoverTargetGroupServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/recover_target_group_server_packet.py
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
@staticmethod
def deserialize(reader: EoReader) -> "RecoverTargetGroupServerPacket":
    """
    Deserializes an instance of `RecoverTargetGroupServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        RecoverTargetGroupServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        stat_points = reader.get_short()
        skill_points = reader.get_short()
        max_hp = reader.get_short()
        max_tp = reader.get_short()
        max_sp = reader.get_short()
        result = RecoverTargetGroupServerPacket(stat_points=stat_points, skill_points=skill_points, max_hp=max_hp, max_tp=max_tp, max_sp=max_sp)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

RecoverReplyServerPacket

Bases: Packet

Karma/experience update

Source code in src/eolib/protocol/_generated/net/server/recover_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
class RecoverReplyServerPacket(Packet):
    """
    Karma/experience update
    """
    _byte_size: int = 0
    _experience: int
    _karma: int
    _level_up: Optional[int]
    _stat_points: Optional[int]
    _skill_points: Optional[int]

    def __init__(self, *, experience: int, karma: int, level_up: Optional[int] = None, stat_points: Optional[int] = None, skill_points: Optional[int] = None):
        """
        Create a new instance of RecoverReplyServerPacket.

        Args:
            experience (int): (Value range is 0-4097152080.)
            karma (int): (Value range is 0-64008.)
            level_up (Optional[int]): A value greater than 0 is "new level" and indicates the player leveled up. The official client reads this if the packet is larger than 6 bytes. (Value range is 0-252.)
            stat_points (Optional[int]): The official client reads this if the player leveled up (Value range is 0-64008.)
            skill_points (Optional[int]): The official client reads this if the player leveled up (Value range is 0-64008.)
        """
        self._experience = experience
        self._karma = karma
        self._level_up = level_up
        self._stat_points = stat_points
        self._skill_points = skill_points

    @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 experience(self) -> int:
        return self._experience

    @property
    def karma(self) -> int:
        return self._karma

    @property
    def level_up(self) -> Optional[int]:
        """
        A value greater than 0 is "new level" and indicates the player leveled up.
        The official client reads this if the packet is larger than 6 bytes.
        """
        return self._level_up

    @property
    def stat_points(self) -> Optional[int]:
        """
        The official client reads this if the player leveled up
        """
        return self._stat_points

    @property
    def skill_points(self) -> Optional[int]:
        """
        The official client reads this if the player leveled up
        """
        return self._skill_points

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Recover

    @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.
        """
        RecoverReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "RecoverReplyServerPacket") -> None:
        """
        Serializes an instance of `RecoverReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (RecoverReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._experience is None:
                raise SerializationError("experience must be provided.")
            writer.add_int(data._experience)
            if data._karma is None:
                raise SerializationError("karma must be provided.")
            writer.add_short(data._karma)
            reached_missing_optional = data._level_up is None
            if not reached_missing_optional:
                writer.add_char(cast(int, data._level_up))
            reached_missing_optional = reached_missing_optional or data._stat_points is None
            if not reached_missing_optional:
                writer.add_short(cast(int, data._stat_points))
            reached_missing_optional = reached_missing_optional or data._skill_points is None
            if not reached_missing_optional:
                writer.add_short(cast(int, data._skill_points))
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "RecoverReplyServerPacket":
        """
        Deserializes an instance of `RecoverReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            RecoverReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            experience = reader.get_int()
            karma = reader.get_short()
            level_up: Optional[int] = None
            if reader.remaining > 0:
                level_up = reader.get_char()
            stat_points: Optional[int] = None
            if reader.remaining > 0:
                stat_points = reader.get_short()
            skill_points: Optional[int] = None
            if reader.remaining > 0:
                skill_points = reader.get_short()
            result = RecoverReplyServerPacket(experience=experience, karma=karma, level_up=level_up, stat_points=stat_points, skill_points=skill_points)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"RecoverReplyServerPacket(byte_size={repr(self._byte_size)}, experience={repr(self._experience)}, karma={repr(self._karma)}, level_up={repr(self._level_up)}, stat_points={repr(self._stat_points)}, skill_points={repr(self._skill_points)})"

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.

experience: int property

karma: int property

level_up: Optional[int] property

A value greater than 0 is "new level" and indicates the player leveled up. The official client reads this if the packet is larger than 6 bytes.

stat_points: Optional[int] property

The official client reads this if the player leveled up

skill_points: Optional[int] property

The official client reads this if the player leveled up

__init__(*, experience, karma, level_up=None, stat_points=None, skill_points=None)

Create a new instance of RecoverReplyServerPacket.

Parameters:

Name Type Description Default
experience int

(Value range is 0-4097152080.)

required
karma int

(Value range is 0-64008.)

required
level_up Optional[int]

A value greater than 0 is "new level" and indicates the player leveled up. The official client reads this if the packet is larger than 6 bytes. (Value range is 0-252.)

None
stat_points Optional[int]

The official client reads this if the player leveled up (Value range is 0-64008.)

None
skill_points Optional[int]

The official client reads this if the player leveled up (Value range is 0-64008.)

None
Source code in src/eolib/protocol/_generated/net/server/recover_reply_server_packet.py
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
def __init__(self, *, experience: int, karma: int, level_up: Optional[int] = None, stat_points: Optional[int] = None, skill_points: Optional[int] = None):
    """
    Create a new instance of RecoverReplyServerPacket.

    Args:
        experience (int): (Value range is 0-4097152080.)
        karma (int): (Value range is 0-64008.)
        level_up (Optional[int]): A value greater than 0 is "new level" and indicates the player leveled up. The official client reads this if the packet is larger than 6 bytes. (Value range is 0-252.)
        stat_points (Optional[int]): The official client reads this if the player leveled up (Value range is 0-64008.)
        skill_points (Optional[int]): The official client reads this if the player leveled up (Value range is 0-64008.)
    """
    self._experience = experience
    self._karma = karma
    self._level_up = level_up
    self._stat_points = stat_points
    self._skill_points = skill_points

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/recover_reply_server_packet.py
83
84
85
86
87
88
89
90
91
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Recover

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/recover_reply_server_packet.py
 93
 94
 95
 96
 97
 98
 99
100
101
@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/recover_reply_server_packet.py
103
104
105
106
107
108
109
110
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.
    """
    RecoverReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of RecoverReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data RecoverReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/recover_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
138
139
@staticmethod
def serialize(writer: EoWriter, data: "RecoverReplyServerPacket") -> None:
    """
    Serializes an instance of `RecoverReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (RecoverReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._experience is None:
            raise SerializationError("experience must be provided.")
        writer.add_int(data._experience)
        if data._karma is None:
            raise SerializationError("karma must be provided.")
        writer.add_short(data._karma)
        reached_missing_optional = data._level_up is None
        if not reached_missing_optional:
            writer.add_char(cast(int, data._level_up))
        reached_missing_optional = reached_missing_optional or data._stat_points is None
        if not reached_missing_optional:
            writer.add_short(cast(int, data._stat_points))
        reached_missing_optional = reached_missing_optional or data._skill_points is None
        if not reached_missing_optional:
            writer.add_short(cast(int, data._skill_points))
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of RecoverReplyServerPacket 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
RecoverReplyServerPacket RecoverReplyServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/recover_reply_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "RecoverReplyServerPacket":
    """
    Deserializes an instance of `RecoverReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        RecoverReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        experience = reader.get_int()
        karma = reader.get_short()
        level_up: Optional[int] = None
        if reader.remaining > 0:
            level_up = reader.get_char()
        stat_points: Optional[int] = None
        if reader.remaining > 0:
            stat_points = reader.get_short()
        skill_points: Optional[int] = None
        if reader.remaining > 0:
            skill_points = reader.get_short()
        result = RecoverReplyServerPacket(experience=experience, karma=karma, level_up=level_up, stat_points=stat_points, skill_points=skill_points)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

RecoverPlayerServerPacket

Bases: Packet

HP/TP update

Source code in src/eolib/protocol/_generated/net/server/recover_player_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
class RecoverPlayerServerPacket(Packet):
    """
    HP/TP update
    """
    _byte_size: int = 0
    _hp: int
    _tp: int

    def __init__(self, *, hp: int, tp: int):
        """
        Create a new instance of RecoverPlayerServerPacket.

        Args:
            hp (int): (Value range is 0-64008.)
            tp (int): (Value range is 0-64008.)
        """
        self._hp = hp
        self._tp = tp

    @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 hp(self) -> int:
        return self._hp

    @property
    def tp(self) -> int:
        return self._tp

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Recover

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Player

    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.
        """
        RecoverPlayerServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "RecoverPlayerServerPacket") -> None:
        """
        Serializes an instance of `RecoverPlayerServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (RecoverPlayerServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._hp is None:
                raise SerializationError("hp must be provided.")
            writer.add_short(data._hp)
            if data._tp is None:
                raise SerializationError("tp must be provided.")
            writer.add_short(data._tp)
            writer.add_short(0)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "RecoverPlayerServerPacket":
        """
        Deserializes an instance of `RecoverPlayerServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            RecoverPlayerServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            hp = reader.get_short()
            tp = reader.get_short()
            reader.get_short()
            result = RecoverPlayerServerPacket(hp=hp, tp=tp)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"RecoverPlayerServerPacket(byte_size={repr(self._byte_size)}, hp={repr(self._hp)}, tp={repr(self._tp)})"

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.

hp: int property

tp: int property

__init__(*, hp, tp)

Create a new instance of RecoverPlayerServerPacket.

Parameters:

Name Type Description Default
hp int

(Value range is 0-64008.)

required
tp int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/recover_player_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, hp: int, tp: int):
    """
    Create a new instance of RecoverPlayerServerPacket.

    Args:
        hp (int): (Value range is 0-64008.)
        tp (int): (Value range is 0-64008.)
    """
    self._hp = hp
    self._tp = tp

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/recover_player_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Recover

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/recover_player_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Player

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/recover_player_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    RecoverPlayerServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of RecoverPlayerServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data RecoverPlayerServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/recover_player_server_packet.py
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@staticmethod
def serialize(writer: EoWriter, data: "RecoverPlayerServerPacket") -> None:
    """
    Serializes an instance of `RecoverPlayerServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (RecoverPlayerServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._hp is None:
            raise SerializationError("hp must be provided.")
        writer.add_short(data._hp)
        if data._tp is None:
            raise SerializationError("tp must be provided.")
        writer.add_short(data._tp)
        writer.add_short(0)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of RecoverPlayerServerPacket 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
RecoverPlayerServerPacket RecoverPlayerServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/recover_player_server_packet.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
@staticmethod
def deserialize(reader: EoReader) -> "RecoverPlayerServerPacket":
    """
    Deserializes an instance of `RecoverPlayerServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        RecoverPlayerServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        hp = reader.get_short()
        tp = reader.get_short()
        reader.get_short()
        result = RecoverPlayerServerPacket(hp=hp, tp=tp)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

RecoverListServerPacket

Bases: Packet

Stats update

Source code in src/eolib/protocol/_generated/net/server/recover_list_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class RecoverListServerPacket(Packet):
    """
    Stats update
    """
    _byte_size: int = 0
    _class_id: int
    _stats: CharacterStatsUpdate

    def __init__(self, *, class_id: int, stats: CharacterStatsUpdate):
        """
        Create a new instance of RecoverListServerPacket.

        Args:
            class_id (int): (Value range is 0-64008.)
            stats (CharacterStatsUpdate): 
        """
        self._class_id = class_id
        self._stats = stats

    @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 class_id(self) -> int:
        return self._class_id

    @property
    def stats(self) -> CharacterStatsUpdate:
        return self._stats

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Recover

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.List

    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.
        """
        RecoverListServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "RecoverListServerPacket") -> None:
        """
        Serializes an instance of `RecoverListServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (RecoverListServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._class_id is None:
                raise SerializationError("class_id must be provided.")
            writer.add_short(data._class_id)
            if data._stats is None:
                raise SerializationError("stats must be provided.")
            CharacterStatsUpdate.serialize(writer, data._stats)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "RecoverListServerPacket":
        """
        Deserializes an instance of `RecoverListServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            RecoverListServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            class_id = reader.get_short()
            stats = CharacterStatsUpdate.deserialize(reader)
            result = RecoverListServerPacket(class_id=class_id, stats=stats)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"RecoverListServerPacket(byte_size={repr(self._byte_size)}, class_id={repr(self._class_id)}, stats={repr(self._stats)})"

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.

class_id: int property

stats: CharacterStatsUpdate property

__init__(*, class_id, stats)

Create a new instance of RecoverListServerPacket.

Parameters:

Name Type Description Default
class_id int

(Value range is 0-64008.)

required
stats CharacterStatsUpdate
required
Source code in src/eolib/protocol/_generated/net/server/recover_list_server_packet.py
22
23
24
25
26
27
28
29
30
31
def __init__(self, *, class_id: int, stats: CharacterStatsUpdate):
    """
    Create a new instance of RecoverListServerPacket.

    Args:
        class_id (int): (Value range is 0-64008.)
        stats (CharacterStatsUpdate): 
    """
    self._class_id = class_id
    self._stats = stats

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/recover_list_server_packet.py
51
52
53
54
55
56
57
58
59
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Recover

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/recover_list_server_packet.py
61
62
63
64
65
66
67
68
69
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.List

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/recover_list_server_packet.py
71
72
73
74
75
76
77
78
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.
    """
    RecoverListServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of RecoverListServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data RecoverListServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/recover_list_server_packet.py
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@staticmethod
def serialize(writer: EoWriter, data: "RecoverListServerPacket") -> None:
    """
    Serializes an instance of `RecoverListServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (RecoverListServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._class_id is None:
            raise SerializationError("class_id must be provided.")
        writer.add_short(data._class_id)
        if data._stats is None:
            raise SerializationError("stats must be provided.")
        CharacterStatsUpdate.serialize(writer, data._stats)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of RecoverListServerPacket 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
RecoverListServerPacket RecoverListServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/recover_list_server_packet.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@staticmethod
def deserialize(reader: EoReader) -> "RecoverListServerPacket":
    """
    Deserializes an instance of `RecoverListServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        RecoverListServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        class_id = reader.get_short()
        stats = CharacterStatsUpdate.deserialize(reader)
        result = RecoverListServerPacket(class_id=class_id, stats=stats)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

RecoverAgreeServerPacket

Bases: Packet

Nearby player gained HP

Source code in src/eolib/protocol/_generated/net/server/recover_agree_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
class RecoverAgreeServerPacket(Packet):
    """
    Nearby player gained HP
    """
    _byte_size: int = 0
    _player_id: int
    _heal_hp: int
    _hp_percentage: int

    def __init__(self, *, player_id: int, heal_hp: int, hp_percentage: int):
        """
        Create a new instance of RecoverAgreeServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            heal_hp (int): (Value range is 0-4097152080.)
            hp_percentage (int): (Value range is 0-252.)
        """
        self._player_id = player_id
        self._heal_hp = heal_hp
        self._hp_percentage = hp_percentage

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def heal_hp(self) -> int:
        return self._heal_hp

    @property
    def hp_percentage(self) -> int:
        return self._hp_percentage

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Recover

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Agree

    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.
        """
        RecoverAgreeServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "RecoverAgreeServerPacket") -> None:
        """
        Serializes an instance of `RecoverAgreeServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (RecoverAgreeServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._heal_hp is None:
                raise SerializationError("heal_hp must be provided.")
            writer.add_int(data._heal_hp)
            if data._hp_percentage is None:
                raise SerializationError("hp_percentage must be provided.")
            writer.add_char(data._hp_percentage)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "RecoverAgreeServerPacket":
        """
        Deserializes an instance of `RecoverAgreeServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            RecoverAgreeServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            heal_hp = reader.get_int()
            hp_percentage = reader.get_char()
            result = RecoverAgreeServerPacket(player_id=player_id, heal_hp=heal_hp, hp_percentage=hp_percentage)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"RecoverAgreeServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, heal_hp={repr(self._heal_hp)}, hp_percentage={repr(self._hp_percentage)})"

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.

player_id: int property

heal_hp: int property

hp_percentage: int property

__init__(*, player_id, heal_hp, hp_percentage)

Create a new instance of RecoverAgreeServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
heal_hp int

(Value range is 0-4097152080.)

required
hp_percentage int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/recover_agree_server_packet.py
22
23
24
25
26
27
28
29
30
31
32
33
def __init__(self, *, player_id: int, heal_hp: int, hp_percentage: int):
    """
    Create a new instance of RecoverAgreeServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        heal_hp (int): (Value range is 0-4097152080.)
        hp_percentage (int): (Value range is 0-252.)
    """
    self._player_id = player_id
    self._heal_hp = heal_hp
    self._hp_percentage = hp_percentage

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/recover_agree_server_packet.py
57
58
59
60
61
62
63
64
65
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Recover

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/recover_agree_server_packet.py
67
68
69
70
71
72
73
74
75
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Agree

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/recover_agree_server_packet.py
77
78
79
80
81
82
83
84
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.
    """
    RecoverAgreeServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of RecoverAgreeServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data RecoverAgreeServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/recover_agree_server_packet.py
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
@staticmethod
def serialize(writer: EoWriter, data: "RecoverAgreeServerPacket") -> None:
    """
    Serializes an instance of `RecoverAgreeServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (RecoverAgreeServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._heal_hp is None:
            raise SerializationError("heal_hp must be provided.")
        writer.add_int(data._heal_hp)
        if data._hp_percentage is None:
            raise SerializationError("hp_percentage must be provided.")
        writer.add_char(data._hp_percentage)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of RecoverAgreeServerPacket 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
RecoverAgreeServerPacket RecoverAgreeServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/recover_agree_server_packet.py
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
@staticmethod
def deserialize(reader: EoReader) -> "RecoverAgreeServerPacket":
    """
    Deserializes an instance of `RecoverAgreeServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        RecoverAgreeServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        heal_hp = reader.get_int()
        hp_percentage = reader.get_char()
        result = RecoverAgreeServerPacket(player_id=player_id, heal_hp=heal_hp, hp_percentage=hp_percentage)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

RangeReplyServerPacket

Bases: Packet

Reply to request for information about nearby players and NPCs

Source code in src/eolib/protocol/_generated/net/server/range_reply_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
class RangeReplyServerPacket(Packet):
    """
    Reply to request for information about nearby players and NPCs
    """
    _byte_size: int = 0
    _nearby: NearbyInfo

    def __init__(self, *, nearby: NearbyInfo):
        """
        Create a new instance of RangeReplyServerPacket.

        Args:
            nearby (NearbyInfo): 
        """
        self._nearby = nearby

    @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 nearby(self) -> NearbyInfo:
        return self._nearby

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Range

    @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.
        """
        RangeReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "RangeReplyServerPacket") -> None:
        """
        Serializes an instance of `RangeReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (RangeReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._nearby is None:
                raise SerializationError("nearby must be provided.")
            NearbyInfo.serialize(writer, data._nearby)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "RangeReplyServerPacket":
        """
        Deserializes an instance of `RangeReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            RangeReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            nearby = NearbyInfo.deserialize(reader)
            result = RangeReplyServerPacket(nearby=nearby)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"RangeReplyServerPacket(byte_size={repr(self._byte_size)}, 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.

nearby: NearbyInfo property

__init__(*, nearby)

Create a new instance of RangeReplyServerPacket.

Parameters:

Name Type Description Default
nearby NearbyInfo
required
Source code in src/eolib/protocol/_generated/net/server/range_reply_server_packet.py
21
22
23
24
25
26
27
28
def __init__(self, *, nearby: NearbyInfo):
    """
    Create a new instance of RangeReplyServerPacket.

    Args:
        nearby (NearbyInfo): 
    """
    self._nearby = nearby

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/range_reply_server_packet.py
44
45
46
47
48
49
50
51
52
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Range

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/range_reply_server_packet.py
54
55
56
57
58
59
60
61
62
@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/range_reply_server_packet.py
64
65
66
67
68
69
70
71
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.
    """
    RangeReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of RangeReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data RangeReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/range_reply_server_packet.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@staticmethod
def serialize(writer: EoWriter, data: "RangeReplyServerPacket") -> None:
    """
    Serializes an instance of `RangeReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (RangeReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._nearby is None:
            raise SerializationError("nearby must be provided.")
        NearbyInfo.serialize(writer, data._nearby)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of RangeReplyServerPacket 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
RangeReplyServerPacket RangeReplyServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/range_reply_server_packet.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@staticmethod
def deserialize(reader: EoReader) -> "RangeReplyServerPacket":
    """
    Deserializes an instance of `RangeReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        RangeReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        nearby = NearbyInfo.deserialize(reader)
        result = RangeReplyServerPacket(nearby=nearby)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

QuestReportServerPacket

Bases: Packet

NPC chat messages

Source code in src/eolib/protocol/_generated/net/server/quest_report_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
class QuestReportServerPacket(Packet):
    """
    NPC chat messages
    """
    _byte_size: int = 0
    _npc_index: int
    _messages: tuple[str, ...]

    def __init__(self, *, npc_index: int, messages: Iterable[str]):
        """
        Create a new instance of QuestReportServerPacket.

        Args:
            npc_index (int): (Value range is 0-64008.)
            messages (Iterable[str]): 
        """
        self._npc_index = npc_index
        self._messages = tuple(messages)

    @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 npc_index(self) -> int:
        return self._npc_index

    @property
    def messages(self) -> tuple[str, ...]:
        return self._messages

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Quest

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Report

    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.
        """
        QuestReportServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "QuestReportServerPacket") -> None:
        """
        Serializes an instance of `QuestReportServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (QuestReportServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._npc_index is None:
                raise SerializationError("npc_index must be provided.")
            writer.add_short(data._npc_index)
            writer.add_byte(0xFF)
            if data._messages is None:
                raise SerializationError("messages must be provided.")
            for i in range(len(data._messages)):
                writer.add_string(data._messages[i])
                writer.add_byte(0xFF)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "QuestReportServerPacket":
        """
        Deserializes an instance of `QuestReportServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            QuestReportServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            npc_index = reader.get_short()
            reader.next_chunk()
            messages = []
            while reader.remaining > 0:
                messages.append(reader.get_string())
                reader.next_chunk()
            reader.chunked_reading_mode = False
            result = QuestReportServerPacket(npc_index=npc_index, messages=messages)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"QuestReportServerPacket(byte_size={repr(self._byte_size)}, npc_index={repr(self._npc_index)}, messages={repr(self._messages)})"

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.

npc_index: int property

messages: tuple[str, ...] property

__init__(*, npc_index, messages)

Create a new instance of QuestReportServerPacket.

Parameters:

Name Type Description Default
npc_index int

(Value range is 0-64008.)

required
messages Iterable[str]
required
Source code in src/eolib/protocol/_generated/net/server/quest_report_server_packet.py
23
24
25
26
27
28
29
30
31
32
def __init__(self, *, npc_index: int, messages: Iterable[str]):
    """
    Create a new instance of QuestReportServerPacket.

    Args:
        npc_index (int): (Value range is 0-64008.)
        messages (Iterable[str]): 
    """
    self._npc_index = npc_index
    self._messages = tuple(messages)

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/quest_report_server_packet.py
52
53
54
55
56
57
58
59
60
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Quest

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/quest_report_server_packet.py
62
63
64
65
66
67
68
69
70
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Report

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/quest_report_server_packet.py
72
73
74
75
76
77
78
79
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.
    """
    QuestReportServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of QuestReportServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data QuestReportServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/quest_report_server_packet.py
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
@staticmethod
def serialize(writer: EoWriter, data: "QuestReportServerPacket") -> None:
    """
    Serializes an instance of `QuestReportServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (QuestReportServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._npc_index is None:
            raise SerializationError("npc_index must be provided.")
        writer.add_short(data._npc_index)
        writer.add_byte(0xFF)
        if data._messages is None:
            raise SerializationError("messages must be provided.")
        for i in range(len(data._messages)):
            writer.add_string(data._messages[i])
            writer.add_byte(0xFF)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of QuestReportServerPacket 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
QuestReportServerPacket 'QuestReportServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/quest_report_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "QuestReportServerPacket":
    """
    Deserializes an instance of `QuestReportServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        QuestReportServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        npc_index = reader.get_short()
        reader.next_chunk()
        messages = []
        while reader.remaining > 0:
            messages.append(reader.get_string())
            reader.next_chunk()
        reader.chunked_reading_mode = False
        result = QuestReportServerPacket(npc_index=npc_index, messages=messages)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

QuestRequirementIcon

Bases: IntEnum

Icon displayed for each quest in the Quest Progress window

Source code in src/eolib/protocol/_generated/net/server/quest_requirement_icon.py
 9
10
11
12
13
14
15
16
class QuestRequirementIcon(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Icon displayed for each quest in the Quest Progress window
    """
    Item = 3
    Talk = 5
    Kill = 8
    Step = 10

Item = 3 class-attribute instance-attribute

Talk = 5 class-attribute instance-attribute

Kill = 8 class-attribute instance-attribute

Step = 10 class-attribute instance-attribute

QuestProgressEntry

An entry in the Quest Progress window

Source code in src/eolib/protocol/_generated/net/server/quest_progress_entry.py
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
class QuestProgressEntry:
    """
    An entry in the Quest Progress window
    """
    _byte_size: int = 0
    _name: str
    _description: str
    _icon: QuestRequirementIcon
    _progress: int
    _target: int

    def __init__(self, *, name: str, description: str, icon: QuestRequirementIcon, progress: int, target: int):
        """
        Create a new instance of QuestProgressEntry.

        Args:
            name (str): 
            description (str): 
            icon (QuestRequirementIcon): 
            progress (int): (Value range is 0-64008.)
            target (int): (Value range is 0-64008.)
        """
        self._name = name
        self._description = description
        self._icon = icon
        self._progress = progress
        self._target = target

    @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 name(self) -> str:
        return self._name

    @property
    def description(self) -> str:
        return self._description

    @property
    def icon(self) -> QuestRequirementIcon:
        return self._icon

    @property
    def progress(self) -> int:
        return self._progress

    @property
    def target(self) -> int:
        return self._target

    @staticmethod
    def serialize(writer: EoWriter, data: "QuestProgressEntry") -> None:
        """
        Serializes an instance of `QuestProgressEntry` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (QuestProgressEntry): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._name is None:
                raise SerializationError("name must be provided.")
            writer.add_string(data._name)
            writer.add_byte(0xFF)
            if data._description is None:
                raise SerializationError("description must be provided.")
            writer.add_string(data._description)
            writer.add_byte(0xFF)
            if data._icon is None:
                raise SerializationError("icon must be provided.")
            writer.add_short(int(data._icon))
            if data._progress is None:
                raise SerializationError("progress must be provided.")
            writer.add_short(data._progress)
            if data._target is None:
                raise SerializationError("target must be provided.")
            writer.add_short(data._target)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "QuestProgressEntry":
        """
        Deserializes an instance of `QuestProgressEntry` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            QuestProgressEntry: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            name = reader.get_string()
            reader.next_chunk()
            description = reader.get_string()
            reader.next_chunk()
            icon = QuestRequirementIcon(reader.get_short())
            progress = reader.get_short()
            target = reader.get_short()
            reader.chunked_reading_mode = False
            result = QuestProgressEntry(name=name, description=description, icon=icon, progress=progress, target=target)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"QuestProgressEntry(byte_size={repr(self._byte_size)}, name={repr(self._name)}, description={repr(self._description)}, icon={repr(self._icon)}, progress={repr(self._progress)}, target={repr(self._target)})"

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.

name: str property

description: str property

icon: QuestRequirementIcon property

progress: int property

target: int property

__init__(*, name, description, icon, progress, target)

Create a new instance of QuestProgressEntry.

Parameters:

Name Type Description Default
name str
required
description str
required
icon QuestRequirementIcon
required
progress int

(Value range is 0-64008.)

required
target int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/quest_progress_entry.py
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
def __init__(self, *, name: str, description: str, icon: QuestRequirementIcon, progress: int, target: int):
    """
    Create a new instance of QuestProgressEntry.

    Args:
        name (str): 
        description (str): 
        icon (QuestRequirementIcon): 
        progress (int): (Value range is 0-64008.)
        target (int): (Value range is 0-64008.)
    """
    self._name = name
    self._description = description
    self._icon = icon
    self._progress = progress
    self._target = target

serialize(writer, data) staticmethod

Serializes an instance of QuestProgressEntry to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data QuestProgressEntry

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/quest_progress_entry.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "QuestProgressEntry") -> None:
    """
    Serializes an instance of `QuestProgressEntry` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (QuestProgressEntry): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._name is None:
            raise SerializationError("name must be provided.")
        writer.add_string(data._name)
        writer.add_byte(0xFF)
        if data._description is None:
            raise SerializationError("description must be provided.")
        writer.add_string(data._description)
        writer.add_byte(0xFF)
        if data._icon is None:
            raise SerializationError("icon must be provided.")
        writer.add_short(int(data._icon))
        if data._progress is None:
            raise SerializationError("progress must be provided.")
        writer.add_short(data._progress)
        if data._target is None:
            raise SerializationError("target must be provided.")
        writer.add_short(data._target)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of QuestProgressEntry 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
QuestProgressEntry QuestProgressEntry

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/quest_progress_entry.py
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
@staticmethod
def deserialize(reader: EoReader) -> "QuestProgressEntry":
    """
    Deserializes an instance of `QuestProgressEntry` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        QuestProgressEntry: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        name = reader.get_string()
        reader.next_chunk()
        description = reader.get_string()
        reader.next_chunk()
        icon = QuestRequirementIcon(reader.get_short())
        progress = reader.get_short()
        target = reader.get_short()
        reader.chunked_reading_mode = False
        result = QuestProgressEntry(name=name, description=description, icon=icon, progress=progress, target=target)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

QuestPage

Bases: IntEnum

A page in the Quest menu

Source code in src/eolib/protocol/_generated/net/quest_page.py
 9
10
11
12
13
14
class QuestPage(IntEnum, metaclass=ProtocolEnumMeta):
    """
    A page in the Quest menu
    """
    Progress = 1
    History = 2

Progress = 1 class-attribute instance-attribute

History = 2 class-attribute instance-attribute

QuestListServerPacket

Bases: Packet

Quest history / progress reply

Source code in src/eolib/protocol/_generated/net/server/quest_list_server_packet.py
 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
class QuestListServerPacket(Packet):
    """
    Quest history / progress reply
    """
    _byte_size: int = 0
    _page: QuestPage
    _quests_count: int
    _page_data: 'QuestListServerPacket.PageData'

    def __init__(self, *, page: QuestPage, quests_count: int, page_data: 'QuestListServerPacket.PageData' = None):
        """
        Create a new instance of QuestListServerPacket.

        Args:
            page (QuestPage): 
            quests_count (int): (Value range is 0-64008.)
            page_data (QuestListServerPacket.PageData): Data associated with the `page` field.
        """
        self._page = page
        self._quests_count = quests_count
        self._page_data = page_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 page(self) -> QuestPage:
        return self._page

    @property
    def quests_count(self) -> int:
        return self._quests_count

    @property
    def page_data(self) -> 'QuestListServerPacket.PageData':
        """
        QuestListServerPacket.PageData: Data associated with the `page` field.
        """
        return self._page_data

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Quest

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.List

    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.
        """
        QuestListServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "QuestListServerPacket") -> None:
        """
        Serializes an instance of `QuestListServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (QuestListServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._page is None:
                raise SerializationError("page must be provided.")
            writer.add_char(int(data._page))
            if data._quests_count is None:
                raise SerializationError("quests_count must be provided.")
            writer.add_short(data._quests_count)
            if data._page == QuestPage.Progress:
                if not isinstance(data._page_data, QuestListServerPacket.PageDataProgress):
                    raise SerializationError("Expected page_data to be type QuestListServerPacket.PageDataProgress for page " + QuestPage(data._page).name + ".")
                QuestListServerPacket.PageDataProgress.serialize(writer, data._page_data)
            elif data._page == QuestPage.History:
                if not isinstance(data._page_data, QuestListServerPacket.PageDataHistory):
                    raise SerializationError("Expected page_data to be type QuestListServerPacket.PageDataHistory for page " + QuestPage(data._page).name + ".")
                QuestListServerPacket.PageDataHistory.serialize(writer, data._page_data)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "QuestListServerPacket":
        """
        Deserializes an instance of `QuestListServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            QuestListServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            page = QuestPage(reader.get_char())
            quests_count = reader.get_short()
            page_data: QuestListServerPacket.PageData = None
            if page == QuestPage.Progress:
                page_data = QuestListServerPacket.PageDataProgress.deserialize(reader)
            elif page == QuestPage.History:
                page_data = QuestListServerPacket.PageDataHistory.deserialize(reader)
            reader.chunked_reading_mode = False
            result = QuestListServerPacket(page=page, quests_count=quests_count, page_data=page_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"QuestListServerPacket(byte_size={repr(self._byte_size)}, page={repr(self._page)}, quests_count={repr(self._quests_count)}, page_data={repr(self._page_data)})"

    PageData = Union['QuestListServerPacket.PageDataProgress', 'QuestListServerPacket.PageDataHistory', None]
    """
    Data associated with different values of the `page` field.
    """

    class PageDataProgress:
        """
        Data associated with page value QuestPage.Progress
        """
        _byte_size: int = 0
        _quest_progress_entries: tuple[QuestProgressEntry, ...]

        def __init__(self, *, quest_progress_entries: Iterable[QuestProgressEntry]):
            """
            Create a new instance of QuestListServerPacket.PageDataProgress.

            Args:
                quest_progress_entries (Iterable[QuestProgressEntry]): 
            """
            self._quest_progress_entries = tuple(quest_progress_entries)

        @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 quest_progress_entries(self) -> tuple[QuestProgressEntry, ...]:
            return self._quest_progress_entries

        @staticmethod
        def serialize(writer: EoWriter, data: "QuestListServerPacket.PageDataProgress") -> None:
            """
            Serializes an instance of `QuestListServerPacket.PageDataProgress` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (QuestListServerPacket.PageDataProgress): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._quest_progress_entries is None:
                    raise SerializationError("quest_progress_entries must be provided.")
                for i in range(len(data._quest_progress_entries)):
                    QuestProgressEntry.serialize(writer, data._quest_progress_entries[i])
                    writer.add_byte(0xFF)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "QuestListServerPacket.PageDataProgress":
            """
            Deserializes an instance of `QuestListServerPacket.PageDataProgress` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                QuestListServerPacket.PageDataProgress: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                quest_progress_entries = []
                while reader.remaining > 0:
                    quest_progress_entries.append(QuestProgressEntry.deserialize(reader))
                    reader.next_chunk()
                result = QuestListServerPacket.PageDataProgress(quest_progress_entries=quest_progress_entries)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"QuestListServerPacket.PageDataProgress(byte_size={repr(self._byte_size)}, quest_progress_entries={repr(self._quest_progress_entries)})"

    class PageDataHistory:
        """
        Data associated with page value QuestPage.History
        """
        _byte_size: int = 0
        _completed_quests: tuple[str, ...]

        def __init__(self, *, completed_quests: Iterable[str]):
            """
            Create a new instance of QuestListServerPacket.PageDataHistory.

            Args:
                completed_quests (Iterable[str]): 
            """
            self._completed_quests = tuple(completed_quests)

        @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 completed_quests(self) -> tuple[str, ...]:
            return self._completed_quests

        @staticmethod
        def serialize(writer: EoWriter, data: "QuestListServerPacket.PageDataHistory") -> None:
            """
            Serializes an instance of `QuestListServerPacket.PageDataHistory` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (QuestListServerPacket.PageDataHistory): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._completed_quests is None:
                    raise SerializationError("completed_quests must be provided.")
                for i in range(len(data._completed_quests)):
                    writer.add_string(data._completed_quests[i])
                    writer.add_byte(0xFF)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "QuestListServerPacket.PageDataHistory":
            """
            Deserializes an instance of `QuestListServerPacket.PageDataHistory` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                QuestListServerPacket.PageDataHistory: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                completed_quests = []
                while reader.remaining > 0:
                    completed_quests.append(reader.get_string())
                    reader.next_chunk()
                result = QuestListServerPacket.PageDataHistory(completed_quests=completed_quests)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"QuestListServerPacket.PageDataHistory(byte_size={repr(self._byte_size)}, completed_quests={repr(self._completed_quests)})"

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.

page: QuestPage property

quests_count: int property

page_data: 'QuestListServerPacket.PageData' property

QuestListServerPacket.PageData: Data associated with the page field.

PageData = Union['QuestListServerPacket.PageDataProgress', 'QuestListServerPacket.PageDataHistory', None] class-attribute instance-attribute

Data associated with different values of the page field.

PageDataProgress

Data associated with page value QuestPage.Progress

Source code in src/eolib/protocol/_generated/net/server/quest_list_server_packet.py
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
class PageDataProgress:
    """
    Data associated with page value QuestPage.Progress
    """
    _byte_size: int = 0
    _quest_progress_entries: tuple[QuestProgressEntry, ...]

    def __init__(self, *, quest_progress_entries: Iterable[QuestProgressEntry]):
        """
        Create a new instance of QuestListServerPacket.PageDataProgress.

        Args:
            quest_progress_entries (Iterable[QuestProgressEntry]): 
        """
        self._quest_progress_entries = tuple(quest_progress_entries)

    @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 quest_progress_entries(self) -> tuple[QuestProgressEntry, ...]:
        return self._quest_progress_entries

    @staticmethod
    def serialize(writer: EoWriter, data: "QuestListServerPacket.PageDataProgress") -> None:
        """
        Serializes an instance of `QuestListServerPacket.PageDataProgress` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (QuestListServerPacket.PageDataProgress): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._quest_progress_entries is None:
                raise SerializationError("quest_progress_entries must be provided.")
            for i in range(len(data._quest_progress_entries)):
                QuestProgressEntry.serialize(writer, data._quest_progress_entries[i])
                writer.add_byte(0xFF)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "QuestListServerPacket.PageDataProgress":
        """
        Deserializes an instance of `QuestListServerPacket.PageDataProgress` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            QuestListServerPacket.PageDataProgress: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            quest_progress_entries = []
            while reader.remaining > 0:
                quest_progress_entries.append(QuestProgressEntry.deserialize(reader))
                reader.next_chunk()
            result = QuestListServerPacket.PageDataProgress(quest_progress_entries=quest_progress_entries)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"QuestListServerPacket.PageDataProgress(byte_size={repr(self._byte_size)}, quest_progress_entries={repr(self._quest_progress_entries)})"

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.

quest_progress_entries: tuple[QuestProgressEntry, ...] property

__init__(*, quest_progress_entries)

Create a new instance of QuestListServerPacket.PageDataProgress.

Parameters:

Name Type Description Default
quest_progress_entries Iterable[QuestProgressEntry]
required
Source code in src/eolib/protocol/_generated/net/server/quest_list_server_packet.py
168
169
170
171
172
173
174
175
def __init__(self, *, quest_progress_entries: Iterable[QuestProgressEntry]):
    """
    Create a new instance of QuestListServerPacket.PageDataProgress.

    Args:
        quest_progress_entries (Iterable[QuestProgressEntry]): 
    """
    self._quest_progress_entries = tuple(quest_progress_entries)

serialize(writer, data) staticmethod

Serializes an instance of QuestListServerPacket.PageDataProgress to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PageDataProgress

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/quest_list_server_packet.py
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
@staticmethod
def serialize(writer: EoWriter, data: "QuestListServerPacket.PageDataProgress") -> None:
    """
    Serializes an instance of `QuestListServerPacket.PageDataProgress` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (QuestListServerPacket.PageDataProgress): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._quest_progress_entries is None:
            raise SerializationError("quest_progress_entries must be provided.")
        for i in range(len(data._quest_progress_entries)):
            QuestProgressEntry.serialize(writer, data._quest_progress_entries[i])
            writer.add_byte(0xFF)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of QuestListServerPacket.PageDataProgress from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'QuestListServerPacket.PageDataProgress'

QuestListServerPacket.PageDataProgress: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/quest_list_server_packet.py
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
@staticmethod
def deserialize(reader: EoReader) -> "QuestListServerPacket.PageDataProgress":
    """
    Deserializes an instance of `QuestListServerPacket.PageDataProgress` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        QuestListServerPacket.PageDataProgress: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        quest_progress_entries = []
        while reader.remaining > 0:
            quest_progress_entries.append(QuestProgressEntry.deserialize(reader))
            reader.next_chunk()
        result = QuestListServerPacket.PageDataProgress(quest_progress_entries=quest_progress_entries)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PageDataHistory

Data associated with page value QuestPage.History

Source code in src/eolib/protocol/_generated/net/server/quest_list_server_packet.py
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
class PageDataHistory:
    """
    Data associated with page value QuestPage.History
    """
    _byte_size: int = 0
    _completed_quests: tuple[str, ...]

    def __init__(self, *, completed_quests: Iterable[str]):
        """
        Create a new instance of QuestListServerPacket.PageDataHistory.

        Args:
            completed_quests (Iterable[str]): 
        """
        self._completed_quests = tuple(completed_quests)

    @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 completed_quests(self) -> tuple[str, ...]:
        return self._completed_quests

    @staticmethod
    def serialize(writer: EoWriter, data: "QuestListServerPacket.PageDataHistory") -> None:
        """
        Serializes an instance of `QuestListServerPacket.PageDataHistory` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (QuestListServerPacket.PageDataHistory): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._completed_quests is None:
                raise SerializationError("completed_quests must be provided.")
            for i in range(len(data._completed_quests)):
                writer.add_string(data._completed_quests[i])
                writer.add_byte(0xFF)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "QuestListServerPacket.PageDataHistory":
        """
        Deserializes an instance of `QuestListServerPacket.PageDataHistory` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            QuestListServerPacket.PageDataHistory: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            completed_quests = []
            while reader.remaining > 0:
                completed_quests.append(reader.get_string())
                reader.next_chunk()
            result = QuestListServerPacket.PageDataHistory(completed_quests=completed_quests)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"QuestListServerPacket.PageDataHistory(byte_size={repr(self._byte_size)}, completed_quests={repr(self._completed_quests)})"

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.

completed_quests: tuple[str, ...] property

__init__(*, completed_quests)

Create a new instance of QuestListServerPacket.PageDataHistory.

Parameters:

Name Type Description Default
completed_quests Iterable[str]
required
Source code in src/eolib/protocol/_generated/net/server/quest_list_server_packet.py
244
245
246
247
248
249
250
251
def __init__(self, *, completed_quests: Iterable[str]):
    """
    Create a new instance of QuestListServerPacket.PageDataHistory.

    Args:
        completed_quests (Iterable[str]): 
    """
    self._completed_quests = tuple(completed_quests)

serialize(writer, data) staticmethod

Serializes an instance of QuestListServerPacket.PageDataHistory to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PageDataHistory

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/quest_list_server_packet.py
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
@staticmethod
def serialize(writer: EoWriter, data: "QuestListServerPacket.PageDataHistory") -> None:
    """
    Serializes an instance of `QuestListServerPacket.PageDataHistory` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (QuestListServerPacket.PageDataHistory): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._completed_quests is None:
            raise SerializationError("completed_quests must be provided.")
        for i in range(len(data._completed_quests)):
            writer.add_string(data._completed_quests[i])
            writer.add_byte(0xFF)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of QuestListServerPacket.PageDataHistory from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'QuestListServerPacket.PageDataHistory'

QuestListServerPacket.PageDataHistory: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/quest_list_server_packet.py
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
@staticmethod
def deserialize(reader: EoReader) -> "QuestListServerPacket.PageDataHistory":
    """
    Deserializes an instance of `QuestListServerPacket.PageDataHistory` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        QuestListServerPacket.PageDataHistory: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        completed_quests = []
        while reader.remaining > 0:
            completed_quests.append(reader.get_string())
            reader.next_chunk()
        result = QuestListServerPacket.PageDataHistory(completed_quests=completed_quests)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

__init__(*, page, quests_count, page_data=None)

Create a new instance of QuestListServerPacket.

Parameters:

Name Type Description Default
page QuestPage
required
quests_count int

(Value range is 0-64008.)

required
page_data PageData

Data associated with the page field.

None
Source code in src/eolib/protocol/_generated/net/server/quest_list_server_packet.py
27
28
29
30
31
32
33
34
35
36
37
38
def __init__(self, *, page: QuestPage, quests_count: int, page_data: 'QuestListServerPacket.PageData' = None):
    """
    Create a new instance of QuestListServerPacket.

    Args:
        page (QuestPage): 
        quests_count (int): (Value range is 0-64008.)
        page_data (QuestListServerPacket.PageData): Data associated with the `page` field.
    """
    self._page = page
    self._quests_count = quests_count
    self._page_data = page_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/quest_list_server_packet.py
65
66
67
68
69
70
71
72
73
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Quest

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/quest_list_server_packet.py
75
76
77
78
79
80
81
82
83
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.List

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/quest_list_server_packet.py
85
86
87
88
89
90
91
92
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.
    """
    QuestListServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of QuestListServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data QuestListServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/quest_list_server_packet.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "QuestListServerPacket") -> None:
    """
    Serializes an instance of `QuestListServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (QuestListServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._page is None:
            raise SerializationError("page must be provided.")
        writer.add_char(int(data._page))
        if data._quests_count is None:
            raise SerializationError("quests_count must be provided.")
        writer.add_short(data._quests_count)
        if data._page == QuestPage.Progress:
            if not isinstance(data._page_data, QuestListServerPacket.PageDataProgress):
                raise SerializationError("Expected page_data to be type QuestListServerPacket.PageDataProgress for page " + QuestPage(data._page).name + ".")
            QuestListServerPacket.PageDataProgress.serialize(writer, data._page_data)
        elif data._page == QuestPage.History:
            if not isinstance(data._page_data, QuestListServerPacket.PageDataHistory):
                raise SerializationError("Expected page_data to be type QuestListServerPacket.PageDataHistory for page " + QuestPage(data._page).name + ".")
            QuestListServerPacket.PageDataHistory.serialize(writer, data._page_data)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of QuestListServerPacket 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
QuestListServerPacket 'QuestListServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/quest_list_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "QuestListServerPacket":
    """
    Deserializes an instance of `QuestListServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        QuestListServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        page = QuestPage(reader.get_char())
        quests_count = reader.get_short()
        page_data: QuestListServerPacket.PageData = None
        if page == QuestPage.Progress:
            page_data = QuestListServerPacket.PageDataProgress.deserialize(reader)
        elif page == QuestPage.History:
            page_data = QuestListServerPacket.PageDataHistory.deserialize(reader)
        reader.chunked_reading_mode = False
        result = QuestListServerPacket(page=page, quests_count=quests_count, page_data=page_data)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

QuestDialogServerPacket

Bases: Packet

Quest selection dialog

Source code in src/eolib/protocol/_generated/net/server/quest_dialog_server_packet.py
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
class QuestDialogServerPacket(Packet):
    """
    Quest selection dialog
    """
    _byte_size: int = 0
    _quest_count: int
    _behavior_id: int
    _quest_id: int
    _session_id: int
    _dialog_id: int
    _quest_entries: tuple[DialogQuestEntry, ...]
    _dialog_entries: tuple[DialogEntry, ...]

    def __init__(self, *, behavior_id: int, quest_id: int, session_id: int, dialog_id: int, quest_entries: Iterable[DialogQuestEntry], dialog_entries: Iterable[DialogEntry]):
        """
        Create a new instance of QuestDialogServerPacket.

        Args:
            behavior_id (int): (Value range is 0-64008.)
            quest_id (int): (Value range is 0-64008.)
            session_id (int): (Value range is 0-64008.)
            dialog_id (int): (Value range is 0-64008.)
            quest_entries (Iterable[DialogQuestEntry]): (Length must be 252 or less.)
            dialog_entries (Iterable[DialogEntry]): 
        """
        self._behavior_id = behavior_id
        self._quest_id = quest_id
        self._session_id = session_id
        self._dialog_id = dialog_id
        self._quest_entries = tuple(quest_entries)
        self._quest_count = len(self._quest_entries)
        self._dialog_entries = tuple(dialog_entries)

    @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 behavior_id(self) -> int:
        return self._behavior_id

    @property
    def quest_id(self) -> int:
        return self._quest_id

    @property
    def session_id(self) -> int:
        return self._session_id

    @property
    def dialog_id(self) -> int:
        return self._dialog_id

    @property
    def quest_entries(self) -> tuple[DialogQuestEntry, ...]:
        return self._quest_entries

    @property
    def dialog_entries(self) -> tuple[DialogEntry, ...]:
        return self._dialog_entries

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Quest

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Dialog

    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.
        """
        QuestDialogServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "QuestDialogServerPacket") -> None:
        """
        Serializes an instance of `QuestDialogServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (QuestDialogServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._quest_count is None:
                raise SerializationError("quest_count must be provided.")
            writer.add_char(data._quest_count)
            if data._behavior_id is None:
                raise SerializationError("behavior_id must be provided.")
            writer.add_short(data._behavior_id)
            if data._quest_id is None:
                raise SerializationError("quest_id must be provided.")
            writer.add_short(data._quest_id)
            if data._session_id is None:
                raise SerializationError("session_id must be provided.")
            writer.add_short(data._session_id)
            if data._dialog_id is None:
                raise SerializationError("dialog_id must be provided.")
            writer.add_short(data._dialog_id)
            writer.add_byte(0xFF)
            if data._quest_entries is None:
                raise SerializationError("quest_entries must be provided.")
            if len(data._quest_entries) > 252:
                raise SerializationError(f"Expected length of quest_entries to be 252 or less, got {len(data._quest_entries)}.")
            for i in range(data._quest_count):
                DialogQuestEntry.serialize(writer, data._quest_entries[i])
                writer.add_byte(0xFF)
            if data._dialog_entries is None:
                raise SerializationError("dialog_entries must be provided.")
            for i in range(len(data._dialog_entries)):
                DialogEntry.serialize(writer, data._dialog_entries[i])
                writer.add_byte(0xFF)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "QuestDialogServerPacket":
        """
        Deserializes an instance of `QuestDialogServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            QuestDialogServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            quest_count = reader.get_char()
            behavior_id = reader.get_short()
            quest_id = reader.get_short()
            session_id = reader.get_short()
            dialog_id = reader.get_short()
            reader.next_chunk()
            quest_entries = []
            for i in range(quest_count):
                quest_entries.append(DialogQuestEntry.deserialize(reader))
                reader.next_chunk()
            dialog_entries = []
            while reader.remaining > 0:
                dialog_entries.append(DialogEntry.deserialize(reader))
                reader.next_chunk()
            reader.chunked_reading_mode = False
            result = QuestDialogServerPacket(behavior_id=behavior_id, quest_id=quest_id, session_id=session_id, dialog_id=dialog_id, quest_entries=quest_entries, dialog_entries=dialog_entries)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"QuestDialogServerPacket(byte_size={repr(self._byte_size)}, behavior_id={repr(self._behavior_id)}, quest_id={repr(self._quest_id)}, session_id={repr(self._session_id)}, dialog_id={repr(self._dialog_id)}, quest_entries={repr(self._quest_entries)}, dialog_entries={repr(self._dialog_entries)})"

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.

behavior_id: int property

quest_id: int property

session_id: int property

dialog_id: int property

quest_entries: tuple[DialogQuestEntry, ...] property

dialog_entries: tuple[DialogEntry, ...] property

__init__(*, behavior_id, quest_id, session_id, dialog_id, quest_entries, dialog_entries)

Create a new instance of QuestDialogServerPacket.

Parameters:

Name Type Description Default
behavior_id int

(Value range is 0-64008.)

required
quest_id int

(Value range is 0-64008.)

required
session_id int

(Value range is 0-64008.)

required
dialog_id int

(Value range is 0-64008.)

required
quest_entries Iterable[DialogQuestEntry]

(Length must be 252 or less.)

required
dialog_entries Iterable[DialogEntry]
required
Source code in src/eolib/protocol/_generated/net/server/quest_dialog_server_packet.py
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
def __init__(self, *, behavior_id: int, quest_id: int, session_id: int, dialog_id: int, quest_entries: Iterable[DialogQuestEntry], dialog_entries: Iterable[DialogEntry]):
    """
    Create a new instance of QuestDialogServerPacket.

    Args:
        behavior_id (int): (Value range is 0-64008.)
        quest_id (int): (Value range is 0-64008.)
        session_id (int): (Value range is 0-64008.)
        dialog_id (int): (Value range is 0-64008.)
        quest_entries (Iterable[DialogQuestEntry]): (Length must be 252 or less.)
        dialog_entries (Iterable[DialogEntry]): 
    """
    self._behavior_id = behavior_id
    self._quest_id = quest_id
    self._session_id = session_id
    self._dialog_id = dialog_id
    self._quest_entries = tuple(quest_entries)
    self._quest_count = len(self._quest_entries)
    self._dialog_entries = tuple(dialog_entries)

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/quest_dialog_server_packet.py
84
85
86
87
88
89
90
91
92
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Quest

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/quest_dialog_server_packet.py
 94
 95
 96
 97
 98
 99
100
101
102
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Dialog

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/quest_dialog_server_packet.py
104
105
106
107
108
109
110
111
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.
    """
    QuestDialogServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of QuestDialogServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data QuestDialogServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/quest_dialog_server_packet.py
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
@staticmethod
def serialize(writer: EoWriter, data: "QuestDialogServerPacket") -> None:
    """
    Serializes an instance of `QuestDialogServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (QuestDialogServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._quest_count is None:
            raise SerializationError("quest_count must be provided.")
        writer.add_char(data._quest_count)
        if data._behavior_id is None:
            raise SerializationError("behavior_id must be provided.")
        writer.add_short(data._behavior_id)
        if data._quest_id is None:
            raise SerializationError("quest_id must be provided.")
        writer.add_short(data._quest_id)
        if data._session_id is None:
            raise SerializationError("session_id must be provided.")
        writer.add_short(data._session_id)
        if data._dialog_id is None:
            raise SerializationError("dialog_id must be provided.")
        writer.add_short(data._dialog_id)
        writer.add_byte(0xFF)
        if data._quest_entries is None:
            raise SerializationError("quest_entries must be provided.")
        if len(data._quest_entries) > 252:
            raise SerializationError(f"Expected length of quest_entries to be 252 or less, got {len(data._quest_entries)}.")
        for i in range(data._quest_count):
            DialogQuestEntry.serialize(writer, data._quest_entries[i])
            writer.add_byte(0xFF)
        if data._dialog_entries is None:
            raise SerializationError("dialog_entries must be provided.")
        for i in range(len(data._dialog_entries)):
            DialogEntry.serialize(writer, data._dialog_entries[i])
            writer.add_byte(0xFF)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of QuestDialogServerPacket 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
QuestDialogServerPacket 'QuestDialogServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/quest_dialog_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "QuestDialogServerPacket":
    """
    Deserializes an instance of `QuestDialogServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        QuestDialogServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        quest_count = reader.get_char()
        behavior_id = reader.get_short()
        quest_id = reader.get_short()
        session_id = reader.get_short()
        dialog_id = reader.get_short()
        reader.next_chunk()
        quest_entries = []
        for i in range(quest_count):
            quest_entries.append(DialogQuestEntry.deserialize(reader))
            reader.next_chunk()
        dialog_entries = []
        while reader.remaining > 0:
            dialog_entries.append(DialogEntry.deserialize(reader))
            reader.next_chunk()
        reader.chunked_reading_mode = False
        result = QuestDialogServerPacket(behavior_id=behavior_id, quest_id=quest_id, session_id=session_id, dialog_id=dialog_id, quest_entries=quest_entries, dialog_entries=dialog_entries)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PriestRequestServerPacket

Bases: Packet

Wedding request

Source code in src/eolib/protocol/_generated/net/server/priest_request_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
class PriestRequestServerPacket(Packet):
    """
    Wedding request
    """
    _byte_size: int = 0
    _session_id: int
    _partner_name: str

    def __init__(self, *, session_id: int, partner_name: str):
        """
        Create a new instance of PriestRequestServerPacket.

        Args:
            session_id (int): (Value range is 0-64008.)
            partner_name (str): 
        """
        self._session_id = session_id
        self._partner_name = partner_name

    @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:
        return self._session_id

    @property
    def partner_name(self) -> str:
        return self._partner_name

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Priest

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Request

    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.
        """
        PriestRequestServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PriestRequestServerPacket") -> None:
        """
        Serializes an instance of `PriestRequestServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PriestRequestServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._session_id is None:
                raise SerializationError("session_id must be provided.")
            writer.add_short(data._session_id)
            if data._partner_name is None:
                raise SerializationError("partner_name must be provided.")
            writer.add_string(data._partner_name)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PriestRequestServerPacket":
        """
        Deserializes an instance of `PriestRequestServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PriestRequestServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            session_id = reader.get_short()
            partner_name = reader.get_string()
            result = PriestRequestServerPacket(session_id=session_id, partner_name=partner_name)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PriestRequestServerPacket(byte_size={repr(self._byte_size)}, session_id={repr(self._session_id)}, partner_name={repr(self._partner_name)})"

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

partner_name: str property

__init__(*, session_id, partner_name)

Create a new instance of PriestRequestServerPacket.

Parameters:

Name Type Description Default
session_id int

(Value range is 0-64008.)

required
partner_name str
required
Source code in src/eolib/protocol/_generated/net/server/priest_request_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, session_id: int, partner_name: str):
    """
    Create a new instance of PriestRequestServerPacket.

    Args:
        session_id (int): (Value range is 0-64008.)
        partner_name (str): 
    """
    self._session_id = session_id
    self._partner_name = partner_name

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/priest_request_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Priest

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/priest_request_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Request

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/priest_request_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    PriestRequestServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PriestRequestServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PriestRequestServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/priest_request_server_packet.py
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@staticmethod
def serialize(writer: EoWriter, data: "PriestRequestServerPacket") -> None:
    """
    Serializes an instance of `PriestRequestServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PriestRequestServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._session_id is None:
            raise SerializationError("session_id must be provided.")
        writer.add_short(data._session_id)
        if data._partner_name is None:
            raise SerializationError("partner_name must be provided.")
        writer.add_string(data._partner_name)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PriestRequestServerPacket 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
PriestRequestServerPacket PriestRequestServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/priest_request_server_packet.py
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@staticmethod
def deserialize(reader: EoReader) -> "PriestRequestServerPacket":
    """
    Deserializes an instance of `PriestRequestServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PriestRequestServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        session_id = reader.get_short()
        partner_name = reader.get_string()
        result = PriestRequestServerPacket(session_id=session_id, partner_name=partner_name)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PriestReplyServerPacket

Bases: Packet

Reply to client Priest-family packets

Source code in src/eolib/protocol/_generated/net/server/priest_reply_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
class PriestReplyServerPacket(Packet):
    """
    Reply to client Priest-family packets
    """
    _byte_size: int = 0
    _reply_code: PriestReply

    def __init__(self, *, reply_code: PriestReply):
        """
        Create a new instance of PriestReplyServerPacket.

        Args:
            reply_code (PriestReply): 
        """
        self._reply_code = reply_code

    @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) -> PriestReply:
        return self._reply_code

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Priest

    @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.
        """
        PriestReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PriestReplyServerPacket") -> None:
        """
        Serializes an instance of `PriestReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PriestReplyServerPacket): 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))
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PriestReplyServerPacket":
        """
        Deserializes an instance of `PriestReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PriestReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reply_code = PriestReply(reader.get_short())
            result = PriestReplyServerPacket(reply_code=reply_code)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PriestReplyServerPacket(byte_size={repr(self._byte_size)}, reply_code={repr(self._reply_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.

reply_code: PriestReply property

__init__(*, reply_code)

Create a new instance of PriestReplyServerPacket.

Parameters:

Name Type Description Default
reply_code PriestReply
required
Source code in src/eolib/protocol/_generated/net/server/priest_reply_server_packet.py
21
22
23
24
25
26
27
28
def __init__(self, *, reply_code: PriestReply):
    """
    Create a new instance of PriestReplyServerPacket.

    Args:
        reply_code (PriestReply): 
    """
    self._reply_code = reply_code

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/priest_reply_server_packet.py
44
45
46
47
48
49
50
51
52
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Priest

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/priest_reply_server_packet.py
54
55
56
57
58
59
60
61
62
@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/priest_reply_server_packet.py
64
65
66
67
68
69
70
71
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.
    """
    PriestReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PriestReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PriestReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/priest_reply_server_packet.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@staticmethod
def serialize(writer: EoWriter, data: "PriestReplyServerPacket") -> None:
    """
    Serializes an instance of `PriestReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PriestReplyServerPacket): 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))
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PriestReplyServerPacket 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
PriestReplyServerPacket PriestReplyServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/priest_reply_server_packet.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@staticmethod
def deserialize(reader: EoReader) -> "PriestReplyServerPacket":
    """
    Deserializes an instance of `PriestReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PriestReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reply_code = PriestReply(reader.get_short())
        result = PriestReplyServerPacket(reply_code=reply_code)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PriestReply

Bases: IntEnum

Reply code sent with PRIEST_REPLY packet

Source code in src/eolib/protocol/_generated/net/server/priest_reply.py
 9
10
11
12
13
14
15
16
17
18
19
20
class PriestReply(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Reply code sent with PRIEST_REPLY packet
    """
    NotDressed = 1
    LowLevel = 2
    PartnerNotPresent = 3
    PartnerNotDressed = 4
    Busy = 5
    DoYou = 6
    PartnerAlreadyMarried = 7
    NoPermission = 8

NotDressed = 1 class-attribute instance-attribute

LowLevel = 2 class-attribute instance-attribute

PartnerNotPresent = 3 class-attribute instance-attribute

PartnerNotDressed = 4 class-attribute instance-attribute

Busy = 5 class-attribute instance-attribute

DoYou = 6 class-attribute instance-attribute

PartnerAlreadyMarried = 7 class-attribute instance-attribute

NoPermission = 8 class-attribute instance-attribute

PriestOpenServerPacket

Bases: Packet

Response from talking to a priest NPC

Source code in src/eolib/protocol/_generated/net/server/priest_open_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class PriestOpenServerPacket(Packet):
    """
    Response from talking to a priest NPC
    """
    _byte_size: int = 0
    _session_id: int

    def __init__(self, *, session_id: int):
        """
        Create a new instance of PriestOpenServerPacket.

        Args:
            session_id (int): (Value range is 0-4097152080.)
        """
        self._session_id = session_id

    @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:
        return self._session_id

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Priest

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Open

    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.
        """
        PriestOpenServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PriestOpenServerPacket") -> None:
        """
        Serializes an instance of `PriestOpenServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PriestOpenServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._session_id is None:
                raise SerializationError("session_id must be provided.")
            writer.add_int(data._session_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PriestOpenServerPacket":
        """
        Deserializes an instance of `PriestOpenServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PriestOpenServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            session_id = reader.get_int()
            result = PriestOpenServerPacket(session_id=session_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PriestOpenServerPacket(byte_size={repr(self._byte_size)}, session_id={repr(self._session_id)})"

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

__init__(*, session_id)

Create a new instance of PriestOpenServerPacket.

Parameters:

Name Type Description Default
session_id int

(Value range is 0-4097152080.)

required
Source code in src/eolib/protocol/_generated/net/server/priest_open_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, session_id: int):
    """
    Create a new instance of PriestOpenServerPacket.

    Args:
        session_id (int): (Value range is 0-4097152080.)
    """
    self._session_id = session_id

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/priest_open_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Priest

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/priest_open_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Open

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/priest_open_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    PriestOpenServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PriestOpenServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PriestOpenServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/priest_open_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "PriestOpenServerPacket") -> None:
    """
    Serializes an instance of `PriestOpenServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PriestOpenServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._session_id is None:
            raise SerializationError("session_id must be provided.")
        writer.add_int(data._session_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PriestOpenServerPacket 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
PriestOpenServerPacket PriestOpenServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/priest_open_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "PriestOpenServerPacket":
    """
    Deserializes an instance of `PriestOpenServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PriestOpenServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        session_id = reader.get_int()
        result = PriestOpenServerPacket(session_id=session_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PlayersReplyServerPacket

Bases: Packet

Equivalent to INIT_INIT with InitReply.PlayersListFriends

Source code in src/eolib/protocol/_generated/net/server/players_reply_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
class PlayersReplyServerPacket(Packet):
    """
    Equivalent to INIT_INIT with InitReply.PlayersListFriends
    """
    _byte_size: int = 0
    _players_list: PlayersListFriends

    def __init__(self, *, players_list: PlayersListFriends):
        """
        Create a new instance of PlayersReplyServerPacket.

        Args:
            players_list (PlayersListFriends): 
        """
        self._players_list = players_list

    @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 players_list(self) -> PlayersListFriends:
        return self._players_list

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Players

    @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.
        """
        PlayersReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PlayersReplyServerPacket") -> None:
        """
        Serializes an instance of `PlayersReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PlayersReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._players_list is None:
                raise SerializationError("players_list must be provided.")
            PlayersListFriends.serialize(writer, data._players_list)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PlayersReplyServerPacket":
        """
        Deserializes an instance of `PlayersReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PlayersReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            players_list = PlayersListFriends.deserialize(reader)
            reader.chunked_reading_mode = False
            result = PlayersReplyServerPacket(players_list=players_list)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PlayersReplyServerPacket(byte_size={repr(self._byte_size)}, players_list={repr(self._players_list)})"

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.

players_list: PlayersListFriends property

__init__(*, players_list)

Create a new instance of PlayersReplyServerPacket.

Parameters:

Name Type Description Default
players_list PlayersListFriends
required
Source code in src/eolib/protocol/_generated/net/server/players_reply_server_packet.py
21
22
23
24
25
26
27
28
def __init__(self, *, players_list: PlayersListFriends):
    """
    Create a new instance of PlayersReplyServerPacket.

    Args:
        players_list (PlayersListFriends): 
    """
    self._players_list = players_list

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/players_reply_server_packet.py
44
45
46
47
48
49
50
51
52
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Players

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/players_reply_server_packet.py
54
55
56
57
58
59
60
61
62
@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/players_reply_server_packet.py
64
65
66
67
68
69
70
71
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.
    """
    PlayersReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PlayersReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PlayersReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/players_reply_server_packet.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
@staticmethod
def serialize(writer: EoWriter, data: "PlayersReplyServerPacket") -> None:
    """
    Serializes an instance of `PlayersReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PlayersReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._players_list is None:
            raise SerializationError("players_list must be provided.")
        PlayersListFriends.serialize(writer, data._players_list)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PlayersReplyServerPacket 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
PlayersReplyServerPacket PlayersReplyServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/players_reply_server_packet.py
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
@staticmethod
def deserialize(reader: EoReader) -> "PlayersReplyServerPacket":
    """
    Deserializes an instance of `PlayersReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PlayersReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        players_list = PlayersListFriends.deserialize(reader)
        reader.chunked_reading_mode = False
        result = PlayersReplyServerPacket(players_list=players_list)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PlayersRemoveServerPacket

Bases: Packet

Nearby player has logged out

Source code in src/eolib/protocol/_generated/net/server/players_remove_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class PlayersRemoveServerPacket(Packet):
    """
    Nearby player has logged out
    """
    _byte_size: int = 0
    _player_id: int

    def __init__(self, *, player_id: int):
        """
        Create a new instance of PlayersRemoveServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
        """
        self._player_id = player_id

    @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 player_id(self) -> int:
        return self._player_id

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Players

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Remove

    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.
        """
        PlayersRemoveServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PlayersRemoveServerPacket") -> None:
        """
        Serializes an instance of `PlayersRemoveServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PlayersRemoveServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PlayersRemoveServerPacket":
        """
        Deserializes an instance of `PlayersRemoveServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PlayersRemoveServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            result = PlayersRemoveServerPacket(player_id=player_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PlayersRemoveServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)})"

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.

player_id: int property

__init__(*, player_id)

Create a new instance of PlayersRemoveServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/players_remove_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, player_id: int):
    """
    Create a new instance of PlayersRemoveServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
    """
    self._player_id = player_id

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/players_remove_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Players

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/players_remove_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Remove

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/players_remove_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    PlayersRemoveServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PlayersRemoveServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PlayersRemoveServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/players_remove_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "PlayersRemoveServerPacket") -> None:
    """
    Serializes an instance of `PlayersRemoveServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PlayersRemoveServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PlayersRemoveServerPacket 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
PlayersRemoveServerPacket PlayersRemoveServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/players_remove_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "PlayersRemoveServerPacket":
    """
    Deserializes an instance of `PlayersRemoveServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PlayersRemoveServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        result = PlayersRemoveServerPacket(player_id=player_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PlayersPongServerPacket

Bases: Packet

find command reply - same map

Source code in src/eolib/protocol/_generated/net/server/players_pong_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class PlayersPongServerPacket(Packet):
    """
    #find command reply - same map
    """
    _byte_size: int = 0
    _name: str

    def __init__(self, *, name: str):
        """
        Create a new instance of PlayersPongServerPacket.

        Args:
            name (str): 
        """
        self._name = name

    @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 name(self) -> str:
        return self._name

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Players

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Pong

    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.
        """
        PlayersPongServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PlayersPongServerPacket") -> None:
        """
        Serializes an instance of `PlayersPongServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PlayersPongServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._name is None:
                raise SerializationError("name must be provided.")
            writer.add_string(data._name)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PlayersPongServerPacket":
        """
        Deserializes an instance of `PlayersPongServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PlayersPongServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            name = reader.get_string()
            result = PlayersPongServerPacket(name=name)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PlayersPongServerPacket(byte_size={repr(self._byte_size)}, name={repr(self._name)})"

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.

name: str property

__init__(*, name)

Create a new instance of PlayersPongServerPacket.

Parameters:

Name Type Description Default
name str
required
Source code in src/eolib/protocol/_generated/net/server/players_pong_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, name: str):
    """
    Create a new instance of PlayersPongServerPacket.

    Args:
        name (str): 
    """
    self._name = name

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/players_pong_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Players

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/players_pong_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Pong

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/players_pong_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    PlayersPongServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PlayersPongServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PlayersPongServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/players_pong_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "PlayersPongServerPacket") -> None:
    """
    Serializes an instance of `PlayersPongServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PlayersPongServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._name is None:
            raise SerializationError("name must be provided.")
        writer.add_string(data._name)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PlayersPongServerPacket 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
PlayersPongServerPacket PlayersPongServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/players_pong_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "PlayersPongServerPacket":
    """
    Deserializes an instance of `PlayersPongServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PlayersPongServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        name = reader.get_string()
        result = PlayersPongServerPacket(name=name)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PlayersPingServerPacket

Bases: Packet

find command reply - offline

Source code in src/eolib/protocol/_generated/net/server/players_ping_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class PlayersPingServerPacket(Packet):
    """
    #find command reply - offline
    """
    _byte_size: int = 0
    _name: str

    def __init__(self, *, name: str):
        """
        Create a new instance of PlayersPingServerPacket.

        Args:
            name (str): 
        """
        self._name = name

    @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 name(self) -> str:
        return self._name

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Players

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Ping

    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.
        """
        PlayersPingServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PlayersPingServerPacket") -> None:
        """
        Serializes an instance of `PlayersPingServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PlayersPingServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._name is None:
                raise SerializationError("name must be provided.")
            writer.add_string(data._name)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PlayersPingServerPacket":
        """
        Deserializes an instance of `PlayersPingServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PlayersPingServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            name = reader.get_string()
            result = PlayersPingServerPacket(name=name)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PlayersPingServerPacket(byte_size={repr(self._byte_size)}, name={repr(self._name)})"

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.

name: str property

__init__(*, name)

Create a new instance of PlayersPingServerPacket.

Parameters:

Name Type Description Default
name str
required
Source code in src/eolib/protocol/_generated/net/server/players_ping_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, name: str):
    """
    Create a new instance of PlayersPingServerPacket.

    Args:
        name (str): 
    """
    self._name = name

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/players_ping_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Players

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/players_ping_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Ping

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/players_ping_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    PlayersPingServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PlayersPingServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PlayersPingServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/players_ping_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "PlayersPingServerPacket") -> None:
    """
    Serializes an instance of `PlayersPingServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PlayersPingServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._name is None:
            raise SerializationError("name must be provided.")
        writer.add_string(data._name)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PlayersPingServerPacket 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
PlayersPingServerPacket PlayersPingServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/players_ping_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "PlayersPingServerPacket":
    """
    Deserializes an instance of `PlayersPingServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PlayersPingServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        name = reader.get_string()
        result = PlayersPingServerPacket(name=name)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PlayersNet242ServerPacket

Bases: Packet

find command reply - different map

Source code in src/eolib/protocol/_generated/net/server/players_net242_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class PlayersNet242ServerPacket(Packet):
    """
    #find command reply - different map
    """
    _byte_size: int = 0
    _name: str

    def __init__(self, *, name: str):
        """
        Create a new instance of PlayersNet242ServerPacket.

        Args:
            name (str): 
        """
        self._name = name

    @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 name(self) -> str:
        return self._name

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Players

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Net242

    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.
        """
        PlayersNet242ServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PlayersNet242ServerPacket") -> None:
        """
        Serializes an instance of `PlayersNet242ServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PlayersNet242ServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._name is None:
                raise SerializationError("name must be provided.")
            writer.add_string(data._name)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PlayersNet242ServerPacket":
        """
        Deserializes an instance of `PlayersNet242ServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PlayersNet242ServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            name = reader.get_string()
            result = PlayersNet242ServerPacket(name=name)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PlayersNet242ServerPacket(byte_size={repr(self._byte_size)}, name={repr(self._name)})"

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.

name: str property

__init__(*, name)

Create a new instance of PlayersNet242ServerPacket.

Parameters:

Name Type Description Default
name str
required
Source code in src/eolib/protocol/_generated/net/server/players_net242_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, name: str):
    """
    Create a new instance of PlayersNet242ServerPacket.

    Args:
        name (str): 
    """
    self._name = name

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/players_net242_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Players

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/players_net242_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Net242

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/players_net242_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    PlayersNet242ServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PlayersNet242ServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PlayersNet242ServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/players_net242_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "PlayersNet242ServerPacket") -> None:
    """
    Serializes an instance of `PlayersNet242ServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PlayersNet242ServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._name is None:
            raise SerializationError("name must be provided.")
        writer.add_string(data._name)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PlayersNet242ServerPacket 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
PlayersNet242ServerPacket PlayersNet242ServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/players_net242_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "PlayersNet242ServerPacket":
    """
    Deserializes an instance of `PlayersNet242ServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PlayersNet242ServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        name = reader.get_string()
        result = PlayersNet242ServerPacket(name=name)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PlayersListServerPacket

Bases: Packet

Equivalent to INIT_INIT with InitReply.PlayersList

Source code in src/eolib/protocol/_generated/net/server/players_list_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
class PlayersListServerPacket(Packet):
    """
    Equivalent to INIT_INIT with InitReply.PlayersList
    """
    _byte_size: int = 0
    _players_list: PlayersList

    def __init__(self, *, players_list: PlayersList):
        """
        Create a new instance of PlayersListServerPacket.

        Args:
            players_list (PlayersList): 
        """
        self._players_list = players_list

    @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 players_list(self) -> PlayersList:
        return self._players_list

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Players

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.List

    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.
        """
        PlayersListServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PlayersListServerPacket") -> None:
        """
        Serializes an instance of `PlayersListServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PlayersListServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._players_list is None:
                raise SerializationError("players_list must be provided.")
            PlayersList.serialize(writer, data._players_list)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PlayersListServerPacket":
        """
        Deserializes an instance of `PlayersListServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PlayersListServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            players_list = PlayersList.deserialize(reader)
            reader.chunked_reading_mode = False
            result = PlayersListServerPacket(players_list=players_list)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PlayersListServerPacket(byte_size={repr(self._byte_size)}, players_list={repr(self._players_list)})"

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.

players_list: PlayersList property

__init__(*, players_list)

Create a new instance of PlayersListServerPacket.

Parameters:

Name Type Description Default
players_list PlayersList
required
Source code in src/eolib/protocol/_generated/net/server/players_list_server_packet.py
21
22
23
24
25
26
27
28
def __init__(self, *, players_list: PlayersList):
    """
    Create a new instance of PlayersListServerPacket.

    Args:
        players_list (PlayersList): 
    """
    self._players_list = players_list

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/players_list_server_packet.py
44
45
46
47
48
49
50
51
52
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Players

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/players_list_server_packet.py
54
55
56
57
58
59
60
61
62
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.List

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/players_list_server_packet.py
64
65
66
67
68
69
70
71
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.
    """
    PlayersListServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PlayersListServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PlayersListServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/players_list_server_packet.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
@staticmethod
def serialize(writer: EoWriter, data: "PlayersListServerPacket") -> None:
    """
    Serializes an instance of `PlayersListServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PlayersListServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._players_list is None:
            raise SerializationError("players_list must be provided.")
        PlayersList.serialize(writer, data._players_list)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PlayersListServerPacket 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
PlayersListServerPacket PlayersListServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/players_list_server_packet.py
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
@staticmethod
def deserialize(reader: EoReader) -> "PlayersListServerPacket":
    """
    Deserializes an instance of `PlayersListServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PlayersListServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        players_list = PlayersList.deserialize(reader)
        reader.chunked_reading_mode = False
        result = PlayersListServerPacket(players_list=players_list)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PlayersAgreeServerPacket

Bases: Packet

Player has appeared in nearby view

Source code in src/eolib/protocol/_generated/net/server/players_agree_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
class PlayersAgreeServerPacket(Packet):
    """
    Player has appeared in nearby view
    """
    _byte_size: int = 0
    _nearby: NearbyInfo

    def __init__(self, *, nearby: NearbyInfo):
        """
        Create a new instance of PlayersAgreeServerPacket.

        Args:
            nearby (NearbyInfo): 
        """
        self._nearby = nearby

    @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 nearby(self) -> NearbyInfo:
        return self._nearby

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Players

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Agree

    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.
        """
        PlayersAgreeServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PlayersAgreeServerPacket") -> None:
        """
        Serializes an instance of `PlayersAgreeServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PlayersAgreeServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._nearby is None:
                raise SerializationError("nearby must be provided.")
            NearbyInfo.serialize(writer, data._nearby)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PlayersAgreeServerPacket":
        """
        Deserializes an instance of `PlayersAgreeServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PlayersAgreeServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            nearby = NearbyInfo.deserialize(reader)
            result = PlayersAgreeServerPacket(nearby=nearby)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PlayersAgreeServerPacket(byte_size={repr(self._byte_size)}, 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.

nearby: NearbyInfo property

__init__(*, nearby)

Create a new instance of PlayersAgreeServerPacket.

Parameters:

Name Type Description Default
nearby NearbyInfo
required
Source code in src/eolib/protocol/_generated/net/server/players_agree_server_packet.py
21
22
23
24
25
26
27
28
def __init__(self, *, nearby: NearbyInfo):
    """
    Create a new instance of PlayersAgreeServerPacket.

    Args:
        nearby (NearbyInfo): 
    """
    self._nearby = nearby

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/players_agree_server_packet.py
44
45
46
47
48
49
50
51
52
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Players

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/players_agree_server_packet.py
54
55
56
57
58
59
60
61
62
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Agree

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/players_agree_server_packet.py
64
65
66
67
68
69
70
71
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.
    """
    PlayersAgreeServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PlayersAgreeServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PlayersAgreeServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/players_agree_server_packet.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@staticmethod
def serialize(writer: EoWriter, data: "PlayersAgreeServerPacket") -> None:
    """
    Serializes an instance of `PlayersAgreeServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PlayersAgreeServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._nearby is None:
            raise SerializationError("nearby must be provided.")
        NearbyInfo.serialize(writer, data._nearby)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PlayersAgreeServerPacket 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
PlayersAgreeServerPacket PlayersAgreeServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/players_agree_server_packet.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@staticmethod
def deserialize(reader: EoReader) -> "PlayersAgreeServerPacket":
    """
    Deserializes an instance of `PlayersAgreeServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PlayersAgreeServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        nearby = NearbyInfo.deserialize(reader)
        result = PlayersAgreeServerPacket(nearby=nearby)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PartyTargetGroupServerPacket

Bases: Packet

Updated experience and level-ups from party experience

Source code in src/eolib/protocol/_generated/net/server/party_target_group_server_packet.py
 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
class PartyTargetGroupServerPacket(Packet):
    """
    Updated experience and level-ups from party experience
    """
    _byte_size: int = 0
    _gains: tuple[PartyExpShare, ...]

    def __init__(self, *, gains: Iterable[PartyExpShare]):
        """
        Create a new instance of PartyTargetGroupServerPacket.

        Args:
            gains (Iterable[PartyExpShare]): 
        """
        self._gains = tuple(gains)

    @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 gains(self) -> tuple[PartyExpShare, ...]:
        return self._gains

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Party

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.TargetGroup

    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.
        """
        PartyTargetGroupServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PartyTargetGroupServerPacket") -> None:
        """
        Serializes an instance of `PartyTargetGroupServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PartyTargetGroupServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._gains is None:
                raise SerializationError("gains must be provided.")
            for i in range(len(data._gains)):
                PartyExpShare.serialize(writer, data._gains[i])
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PartyTargetGroupServerPacket":
        """
        Deserializes an instance of `PartyTargetGroupServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PartyTargetGroupServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            gains_length = int(reader.remaining / 7)
            gains = []
            for i in range(gains_length):
                gains.append(PartyExpShare.deserialize(reader))
            result = PartyTargetGroupServerPacket(gains=gains)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PartyTargetGroupServerPacket(byte_size={repr(self._byte_size)}, gains={repr(self._gains)})"

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.

gains: tuple[PartyExpShare, ...] property

__init__(*, gains)

Create a new instance of PartyTargetGroupServerPacket.

Parameters:

Name Type Description Default
gains Iterable[PartyExpShare]
required
Source code in src/eolib/protocol/_generated/net/server/party_target_group_server_packet.py
23
24
25
26
27
28
29
30
def __init__(self, *, gains: Iterable[PartyExpShare]):
    """
    Create a new instance of PartyTargetGroupServerPacket.

    Args:
        gains (Iterable[PartyExpShare]): 
    """
    self._gains = tuple(gains)

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/party_target_group_server_packet.py
46
47
48
49
50
51
52
53
54
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Party

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/party_target_group_server_packet.py
56
57
58
59
60
61
62
63
64
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.TargetGroup

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/party_target_group_server_packet.py
66
67
68
69
70
71
72
73
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.
    """
    PartyTargetGroupServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PartyTargetGroupServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PartyTargetGroupServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/party_target_group_server_packet.py
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
@staticmethod
def serialize(writer: EoWriter, data: "PartyTargetGroupServerPacket") -> None:
    """
    Serializes an instance of `PartyTargetGroupServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PartyTargetGroupServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._gains is None:
            raise SerializationError("gains must be provided.")
        for i in range(len(data._gains)):
            PartyExpShare.serialize(writer, data._gains[i])
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PartyTargetGroupServerPacket 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
PartyTargetGroupServerPacket 'PartyTargetGroupServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/party_target_group_server_packet.py
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
@staticmethod
def deserialize(reader: EoReader) -> "PartyTargetGroupServerPacket":
    """
    Deserializes an instance of `PartyTargetGroupServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PartyTargetGroupServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        gains_length = int(reader.remaining / 7)
        gains = []
        for i in range(gains_length):
            gains.append(PartyExpShare.deserialize(reader))
        result = PartyTargetGroupServerPacket(gains=gains)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PartyRequestType

Bases: IntEnum

Whether a player is requesting to join a party, or inviting someone to join theirs

Source code in src/eolib/protocol/_generated/net/party_request_type.py
 9
10
11
12
13
14
class PartyRequestType(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Whether a player is requesting to join a party, or inviting someone to join theirs
    """
    Join = 0
    Invite = 1

Join = 0 class-attribute instance-attribute

Invite = 1 class-attribute instance-attribute

PartyRequestServerPacket

Bases: Packet

Received party invite / join request

Source code in src/eolib/protocol/_generated/net/server/party_request_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
class PartyRequestServerPacket(Packet):
    """
    Received party invite / join request
    """
    _byte_size: int = 0
    _request_type: PartyRequestType
    _inviter_player_id: int
    _player_name: str

    def __init__(self, *, request_type: PartyRequestType, inviter_player_id: int, player_name: str):
        """
        Create a new instance of PartyRequestServerPacket.

        Args:
            request_type (PartyRequestType): 
            inviter_player_id (int): (Value range is 0-64008.)
            player_name (str): 
        """
        self._request_type = request_type
        self._inviter_player_id = inviter_player_id
        self._player_name = player_name

    @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 request_type(self) -> PartyRequestType:
        return self._request_type

    @property
    def inviter_player_id(self) -> int:
        return self._inviter_player_id

    @property
    def player_name(self) -> str:
        return self._player_name

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Party

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Request

    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.
        """
        PartyRequestServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PartyRequestServerPacket") -> None:
        """
        Serializes an instance of `PartyRequestServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PartyRequestServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._request_type is None:
                raise SerializationError("request_type must be provided.")
            writer.add_char(int(data._request_type))
            if data._inviter_player_id is None:
                raise SerializationError("inviter_player_id must be provided.")
            writer.add_short(data._inviter_player_id)
            if data._player_name is None:
                raise SerializationError("player_name must be provided.")
            writer.add_string(data._player_name)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PartyRequestServerPacket":
        """
        Deserializes an instance of `PartyRequestServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PartyRequestServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            request_type = PartyRequestType(reader.get_char())
            inviter_player_id = reader.get_short()
            player_name = reader.get_string()
            result = PartyRequestServerPacket(request_type=request_type, inviter_player_id=inviter_player_id, player_name=player_name)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PartyRequestServerPacket(byte_size={repr(self._byte_size)}, request_type={repr(self._request_type)}, inviter_player_id={repr(self._inviter_player_id)}, player_name={repr(self._player_name)})"

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.

request_type: PartyRequestType property

inviter_player_id: int property

player_name: str property

__init__(*, request_type, inviter_player_id, player_name)

Create a new instance of PartyRequestServerPacket.

Parameters:

Name Type Description Default
request_type PartyRequestType
required
inviter_player_id int

(Value range is 0-64008.)

required
player_name str
required
Source code in src/eolib/protocol/_generated/net/server/party_request_server_packet.py
23
24
25
26
27
28
29
30
31
32
33
34
def __init__(self, *, request_type: PartyRequestType, inviter_player_id: int, player_name: str):
    """
    Create a new instance of PartyRequestServerPacket.

    Args:
        request_type (PartyRequestType): 
        inviter_player_id (int): (Value range is 0-64008.)
        player_name (str): 
    """
    self._request_type = request_type
    self._inviter_player_id = inviter_player_id
    self._player_name = player_name

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/party_request_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.Party

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/party_request_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.Request

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/party_request_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.
    """
    PartyRequestServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PartyRequestServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PartyRequestServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/party_request_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
@staticmethod
def serialize(writer: EoWriter, data: "PartyRequestServerPacket") -> None:
    """
    Serializes an instance of `PartyRequestServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PartyRequestServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._request_type is None:
            raise SerializationError("request_type must be provided.")
        writer.add_char(int(data._request_type))
        if data._inviter_player_id is None:
            raise SerializationError("inviter_player_id must be provided.")
        writer.add_short(data._inviter_player_id)
        if data._player_name is None:
            raise SerializationError("player_name must be provided.")
        writer.add_string(data._player_name)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PartyRequestServerPacket 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
PartyRequestServerPacket PartyRequestServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/party_request_server_packet.py
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
@staticmethod
def deserialize(reader: EoReader) -> "PartyRequestServerPacket":
    """
    Deserializes an instance of `PartyRequestServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PartyRequestServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        request_type = PartyRequestType(reader.get_char())
        inviter_player_id = reader.get_short()
        player_name = reader.get_string()
        result = PartyRequestServerPacket(request_type=request_type, inviter_player_id=inviter_player_id, player_name=player_name)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PartyReplyServerPacket

Bases: Packet

Failed party invite / join request

Source code in src/eolib/protocol/_generated/net/server/party_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
class PartyReplyServerPacket(Packet):
    """
    Failed party invite / join request
    """
    _byte_size: int = 0
    _reply_code: PartyReplyCode
    _reply_code_data: 'PartyReplyServerPacket.ReplyCodeData'

    def __init__(self, *, reply_code: PartyReplyCode, reply_code_data: 'PartyReplyServerPacket.ReplyCodeData' = None):
        """
        Create a new instance of PartyReplyServerPacket.

        Args:
            reply_code (PartyReplyCode): 
            reply_code_data (PartyReplyServerPacket.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) -> PartyReplyCode:
        return self._reply_code

    @property
    def reply_code_data(self) -> 'PartyReplyServerPacket.ReplyCodeData':
        """
        PartyReplyServerPacket.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.Party

    @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.
        """
        PartyReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PartyReplyServerPacket") -> None:
        """
        Serializes an instance of `PartyReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PartyReplyServerPacket): 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_char(int(data._reply_code))
            if data._reply_code == PartyReplyCode.AlreadyInAnotherParty:
                if not isinstance(data._reply_code_data, PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty):
                    raise SerializationError("Expected reply_code_data to be type PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty for reply_code " + PartyReplyCode(data._reply_code).name + ".")
                PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty.serialize(writer, data._reply_code_data)
            elif data._reply_code == PartyReplyCode.AlreadyInYourParty:
                if not isinstance(data._reply_code_data, PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty):
                    raise SerializationError("Expected reply_code_data to be type PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty for reply_code " + PartyReplyCode(data._reply_code).name + ".")
                PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty.serialize(writer, data._reply_code_data)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PartyReplyServerPacket":
        """
        Deserializes an instance of `PartyReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PartyReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reply_code = PartyReplyCode(reader.get_char())
            reply_code_data: PartyReplyServerPacket.ReplyCodeData = None
            if reply_code == PartyReplyCode.AlreadyInAnotherParty:
                reply_code_data = PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty.deserialize(reader)
            elif reply_code == PartyReplyCode.AlreadyInYourParty:
                reply_code_data = PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty.deserialize(reader)
            result = PartyReplyServerPacket(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"PartyReplyServerPacket(byte_size={repr(self._byte_size)}, reply_code={repr(self._reply_code)}, reply_code_data={repr(self._reply_code_data)})"

    ReplyCodeData = Union['PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty', 'PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty', None]
    """
    Data associated with different values of the `reply_code` field.
    """

    class ReplyCodeDataAlreadyInAnotherParty:
        """
        Data associated with reply_code value PartyReplyCode.AlreadyInAnotherParty
        """
        _byte_size: int = 0
        _player_name: str

        def __init__(self, *, player_name: str):
            """
            Create a new instance of PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty.

            Args:
                player_name (str): 
            """
            self._player_name = player_name

        @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 player_name(self) -> str:
            return self._player_name

        @staticmethod
        def serialize(writer: EoWriter, data: "PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty") -> None:
            """
            Serializes an instance of `PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._player_name is None:
                    raise SerializationError("player_name must be provided.")
                writer.add_string(data._player_name)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty":
            """
            Deserializes an instance of `PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                player_name = reader.get_string()
                result = PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty(player_name=player_name)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty(byte_size={repr(self._byte_size)}, player_name={repr(self._player_name)})"

    class ReplyCodeDataAlreadyInYourParty:
        """
        Data associated with reply_code value PartyReplyCode.AlreadyInYourParty
        """
        _byte_size: int = 0
        _player_name: str

        def __init__(self, *, player_name: str):
            """
            Create a new instance of PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty.

            Args:
                player_name (str): 
            """
            self._player_name = player_name

        @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 player_name(self) -> str:
            return self._player_name

        @staticmethod
        def serialize(writer: EoWriter, data: "PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty") -> None:
            """
            Serializes an instance of `PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._player_name is None:
                    raise SerializationError("player_name must be provided.")
                writer.add_string(data._player_name)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty":
            """
            Deserializes an instance of `PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                player_name = reader.get_string()
                result = PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty(player_name=player_name)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty(byte_size={repr(self._byte_size)}, player_name={repr(self._player_name)})"

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: PartyReplyCode property

reply_code_data: PartyReplyServerPacket.ReplyCodeData property

PartyReplyServerPacket.ReplyCodeData: Data associated with the reply_code field.

ReplyCodeData = Union['PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty', 'PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty', None] class-attribute instance-attribute

Data associated with different values of the reply_code field.

ReplyCodeDataAlreadyInAnotherParty

Data associated with reply_code value PartyReplyCode.AlreadyInAnotherParty

Source code in src/eolib/protocol/_generated/net/server/party_reply_server_packet.py
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
class ReplyCodeDataAlreadyInAnotherParty:
    """
    Data associated with reply_code value PartyReplyCode.AlreadyInAnotherParty
    """
    _byte_size: int = 0
    _player_name: str

    def __init__(self, *, player_name: str):
        """
        Create a new instance of PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty.

        Args:
            player_name (str): 
        """
        self._player_name = player_name

    @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 player_name(self) -> str:
        return self._player_name

    @staticmethod
    def serialize(writer: EoWriter, data: "PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty") -> None:
        """
        Serializes an instance of `PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_name is None:
                raise SerializationError("player_name must be provided.")
            writer.add_string(data._player_name)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty":
        """
        Deserializes an instance of `PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_name = reader.get_string()
            result = PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty(player_name=player_name)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty(byte_size={repr(self._byte_size)}, player_name={repr(self._player_name)})"

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.

player_name: str property

__init__(*, player_name)

Create a new instance of PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty.

Parameters:

Name Type Description Default
player_name str
required
Source code in src/eolib/protocol/_generated/net/server/party_reply_server_packet.py
150
151
152
153
154
155
156
157
def __init__(self, *, player_name: str):
    """
    Create a new instance of PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty.

    Args:
        player_name (str): 
    """
    self._player_name = player_name

serialize(writer, data) staticmethod

Serializes an instance of PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataAlreadyInAnotherParty

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/party_reply_server_packet.py
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
@staticmethod
def serialize(writer: EoWriter, data: "PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty") -> None:
    """
    Serializes an instance of `PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_name is None:
            raise SerializationError("player_name must be provided.")
        writer.add_string(data._player_name)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataAlreadyInAnotherParty

PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/party_reply_server_packet.py
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
@staticmethod
def deserialize(reader: EoReader) -> "PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty":
    """
    Deserializes an instance of `PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_name = reader.get_string()
        result = PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty(player_name=player_name)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataAlreadyInYourParty

Data associated with reply_code value PartyReplyCode.AlreadyInYourParty

Source code in src/eolib/protocol/_generated/net/server/party_reply_server_packet.py
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
class ReplyCodeDataAlreadyInYourParty:
    """
    Data associated with reply_code value PartyReplyCode.AlreadyInYourParty
    """
    _byte_size: int = 0
    _player_name: str

    def __init__(self, *, player_name: str):
        """
        Create a new instance of PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty.

        Args:
            player_name (str): 
        """
        self._player_name = player_name

    @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 player_name(self) -> str:
        return self._player_name

    @staticmethod
    def serialize(writer: EoWriter, data: "PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty") -> None:
        """
        Serializes an instance of `PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_name is None:
                raise SerializationError("player_name must be provided.")
            writer.add_string(data._player_name)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty":
        """
        Deserializes an instance of `PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_name = reader.get_string()
            result = PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty(player_name=player_name)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty(byte_size={repr(self._byte_size)}, player_name={repr(self._player_name)})"

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.

player_name: str property

__init__(*, player_name)

Create a new instance of PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty.

Parameters:

Name Type Description Default
player_name str
required
Source code in src/eolib/protocol/_generated/net/server/party_reply_server_packet.py
221
222
223
224
225
226
227
228
def __init__(self, *, player_name: str):
    """
    Create a new instance of PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty.

    Args:
        player_name (str): 
    """
    self._player_name = player_name

serialize(writer, data) staticmethod

Serializes an instance of PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataAlreadyInYourParty

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/party_reply_server_packet.py
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
@staticmethod
def serialize(writer: EoWriter, data: "PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty") -> None:
    """
    Serializes an instance of `PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_name is None:
            raise SerializationError("player_name must be provided.")
        writer.add_string(data._player_name)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataAlreadyInYourParty

PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/party_reply_server_packet.py
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
@staticmethod
def deserialize(reader: EoReader) -> "PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty":
    """
    Deserializes an instance of `PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_name = reader.get_string()
        result = PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty(player_name=player_name)
        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 PartyReplyServerPacket.

Parameters:

Name Type Description Default
reply_code PartyReplyCode
required
reply_code_data ReplyCodeData

Data associated with the reply_code field.

None
Source code in src/eolib/protocol/_generated/net/server/party_reply_server_packet.py
23
24
25
26
27
28
29
30
31
32
def __init__(self, *, reply_code: PartyReplyCode, reply_code_data: 'PartyReplyServerPacket.ReplyCodeData' = None):
    """
    Create a new instance of PartyReplyServerPacket.

    Args:
        reply_code (PartyReplyCode): 
        reply_code_data (PartyReplyServerPacket.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/party_reply_server_packet.py
55
56
57
58
59
60
61
62
63
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Party

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/party_reply_server_packet.py
65
66
67
68
69
70
71
72
73
@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/party_reply_server_packet.py
75
76
77
78
79
80
81
82
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.
    """
    PartyReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PartyReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PartyReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/party_reply_server_packet.py
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
@staticmethod
def serialize(writer: EoWriter, data: "PartyReplyServerPacket") -> None:
    """
    Serializes an instance of `PartyReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PartyReplyServerPacket): 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_char(int(data._reply_code))
        if data._reply_code == PartyReplyCode.AlreadyInAnotherParty:
            if not isinstance(data._reply_code_data, PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty):
                raise SerializationError("Expected reply_code_data to be type PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty for reply_code " + PartyReplyCode(data._reply_code).name + ".")
            PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty.serialize(writer, data._reply_code_data)
        elif data._reply_code == PartyReplyCode.AlreadyInYourParty:
            if not isinstance(data._reply_code_data, PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty):
                raise SerializationError("Expected reply_code_data to be type PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty for reply_code " + PartyReplyCode(data._reply_code).name + ".")
            PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty.serialize(writer, data._reply_code_data)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PartyReplyServerPacket 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
PartyReplyServerPacket PartyReplyServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/party_reply_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "PartyReplyServerPacket":
    """
    Deserializes an instance of `PartyReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PartyReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reply_code = PartyReplyCode(reader.get_char())
        reply_code_data: PartyReplyServerPacket.ReplyCodeData = None
        if reply_code == PartyReplyCode.AlreadyInAnotherParty:
            reply_code_data = PartyReplyServerPacket.ReplyCodeDataAlreadyInAnotherParty.deserialize(reader)
        elif reply_code == PartyReplyCode.AlreadyInYourParty:
            reply_code_data = PartyReplyServerPacket.ReplyCodeDataAlreadyInYourParty.deserialize(reader)
        result = PartyReplyServerPacket(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

PartyReplyCode

Bases: IntEnum

Reply code sent with PARTY_REPLY packet. Indicates why an invite or join request failed.

Source code in src/eolib/protocol/_generated/net/server/party_reply_code.py
 9
10
11
12
13
14
15
16
class PartyReplyCode(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Reply code sent with PARTY_REPLY packet.
    Indicates why an invite or join request failed.
    """
    AlreadyInAnotherParty = 0
    AlreadyInYourParty = 1
    PartyIsFull = 2

AlreadyInAnotherParty = 0 class-attribute instance-attribute

AlreadyInYourParty = 1 class-attribute instance-attribute

PartyIsFull = 2 class-attribute instance-attribute

PartyRemoveServerPacket

Bases: Packet

Player left the party

Source code in src/eolib/protocol/_generated/net/server/party_remove_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class PartyRemoveServerPacket(Packet):
    """
    Player left the party
    """
    _byte_size: int = 0
    _player_id: int

    def __init__(self, *, player_id: int):
        """
        Create a new instance of PartyRemoveServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
        """
        self._player_id = player_id

    @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 player_id(self) -> int:
        return self._player_id

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Party

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Remove

    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.
        """
        PartyRemoveServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PartyRemoveServerPacket") -> None:
        """
        Serializes an instance of `PartyRemoveServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PartyRemoveServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PartyRemoveServerPacket":
        """
        Deserializes an instance of `PartyRemoveServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PartyRemoveServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            result = PartyRemoveServerPacket(player_id=player_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PartyRemoveServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)})"

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.

player_id: int property

__init__(*, player_id)

Create a new instance of PartyRemoveServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/party_remove_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, player_id: int):
    """
    Create a new instance of PartyRemoveServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
    """
    self._player_id = player_id

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/party_remove_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Party

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/party_remove_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Remove

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/party_remove_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    PartyRemoveServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PartyRemoveServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PartyRemoveServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/party_remove_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "PartyRemoveServerPacket") -> None:
    """
    Serializes an instance of `PartyRemoveServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PartyRemoveServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PartyRemoveServerPacket 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
PartyRemoveServerPacket PartyRemoveServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/party_remove_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "PartyRemoveServerPacket":
    """
    Deserializes an instance of `PartyRemoveServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PartyRemoveServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        result = PartyRemoveServerPacket(player_id=player_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PartyListServerPacket

Bases: Packet

Party member list update

Source code in src/eolib/protocol/_generated/net/server/party_list_server_packet.py
 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
class PartyListServerPacket(Packet):
    """
    Party member list update
    """
    _byte_size: int = 0
    _members: tuple[PartyMember, ...]

    def __init__(self, *, members: Iterable[PartyMember]):
        """
        Create a new instance of PartyListServerPacket.

        Args:
            members (Iterable[PartyMember]): 
        """
        self._members = tuple(members)

    @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 members(self) -> tuple[PartyMember, ...]:
        return self._members

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Party

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.List

    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.
        """
        PartyListServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PartyListServerPacket") -> None:
        """
        Serializes an instance of `PartyListServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PartyListServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._members is None:
                raise SerializationError("members must be provided.")
            for i in range(len(data._members)):
                PartyMember.serialize(writer, data._members[i])
                writer.add_byte(0xFF)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PartyListServerPacket":
        """
        Deserializes an instance of `PartyListServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PartyListServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            members = []
            while reader.remaining > 0:
                members.append(PartyMember.deserialize(reader))
                reader.next_chunk()
            reader.chunked_reading_mode = False
            result = PartyListServerPacket(members=members)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PartyListServerPacket(byte_size={repr(self._byte_size)}, members={repr(self._members)})"

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.

members: tuple[PartyMember, ...] property

__init__(*, members)

Create a new instance of PartyListServerPacket.

Parameters:

Name Type Description Default
members Iterable[PartyMember]
required
Source code in src/eolib/protocol/_generated/net/server/party_list_server_packet.py
23
24
25
26
27
28
29
30
def __init__(self, *, members: Iterable[PartyMember]):
    """
    Create a new instance of PartyListServerPacket.

    Args:
        members (Iterable[PartyMember]): 
    """
    self._members = tuple(members)

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/party_list_server_packet.py
46
47
48
49
50
51
52
53
54
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Party

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/party_list_server_packet.py
56
57
58
59
60
61
62
63
64
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.List

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/party_list_server_packet.py
66
67
68
69
70
71
72
73
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.
    """
    PartyListServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PartyListServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PartyListServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/party_list_server_packet.py
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
@staticmethod
def serialize(writer: EoWriter, data: "PartyListServerPacket") -> None:
    """
    Serializes an instance of `PartyListServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PartyListServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._members is None:
            raise SerializationError("members must be provided.")
        for i in range(len(data._members)):
            PartyMember.serialize(writer, data._members[i])
            writer.add_byte(0xFF)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PartyListServerPacket 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
PartyListServerPacket 'PartyListServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/party_list_server_packet.py
 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
@staticmethod
def deserialize(reader: EoReader) -> "PartyListServerPacket":
    """
    Deserializes an instance of `PartyListServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PartyListServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        members = []
        while reader.remaining > 0:
            members.append(PartyMember.deserialize(reader))
            reader.next_chunk()
        reader.chunked_reading_mode = False
        result = PartyListServerPacket(members=members)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PartyExpShare

EXP gain for a member of the player's party

Source code in src/eolib/protocol/_generated/net/server/party_exp_share.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
class PartyExpShare:
    """
    EXP gain for a member of the player's party
    """
    _byte_size: int = 0
    _player_id: int
    _experience: int
    _level_up: int

    def __init__(self, *, player_id: int, experience: int, level_up: int):
        """
        Create a new instance of PartyExpShare.

        Args:
            player_id (int): (Value range is 0-64008.)
            experience (int): (Value range is 0-4097152080.)
            level_up (int): A value greater than 0 is "new level" and indicates the player leveled up. (Value range is 0-252.)
        """
        self._player_id = player_id
        self._experience = experience
        self._level_up = level_up

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def experience(self) -> int:
        return self._experience

    @property
    def level_up(self) -> int:
        """
        A value greater than 0 is "new level" and indicates the player leveled up.
        """
        return self._level_up

    @staticmethod
    def serialize(writer: EoWriter, data: "PartyExpShare") -> None:
        """
        Serializes an instance of `PartyExpShare` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PartyExpShare): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._experience is None:
                raise SerializationError("experience must be provided.")
            writer.add_int(data._experience)
            if data._level_up is None:
                raise SerializationError("level_up must be provided.")
            writer.add_char(data._level_up)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PartyExpShare":
        """
        Deserializes an instance of `PartyExpShare` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PartyExpShare: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            experience = reader.get_int()
            level_up = reader.get_char()
            result = PartyExpShare(player_id=player_id, experience=experience, level_up=level_up)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PartyExpShare(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, experience={repr(self._experience)}, level_up={repr(self._level_up)})"

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.

player_id: int property

experience: int property

level_up: int property

A value greater than 0 is "new level" and indicates the player leveled up.

__init__(*, player_id, experience, level_up)

Create a new instance of PartyExpShare.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
experience int

(Value range is 0-4097152080.)

required
level_up int

A value greater than 0 is "new level" and indicates the player leveled up. (Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/party_exp_share.py
19
20
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, player_id: int, experience: int, level_up: int):
    """
    Create a new instance of PartyExpShare.

    Args:
        player_id (int): (Value range is 0-64008.)
        experience (int): (Value range is 0-4097152080.)
        level_up (int): A value greater than 0 is "new level" and indicates the player leveled up. (Value range is 0-252.)
    """
    self._player_id = player_id
    self._experience = experience
    self._level_up = level_up

serialize(writer, data) staticmethod

Serializes an instance of PartyExpShare to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PartyExpShare

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/party_exp_share.py
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
@staticmethod
def serialize(writer: EoWriter, data: "PartyExpShare") -> None:
    """
    Serializes an instance of `PartyExpShare` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PartyExpShare): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._experience is None:
            raise SerializationError("experience must be provided.")
        writer.add_int(data._experience)
        if data._level_up is None:
            raise SerializationError("level_up must be provided.")
        writer.add_char(data._level_up)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PartyExpShare 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
PartyExpShare PartyExpShare

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/party_exp_share.py
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
@staticmethod
def deserialize(reader: EoReader) -> "PartyExpShare":
    """
    Deserializes an instance of `PartyExpShare` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PartyExpShare: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        experience = reader.get_int()
        level_up = reader.get_char()
        result = PartyExpShare(player_id=player_id, experience=experience, level_up=level_up)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PartyCreateServerPacket

Bases: Packet

Member list received when party is first joined

Source code in src/eolib/protocol/_generated/net/server/party_create_server_packet.py
 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
class PartyCreateServerPacket(Packet):
    """
    Member list received when party is first joined
    """
    _byte_size: int = 0
    _members: tuple[PartyMember, ...]

    def __init__(self, *, members: Iterable[PartyMember]):
        """
        Create a new instance of PartyCreateServerPacket.

        Args:
            members (Iterable[PartyMember]): 
        """
        self._members = tuple(members)

    @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 members(self) -> tuple[PartyMember, ...]:
        return self._members

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Party

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Create

    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.
        """
        PartyCreateServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PartyCreateServerPacket") -> None:
        """
        Serializes an instance of `PartyCreateServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PartyCreateServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._members is None:
                raise SerializationError("members must be provided.")
            for i in range(len(data._members)):
                PartyMember.serialize(writer, data._members[i])
                writer.add_byte(0xFF)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PartyCreateServerPacket":
        """
        Deserializes an instance of `PartyCreateServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PartyCreateServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            members = []
            while reader.remaining > 0:
                members.append(PartyMember.deserialize(reader))
                reader.next_chunk()
            reader.chunked_reading_mode = False
            result = PartyCreateServerPacket(members=members)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PartyCreateServerPacket(byte_size={repr(self._byte_size)}, members={repr(self._members)})"

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.

members: tuple[PartyMember, ...] property

__init__(*, members)

Create a new instance of PartyCreateServerPacket.

Parameters:

Name Type Description Default
members Iterable[PartyMember]
required
Source code in src/eolib/protocol/_generated/net/server/party_create_server_packet.py
23
24
25
26
27
28
29
30
def __init__(self, *, members: Iterable[PartyMember]):
    """
    Create a new instance of PartyCreateServerPacket.

    Args:
        members (Iterable[PartyMember]): 
    """
    self._members = tuple(members)

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/party_create_server_packet.py
46
47
48
49
50
51
52
53
54
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Party

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/party_create_server_packet.py
56
57
58
59
60
61
62
63
64
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Create

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/party_create_server_packet.py
66
67
68
69
70
71
72
73
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.
    """
    PartyCreateServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PartyCreateServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PartyCreateServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/party_create_server_packet.py
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
@staticmethod
def serialize(writer: EoWriter, data: "PartyCreateServerPacket") -> None:
    """
    Serializes an instance of `PartyCreateServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PartyCreateServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._members is None:
            raise SerializationError("members must be provided.")
        for i in range(len(data._members)):
            PartyMember.serialize(writer, data._members[i])
            writer.add_byte(0xFF)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PartyCreateServerPacket 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
PartyCreateServerPacket 'PartyCreateServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/party_create_server_packet.py
 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
@staticmethod
def deserialize(reader: EoReader) -> "PartyCreateServerPacket":
    """
    Deserializes an instance of `PartyCreateServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PartyCreateServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        members = []
        while reader.remaining > 0:
            members.append(PartyMember.deserialize(reader))
            reader.next_chunk()
        reader.chunked_reading_mode = False
        result = PartyCreateServerPacket(members=members)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PartyCloseServerPacket

Bases: Packet

Left / disbanded a party

Source code in src/eolib/protocol/_generated/net/server/party_close_server_packet.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
class PartyCloseServerPacket(Packet):
    """
    Left / disbanded a party
    """
    _byte_size: int = 0

    def __init__(self):
        """
        Create a new instance of PartyCloseServerPacket.
        """

    @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 family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Party

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Close

    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.
        """
        PartyCloseServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PartyCloseServerPacket") -> None:
        """
        Serializes an instance of `PartyCloseServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PartyCloseServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.add_byte(255)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PartyCloseServerPacket":
        """
        Deserializes an instance of `PartyCloseServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PartyCloseServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_byte()
            result = PartyCloseServerPacket()
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PartyCloseServerPacket(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 PartyCloseServerPacket.

Source code in src/eolib/protocol/_generated/net/server/party_close_server_packet.py
18
19
20
21
def __init__(self):
    """
    Create a new instance of PartyCloseServerPacket.
    """

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/party_close_server_packet.py
33
34
35
36
37
38
39
40
41
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Party

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/party_close_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Close

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/party_close_server_packet.py
53
54
55
56
57
58
59
60
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.
    """
    PartyCloseServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PartyCloseServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PartyCloseServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/party_close_server_packet.py
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@staticmethod
def serialize(writer: EoWriter, data: "PartyCloseServerPacket") -> None:
    """
    Serializes an instance of `PartyCloseServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PartyCloseServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.add_byte(255)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PartyCloseServerPacket 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
PartyCloseServerPacket PartyCloseServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/party_close_server_packet.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@staticmethod
def deserialize(reader: EoReader) -> "PartyCloseServerPacket":
    """
    Deserializes an instance of `PartyCloseServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PartyCloseServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_byte()
        result = PartyCloseServerPacket()
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PartyAgreeServerPacket

Bases: Packet

Party member list update

Source code in src/eolib/protocol/_generated/net/server/party_agree_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
class PartyAgreeServerPacket(Packet):
    """
    Party member list update
    """
    _byte_size: int = 0
    _player_id: int
    _hp_percentage: int

    def __init__(self, *, player_id: int, hp_percentage: int):
        """
        Create a new instance of PartyAgreeServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            hp_percentage (int): (Value range is 0-252.)
        """
        self._player_id = player_id
        self._hp_percentage = hp_percentage

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def hp_percentage(self) -> int:
        return self._hp_percentage

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Party

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Agree

    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.
        """
        PartyAgreeServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PartyAgreeServerPacket") -> None:
        """
        Serializes an instance of `PartyAgreeServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PartyAgreeServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._hp_percentage is None:
                raise SerializationError("hp_percentage must be provided.")
            writer.add_char(data._hp_percentage)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PartyAgreeServerPacket":
        """
        Deserializes an instance of `PartyAgreeServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PartyAgreeServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            hp_percentage = reader.get_char()
            result = PartyAgreeServerPacket(player_id=player_id, hp_percentage=hp_percentage)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PartyAgreeServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, hp_percentage={repr(self._hp_percentage)})"

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.

player_id: int property

hp_percentage: int property

__init__(*, player_id, hp_percentage)

Create a new instance of PartyAgreeServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
hp_percentage int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/party_agree_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, player_id: int, hp_percentage: int):
    """
    Create a new instance of PartyAgreeServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        hp_percentage (int): (Value range is 0-252.)
    """
    self._player_id = player_id
    self._hp_percentage = hp_percentage

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/party_agree_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Party

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/party_agree_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Agree

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/party_agree_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    PartyAgreeServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PartyAgreeServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PartyAgreeServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/party_agree_server_packet.py
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@staticmethod
def serialize(writer: EoWriter, data: "PartyAgreeServerPacket") -> None:
    """
    Serializes an instance of `PartyAgreeServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PartyAgreeServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._hp_percentage is None:
            raise SerializationError("hp_percentage must be provided.")
        writer.add_char(data._hp_percentage)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PartyAgreeServerPacket 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
PartyAgreeServerPacket PartyAgreeServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/party_agree_server_packet.py
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@staticmethod
def deserialize(reader: EoReader) -> "PartyAgreeServerPacket":
    """
    Deserializes an instance of `PartyAgreeServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PartyAgreeServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        hp_percentage = reader.get_char()
        result = PartyAgreeServerPacket(player_id=player_id, hp_percentage=hp_percentage)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PartyMember

A member of the player's party

Source code in src/eolib/protocol/_generated/net/server/party_member.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class PartyMember:
    """
    A member of the player's party
    """
    _byte_size: int = 0
    _player_id: int
    _leader: bool
    _level: int
    _hp_percentage: int
    _name: str

    def __init__(self, *, player_id: int, leader: bool, level: int, hp_percentage: int, name: str):
        """
        Create a new instance of PartyMember.

        Args:
            player_id (int): (Value range is 0-64008.)
            leader (bool): 
            level (int): (Value range is 0-252.)
            hp_percentage (int): (Value range is 0-252.)
            name (str): 
        """
        self._player_id = player_id
        self._leader = leader
        self._level = level
        self._hp_percentage = hp_percentage
        self._name = name

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def leader(self) -> bool:
        return self._leader

    @property
    def level(self) -> int:
        return self._level

    @property
    def hp_percentage(self) -> int:
        return self._hp_percentage

    @property
    def name(self) -> str:
        return self._name

    @staticmethod
    def serialize(writer: EoWriter, data: "PartyMember") -> None:
        """
        Serializes an instance of `PartyMember` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PartyMember): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._leader is None:
                raise SerializationError("leader must be provided.")
            writer.add_char(1 if data._leader else 0)
            if data._level is None:
                raise SerializationError("level must be provided.")
            writer.add_char(data._level)
            if data._hp_percentage is None:
                raise SerializationError("hp_percentage must be provided.")
            writer.add_char(data._hp_percentage)
            if data._name is None:
                raise SerializationError("name must be provided.")
            writer.add_string(data._name)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PartyMember":
        """
        Deserializes an instance of `PartyMember` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PartyMember: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            leader = reader.get_char() != 0
            level = reader.get_char()
            hp_percentage = reader.get_char()
            name = reader.get_string()
            result = PartyMember(player_id=player_id, leader=leader, level=level, hp_percentage=hp_percentage, name=name)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PartyMember(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, leader={repr(self._leader)}, level={repr(self._level)}, hp_percentage={repr(self._hp_percentage)}, name={repr(self._name)})"

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.

player_id: int property

leader: bool property

level: int property

hp_percentage: int property

name: str property

__init__(*, player_id, leader, level, hp_percentage, name)

Create a new instance of PartyMember.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
leader bool
required
level int

(Value range is 0-252.)

required
hp_percentage int

(Value range is 0-252.)

required
name str
required
Source code in src/eolib/protocol/_generated/net/server/party_member.py
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
def __init__(self, *, player_id: int, leader: bool, level: int, hp_percentage: int, name: str):
    """
    Create a new instance of PartyMember.

    Args:
        player_id (int): (Value range is 0-64008.)
        leader (bool): 
        level (int): (Value range is 0-252.)
        hp_percentage (int): (Value range is 0-252.)
        name (str): 
    """
    self._player_id = player_id
    self._leader = leader
    self._level = level
    self._hp_percentage = hp_percentage
    self._name = name

serialize(writer, data) staticmethod

Serializes an instance of PartyMember to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PartyMember

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/party_member.py
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
@staticmethod
def serialize(writer: EoWriter, data: "PartyMember") -> None:
    """
    Serializes an instance of `PartyMember` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PartyMember): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._leader is None:
            raise SerializationError("leader must be provided.")
        writer.add_char(1 if data._leader else 0)
        if data._level is None:
            raise SerializationError("level must be provided.")
        writer.add_char(data._level)
        if data._hp_percentage is None:
            raise SerializationError("hp_percentage must be provided.")
        writer.add_char(data._hp_percentage)
        if data._name is None:
            raise SerializationError("name must be provided.")
        writer.add_string(data._name)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PartyMember 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
PartyMember PartyMember

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/party_member.py
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@staticmethod
def deserialize(reader: EoReader) -> "PartyMember":
    """
    Deserializes an instance of `PartyMember` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PartyMember: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        leader = reader.get_char() != 0
        level = reader.get_char()
        hp_percentage = reader.get_char()
        name = reader.get_string()
        result = PartyMember(player_id=player_id, leader=leader, level=level, hp_percentage=hp_percentage, name=name)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PartyAddServerPacket

Bases: Packet

New player joined the party

Source code in src/eolib/protocol/_generated/net/server/party_add_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
class PartyAddServerPacket(Packet):
    """
    New player joined the party
    """
    _byte_size: int = 0
    _member: PartyMember

    def __init__(self, *, member: PartyMember):
        """
        Create a new instance of PartyAddServerPacket.

        Args:
            member (PartyMember): 
        """
        self._member = member

    @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 member(self) -> PartyMember:
        return self._member

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Party

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Add

    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.
        """
        PartyAddServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PartyAddServerPacket") -> None:
        """
        Serializes an instance of `PartyAddServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PartyAddServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._member is None:
                raise SerializationError("member must be provided.")
            PartyMember.serialize(writer, data._member)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PartyAddServerPacket":
        """
        Deserializes an instance of `PartyAddServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PartyAddServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            member = PartyMember.deserialize(reader)
            result = PartyAddServerPacket(member=member)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PartyAddServerPacket(byte_size={repr(self._byte_size)}, member={repr(self._member)})"

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.

member: PartyMember property

__init__(*, member)

Create a new instance of PartyAddServerPacket.

Parameters:

Name Type Description Default
member PartyMember
required
Source code in src/eolib/protocol/_generated/net/server/party_add_server_packet.py
21
22
23
24
25
26
27
28
def __init__(self, *, member: PartyMember):
    """
    Create a new instance of PartyAddServerPacket.

    Args:
        member (PartyMember): 
    """
    self._member = member

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/party_add_server_packet.py
44
45
46
47
48
49
50
51
52
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Party

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/party_add_server_packet.py
54
55
56
57
58
59
60
61
62
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Add

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/party_add_server_packet.py
64
65
66
67
68
69
70
71
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.
    """
    PartyAddServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PartyAddServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PartyAddServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/party_add_server_packet.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@staticmethod
def serialize(writer: EoWriter, data: "PartyAddServerPacket") -> None:
    """
    Serializes an instance of `PartyAddServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PartyAddServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._member is None:
            raise SerializationError("member must be provided.")
        PartyMember.serialize(writer, data._member)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PartyAddServerPacket 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
PartyAddServerPacket PartyAddServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/party_add_server_packet.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@staticmethod
def deserialize(reader: EoReader) -> "PartyAddServerPacket":
    """
    Deserializes an instance of `PartyAddServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PartyAddServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        member = PartyMember.deserialize(reader)
        result = PartyAddServerPacket(member=member)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PaperdollReplyServerPacket

Bases: Packet

Reply to requesting a paperdoll

Source code in src/eolib/protocol/_generated/net/server/paperdoll_reply_server_packet.py
 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
class PaperdollReplyServerPacket(Packet):
    """
    Reply to requesting a paperdoll
    """
    _byte_size: int = 0
    _details: CharacterDetails
    _equipment: EquipmentPaperdoll
    _icon: CharacterIcon

    def __init__(self, *, details: CharacterDetails, equipment: EquipmentPaperdoll, icon: CharacterIcon):
        """
        Create a new instance of PaperdollReplyServerPacket.

        Args:
            details (CharacterDetails): 
            equipment (EquipmentPaperdoll): 
            icon (CharacterIcon): 
        """
        self._details = details
        self._equipment = equipment
        self._icon = icon

    @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 details(self) -> CharacterDetails:
        return self._details

    @property
    def equipment(self) -> EquipmentPaperdoll:
        return self._equipment

    @property
    def icon(self) -> CharacterIcon:
        return self._icon

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Paperdoll

    @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.
        """
        PaperdollReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PaperdollReplyServerPacket") -> None:
        """
        Serializes an instance of `PaperdollReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PaperdollReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._details is None:
                raise SerializationError("details must be provided.")
            CharacterDetails.serialize(writer, data._details)
            if data._equipment is None:
                raise SerializationError("equipment must be provided.")
            EquipmentPaperdoll.serialize(writer, data._equipment)
            if data._icon is None:
                raise SerializationError("icon must be provided.")
            writer.add_char(int(data._icon))
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PaperdollReplyServerPacket":
        """
        Deserializes an instance of `PaperdollReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PaperdollReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            details = CharacterDetails.deserialize(reader)
            equipment = EquipmentPaperdoll.deserialize(reader)
            icon = CharacterIcon(reader.get_char())
            reader.chunked_reading_mode = False
            result = PaperdollReplyServerPacket(details=details, equipment=equipment, icon=icon)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PaperdollReplyServerPacket(byte_size={repr(self._byte_size)}, details={repr(self._details)}, equipment={repr(self._equipment)}, icon={repr(self._icon)})"

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.

details: CharacterDetails property

equipment: EquipmentPaperdoll property

icon: CharacterIcon property

__init__(*, details, equipment, icon)

Create a new instance of PaperdollReplyServerPacket.

Parameters:

Name Type Description Default
details CharacterDetails
required
equipment EquipmentPaperdoll
required
icon CharacterIcon
required
Source code in src/eolib/protocol/_generated/net/server/paperdoll_reply_server_packet.py
25
26
27
28
29
30
31
32
33
34
35
36
def __init__(self, *, details: CharacterDetails, equipment: EquipmentPaperdoll, icon: CharacterIcon):
    """
    Create a new instance of PaperdollReplyServerPacket.

    Args:
        details (CharacterDetails): 
        equipment (EquipmentPaperdoll): 
        icon (CharacterIcon): 
    """
    self._details = details
    self._equipment = equipment
    self._icon = icon

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/paperdoll_reply_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Paperdoll

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/paperdoll_reply_server_packet.py
70
71
72
73
74
75
76
77
78
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Reply

write(writer)

Serializes and writes this packet to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

the writer that this packet will be written to.

required
Source code in src/eolib/protocol/_generated/net/server/paperdoll_reply_server_packet.py
80
81
82
83
84
85
86
87
def write(self, writer):
    """
    Serializes and writes this packet to the provided EoWriter.

    Args:
        writer (EoWriter): the writer that this packet will be written to.
    """
    PaperdollReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PaperdollReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PaperdollReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/paperdoll_reply_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
@staticmethod
def serialize(writer: EoWriter, data: "PaperdollReplyServerPacket") -> None:
    """
    Serializes an instance of `PaperdollReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PaperdollReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._details is None:
            raise SerializationError("details must be provided.")
        CharacterDetails.serialize(writer, data._details)
        if data._equipment is None:
            raise SerializationError("equipment must be provided.")
        EquipmentPaperdoll.serialize(writer, data._equipment)
        if data._icon is None:
            raise SerializationError("icon must be provided.")
        writer.add_char(int(data._icon))
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PaperdollReplyServerPacket 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
PaperdollReplyServerPacket PaperdollReplyServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/paperdoll_reply_server_packet.py
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) -> "PaperdollReplyServerPacket":
    """
    Deserializes an instance of `PaperdollReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PaperdollReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        details = CharacterDetails.deserialize(reader)
        equipment = EquipmentPaperdoll.deserialize(reader)
        icon = CharacterIcon(reader.get_char())
        reader.chunked_reading_mode = False
        result = PaperdollReplyServerPacket(details=details, equipment=equipment, icon=icon)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PaperdollRemoveServerPacket

Bases: Packet

Reply to unequipping an item

Source code in src/eolib/protocol/_generated/net/server/paperdoll_remove_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
class PaperdollRemoveServerPacket(Packet):
    """
    Reply to unequipping an item
    """
    _byte_size: int = 0
    _change: AvatarChange
    _item_id: int
    _sub_loc: int
    _stats: CharacterStatsEquipmentChange

    def __init__(self, *, change: AvatarChange, item_id: int, sub_loc: int, stats: CharacterStatsEquipmentChange):
        """
        Create a new instance of PaperdollRemoveServerPacket.

        Args:
            change (AvatarChange): 
            item_id (int): (Value range is 0-64008.)
            sub_loc (int): (Value range is 0-252.)
            stats (CharacterStatsEquipmentChange): 
        """
        self._change = change
        self._item_id = item_id
        self._sub_loc = sub_loc
        self._stats = stats

    @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 change(self) -> AvatarChange:
        return self._change

    @property
    def item_id(self) -> int:
        return self._item_id

    @property
    def sub_loc(self) -> int:
        return self._sub_loc

    @property
    def stats(self) -> CharacterStatsEquipmentChange:
        return self._stats

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Paperdoll

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Remove

    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.
        """
        PaperdollRemoveServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PaperdollRemoveServerPacket") -> None:
        """
        Serializes an instance of `PaperdollRemoveServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PaperdollRemoveServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._change is None:
                raise SerializationError("change must be provided.")
            AvatarChange.serialize(writer, data._change)
            if data._item_id is None:
                raise SerializationError("item_id must be provided.")
            writer.add_short(data._item_id)
            if data._sub_loc is None:
                raise SerializationError("sub_loc must be provided.")
            writer.add_char(data._sub_loc)
            if data._stats is None:
                raise SerializationError("stats must be provided.")
            CharacterStatsEquipmentChange.serialize(writer, data._stats)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PaperdollRemoveServerPacket":
        """
        Deserializes an instance of `PaperdollRemoveServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PaperdollRemoveServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            change = AvatarChange.deserialize(reader)
            item_id = reader.get_short()
            sub_loc = reader.get_char()
            stats = CharacterStatsEquipmentChange.deserialize(reader)
            result = PaperdollRemoveServerPacket(change=change, item_id=item_id, sub_loc=sub_loc, stats=stats)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PaperdollRemoveServerPacket(byte_size={repr(self._byte_size)}, change={repr(self._change)}, item_id={repr(self._item_id)}, sub_loc={repr(self._sub_loc)}, stats={repr(self._stats)})"

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.

change: AvatarChange property

item_id: int property

sub_loc: int property

stats: CharacterStatsEquipmentChange property

__init__(*, change, item_id, sub_loc, stats)

Create a new instance of PaperdollRemoveServerPacket.

Parameters:

Name Type Description Default
change AvatarChange
required
item_id int

(Value range is 0-64008.)

required
sub_loc int

(Value range is 0-252.)

required
stats CharacterStatsEquipmentChange
required
Source code in src/eolib/protocol/_generated/net/server/paperdoll_remove_server_packet.py
25
26
27
28
29
30
31
32
33
34
35
36
37
38
def __init__(self, *, change: AvatarChange, item_id: int, sub_loc: int, stats: CharacterStatsEquipmentChange):
    """
    Create a new instance of PaperdollRemoveServerPacket.

    Args:
        change (AvatarChange): 
        item_id (int): (Value range is 0-64008.)
        sub_loc (int): (Value range is 0-252.)
        stats (CharacterStatsEquipmentChange): 
    """
    self._change = change
    self._item_id = item_id
    self._sub_loc = sub_loc
    self._stats = stats

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/paperdoll_remove_server_packet.py
66
67
68
69
70
71
72
73
74
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Paperdoll

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/paperdoll_remove_server_packet.py
76
77
78
79
80
81
82
83
84
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Remove

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/paperdoll_remove_server_packet.py
86
87
88
89
90
91
92
93
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.
    """
    PaperdollRemoveServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PaperdollRemoveServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PaperdollRemoveServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/paperdoll_remove_server_packet.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "PaperdollRemoveServerPacket") -> None:
    """
    Serializes an instance of `PaperdollRemoveServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PaperdollRemoveServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._change is None:
            raise SerializationError("change must be provided.")
        AvatarChange.serialize(writer, data._change)
        if data._item_id is None:
            raise SerializationError("item_id must be provided.")
        writer.add_short(data._item_id)
        if data._sub_loc is None:
            raise SerializationError("sub_loc must be provided.")
        writer.add_char(data._sub_loc)
        if data._stats is None:
            raise SerializationError("stats must be provided.")
        CharacterStatsEquipmentChange.serialize(writer, data._stats)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PaperdollRemoveServerPacket 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
PaperdollRemoveServerPacket PaperdollRemoveServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/paperdoll_remove_server_packet.py
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
@staticmethod
def deserialize(reader: EoReader) -> "PaperdollRemoveServerPacket":
    """
    Deserializes an instance of `PaperdollRemoveServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PaperdollRemoveServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        change = AvatarChange.deserialize(reader)
        item_id = reader.get_short()
        sub_loc = reader.get_char()
        stats = CharacterStatsEquipmentChange.deserialize(reader)
        result = PaperdollRemoveServerPacket(change=change, item_id=item_id, sub_loc=sub_loc, stats=stats)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PaperdollPingServerPacket

Bases: Packet

Failed to equip an item due to being the incorrect class

Source code in src/eolib/protocol/_generated/net/server/paperdoll_ping_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
class PaperdollPingServerPacket(Packet):
    """
    Failed to equip an item due to being the incorrect class
    """
    _byte_size: int = 0
    _class_id: int

    def __init__(self, *, class_id: int):
        """
        Create a new instance of PaperdollPingServerPacket.

        Args:
            class_id (int): The player's current class ID (not the item's required class ID) (Value range is 0-252.)
        """
        self._class_id = class_id

    @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 class_id(self) -> int:
        """
        The player's current class ID (not the item's required class ID)
        """
        return self._class_id

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Paperdoll

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Ping

    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.
        """
        PaperdollPingServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PaperdollPingServerPacket") -> None:
        """
        Serializes an instance of `PaperdollPingServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PaperdollPingServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._class_id is None:
                raise SerializationError("class_id must be provided.")
            writer.add_char(data._class_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PaperdollPingServerPacket":
        """
        Deserializes an instance of `PaperdollPingServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PaperdollPingServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            class_id = reader.get_char()
            result = PaperdollPingServerPacket(class_id=class_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PaperdollPingServerPacket(byte_size={repr(self._byte_size)}, class_id={repr(self._class_id)})"

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.

class_id: int property

The player's current class ID (not the item's required class ID)

__init__(*, class_id)

Create a new instance of PaperdollPingServerPacket.

Parameters:

Name Type Description Default
class_id int

The player's current class ID (not the item's required class ID) (Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/paperdoll_ping_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, class_id: int):
    """
    Create a new instance of PaperdollPingServerPacket.

    Args:
        class_id (int): The player's current class ID (not the item's required class ID) (Value range is 0-252.)
    """
    self._class_id = class_id

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/paperdoll_ping_server_packet.py
46
47
48
49
50
51
52
53
54
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Paperdoll

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/paperdoll_ping_server_packet.py
56
57
58
59
60
61
62
63
64
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Ping

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/paperdoll_ping_server_packet.py
66
67
68
69
70
71
72
73
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.
    """
    PaperdollPingServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PaperdollPingServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PaperdollPingServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/paperdoll_ping_server_packet.py
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
@staticmethod
def serialize(writer: EoWriter, data: "PaperdollPingServerPacket") -> None:
    """
    Serializes an instance of `PaperdollPingServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PaperdollPingServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._class_id is None:
            raise SerializationError("class_id must be provided.")
        writer.add_char(data._class_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PaperdollPingServerPacket 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
PaperdollPingServerPacket PaperdollPingServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/paperdoll_ping_server_packet.py
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
@staticmethod
def deserialize(reader: EoReader) -> "PaperdollPingServerPacket":
    """
    Deserializes an instance of `PaperdollPingServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PaperdollPingServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        class_id = reader.get_char()
        result = PaperdollPingServerPacket(class_id=class_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PaperdollAgreeServerPacket

Bases: Packet

Reply to equipping an item

Source code in src/eolib/protocol/_generated/net/server/paperdoll_agree_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
class PaperdollAgreeServerPacket(Packet):
    """
    Reply to equipping an item
    """
    _byte_size: int = 0
    _change: AvatarChange
    _item_id: int
    _remaining_amount: int
    _sub_loc: int
    _stats: CharacterStatsEquipmentChange

    def __init__(self, *, change: AvatarChange, item_id: int, remaining_amount: int, sub_loc: int, stats: CharacterStatsEquipmentChange):
        """
        Create a new instance of PaperdollAgreeServerPacket.

        Args:
            change (AvatarChange): 
            item_id (int): (Value range is 0-64008.)
            remaining_amount (int): (Value range is 0-16194276.)
            sub_loc (int): (Value range is 0-252.)
            stats (CharacterStatsEquipmentChange): 
        """
        self._change = change
        self._item_id = item_id
        self._remaining_amount = remaining_amount
        self._sub_loc = sub_loc
        self._stats = stats

    @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 change(self) -> AvatarChange:
        return self._change

    @property
    def item_id(self) -> int:
        return self._item_id

    @property
    def remaining_amount(self) -> int:
        return self._remaining_amount

    @property
    def sub_loc(self) -> int:
        return self._sub_loc

    @property
    def stats(self) -> CharacterStatsEquipmentChange:
        return self._stats

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Paperdoll

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Agree

    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.
        """
        PaperdollAgreeServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "PaperdollAgreeServerPacket") -> None:
        """
        Serializes an instance of `PaperdollAgreeServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PaperdollAgreeServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._change is None:
                raise SerializationError("change must be provided.")
            AvatarChange.serialize(writer, data._change)
            if data._item_id is None:
                raise SerializationError("item_id must be provided.")
            writer.add_short(data._item_id)
            if data._remaining_amount is None:
                raise SerializationError("remaining_amount must be provided.")
            writer.add_three(data._remaining_amount)
            if data._sub_loc is None:
                raise SerializationError("sub_loc must be provided.")
            writer.add_char(data._sub_loc)
            if data._stats is None:
                raise SerializationError("stats must be provided.")
            CharacterStatsEquipmentChange.serialize(writer, data._stats)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PaperdollAgreeServerPacket":
        """
        Deserializes an instance of `PaperdollAgreeServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PaperdollAgreeServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            change = AvatarChange.deserialize(reader)
            item_id = reader.get_short()
            remaining_amount = reader.get_three()
            sub_loc = reader.get_char()
            stats = CharacterStatsEquipmentChange.deserialize(reader)
            result = PaperdollAgreeServerPacket(change=change, item_id=item_id, remaining_amount=remaining_amount, sub_loc=sub_loc, stats=stats)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PaperdollAgreeServerPacket(byte_size={repr(self._byte_size)}, change={repr(self._change)}, item_id={repr(self._item_id)}, remaining_amount={repr(self._remaining_amount)}, sub_loc={repr(self._sub_loc)}, stats={repr(self._stats)})"

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.

change: AvatarChange property

item_id: int property

remaining_amount: int property

sub_loc: int property

stats: CharacterStatsEquipmentChange property

__init__(*, change, item_id, remaining_amount, sub_loc, stats)

Create a new instance of PaperdollAgreeServerPacket.

Parameters:

Name Type Description Default
change AvatarChange
required
item_id int

(Value range is 0-64008.)

required
remaining_amount int

(Value range is 0-16194276.)

required
sub_loc int

(Value range is 0-252.)

required
stats CharacterStatsEquipmentChange
required
Source code in src/eolib/protocol/_generated/net/server/paperdoll_agree_server_packet.py
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
def __init__(self, *, change: AvatarChange, item_id: int, remaining_amount: int, sub_loc: int, stats: CharacterStatsEquipmentChange):
    """
    Create a new instance of PaperdollAgreeServerPacket.

    Args:
        change (AvatarChange): 
        item_id (int): (Value range is 0-64008.)
        remaining_amount (int): (Value range is 0-16194276.)
        sub_loc (int): (Value range is 0-252.)
        stats (CharacterStatsEquipmentChange): 
    """
    self._change = change
    self._item_id = item_id
    self._remaining_amount = remaining_amount
    self._sub_loc = sub_loc
    self._stats = stats

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/paperdoll_agree_server_packet.py
73
74
75
76
77
78
79
80
81
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Paperdoll

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/paperdoll_agree_server_packet.py
83
84
85
86
87
88
89
90
91
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Agree

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/paperdoll_agree_server_packet.py
 93
 94
 95
 96
 97
 98
 99
100
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.
    """
    PaperdollAgreeServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of PaperdollAgreeServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PaperdollAgreeServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/paperdoll_agree_server_packet.py
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
@staticmethod
def serialize(writer: EoWriter, data: "PaperdollAgreeServerPacket") -> None:
    """
    Serializes an instance of `PaperdollAgreeServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PaperdollAgreeServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._change is None:
            raise SerializationError("change must be provided.")
        AvatarChange.serialize(writer, data._change)
        if data._item_id is None:
            raise SerializationError("item_id must be provided.")
        writer.add_short(data._item_id)
        if data._remaining_amount is None:
            raise SerializationError("remaining_amount must be provided.")
        writer.add_three(data._remaining_amount)
        if data._sub_loc is None:
            raise SerializationError("sub_loc must be provided.")
        writer.add_char(data._sub_loc)
        if data._stats is None:
            raise SerializationError("stats must be provided.")
        CharacterStatsEquipmentChange.serialize(writer, data._stats)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PaperdollAgreeServerPacket 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
PaperdollAgreeServerPacket PaperdollAgreeServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/paperdoll_agree_server_packet.py
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
@staticmethod
def deserialize(reader: EoReader) -> "PaperdollAgreeServerPacket":
    """
    Deserializes an instance of `PaperdollAgreeServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PaperdollAgreeServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        change = AvatarChange.deserialize(reader)
        item_id = reader.get_short()
        remaining_amount = reader.get_three()
        sub_loc = reader.get_char()
        stats = CharacterStatsEquipmentChange.deserialize(reader)
        result = PaperdollAgreeServerPacket(change=change, item_id=item_id, remaining_amount=remaining_amount, sub_loc=sub_loc, stats=stats)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

OnlinePlayer

A player in the online list

Source code in src/eolib/protocol/_generated/net/server/online_player.py
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
class OnlinePlayer:
    """
    A player in the online list
    """
    _byte_size: int = 0
    _name: str
    _title: str
    _level: int
    _icon: CharacterIcon
    _class_id: int
    _guild_tag: str

    def __init__(self, *, name: str, title: str, level: int, icon: CharacterIcon, class_id: int, guild_tag: str):
        """
        Create a new instance of OnlinePlayer.

        Args:
            name (str): 
            title (str): 
            level (int): (Value range is 0-252.)
            icon (CharacterIcon): 
            class_id (int): (Value range is 0-252.)
            guild_tag (str): 
        """
        self._name = name
        self._title = title
        self._level = level
        self._icon = icon
        self._class_id = class_id
        self._guild_tag = guild_tag

    @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 name(self) -> str:
        return self._name

    @property
    def title(self) -> str:
        return self._title

    @property
    def level(self) -> int:
        return self._level

    @property
    def icon(self) -> CharacterIcon:
        return self._icon

    @property
    def class_id(self) -> int:
        return self._class_id

    @property
    def guild_tag(self) -> str:
        return self._guild_tag

    @staticmethod
    def serialize(writer: EoWriter, data: "OnlinePlayer") -> None:
        """
        Serializes an instance of `OnlinePlayer` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (OnlinePlayer): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            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._level is None:
                raise SerializationError("level must be provided.")
            writer.add_char(data._level)
            if data._icon is None:
                raise SerializationError("icon must be provided.")
            writer.add_char(int(data._icon))
            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.")
            writer.add_string(data._guild_tag)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "OnlinePlayer":
        """
        Deserializes an instance of `OnlinePlayer` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            OnlinePlayer: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            name = reader.get_string()
            reader.next_chunk()
            title = reader.get_string()
            reader.next_chunk()
            level = reader.get_char()
            icon = CharacterIcon(reader.get_char())
            class_id = reader.get_char()
            guild_tag = reader.get_string()
            reader.chunked_reading_mode = False
            result = OnlinePlayer(name=name, title=title, level=level, icon=icon, class_id=class_id, guild_tag=guild_tag)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"OnlinePlayer(byte_size={repr(self._byte_size)}, name={repr(self._name)}, title={repr(self._title)}, level={repr(self._level)}, icon={repr(self._icon)}, class_id={repr(self._class_id)}, guild_tag={repr(self._guild_tag)})"

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.

name: str property

title: str property

level: int property

icon: CharacterIcon property

class_id: int property

guild_tag: str property

__init__(*, name, title, level, icon, class_id, guild_tag)

Create a new instance of OnlinePlayer.

Parameters:

Name Type Description Default
name str
required
title str
required
level int

(Value range is 0-252.)

required
icon CharacterIcon
required
class_id int

(Value range is 0-252.)

required
guild_tag str
required
Source code in src/eolib/protocol/_generated/net/server/online_player.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
def __init__(self, *, name: str, title: str, level: int, icon: CharacterIcon, class_id: int, guild_tag: str):
    """
    Create a new instance of OnlinePlayer.

    Args:
        name (str): 
        title (str): 
        level (int): (Value range is 0-252.)
        icon (CharacterIcon): 
        class_id (int): (Value range is 0-252.)
        guild_tag (str): 
    """
    self._name = name
    self._title = title
    self._level = level
    self._icon = icon
    self._class_id = class_id
    self._guild_tag = guild_tag

serialize(writer, data) staticmethod

Serializes an instance of OnlinePlayer to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data OnlinePlayer

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/online_player.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "OnlinePlayer") -> None:
    """
    Serializes an instance of `OnlinePlayer` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (OnlinePlayer): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        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._level is None:
            raise SerializationError("level must be provided.")
        writer.add_char(data._level)
        if data._icon is None:
            raise SerializationError("icon must be provided.")
        writer.add_char(int(data._icon))
        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.")
        writer.add_string(data._guild_tag)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of OnlinePlayer 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
OnlinePlayer OnlinePlayer

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/online_player.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
138
139
140
@staticmethod
def deserialize(reader: EoReader) -> "OnlinePlayer":
    """
    Deserializes an instance of `OnlinePlayer` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        OnlinePlayer: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        name = reader.get_string()
        reader.next_chunk()
        title = reader.get_string()
        reader.next_chunk()
        level = reader.get_char()
        icon = CharacterIcon(reader.get_char())
        class_id = reader.get_char()
        guild_tag = reader.get_string()
        reader.chunked_reading_mode = False
        result = OnlinePlayer(name=name, title=title, level=level, icon=icon, class_id=class_id, guild_tag=guild_tag)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PlayerKilledState

Bases: IntEnum

Flag to indicate that a player has been killed

Source code in src/eolib/protocol/_generated/net/server/player_killed_state.py
 9
10
11
12
13
14
class PlayerKilledState(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Flag to indicate that a player has been killed
    """
    Alive = 1
    Killed = 2

Alive = 1 class-attribute instance-attribute

Killed = 2 class-attribute instance-attribute

NpcSpecServerPacket

Bases: Packet

Nearby NPC killed by player

Source code in src/eolib/protocol/_generated/net/server/npc_spec_server_packet.py
 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
class NpcSpecServerPacket(Packet):
    """
    Nearby NPC killed by player
    """
    _byte_size: int = 0
    _npc_killed_data: NpcKilledData
    _experience: Optional[int]

    def __init__(self, *, npc_killed_data: NpcKilledData, experience: Optional[int] = None):
        """
        Create a new instance of NpcSpecServerPacket.

        Args:
            npc_killed_data (NpcKilledData): 
            experience (Optional[int]): This field should be sent to the killer, but not nearby players (Value range is 0-4097152080.)
        """
        self._npc_killed_data = npc_killed_data
        self._experience = experience

    @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 npc_killed_data(self) -> NpcKilledData:
        return self._npc_killed_data

    @property
    def experience(self) -> Optional[int]:
        """
        This field should be sent to the killer, but not nearby players
        """
        return self._experience

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Npc

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Spec

    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.
        """
        NpcSpecServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "NpcSpecServerPacket") -> None:
        """
        Serializes an instance of `NpcSpecServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (NpcSpecServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._npc_killed_data is None:
                raise SerializationError("npc_killed_data must be provided.")
            NpcKilledData.serialize(writer, data._npc_killed_data)
            reached_missing_optional = data._experience is None
            if not reached_missing_optional:
                writer.add_int(cast(int, data._experience))
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "NpcSpecServerPacket":
        """
        Deserializes an instance of `NpcSpecServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            NpcSpecServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            npc_killed_data = NpcKilledData.deserialize(reader)
            experience: Optional[int] = None
            if reader.remaining > 0:
                experience = reader.get_int()
            result = NpcSpecServerPacket(npc_killed_data=npc_killed_data, experience=experience)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"NpcSpecServerPacket(byte_size={repr(self._byte_size)}, npc_killed_data={repr(self._npc_killed_data)}, experience={repr(self._experience)})"

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.

npc_killed_data: NpcKilledData property

experience: Optional[int] property

This field should be sent to the killer, but not nearby players

__init__(*, npc_killed_data, experience=None)

Create a new instance of NpcSpecServerPacket.

Parameters:

Name Type Description Default
npc_killed_data NpcKilledData
required
experience Optional[int]

This field should be sent to the killer, but not nearby players (Value range is 0-4097152080.)

None
Source code in src/eolib/protocol/_generated/net/server/npc_spec_server_packet.py
24
25
26
27
28
29
30
31
32
33
def __init__(self, *, npc_killed_data: NpcKilledData, experience: Optional[int] = None):
    """
    Create a new instance of NpcSpecServerPacket.

    Args:
        npc_killed_data (NpcKilledData): 
        experience (Optional[int]): This field should be sent to the killer, but not nearby players (Value range is 0-4097152080.)
    """
    self._npc_killed_data = npc_killed_data
    self._experience = experience

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/npc_spec_server_packet.py
56
57
58
59
60
61
62
63
64
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Npc

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/npc_spec_server_packet.py
66
67
68
69
70
71
72
73
74
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Spec

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/npc_spec_server_packet.py
76
77
78
79
80
81
82
83
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.
    """
    NpcSpecServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of NpcSpecServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data NpcSpecServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/npc_spec_server_packet.py
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
@staticmethod
def serialize(writer: EoWriter, data: "NpcSpecServerPacket") -> None:
    """
    Serializes an instance of `NpcSpecServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (NpcSpecServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._npc_killed_data is None:
            raise SerializationError("npc_killed_data must be provided.")
        NpcKilledData.serialize(writer, data._npc_killed_data)
        reached_missing_optional = data._experience is None
        if not reached_missing_optional:
            writer.add_int(cast(int, data._experience))
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of NpcSpecServerPacket 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
NpcSpecServerPacket NpcSpecServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/npc_spec_server_packet.py
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
@staticmethod
def deserialize(reader: EoReader) -> "NpcSpecServerPacket":
    """
    Deserializes an instance of `NpcSpecServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        NpcSpecServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        npc_killed_data = NpcKilledData.deserialize(reader)
        experience: Optional[int] = None
        if reader.remaining > 0:
            experience = reader.get_int()
        result = NpcSpecServerPacket(npc_killed_data=npc_killed_data, experience=experience)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

NpcReplyServerPacket

Bases: Packet

Nearby NPC hit by a player

Source code in src/eolib/protocol/_generated/net/server/npc_reply_server_packet.py
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
class NpcReplyServerPacket(Packet):
    """
    Nearby NPC hit by a player
    """
    _byte_size: int = 0
    _player_id: int
    _player_direction: Direction
    _npc_index: int
    _damage: int
    _hp_percentage: int
    _kill_steal_protection: Optional[NpcKillStealProtectionState]

    def __init__(self, *, player_id: int, player_direction: Direction, npc_index: int, damage: int, hp_percentage: int, kill_steal_protection: Optional[NpcKillStealProtectionState] = None):
        """
        Create a new instance of NpcReplyServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            player_direction (Direction): 
            npc_index (int): (Value range is 0-64008.)
            damage (int): (Value range is 0-16194276.)
            hp_percentage (int): (Value range is 0-64008.)
            kill_steal_protection (Optional[NpcKillStealProtectionState]): This field should be sent to the attacker, but not nearby players
        """
        self._player_id = player_id
        self._player_direction = player_direction
        self._npc_index = npc_index
        self._damage = damage
        self._hp_percentage = hp_percentage
        self._kill_steal_protection = kill_steal_protection

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def player_direction(self) -> Direction:
        return self._player_direction

    @property
    def npc_index(self) -> int:
        return self._npc_index

    @property
    def damage(self) -> int:
        return self._damage

    @property
    def hp_percentage(self) -> int:
        return self._hp_percentage

    @property
    def kill_steal_protection(self) -> Optional[NpcKillStealProtectionState]:
        """
        This field should be sent to the attacker, but not nearby players
        """
        return self._kill_steal_protection

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Npc

    @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.
        """
        NpcReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "NpcReplyServerPacket") -> None:
        """
        Serializes an instance of `NpcReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (NpcReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._player_direction is None:
                raise SerializationError("player_direction must be provided.")
            writer.add_char(int(data._player_direction))
            if data._npc_index is None:
                raise SerializationError("npc_index must be provided.")
            writer.add_short(data._npc_index)
            if data._damage is None:
                raise SerializationError("damage must be provided.")
            writer.add_three(data._damage)
            if data._hp_percentage is None:
                raise SerializationError("hp_percentage must be provided.")
            writer.add_short(data._hp_percentage)
            reached_missing_optional = data._kill_steal_protection is None
            if not reached_missing_optional:
                writer.add_char(int(cast(NpcKillStealProtectionState, data._kill_steal_protection)))
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "NpcReplyServerPacket":
        """
        Deserializes an instance of `NpcReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            NpcReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            player_direction = Direction(reader.get_char())
            npc_index = reader.get_short()
            damage = reader.get_three()
            hp_percentage = reader.get_short()
            kill_steal_protection: Optional[NpcKillStealProtectionState] = None
            if reader.remaining > 0:
                kill_steal_protection = NpcKillStealProtectionState(reader.get_char())
            result = NpcReplyServerPacket(player_id=player_id, player_direction=player_direction, npc_index=npc_index, damage=damage, hp_percentage=hp_percentage, kill_steal_protection=kill_steal_protection)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"NpcReplyServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, player_direction={repr(self._player_direction)}, npc_index={repr(self._npc_index)}, damage={repr(self._damage)}, hp_percentage={repr(self._hp_percentage)}, kill_steal_protection={repr(self._kill_steal_protection)})"

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.

player_id: int property

player_direction: Direction property

npc_index: int property

damage: int property

hp_percentage: int property

kill_steal_protection: Optional[NpcKillStealProtectionState] property

This field should be sent to the attacker, but not nearby players

__init__(*, player_id, player_direction, npc_index, damage, hp_percentage, kill_steal_protection=None)

Create a new instance of NpcReplyServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
player_direction Direction
required
npc_index int

(Value range is 0-64008.)

required
damage int

(Value range is 0-16194276.)

required
hp_percentage int

(Value range is 0-64008.)

required
kill_steal_protection Optional[NpcKillStealProtectionState]

This field should be sent to the attacker, but not nearby players

None
Source code in src/eolib/protocol/_generated/net/server/npc_reply_server_packet.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
def __init__(self, *, player_id: int, player_direction: Direction, npc_index: int, damage: int, hp_percentage: int, kill_steal_protection: Optional[NpcKillStealProtectionState] = None):
    """
    Create a new instance of NpcReplyServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        player_direction (Direction): 
        npc_index (int): (Value range is 0-64008.)
        damage (int): (Value range is 0-16194276.)
        hp_percentage (int): (Value range is 0-64008.)
        kill_steal_protection (Optional[NpcKillStealProtectionState]): This field should be sent to the attacker, but not nearby players
    """
    self._player_id = player_id
    self._player_direction = player_direction
    self._npc_index = npc_index
    self._damage = damage
    self._hp_percentage = hp_percentage
    self._kill_steal_protection = kill_steal_protection

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/npc_reply_server_packet.py
85
86
87
88
89
90
91
92
93
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Npc

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/npc_reply_server_packet.py
 95
 96
 97
 98
 99
100
101
102
103
@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/npc_reply_server_packet.py
105
106
107
108
109
110
111
112
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.
    """
    NpcReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of NpcReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data NpcReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/npc_reply_server_packet.py
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
@staticmethod
def serialize(writer: EoWriter, data: "NpcReplyServerPacket") -> None:
    """
    Serializes an instance of `NpcReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (NpcReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._player_direction is None:
            raise SerializationError("player_direction must be provided.")
        writer.add_char(int(data._player_direction))
        if data._npc_index is None:
            raise SerializationError("npc_index must be provided.")
        writer.add_short(data._npc_index)
        if data._damage is None:
            raise SerializationError("damage must be provided.")
        writer.add_three(data._damage)
        if data._hp_percentage is None:
            raise SerializationError("hp_percentage must be provided.")
        writer.add_short(data._hp_percentage)
        reached_missing_optional = data._kill_steal_protection is None
        if not reached_missing_optional:
            writer.add_char(int(cast(NpcKillStealProtectionState, data._kill_steal_protection)))
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of NpcReplyServerPacket 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
NpcReplyServerPacket NpcReplyServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/npc_reply_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "NpcReplyServerPacket":
    """
    Deserializes an instance of `NpcReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        NpcReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        player_direction = Direction(reader.get_char())
        npc_index = reader.get_short()
        damage = reader.get_three()
        hp_percentage = reader.get_short()
        kill_steal_protection: Optional[NpcKillStealProtectionState] = None
        if reader.remaining > 0:
            kill_steal_protection = NpcKillStealProtectionState(reader.get_char())
        result = NpcReplyServerPacket(player_id=player_id, player_direction=player_direction, npc_index=npc_index, damage=damage, hp_percentage=hp_percentage, kill_steal_protection=kill_steal_protection)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

NpcUpdatePosition

An NPC walking

Source code in src/eolib/protocol/_generated/net/server/npc_update_position.py
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
class NpcUpdatePosition:
    """
    An NPC walking
    """
    _byte_size: int = 0
    _npc_index: int
    _coords: Coords
    _direction: Direction

    def __init__(self, *, npc_index: int, coords: Coords, direction: Direction):
        """
        Create a new instance of NpcUpdatePosition.

        Args:
            npc_index (int): (Value range is 0-252.)
            coords (Coords): 
            direction (Direction): 
        """
        self._npc_index = npc_index
        self._coords = coords
        self._direction = direction

    @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 npc_index(self) -> int:
        return self._npc_index

    @property
    def coords(self) -> Coords:
        return self._coords

    @property
    def direction(self) -> Direction:
        return self._direction

    @staticmethod
    def serialize(writer: EoWriter, data: "NpcUpdatePosition") -> None:
        """
        Serializes an instance of `NpcUpdatePosition` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (NpcUpdatePosition): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._npc_index is None:
                raise SerializationError("npc_index must be provided.")
            writer.add_char(data._npc_index)
            if data._coords is None:
                raise SerializationError("coords must be provided.")
            Coords.serialize(writer, data._coords)
            if data._direction is None:
                raise SerializationError("direction must be provided.")
            writer.add_char(int(data._direction))
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "NpcUpdatePosition":
        """
        Deserializes an instance of `NpcUpdatePosition` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            NpcUpdatePosition: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            npc_index = reader.get_char()
            coords = Coords.deserialize(reader)
            direction = Direction(reader.get_char())
            result = NpcUpdatePosition(npc_index=npc_index, coords=coords, direction=direction)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"NpcUpdatePosition(byte_size={repr(self._byte_size)}, npc_index={repr(self._npc_index)}, coords={repr(self._coords)}, direction={repr(self._direction)})"

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.

npc_index: int property

coords: Coords property

direction: Direction property

__init__(*, npc_index, coords, direction)

Create a new instance of NpcUpdatePosition.

Parameters:

Name Type Description Default
npc_index int

(Value range is 0-252.)

required
coords Coords
required
direction Direction
required
Source code in src/eolib/protocol/_generated/net/server/npc_update_position.py
21
22
23
24
25
26
27
28
29
30
31
32
def __init__(self, *, npc_index: int, coords: Coords, direction: Direction):
    """
    Create a new instance of NpcUpdatePosition.

    Args:
        npc_index (int): (Value range is 0-252.)
        coords (Coords): 
        direction (Direction): 
    """
    self._npc_index = npc_index
    self._coords = coords
    self._direction = direction

serialize(writer, data) staticmethod

Serializes an instance of NpcUpdatePosition to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data NpcUpdatePosition

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/npc_update_position.py
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
@staticmethod
def serialize(writer: EoWriter, data: "NpcUpdatePosition") -> None:
    """
    Serializes an instance of `NpcUpdatePosition` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (NpcUpdatePosition): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._npc_index is None:
            raise SerializationError("npc_index must be provided.")
        writer.add_char(data._npc_index)
        if data._coords is None:
            raise SerializationError("coords must be provided.")
        Coords.serialize(writer, data._coords)
        if data._direction is None:
            raise SerializationError("direction must be provided.")
        writer.add_char(int(data._direction))
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of NpcUpdatePosition 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
NpcUpdatePosition NpcUpdatePosition

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/npc_update_position.py
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
@staticmethod
def deserialize(reader: EoReader) -> "NpcUpdatePosition":
    """
    Deserializes an instance of `NpcUpdatePosition` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        NpcUpdatePosition: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        npc_index = reader.get_char()
        coords = Coords.deserialize(reader)
        direction = Direction(reader.get_char())
        result = NpcUpdatePosition(npc_index=npc_index, coords=coords, direction=direction)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

NpcUpdateChat

An NPC talking

Source code in src/eolib/protocol/_generated/net/server/npc_update_chat.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
class NpcUpdateChat:
    """
    An NPC talking
    """
    _byte_size: int = 0
    _npc_index: int
    _message_length: int
    _message: str

    def __init__(self, *, npc_index: int, message: str):
        """
        Create a new instance of NpcUpdateChat.

        Args:
            npc_index (int): (Value range is 0-252.)
            message (str): (Length must be 252 or less.)
        """
        self._npc_index = npc_index
        self._message = message
        self._message_length = len(self._message)

    @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 npc_index(self) -> int:
        return self._npc_index

    @property
    def message(self) -> str:
        return self._message

    @staticmethod
    def serialize(writer: EoWriter, data: "NpcUpdateChat") -> None:
        """
        Serializes an instance of `NpcUpdateChat` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (NpcUpdateChat): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._npc_index is None:
                raise SerializationError("npc_index must be provided.")
            writer.add_char(data._npc_index)
            if data._message_length is None:
                raise SerializationError("message_length must be provided.")
            writer.add_char(data._message_length)
            if data._message is None:
                raise SerializationError("message must be provided.")
            if len(data._message) > 252:
                raise SerializationError(f"Expected length of message to be 252 or less, got {len(data._message)}.")
            writer.add_fixed_string(data._message, data._message_length, False)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "NpcUpdateChat":
        """
        Deserializes an instance of `NpcUpdateChat` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            NpcUpdateChat: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            npc_index = reader.get_char()
            message_length = reader.get_char()
            message = reader.get_fixed_string(message_length, False)
            result = NpcUpdateChat(npc_index=npc_index, message=message)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"NpcUpdateChat(byte_size={repr(self._byte_size)}, npc_index={repr(self._npc_index)}, message={repr(self._message)})"

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.

npc_index: int property

message: str property

__init__(*, npc_index, message)

Create a new instance of NpcUpdateChat.

Parameters:

Name Type Description Default
npc_index int

(Value range is 0-252.)

required
message str

(Length must be 252 or less.)

required
Source code in src/eolib/protocol/_generated/net/server/npc_update_chat.py
19
20
21
22
23
24
25
26
27
28
29
def __init__(self, *, npc_index: int, message: str):
    """
    Create a new instance of NpcUpdateChat.

    Args:
        npc_index (int): (Value range is 0-252.)
        message (str): (Length must be 252 or less.)
    """
    self._npc_index = npc_index
    self._message = message
    self._message_length = len(self._message)

serialize(writer, data) staticmethod

Serializes an instance of NpcUpdateChat to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data NpcUpdateChat

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/npc_update_chat.py
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
@staticmethod
def serialize(writer: EoWriter, data: "NpcUpdateChat") -> None:
    """
    Serializes an instance of `NpcUpdateChat` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (NpcUpdateChat): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._npc_index is None:
            raise SerializationError("npc_index must be provided.")
        writer.add_char(data._npc_index)
        if data._message_length is None:
            raise SerializationError("message_length must be provided.")
        writer.add_char(data._message_length)
        if data._message is None:
            raise SerializationError("message must be provided.")
        if len(data._message) > 252:
            raise SerializationError(f"Expected length of message to be 252 or less, got {len(data._message)}.")
        writer.add_fixed_string(data._message, data._message_length, False)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of NpcUpdateChat 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
NpcUpdateChat NpcUpdateChat

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/npc_update_chat.py
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
@staticmethod
def deserialize(reader: EoReader) -> "NpcUpdateChat":
    """
    Deserializes an instance of `NpcUpdateChat` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        NpcUpdateChat: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        npc_index = reader.get_char()
        message_length = reader.get_char()
        message = reader.get_fixed_string(message_length, False)
        result = NpcUpdateChat(npc_index=npc_index, message=message)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

NpcUpdateAttack

An NPC attacking

Source code in src/eolib/protocol/_generated/net/server/npc_update_attack.py
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
class NpcUpdateAttack:
    """
    An NPC attacking
    """
    _byte_size: int = 0
    _npc_index: int
    _killed: PlayerKilledState
    _direction: Direction
    _player_id: int
    _damage: int
    _hp_percentage: int

    def __init__(self, *, npc_index: int, killed: PlayerKilledState, direction: Direction, player_id: int, damage: int, hp_percentage: int):
        """
        Create a new instance of NpcUpdateAttack.

        Args:
            npc_index (int): (Value range is 0-252.)
            killed (PlayerKilledState): 
            direction (Direction): 
            player_id (int): (Value range is 0-64008.)
            damage (int): (Value range is 0-16194276.)
            hp_percentage (int): (Value range is 0-252.)
        """
        self._npc_index = npc_index
        self._killed = killed
        self._direction = direction
        self._player_id = player_id
        self._damage = damage
        self._hp_percentage = hp_percentage

    @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 npc_index(self) -> int:
        return self._npc_index

    @property
    def killed(self) -> PlayerKilledState:
        return self._killed

    @property
    def direction(self) -> Direction:
        return self._direction

    @property
    def player_id(self) -> int:
        return self._player_id

    @property
    def damage(self) -> int:
        return self._damage

    @property
    def hp_percentage(self) -> int:
        return self._hp_percentage

    @staticmethod
    def serialize(writer: EoWriter, data: "NpcUpdateAttack") -> None:
        """
        Serializes an instance of `NpcUpdateAttack` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (NpcUpdateAttack): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._npc_index is None:
                raise SerializationError("npc_index must be provided.")
            writer.add_char(data._npc_index)
            if data._killed is None:
                raise SerializationError("killed must be provided.")
            writer.add_char(int(data._killed))
            if data._direction is None:
                raise SerializationError("direction must be provided.")
            writer.add_char(int(data._direction))
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._damage is None:
                raise SerializationError("damage must be provided.")
            writer.add_three(data._damage)
            if data._hp_percentage is None:
                raise SerializationError("hp_percentage must be provided.")
            writer.add_char(data._hp_percentage)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "NpcUpdateAttack":
        """
        Deserializes an instance of `NpcUpdateAttack` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            NpcUpdateAttack: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            npc_index = reader.get_char()
            killed = PlayerKilledState(reader.get_char())
            direction = Direction(reader.get_char())
            player_id = reader.get_short()
            damage = reader.get_three()
            hp_percentage = reader.get_char()
            result = NpcUpdateAttack(npc_index=npc_index, killed=killed, direction=direction, player_id=player_id, damage=damage, hp_percentage=hp_percentage)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"NpcUpdateAttack(byte_size={repr(self._byte_size)}, npc_index={repr(self._npc_index)}, killed={repr(self._killed)}, direction={repr(self._direction)}, player_id={repr(self._player_id)}, damage={repr(self._damage)}, hp_percentage={repr(self._hp_percentage)})"

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.

npc_index: int property

killed: PlayerKilledState property

direction: Direction property

player_id: int property

damage: int property

hp_percentage: int property

__init__(*, npc_index, killed, direction, player_id, damage, hp_percentage)

Create a new instance of NpcUpdateAttack.

Parameters:

Name Type Description Default
npc_index int

(Value range is 0-252.)

required
killed PlayerKilledState
required
direction Direction
required
player_id int

(Value range is 0-64008.)

required
damage int

(Value range is 0-16194276.)

required
hp_percentage int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/npc_update_attack.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
def __init__(self, *, npc_index: int, killed: PlayerKilledState, direction: Direction, player_id: int, damage: int, hp_percentage: int):
    """
    Create a new instance of NpcUpdateAttack.

    Args:
        npc_index (int): (Value range is 0-252.)
        killed (PlayerKilledState): 
        direction (Direction): 
        player_id (int): (Value range is 0-64008.)
        damage (int): (Value range is 0-16194276.)
        hp_percentage (int): (Value range is 0-252.)
    """
    self._npc_index = npc_index
    self._killed = killed
    self._direction = direction
    self._player_id = player_id
    self._damage = damage
    self._hp_percentage = hp_percentage

serialize(writer, data) staticmethod

Serializes an instance of NpcUpdateAttack to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data NpcUpdateAttack

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/npc_update_attack.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "NpcUpdateAttack") -> None:
    """
    Serializes an instance of `NpcUpdateAttack` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (NpcUpdateAttack): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._npc_index is None:
            raise SerializationError("npc_index must be provided.")
        writer.add_char(data._npc_index)
        if data._killed is None:
            raise SerializationError("killed must be provided.")
        writer.add_char(int(data._killed))
        if data._direction is None:
            raise SerializationError("direction must be provided.")
        writer.add_char(int(data._direction))
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._damage is None:
            raise SerializationError("damage must be provided.")
        writer.add_three(data._damage)
        if data._hp_percentage is None:
            raise SerializationError("hp_percentage must be provided.")
        writer.add_char(data._hp_percentage)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of NpcUpdateAttack 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
NpcUpdateAttack NpcUpdateAttack

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/npc_update_attack.py
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
@staticmethod
def deserialize(reader: EoReader) -> "NpcUpdateAttack":
    """
    Deserializes an instance of `NpcUpdateAttack` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        NpcUpdateAttack: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        npc_index = reader.get_char()
        killed = PlayerKilledState(reader.get_char())
        direction = Direction(reader.get_char())
        player_id = reader.get_short()
        damage = reader.get_three()
        hp_percentage = reader.get_char()
        result = NpcUpdateAttack(npc_index=npc_index, killed=killed, direction=direction, player_id=player_id, damage=damage, hp_percentage=hp_percentage)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

NpcPlayerServerPacket

Bases: Packet

Main NPC update message

Source code in src/eolib/protocol/_generated/net/server/npc_player_server_packet.py
 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
class NpcPlayerServerPacket(Packet):
    """
    Main NPC update message
    """
    _byte_size: int = 0
    _positions: tuple[NpcUpdatePosition, ...]
    _attacks: tuple[NpcUpdateAttack, ...]
    _chats: tuple[NpcUpdateChat, ...]
    _hp: Optional[int]
    _tp: Optional[int]

    def __init__(self, *, positions: Iterable[NpcUpdatePosition], attacks: Iterable[NpcUpdateAttack], chats: Iterable[NpcUpdateChat], hp: Optional[int] = None, tp: Optional[int] = None):
        """
        Create a new instance of NpcPlayerServerPacket.

        Args:
            positions (Iterable[NpcUpdatePosition]): 
            attacks (Iterable[NpcUpdateAttack]): 
            chats (Iterable[NpcUpdateChat]): 
            hp (Optional[int]): (Value range is 0-64008.)
            tp (Optional[int]): (Value range is 0-64008.)
        """
        self._positions = tuple(positions)
        self._attacks = tuple(attacks)
        self._chats = tuple(chats)
        self._hp = hp
        self._tp = tp

    @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 positions(self) -> tuple[NpcUpdatePosition, ...]:
        return self._positions

    @property
    def attacks(self) -> tuple[NpcUpdateAttack, ...]:
        return self._attacks

    @property
    def chats(self) -> tuple[NpcUpdateChat, ...]:
        return self._chats

    @property
    def hp(self) -> Optional[int]:
        return self._hp

    @property
    def tp(self) -> Optional[int]:
        return self._tp

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Npc

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Player

    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.
        """
        NpcPlayerServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "NpcPlayerServerPacket") -> None:
        """
        Serializes an instance of `NpcPlayerServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (NpcPlayerServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._positions is None:
                raise SerializationError("positions must be provided.")
            for i in range(len(data._positions)):
                NpcUpdatePosition.serialize(writer, data._positions[i])
            writer.add_byte(0xFF)
            if data._attacks is None:
                raise SerializationError("attacks must be provided.")
            for i in range(len(data._attacks)):
                NpcUpdateAttack.serialize(writer, data._attacks[i])
            writer.add_byte(0xFF)
            if data._chats is None:
                raise SerializationError("chats must be provided.")
            for i in range(len(data._chats)):
                NpcUpdateChat.serialize(writer, data._chats[i])
            writer.add_byte(0xFF)
            reached_missing_optional = data._hp is None
            if not reached_missing_optional:
                writer.add_short(cast(int, data._hp))
            reached_missing_optional = reached_missing_optional or data._tp is None
            if not reached_missing_optional:
                writer.add_short(cast(int, data._tp))
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "NpcPlayerServerPacket":
        """
        Deserializes an instance of `NpcPlayerServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            NpcPlayerServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            positions_length = int(reader.remaining / 4)
            positions = []
            for i in range(positions_length):
                positions.append(NpcUpdatePosition.deserialize(reader))
            reader.next_chunk()
            attacks_length = int(reader.remaining / 9)
            attacks = []
            for i in range(attacks_length):
                attacks.append(NpcUpdateAttack.deserialize(reader))
            reader.next_chunk()
            chats = []
            while reader.remaining > 0:
                chats.append(NpcUpdateChat.deserialize(reader))
            reader.next_chunk()
            hp: Optional[int] = None
            if reader.remaining > 0:
                hp = reader.get_short()
            tp: Optional[int] = None
            if reader.remaining > 0:
                tp = reader.get_short()
            reader.chunked_reading_mode = False
            result = NpcPlayerServerPacket(positions=positions, attacks=attacks, chats=chats, hp=hp, tp=tp)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"NpcPlayerServerPacket(byte_size={repr(self._byte_size)}, positions={repr(self._positions)}, attacks={repr(self._attacks)}, chats={repr(self._chats)}, hp={repr(self._hp)}, tp={repr(self._tp)})"

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.

positions: tuple[NpcUpdatePosition, ...] property

attacks: tuple[NpcUpdateAttack, ...] property

chats: tuple[NpcUpdateChat, ...] property

hp: Optional[int] property

tp: Optional[int] property

__init__(*, positions, attacks, chats, hp=None, tp=None)

Create a new instance of NpcPlayerServerPacket.

Parameters:

Name Type Description Default
positions Iterable[NpcUpdatePosition]
required
attacks Iterable[NpcUpdateAttack]
required
chats Iterable[NpcUpdateChat]
required
hp Optional[int]

(Value range is 0-64008.)

None
tp Optional[int]

(Value range is 0-64008.)

None
Source code in src/eolib/protocol/_generated/net/server/npc_player_server_packet.py
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
def __init__(self, *, positions: Iterable[NpcUpdatePosition], attacks: Iterable[NpcUpdateAttack], chats: Iterable[NpcUpdateChat], hp: Optional[int] = None, tp: Optional[int] = None):
    """
    Create a new instance of NpcPlayerServerPacket.

    Args:
        positions (Iterable[NpcUpdatePosition]): 
        attacks (Iterable[NpcUpdateAttack]): 
        chats (Iterable[NpcUpdateChat]): 
        hp (Optional[int]): (Value range is 0-64008.)
        tp (Optional[int]): (Value range is 0-64008.)
    """
    self._positions = tuple(positions)
    self._attacks = tuple(attacks)
    self._chats = tuple(chats)
    self._hp = hp
    self._tp = tp

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/npc_player_server_packet.py
78
79
80
81
82
83
84
85
86
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Npc

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/npc_player_server_packet.py
88
89
90
91
92
93
94
95
96
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Player

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/npc_player_server_packet.py
 98
 99
100
101
102
103
104
105
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.
    """
    NpcPlayerServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of NpcPlayerServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data NpcPlayerServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/npc_player_server_packet.py
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: "NpcPlayerServerPacket") -> None:
    """
    Serializes an instance of `NpcPlayerServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (NpcPlayerServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._positions is None:
            raise SerializationError("positions must be provided.")
        for i in range(len(data._positions)):
            NpcUpdatePosition.serialize(writer, data._positions[i])
        writer.add_byte(0xFF)
        if data._attacks is None:
            raise SerializationError("attacks must be provided.")
        for i in range(len(data._attacks)):
            NpcUpdateAttack.serialize(writer, data._attacks[i])
        writer.add_byte(0xFF)
        if data._chats is None:
            raise SerializationError("chats must be provided.")
        for i in range(len(data._chats)):
            NpcUpdateChat.serialize(writer, data._chats[i])
        writer.add_byte(0xFF)
        reached_missing_optional = data._hp is None
        if not reached_missing_optional:
            writer.add_short(cast(int, data._hp))
        reached_missing_optional = reached_missing_optional or data._tp is None
        if not reached_missing_optional:
            writer.add_short(cast(int, data._tp))
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of NpcPlayerServerPacket 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
NpcPlayerServerPacket 'NpcPlayerServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/npc_player_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
@staticmethod
def deserialize(reader: EoReader) -> "NpcPlayerServerPacket":
    """
    Deserializes an instance of `NpcPlayerServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        NpcPlayerServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        positions_length = int(reader.remaining / 4)
        positions = []
        for i in range(positions_length):
            positions.append(NpcUpdatePosition.deserialize(reader))
        reader.next_chunk()
        attacks_length = int(reader.remaining / 9)
        attacks = []
        for i in range(attacks_length):
            attacks.append(NpcUpdateAttack.deserialize(reader))
        reader.next_chunk()
        chats = []
        while reader.remaining > 0:
            chats.append(NpcUpdateChat.deserialize(reader))
        reader.next_chunk()
        hp: Optional[int] = None
        if reader.remaining > 0:
            hp = reader.get_short()
        tp: Optional[int] = None
        if reader.remaining > 0:
            tp = reader.get_short()
        reader.chunked_reading_mode = False
        result = NpcPlayerServerPacket(positions=positions, attacks=attacks, chats=chats, hp=hp, tp=tp)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

NpcJunkServerPacket

Bases: Packet

Clearing all boss children

Source code in src/eolib/protocol/_generated/net/server/npc_junk_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class NpcJunkServerPacket(Packet):
    """
    Clearing all boss children
    """
    _byte_size: int = 0
    _npc_id: int

    def __init__(self, *, npc_id: int):
        """
        Create a new instance of NpcJunkServerPacket.

        Args:
            npc_id (int): (Value range is 0-64008.)
        """
        self._npc_id = npc_id

    @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 npc_id(self) -> int:
        return self._npc_id

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Npc

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Junk

    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.
        """
        NpcJunkServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "NpcJunkServerPacket") -> None:
        """
        Serializes an instance of `NpcJunkServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (NpcJunkServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._npc_id is None:
                raise SerializationError("npc_id must be provided.")
            writer.add_short(data._npc_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "NpcJunkServerPacket":
        """
        Deserializes an instance of `NpcJunkServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            NpcJunkServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            npc_id = reader.get_short()
            result = NpcJunkServerPacket(npc_id=npc_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"NpcJunkServerPacket(byte_size={repr(self._byte_size)}, npc_id={repr(self._npc_id)})"

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.

npc_id: int property

__init__(*, npc_id)

Create a new instance of NpcJunkServerPacket.

Parameters:

Name Type Description Default
npc_id int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/npc_junk_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, npc_id: int):
    """
    Create a new instance of NpcJunkServerPacket.

    Args:
        npc_id (int): (Value range is 0-64008.)
    """
    self._npc_id = npc_id

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/npc_junk_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Npc

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/npc_junk_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Junk

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/npc_junk_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    NpcJunkServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of NpcJunkServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data NpcJunkServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/npc_junk_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "NpcJunkServerPacket") -> None:
    """
    Serializes an instance of `NpcJunkServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (NpcJunkServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._npc_id is None:
            raise SerializationError("npc_id must be provided.")
        writer.add_short(data._npc_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of NpcJunkServerPacket 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
NpcJunkServerPacket NpcJunkServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/npc_junk_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "NpcJunkServerPacket":
    """
    Deserializes an instance of `NpcJunkServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        NpcJunkServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        npc_id = reader.get_short()
        result = NpcJunkServerPacket(npc_id=npc_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

NpcDialogServerPacket

Bases: Packet

NPC chat message

Source code in src/eolib/protocol/_generated/net/server/npc_dialog_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
class NpcDialogServerPacket(Packet):
    """
    NPC chat message
    """
    _byte_size: int = 0
    _npc_index: int
    _message: str

    def __init__(self, *, npc_index: int, message: str):
        """
        Create a new instance of NpcDialogServerPacket.

        Args:
            npc_index (int): (Value range is 0-64008.)
            message (str): 
        """
        self._npc_index = npc_index
        self._message = message

    @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 npc_index(self) -> int:
        return self._npc_index

    @property
    def message(self) -> str:
        return self._message

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Npc

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Dialog

    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.
        """
        NpcDialogServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "NpcDialogServerPacket") -> None:
        """
        Serializes an instance of `NpcDialogServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (NpcDialogServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._npc_index is None:
                raise SerializationError("npc_index must be provided.")
            writer.add_short(data._npc_index)
            if data._message is None:
                raise SerializationError("message must be provided.")
            writer.add_string(data._message)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "NpcDialogServerPacket":
        """
        Deserializes an instance of `NpcDialogServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            NpcDialogServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            npc_index = reader.get_short()
            message = reader.get_string()
            result = NpcDialogServerPacket(npc_index=npc_index, message=message)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"NpcDialogServerPacket(byte_size={repr(self._byte_size)}, npc_index={repr(self._npc_index)}, message={repr(self._message)})"

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.

npc_index: int property

message: str property

__init__(*, npc_index, message)

Create a new instance of NpcDialogServerPacket.

Parameters:

Name Type Description Default
npc_index int

(Value range is 0-64008.)

required
message str
required
Source code in src/eolib/protocol/_generated/net/server/npc_dialog_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, npc_index: int, message: str):
    """
    Create a new instance of NpcDialogServerPacket.

    Args:
        npc_index (int): (Value range is 0-64008.)
        message (str): 
    """
    self._npc_index = npc_index
    self._message = message

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/npc_dialog_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Npc

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/npc_dialog_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Dialog

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/npc_dialog_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    NpcDialogServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of NpcDialogServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data NpcDialogServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/npc_dialog_server_packet.py
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@staticmethod
def serialize(writer: EoWriter, data: "NpcDialogServerPacket") -> None:
    """
    Serializes an instance of `NpcDialogServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (NpcDialogServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._npc_index is None:
            raise SerializationError("npc_index must be provided.")
        writer.add_short(data._npc_index)
        if data._message is None:
            raise SerializationError("message must be provided.")
        writer.add_string(data._message)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of NpcDialogServerPacket 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
NpcDialogServerPacket NpcDialogServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/npc_dialog_server_packet.py
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@staticmethod
def deserialize(reader: EoReader) -> "NpcDialogServerPacket":
    """
    Deserializes an instance of `NpcDialogServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        NpcDialogServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        npc_index = reader.get_short()
        message = reader.get_string()
        result = NpcDialogServerPacket(npc_index=npc_index, message=message)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

NpcAgreeServerPacket

Bases: Packet

Reply to request for information about nearby NPCs

Source code in src/eolib/protocol/_generated/net/server/npc_agree_server_packet.py
 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
class NpcAgreeServerPacket(Packet):
    """
    Reply to request for information about nearby NPCs
    """
    _byte_size: int = 0
    _npcs_count: int
    _npcs: tuple[NpcMapInfo, ...]

    def __init__(self, *, npcs: Iterable[NpcMapInfo]):
        """
        Create a new instance of NpcAgreeServerPacket.

        Args:
            npcs (Iterable[NpcMapInfo]): (Length must be 252 or less.)
        """
        self._npcs = tuple(npcs)
        self._npcs_count = len(self._npcs)

    @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 npcs(self) -> tuple[NpcMapInfo, ...]:
        return self._npcs

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Npc

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Agree

    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.
        """
        NpcAgreeServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "NpcAgreeServerPacket") -> None:
        """
        Serializes an instance of `NpcAgreeServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (NpcAgreeServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._npcs_count is None:
                raise SerializationError("npcs_count must be provided.")
            writer.add_char(data._npcs_count)
            if data._npcs is None:
                raise SerializationError("npcs must be provided.")
            if len(data._npcs) > 252:
                raise SerializationError(f"Expected length of npcs to be 252 or less, got {len(data._npcs)}.")
            for i in range(data._npcs_count):
                NpcMapInfo.serialize(writer, data._npcs[i])
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "NpcAgreeServerPacket":
        """
        Deserializes an instance of `NpcAgreeServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            NpcAgreeServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            npcs_count = reader.get_char()
            npcs = []
            for i in range(npcs_count):
                npcs.append(NpcMapInfo.deserialize(reader))
            result = NpcAgreeServerPacket(npcs=npcs)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"NpcAgreeServerPacket(byte_size={repr(self._byte_size)}, npcs={repr(self._npcs)})"

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.

npcs: tuple[NpcMapInfo, ...] property

__init__(*, npcs)

Create a new instance of NpcAgreeServerPacket.

Parameters:

Name Type Description Default
npcs Iterable[NpcMapInfo]

(Length must be 252 or less.)

required
Source code in src/eolib/protocol/_generated/net/server/npc_agree_server_packet.py
24
25
26
27
28
29
30
31
32
def __init__(self, *, npcs: Iterable[NpcMapInfo]):
    """
    Create a new instance of NpcAgreeServerPacket.

    Args:
        npcs (Iterable[NpcMapInfo]): (Length must be 252 or less.)
    """
    self._npcs = tuple(npcs)
    self._npcs_count = len(self._npcs)

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/npc_agree_server_packet.py
48
49
50
51
52
53
54
55
56
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Npc

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/npc_agree_server_packet.py
58
59
60
61
62
63
64
65
66
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Agree

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/npc_agree_server_packet.py
68
69
70
71
72
73
74
75
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.
    """
    NpcAgreeServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of NpcAgreeServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data NpcAgreeServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/npc_agree_server_packet.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@staticmethod
def serialize(writer: EoWriter, data: "NpcAgreeServerPacket") -> None:
    """
    Serializes an instance of `NpcAgreeServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (NpcAgreeServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._npcs_count is None:
            raise SerializationError("npcs_count must be provided.")
        writer.add_char(data._npcs_count)
        if data._npcs is None:
            raise SerializationError("npcs must be provided.")
        if len(data._npcs) > 252:
            raise SerializationError(f"Expected length of npcs to be 252 or less, got {len(data._npcs)}.")
        for i in range(data._npcs_count):
            NpcMapInfo.serialize(writer, data._npcs[i])
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of NpcAgreeServerPacket 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
NpcAgreeServerPacket 'NpcAgreeServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/npc_agree_server_packet.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
@staticmethod
def deserialize(reader: EoReader) -> "NpcAgreeServerPacket":
    """
    Deserializes an instance of `NpcAgreeServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        NpcAgreeServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        npcs_count = reader.get_char()
        npcs = []
        for i in range(npcs_count):
            npcs.append(NpcMapInfo.deserialize(reader))
        result = NpcAgreeServerPacket(npcs=npcs)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

NpcAcceptServerPacket

Bases: Packet

Nearby NPC killed and killer leveled up

Source code in src/eolib/protocol/_generated/net/server/npc_accept_server_packet.py
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
class NpcAcceptServerPacket(Packet):
    """
    Nearby NPC killed and killer leveled up
    """
    _byte_size: int = 0
    _npc_killed_data: NpcKilledData
    _experience: Optional[int]
    _level_up: Optional[LevelUpStats]

    def __init__(self, *, npc_killed_data: NpcKilledData, experience: Optional[int] = None, level_up: Optional[LevelUpStats] = None):
        """
        Create a new instance of NpcAcceptServerPacket.

        Args:
            npc_killed_data (NpcKilledData): 
            experience (Optional[int]): This field should be sent to the killer, but not nearby players (Value range is 0-4097152080.)
            level_up (Optional[LevelUpStats]): This field should be sent to the killer if they leveled up, but not nearby players
        """
        self._npc_killed_data = npc_killed_data
        self._experience = experience
        self._level_up = level_up

    @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 npc_killed_data(self) -> NpcKilledData:
        return self._npc_killed_data

    @property
    def experience(self) -> Optional[int]:
        """
        This field should be sent to the killer, but not nearby players
        """
        return self._experience

    @property
    def level_up(self) -> Optional[LevelUpStats]:
        """
        This field should be sent to the killer if they leveled up, but not nearby players
        """
        return self._level_up

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Npc

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Accept

    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.
        """
        NpcAcceptServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "NpcAcceptServerPacket") -> None:
        """
        Serializes an instance of `NpcAcceptServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (NpcAcceptServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._npc_killed_data is None:
                raise SerializationError("npc_killed_data must be provided.")
            NpcKilledData.serialize(writer, data._npc_killed_data)
            reached_missing_optional = data._experience is None
            if not reached_missing_optional:
                writer.add_int(cast(int, data._experience))
            reached_missing_optional = reached_missing_optional or data._level_up is None
            if not reached_missing_optional:
                LevelUpStats.serialize(writer, cast(LevelUpStats, data._level_up))
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "NpcAcceptServerPacket":
        """
        Deserializes an instance of `NpcAcceptServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            NpcAcceptServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            npc_killed_data = NpcKilledData.deserialize(reader)
            experience: Optional[int] = None
            if reader.remaining > 0:
                experience = reader.get_int()
            level_up: Optional[LevelUpStats] = None
            if reader.remaining > 0:
                level_up = LevelUpStats.deserialize(reader)
            result = NpcAcceptServerPacket(npc_killed_data=npc_killed_data, experience=experience, level_up=level_up)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"NpcAcceptServerPacket(byte_size={repr(self._byte_size)}, npc_killed_data={repr(self._npc_killed_data)}, experience={repr(self._experience)}, level_up={repr(self._level_up)})"

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.

npc_killed_data: NpcKilledData property

experience: Optional[int] property

This field should be sent to the killer, but not nearby players

level_up: Optional[LevelUpStats] property

This field should be sent to the killer if they leveled up, but not nearby players

__init__(*, npc_killed_data, experience=None, level_up=None)

Create a new instance of NpcAcceptServerPacket.

Parameters:

Name Type Description Default
npc_killed_data NpcKilledData
required
experience Optional[int]

This field should be sent to the killer, but not nearby players (Value range is 0-4097152080.)

None
level_up Optional[LevelUpStats]

This field should be sent to the killer if they leveled up, but not nearby players

None
Source code in src/eolib/protocol/_generated/net/server/npc_accept_server_packet.py
26
27
28
29
30
31
32
33
34
35
36
37
def __init__(self, *, npc_killed_data: NpcKilledData, experience: Optional[int] = None, level_up: Optional[LevelUpStats] = None):
    """
    Create a new instance of NpcAcceptServerPacket.

    Args:
        npc_killed_data (NpcKilledData): 
        experience (Optional[int]): This field should be sent to the killer, but not nearby players (Value range is 0-4097152080.)
        level_up (Optional[LevelUpStats]): This field should be sent to the killer if they leveled up, but not nearby players
    """
    self._npc_killed_data = npc_killed_data
    self._experience = experience
    self._level_up = level_up

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/npc_accept_server_packet.py
67
68
69
70
71
72
73
74
75
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Npc

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/npc_accept_server_packet.py
77
78
79
80
81
82
83
84
85
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Accept

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/npc_accept_server_packet.py
87
88
89
90
91
92
93
94
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.
    """
    NpcAcceptServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of NpcAcceptServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data NpcAcceptServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/npc_accept_server_packet.py
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
@staticmethod
def serialize(writer: EoWriter, data: "NpcAcceptServerPacket") -> None:
    """
    Serializes an instance of `NpcAcceptServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (NpcAcceptServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._npc_killed_data is None:
            raise SerializationError("npc_killed_data must be provided.")
        NpcKilledData.serialize(writer, data._npc_killed_data)
        reached_missing_optional = data._experience is None
        if not reached_missing_optional:
            writer.add_int(cast(int, data._experience))
        reached_missing_optional = reached_missing_optional or data._level_up is None
        if not reached_missing_optional:
            LevelUpStats.serialize(writer, cast(LevelUpStats, data._level_up))
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of NpcAcceptServerPacket 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
NpcAcceptServerPacket NpcAcceptServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/npc_accept_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "NpcAcceptServerPacket":
    """
    Deserializes an instance of `NpcAcceptServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        NpcAcceptServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        npc_killed_data = NpcKilledData.deserialize(reader)
        experience: Optional[int] = None
        if reader.remaining > 0:
            experience = reader.get_int()
        level_up: Optional[LevelUpStats] = None
        if reader.remaining > 0:
            level_up = LevelUpStats.deserialize(reader)
        result = NpcAcceptServerPacket(npc_killed_data=npc_killed_data, experience=experience, level_up=level_up)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

NearbyInfo

Information about nearby entities

Source code in src/eolib/protocol/_generated/net/server/nearby_info.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
class NearbyInfo:
    """
    Information about nearby entities
    """
    _byte_size: int = 0
    _characters_count: int
    _characters: tuple[CharacterMapInfo, ...]
    _npcs: tuple[NpcMapInfo, ...]
    _items: tuple[ItemMapInfo, ...]

    def __init__(self, *, characters: Iterable[CharacterMapInfo], npcs: Iterable[NpcMapInfo], items: Iterable[ItemMapInfo]):
        """
        Create a new instance of NearbyInfo.

        Args:
            characters (Iterable[CharacterMapInfo]): (Length must be 252 or less.)
            npcs (Iterable[NpcMapInfo]): 
            items (Iterable[ItemMapInfo]): 
        """
        self._characters = tuple(characters)
        self._characters_count = len(self._characters)
        self._npcs = tuple(npcs)
        self._items = tuple(items)

    @property
    def byte_size(self) -> int:
        """
        Returns the size of the data that this was deserialized from.

        Returns:
            int: The size of the data that this was deserialized from.
        """
        return self._byte_size

    @property
    def characters(self) -> tuple[CharacterMapInfo, ...]:
        return self._characters

    @property
    def npcs(self) -> tuple[NpcMapInfo, ...]:
        return self._npcs

    @property
    def items(self) -> tuple[ItemMapInfo, ...]:
        return self._items

    @staticmethod
    def serialize(writer: EoWriter, data: "NearbyInfo") -> None:
        """
        Serializes an instance of `NearbyInfo` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (NearbyInfo): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._characters_count is None:
                raise SerializationError("characters_count must be provided.")
            writer.add_char(data._characters_count)
            writer.string_sanitization_mode = True
            writer.add_byte(0xFF)
            if data._characters is None:
                raise SerializationError("characters must be provided.")
            if len(data._characters) > 252:
                raise SerializationError(f"Expected length of characters to be 252 or less, got {len(data._characters)}.")
            for i in range(data._characters_count):
                CharacterMapInfo.serialize(writer, data._characters[i])
                writer.add_byte(0xFF)
            if data._npcs is None:
                raise SerializationError("npcs must be provided.")
            for i in range(len(data._npcs)):
                NpcMapInfo.serialize(writer, data._npcs[i])
            writer.add_byte(0xFF)
            if data._items is None:
                raise SerializationError("items must be provided.")
            for i in range(len(data._items)):
                ItemMapInfo.serialize(writer, data._items[i])
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "NearbyInfo":
        """
        Deserializes an instance of `NearbyInfo` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            NearbyInfo: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            characters_count = reader.get_char()
            reader.chunked_reading_mode = True
            reader.next_chunk()
            characters = []
            for i in range(characters_count):
                characters.append(CharacterMapInfo.deserialize(reader))
                reader.next_chunk()
            npcs_length = int(reader.remaining / 6)
            npcs = []
            for i in range(npcs_length):
                npcs.append(NpcMapInfo.deserialize(reader))
            reader.next_chunk()
            items_length = int(reader.remaining / 9)
            items = []
            for i in range(items_length):
                items.append(ItemMapInfo.deserialize(reader))
            reader.chunked_reading_mode = False
            result = NearbyInfo(characters=characters, npcs=npcs, items=items)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"NearbyInfo(byte_size={repr(self._byte_size)}, characters={repr(self._characters)}, npcs={repr(self._npcs)}, items={repr(self._items)})"

byte_size: int property

Returns the size of the data that this was deserialized from.

Returns:

Name Type Description
int int

The size of the data that this was deserialized from.

characters: tuple[CharacterMapInfo, ...] property

npcs: tuple[NpcMapInfo, ...] property

items: tuple[ItemMapInfo, ...] property

__init__(*, characters, npcs, items)

Create a new instance of NearbyInfo.

Parameters:

Name Type Description Default
characters Iterable[CharacterMapInfo]

(Length must be 252 or less.)

required
npcs Iterable[NpcMapInfo]
required
items Iterable[ItemMapInfo]
required
Source code in src/eolib/protocol/_generated/net/server/nearby_info.py
25
26
27
28
29
30
31
32
33
34
35
36
37
def __init__(self, *, characters: Iterable[CharacterMapInfo], npcs: Iterable[NpcMapInfo], items: Iterable[ItemMapInfo]):
    """
    Create a new instance of NearbyInfo.

    Args:
        characters (Iterable[CharacterMapInfo]): (Length must be 252 or less.)
        npcs (Iterable[NpcMapInfo]): 
        items (Iterable[ItemMapInfo]): 
    """
    self._characters = tuple(characters)
    self._characters_count = len(self._characters)
    self._npcs = tuple(npcs)
    self._items = tuple(items)

serialize(writer, data) staticmethod

Serializes an instance of NearbyInfo to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data NearbyInfo

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/nearby_info.py
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
@staticmethod
def serialize(writer: EoWriter, data: "NearbyInfo") -> None:
    """
    Serializes an instance of `NearbyInfo` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (NearbyInfo): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._characters_count is None:
            raise SerializationError("characters_count must be provided.")
        writer.add_char(data._characters_count)
        writer.string_sanitization_mode = True
        writer.add_byte(0xFF)
        if data._characters is None:
            raise SerializationError("characters must be provided.")
        if len(data._characters) > 252:
            raise SerializationError(f"Expected length of characters to be 252 or less, got {len(data._characters)}.")
        for i in range(data._characters_count):
            CharacterMapInfo.serialize(writer, data._characters[i])
            writer.add_byte(0xFF)
        if data._npcs is None:
            raise SerializationError("npcs must be provided.")
        for i in range(len(data._npcs)):
            NpcMapInfo.serialize(writer, data._npcs[i])
        writer.add_byte(0xFF)
        if data._items is None:
            raise SerializationError("items must be provided.")
        for i in range(len(data._items)):
            ItemMapInfo.serialize(writer, data._items[i])
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of NearbyInfo 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
NearbyInfo 'NearbyInfo'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/nearby_info.py
 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
@staticmethod
def deserialize(reader: EoReader) -> "NearbyInfo":
    """
    Deserializes an instance of `NearbyInfo` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        NearbyInfo: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        characters_count = reader.get_char()
        reader.chunked_reading_mode = True
        reader.next_chunk()
        characters = []
        for i in range(characters_count):
            characters.append(CharacterMapInfo.deserialize(reader))
            reader.next_chunk()
        npcs_length = int(reader.remaining / 6)
        npcs = []
        for i in range(npcs_length):
            npcs.append(NpcMapInfo.deserialize(reader))
        reader.next_chunk()
        items_length = int(reader.remaining / 9)
        items = []
        for i in range(items_length):
            items.append(ItemMapInfo.deserialize(reader))
        reader.chunked_reading_mode = False
        result = NearbyInfo(characters=characters, npcs=npcs, items=items)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

NpcMapInfo

Information about a nearby NPC

Source code in src/eolib/protocol/_generated/net/server/npc_map_info.py
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
class NpcMapInfo:
    """
    Information about a nearby NPC
    """
    _byte_size: int = 0
    _index: int
    _id: int
    _coords: Coords
    _direction: Direction

    def __init__(self, *, index: int, id: int, coords: Coords, direction: Direction):
        """
        Create a new instance of NpcMapInfo.

        Args:
            index (int): (Value range is 0-252.)
            id (int): (Value range is 0-64008.)
            coords (Coords): 
            direction (Direction): 
        """
        self._index = index
        self._id = id
        self._coords = coords
        self._direction = direction

    @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 index(self) -> int:
        return self._index

    @property
    def id(self) -> int:
        return self._id

    @property
    def coords(self) -> Coords:
        return self._coords

    @property
    def direction(self) -> Direction:
        return self._direction

    @staticmethod
    def serialize(writer: EoWriter, data: "NpcMapInfo") -> None:
        """
        Serializes an instance of `NpcMapInfo` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (NpcMapInfo): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._index is None:
                raise SerializationError("index must be provided.")
            writer.add_char(data._index)
            if data._id is None:
                raise SerializationError("id must be provided.")
            writer.add_short(data._id)
            if data._coords is None:
                raise SerializationError("coords must be provided.")
            Coords.serialize(writer, data._coords)
            if data._direction is None:
                raise SerializationError("direction must be provided.")
            writer.add_char(int(data._direction))
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "NpcMapInfo":
        """
        Deserializes an instance of `NpcMapInfo` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            NpcMapInfo: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            index = reader.get_char()
            id = reader.get_short()
            coords = Coords.deserialize(reader)
            direction = Direction(reader.get_char())
            result = NpcMapInfo(index=index, id=id, coords=coords, direction=direction)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"NpcMapInfo(byte_size={repr(self._byte_size)}, index={repr(self._index)}, id={repr(self._id)}, coords={repr(self._coords)}, direction={repr(self._direction)})"

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.

index: int property

id: int property

coords: Coords property

direction: Direction property

__init__(*, index, id, coords, direction)

Create a new instance of NpcMapInfo.

Parameters:

Name Type Description Default
index int

(Value range is 0-252.)

required
id int

(Value range is 0-64008.)

required
coords Coords
required
direction Direction
required
Source code in src/eolib/protocol/_generated/net/server/npc_map_info.py
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def __init__(self, *, index: int, id: int, coords: Coords, direction: Direction):
    """
    Create a new instance of NpcMapInfo.

    Args:
        index (int): (Value range is 0-252.)
        id (int): (Value range is 0-64008.)
        coords (Coords): 
        direction (Direction): 
    """
    self._index = index
    self._id = id
    self._coords = coords
    self._direction = direction

serialize(writer, data) staticmethod

Serializes an instance of NpcMapInfo to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data NpcMapInfo

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/npc_map_info.py
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
@staticmethod
def serialize(writer: EoWriter, data: "NpcMapInfo") -> None:
    """
    Serializes an instance of `NpcMapInfo` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (NpcMapInfo): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._index is None:
            raise SerializationError("index must be provided.")
        writer.add_char(data._index)
        if data._id is None:
            raise SerializationError("id must be provided.")
        writer.add_short(data._id)
        if data._coords is None:
            raise SerializationError("coords must be provided.")
        Coords.serialize(writer, data._coords)
        if data._direction is None:
            raise SerializationError("direction must be provided.")
        writer.add_char(int(data._direction))
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of NpcMapInfo 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
NpcMapInfo NpcMapInfo

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/npc_map_info.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
@staticmethod
def deserialize(reader: EoReader) -> "NpcMapInfo":
    """
    Deserializes an instance of `NpcMapInfo` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        NpcMapInfo: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        index = reader.get_char()
        id = reader.get_short()
        coords = Coords.deserialize(reader)
        direction = Direction(reader.get_char())
        result = NpcMapInfo(index=index, id=id, coords=coords, direction=direction)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

MusicPlayerServerPacket

Bases: Packet

Sound effect

Source code in src/eolib/protocol/_generated/net/server/music_player_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class MusicPlayerServerPacket(Packet):
    """
    Sound effect
    """
    _byte_size: int = 0
    _sound_id: int

    def __init__(self, *, sound_id: int):
        """
        Create a new instance of MusicPlayerServerPacket.

        Args:
            sound_id (int): (Value range is 0-252.)
        """
        self._sound_id = sound_id

    @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 sound_id(self) -> int:
        return self._sound_id

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Music

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Player

    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.
        """
        MusicPlayerServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "MusicPlayerServerPacket") -> None:
        """
        Serializes an instance of `MusicPlayerServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (MusicPlayerServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._sound_id is None:
                raise SerializationError("sound_id must be provided.")
            writer.add_char(data._sound_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "MusicPlayerServerPacket":
        """
        Deserializes an instance of `MusicPlayerServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            MusicPlayerServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            sound_id = reader.get_char()
            result = MusicPlayerServerPacket(sound_id=sound_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"MusicPlayerServerPacket(byte_size={repr(self._byte_size)}, sound_id={repr(self._sound_id)})"

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.

sound_id: int property

__init__(*, sound_id)

Create a new instance of MusicPlayerServerPacket.

Parameters:

Name Type Description Default
sound_id int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/music_player_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, sound_id: int):
    """
    Create a new instance of MusicPlayerServerPacket.

    Args:
        sound_id (int): (Value range is 0-252.)
    """
    self._sound_id = sound_id

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/music_player_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Music

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/music_player_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Player

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/music_player_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    MusicPlayerServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of MusicPlayerServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data MusicPlayerServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/music_player_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "MusicPlayerServerPacket") -> None:
    """
    Serializes an instance of `MusicPlayerServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (MusicPlayerServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._sound_id is None:
            raise SerializationError("sound_id must be provided.")
        writer.add_char(data._sound_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of MusicPlayerServerPacket 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
MusicPlayerServerPacket MusicPlayerServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/music_player_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "MusicPlayerServerPacket":
    """
    Deserializes an instance of `MusicPlayerServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        MusicPlayerServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        sound_id = reader.get_char()
        result = MusicPlayerServerPacket(sound_id=sound_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

MessagePongServerPacket

Bases: Packet

ping command reply

Source code in src/eolib/protocol/_generated/net/server/message_pong_server_packet.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
class MessagePongServerPacket(Packet):
    """
    #ping command reply
    """
    _byte_size: int = 0

    def __init__(self):
        """
        Create a new instance of MessagePongServerPacket.
        """

    @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 family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Message

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Pong

    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.
        """
        MessagePongServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "MessagePongServerPacket") -> None:
        """
        Serializes an instance of `MessagePongServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (MessagePongServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.add_short(2)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "MessagePongServerPacket":
        """
        Deserializes an instance of `MessagePongServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            MessagePongServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_short()
            result = MessagePongServerPacket()
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"MessagePongServerPacket(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 MessagePongServerPacket.

Source code in src/eolib/protocol/_generated/net/server/message_pong_server_packet.py
18
19
20
21
def __init__(self):
    """
    Create a new instance of MessagePongServerPacket.
    """

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/message_pong_server_packet.py
33
34
35
36
37
38
39
40
41
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Message

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/message_pong_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Pong

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/message_pong_server_packet.py
53
54
55
56
57
58
59
60
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.
    """
    MessagePongServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of MessagePongServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data MessagePongServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/message_pong_server_packet.py
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@staticmethod
def serialize(writer: EoWriter, data: "MessagePongServerPacket") -> None:
    """
    Serializes an instance of `MessagePongServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (MessagePongServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.add_short(2)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of MessagePongServerPacket 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
MessagePongServerPacket MessagePongServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/message_pong_server_packet.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@staticmethod
def deserialize(reader: EoReader) -> "MessagePongServerPacket":
    """
    Deserializes an instance of `MessagePongServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        MessagePongServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_short()
        result = MessagePongServerPacket()
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

MessageOpenServerPacket

Bases: Packet

Status bar message

Source code in src/eolib/protocol/_generated/net/server/message_open_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class MessageOpenServerPacket(Packet):
    """
    Status bar message
    """
    _byte_size: int = 0
    _message: str

    def __init__(self, *, message: str):
        """
        Create a new instance of MessageOpenServerPacket.

        Args:
            message (str): 
        """
        self._message = message

    @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 message(self) -> str:
        return self._message

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Message

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Open

    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.
        """
        MessageOpenServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "MessageOpenServerPacket") -> None:
        """
        Serializes an instance of `MessageOpenServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (MessageOpenServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._message is None:
                raise SerializationError("message must be provided.")
            writer.add_string(data._message)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "MessageOpenServerPacket":
        """
        Deserializes an instance of `MessageOpenServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            MessageOpenServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            message = reader.get_string()
            result = MessageOpenServerPacket(message=message)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"MessageOpenServerPacket(byte_size={repr(self._byte_size)}, message={repr(self._message)})"

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.

message: str property

__init__(*, message)

Create a new instance of MessageOpenServerPacket.

Parameters:

Name Type Description Default
message str
required
Source code in src/eolib/protocol/_generated/net/server/message_open_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, message: str):
    """
    Create a new instance of MessageOpenServerPacket.

    Args:
        message (str): 
    """
    self._message = message

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/message_open_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Message

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/message_open_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Open

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/message_open_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    MessageOpenServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of MessageOpenServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data MessageOpenServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/message_open_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "MessageOpenServerPacket") -> None:
    """
    Serializes an instance of `MessageOpenServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (MessageOpenServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._message is None:
            raise SerializationError("message must be provided.")
        writer.add_string(data._message)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of MessageOpenServerPacket 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
MessageOpenServerPacket MessageOpenServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/message_open_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "MessageOpenServerPacket":
    """
    Deserializes an instance of `MessageOpenServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        MessageOpenServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        message = reader.get_string()
        result = MessageOpenServerPacket(message=message)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

MessageCloseServerPacket

Bases: Packet

Server is rebooting

Source code in src/eolib/protocol/_generated/net/server/message_close_server_packet.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
class MessageCloseServerPacket(Packet):
    """
    Server is rebooting
    """
    _byte_size: int = 0

    def __init__(self):
        """
        Create a new instance of MessageCloseServerPacket.
        """

    @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 family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Message

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Close

    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.
        """
        MessageCloseServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "MessageCloseServerPacket") -> None:
        """
        Serializes an instance of `MessageCloseServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (MessageCloseServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.add_string("r")
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "MessageCloseServerPacket":
        """
        Deserializes an instance of `MessageCloseServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            MessageCloseServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            result = MessageCloseServerPacket()
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"MessageCloseServerPacket(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 MessageCloseServerPacket.

Source code in src/eolib/protocol/_generated/net/server/message_close_server_packet.py
18
19
20
21
def __init__(self):
    """
    Create a new instance of MessageCloseServerPacket.
    """

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/message_close_server_packet.py
33
34
35
36
37
38
39
40
41
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Message

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/message_close_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Close

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/message_close_server_packet.py
53
54
55
56
57
58
59
60
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.
    """
    MessageCloseServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of MessageCloseServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data MessageCloseServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/message_close_server_packet.py
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@staticmethod
def serialize(writer: EoWriter, data: "MessageCloseServerPacket") -> None:
    """
    Serializes an instance of `MessageCloseServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (MessageCloseServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.add_string("r")
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of MessageCloseServerPacket 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
MessageCloseServerPacket MessageCloseServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/message_close_server_packet.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@staticmethod
def deserialize(reader: EoReader) -> "MessageCloseServerPacket":
    """
    Deserializes an instance of `MessageCloseServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        MessageCloseServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        result = MessageCloseServerPacket()
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

MessageAcceptServerPacket

Bases: Packet

Large message box

Source code in src/eolib/protocol/_generated/net/server/message_accept_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
class MessageAcceptServerPacket(Packet):
    """
    Large message box
    """
    _byte_size: int = 0
    _messages: tuple[str, ...]

    def __init__(self, *, messages: Iterable[str]):
        """
        Create a new instance of MessageAcceptServerPacket.

        Args:
            messages (Iterable[str]): (Length must be `4`.)
        """
        self._messages = tuple(messages)

    @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 messages(self) -> tuple[str, ...]:
        return self._messages

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Message

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Accept

    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.
        """
        MessageAcceptServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "MessageAcceptServerPacket") -> None:
        """
        Serializes an instance of `MessageAcceptServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (MessageAcceptServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._messages is None:
                raise SerializationError("messages must be provided.")
            if len(data._messages) != 4:
                raise SerializationError(f"Expected length of messages to be exactly 4, got {len(data._messages)}.")
            for i in range(4):
                writer.add_string(data._messages[i])
                writer.add_byte(0xFF)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "MessageAcceptServerPacket":
        """
        Deserializes an instance of `MessageAcceptServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            MessageAcceptServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            messages = []
            for i in range(4):
                messages.append(reader.get_string())
                reader.next_chunk()
            reader.chunked_reading_mode = False
            result = MessageAcceptServerPacket(messages=messages)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"MessageAcceptServerPacket(byte_size={repr(self._byte_size)}, messages={repr(self._messages)})"

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.

messages: tuple[str, ...] property

__init__(*, messages)

Create a new instance of MessageAcceptServerPacket.

Parameters:

Name Type Description Default
messages Iterable[str]

(Length must be 4.)

required
Source code in src/eolib/protocol/_generated/net/server/message_accept_server_packet.py
22
23
24
25
26
27
28
29
def __init__(self, *, messages: Iterable[str]):
    """
    Create a new instance of MessageAcceptServerPacket.

    Args:
        messages (Iterable[str]): (Length must be `4`.)
    """
    self._messages = tuple(messages)

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/message_accept_server_packet.py
45
46
47
48
49
50
51
52
53
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Message

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/message_accept_server_packet.py
55
56
57
58
59
60
61
62
63
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Accept

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/message_accept_server_packet.py
65
66
67
68
69
70
71
72
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.
    """
    MessageAcceptServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of MessageAcceptServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data MessageAcceptServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/message_accept_server_packet.py
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
@staticmethod
def serialize(writer: EoWriter, data: "MessageAcceptServerPacket") -> None:
    """
    Serializes an instance of `MessageAcceptServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (MessageAcceptServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._messages is None:
            raise SerializationError("messages must be provided.")
        if len(data._messages) != 4:
            raise SerializationError(f"Expected length of messages to be exactly 4, got {len(data._messages)}.")
        for i in range(4):
            writer.add_string(data._messages[i])
            writer.add_byte(0xFF)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of MessageAcceptServerPacket 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
MessageAcceptServerPacket 'MessageAcceptServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/message_accept_server_packet.py
 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
@staticmethod
def deserialize(reader: EoReader) -> "MessageAcceptServerPacket":
    """
    Deserializes an instance of `MessageAcceptServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        MessageAcceptServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        messages = []
        for i in range(4):
            messages.append(reader.get_string())
            reader.next_chunk()
        reader.chunked_reading_mode = False
        result = MessageAcceptServerPacket(messages=messages)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

MarriageReplyServerPacket

Bases: Packet

Reply to client Marriage-family packets

Source code in src/eolib/protocol/_generated/net/server/marriage_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
class MarriageReplyServerPacket(Packet):
    """
    Reply to client Marriage-family packets
    """
    _byte_size: int = 0
    _reply_code: MarriageReply
    _reply_code_data: 'MarriageReplyServerPacket.ReplyCodeData'

    def __init__(self, *, reply_code: MarriageReply, reply_code_data: 'MarriageReplyServerPacket.ReplyCodeData' = None):
        """
        Create a new instance of MarriageReplyServerPacket.

        Args:
            reply_code (MarriageReply): 
            reply_code_data (MarriageReplyServerPacket.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) -> MarriageReply:
        return self._reply_code

    @property
    def reply_code_data(self) -> 'MarriageReplyServerPacket.ReplyCodeData':
        """
        MarriageReplyServerPacket.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.Marriage

    @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.
        """
        MarriageReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "MarriageReplyServerPacket") -> None:
        """
        Serializes an instance of `MarriageReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (MarriageReplyServerPacket): 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 == MarriageReply.Success:
                if not isinstance(data._reply_code_data, MarriageReplyServerPacket.ReplyCodeDataSuccess):
                    raise SerializationError("Expected reply_code_data to be type MarriageReplyServerPacket.ReplyCodeDataSuccess for reply_code " + MarriageReply(data._reply_code).name + ".")
                MarriageReplyServerPacket.ReplyCodeDataSuccess.serialize(writer, data._reply_code_data)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "MarriageReplyServerPacket":
        """
        Deserializes an instance of `MarriageReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            MarriageReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reply_code = MarriageReply(reader.get_short())
            reply_code_data: MarriageReplyServerPacket.ReplyCodeData = None
            if reply_code == MarriageReply.Success:
                reply_code_data = MarriageReplyServerPacket.ReplyCodeDataSuccess.deserialize(reader)
            result = MarriageReplyServerPacket(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"MarriageReplyServerPacket(byte_size={repr(self._byte_size)}, reply_code={repr(self._reply_code)}, reply_code_data={repr(self._reply_code_data)})"

    ReplyCodeData = Union['MarriageReplyServerPacket.ReplyCodeDataSuccess', None]
    """
    Data associated with different values of the `reply_code` field.
    """

    class ReplyCodeDataSuccess:
        """
        Data associated with reply_code value MarriageReply.Success
        """
        _byte_size: int = 0
        _gold_amount: int

        def __init__(self, *, gold_amount: int):
            """
            Create a new instance of MarriageReplyServerPacket.ReplyCodeDataSuccess.

            Args:
                gold_amount (int): (Value range is 0-4097152080.)
            """
            self._gold_amount = gold_amount

        @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 gold_amount(self) -> int:
            return self._gold_amount

        @staticmethod
        def serialize(writer: EoWriter, data: "MarriageReplyServerPacket.ReplyCodeDataSuccess") -> None:
            """
            Serializes an instance of `MarriageReplyServerPacket.ReplyCodeDataSuccess` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (MarriageReplyServerPacket.ReplyCodeDataSuccess): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._gold_amount is None:
                    raise SerializationError("gold_amount must be provided.")
                writer.add_int(data._gold_amount)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "MarriageReplyServerPacket.ReplyCodeDataSuccess":
            """
            Deserializes an instance of `MarriageReplyServerPacket.ReplyCodeDataSuccess` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                MarriageReplyServerPacket.ReplyCodeDataSuccess: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                gold_amount = reader.get_int()
                result = MarriageReplyServerPacket.ReplyCodeDataSuccess(gold_amount=gold_amount)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"MarriageReplyServerPacket.ReplyCodeDataSuccess(byte_size={repr(self._byte_size)}, gold_amount={repr(self._gold_amount)})"

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: MarriageReply property

reply_code_data: MarriageReplyServerPacket.ReplyCodeData property

MarriageReplyServerPacket.ReplyCodeData: Data associated with the reply_code field.

ReplyCodeData = Union['MarriageReplyServerPacket.ReplyCodeDataSuccess', None] class-attribute instance-attribute

Data associated with different values of the reply_code field.

ReplyCodeDataSuccess

Data associated with reply_code value MarriageReply.Success

Source code in src/eolib/protocol/_generated/net/server/marriage_reply_server_packet.py
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
class ReplyCodeDataSuccess:
    """
    Data associated with reply_code value MarriageReply.Success
    """
    _byte_size: int = 0
    _gold_amount: int

    def __init__(self, *, gold_amount: int):
        """
        Create a new instance of MarriageReplyServerPacket.ReplyCodeDataSuccess.

        Args:
            gold_amount (int): (Value range is 0-4097152080.)
        """
        self._gold_amount = gold_amount

    @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 gold_amount(self) -> int:
        return self._gold_amount

    @staticmethod
    def serialize(writer: EoWriter, data: "MarriageReplyServerPacket.ReplyCodeDataSuccess") -> None:
        """
        Serializes an instance of `MarriageReplyServerPacket.ReplyCodeDataSuccess` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (MarriageReplyServerPacket.ReplyCodeDataSuccess): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._gold_amount is None:
                raise SerializationError("gold_amount must be provided.")
            writer.add_int(data._gold_amount)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "MarriageReplyServerPacket.ReplyCodeDataSuccess":
        """
        Deserializes an instance of `MarriageReplyServerPacket.ReplyCodeDataSuccess` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            MarriageReplyServerPacket.ReplyCodeDataSuccess: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            gold_amount = reader.get_int()
            result = MarriageReplyServerPacket.ReplyCodeDataSuccess(gold_amount=gold_amount)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"MarriageReplyServerPacket.ReplyCodeDataSuccess(byte_size={repr(self._byte_size)}, gold_amount={repr(self._gold_amount)})"

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.

gold_amount: int property

__init__(*, gold_amount)

Create a new instance of MarriageReplyServerPacket.ReplyCodeDataSuccess.

Parameters:

Name Type Description Default
gold_amount int

(Value range is 0-4097152080.)

required
Source code in src/eolib/protocol/_generated/net/server/marriage_reply_server_packet.py
144
145
146
147
148
149
150
151
def __init__(self, *, gold_amount: int):
    """
    Create a new instance of MarriageReplyServerPacket.ReplyCodeDataSuccess.

    Args:
        gold_amount (int): (Value range is 0-4097152080.)
    """
    self._gold_amount = gold_amount

serialize(writer, data) staticmethod

Serializes an instance of MarriageReplyServerPacket.ReplyCodeDataSuccess to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataSuccess

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/marriage_reply_server_packet.py
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
@staticmethod
def serialize(writer: EoWriter, data: "MarriageReplyServerPacket.ReplyCodeDataSuccess") -> None:
    """
    Serializes an instance of `MarriageReplyServerPacket.ReplyCodeDataSuccess` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (MarriageReplyServerPacket.ReplyCodeDataSuccess): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._gold_amount is None:
            raise SerializationError("gold_amount must be provided.")
        writer.add_int(data._gold_amount)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of MarriageReplyServerPacket.ReplyCodeDataSuccess from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataSuccess

MarriageReplyServerPacket.ReplyCodeDataSuccess: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/marriage_reply_server_packet.py
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
@staticmethod
def deserialize(reader: EoReader) -> "MarriageReplyServerPacket.ReplyCodeDataSuccess":
    """
    Deserializes an instance of `MarriageReplyServerPacket.ReplyCodeDataSuccess` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        MarriageReplyServerPacket.ReplyCodeDataSuccess: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        gold_amount = reader.get_int()
        result = MarriageReplyServerPacket.ReplyCodeDataSuccess(gold_amount=gold_amount)
        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 MarriageReplyServerPacket.

Parameters:

Name Type Description Default
reply_code MarriageReply
required
reply_code_data ReplyCodeData

Data associated with the reply_code field.

None
Source code in src/eolib/protocol/_generated/net/server/marriage_reply_server_packet.py
23
24
25
26
27
28
29
30
31
32
def __init__(self, *, reply_code: MarriageReply, reply_code_data: 'MarriageReplyServerPacket.ReplyCodeData' = None):
    """
    Create a new instance of MarriageReplyServerPacket.

    Args:
        reply_code (MarriageReply): 
        reply_code_data (MarriageReplyServerPacket.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/marriage_reply_server_packet.py
55
56
57
58
59
60
61
62
63
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Marriage

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/marriage_reply_server_packet.py
65
66
67
68
69
70
71
72
73
@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/marriage_reply_server_packet.py
75
76
77
78
79
80
81
82
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.
    """
    MarriageReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of MarriageReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data MarriageReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/marriage_reply_server_packet.py
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
@staticmethod
def serialize(writer: EoWriter, data: "MarriageReplyServerPacket") -> None:
    """
    Serializes an instance of `MarriageReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (MarriageReplyServerPacket): 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 == MarriageReply.Success:
            if not isinstance(data._reply_code_data, MarriageReplyServerPacket.ReplyCodeDataSuccess):
                raise SerializationError("Expected reply_code_data to be type MarriageReplyServerPacket.ReplyCodeDataSuccess for reply_code " + MarriageReply(data._reply_code).name + ".")
            MarriageReplyServerPacket.ReplyCodeDataSuccess.serialize(writer, data._reply_code_data)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of MarriageReplyServerPacket 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
MarriageReplyServerPacket MarriageReplyServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/marriage_reply_server_packet.py
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
@staticmethod
def deserialize(reader: EoReader) -> "MarriageReplyServerPacket":
    """
    Deserializes an instance of `MarriageReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        MarriageReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reply_code = MarriageReply(reader.get_short())
        reply_code_data: MarriageReplyServerPacket.ReplyCodeData = None
        if reply_code == MarriageReply.Success:
            reply_code_data = MarriageReplyServerPacket.ReplyCodeDataSuccess.deserialize(reader)
        result = MarriageReplyServerPacket(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

MarriageReply

Bases: IntEnum

Reply code sent with MARRIAGE_REPLY packet

Source code in src/eolib/protocol/_generated/net/server/marriage_reply.py
 9
10
11
12
13
14
15
16
17
18
19
class MarriageReply(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Reply code sent with MARRIAGE_REPLY packet
    """
    AlreadyMarried = 1
    NotMarried = 2
    Success = 3
    NotEnoughGold = 4
    WrongName = 5
    ServiceBusy = 6
    DivorceNotification = 7

AlreadyMarried = 1 class-attribute instance-attribute

NotMarried = 2 class-attribute instance-attribute

Success = 3 class-attribute instance-attribute

NotEnoughGold = 4 class-attribute instance-attribute

WrongName = 5 class-attribute instance-attribute

ServiceBusy = 6 class-attribute instance-attribute

DivorceNotification = 7 class-attribute instance-attribute

MarriageOpenServerPacket

Bases: Packet

Response from talking to a law NPC

Source code in src/eolib/protocol/_generated/net/server/marriage_open_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class MarriageOpenServerPacket(Packet):
    """
    Response from talking to a law NPC
    """
    _byte_size: int = 0
    _session_id: int

    def __init__(self, *, session_id: int):
        """
        Create a new instance of MarriageOpenServerPacket.

        Args:
            session_id (int): (Value range is 0-16194276.)
        """
        self._session_id = session_id

    @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:
        return self._session_id

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Marriage

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Open

    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.
        """
        MarriageOpenServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "MarriageOpenServerPacket") -> None:
        """
        Serializes an instance of `MarriageOpenServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (MarriageOpenServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._session_id is None:
                raise SerializationError("session_id must be provided.")
            writer.add_three(data._session_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "MarriageOpenServerPacket":
        """
        Deserializes an instance of `MarriageOpenServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            MarriageOpenServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            session_id = reader.get_three()
            result = MarriageOpenServerPacket(session_id=session_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"MarriageOpenServerPacket(byte_size={repr(self._byte_size)}, session_id={repr(self._session_id)})"

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

__init__(*, session_id)

Create a new instance of MarriageOpenServerPacket.

Parameters:

Name Type Description Default
session_id int

(Value range is 0-16194276.)

required
Source code in src/eolib/protocol/_generated/net/server/marriage_open_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, session_id: int):
    """
    Create a new instance of MarriageOpenServerPacket.

    Args:
        session_id (int): (Value range is 0-16194276.)
    """
    self._session_id = session_id

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/marriage_open_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Marriage

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/marriage_open_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Open

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/marriage_open_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    MarriageOpenServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of MarriageOpenServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data MarriageOpenServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/marriage_open_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "MarriageOpenServerPacket") -> None:
    """
    Serializes an instance of `MarriageOpenServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (MarriageOpenServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._session_id is None:
            raise SerializationError("session_id must be provided.")
        writer.add_three(data._session_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of MarriageOpenServerPacket 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
MarriageOpenServerPacket MarriageOpenServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/marriage_open_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "MarriageOpenServerPacket":
    """
    Deserializes an instance of `MarriageOpenServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        MarriageOpenServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        session_id = reader.get_three()
        result = MarriageOpenServerPacket(session_id=session_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

LoginReplyServerPacket

Bases: Packet

Login reply

Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
 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
class LoginReplyServerPacket(Packet):
    """
    Login reply
    """
    _byte_size: int = 0
    _reply_code: LoginReply
    _reply_code_data: 'LoginReplyServerPacket.ReplyCodeData'

    def __init__(self, *, reply_code: LoginReply, reply_code_data: 'LoginReplyServerPacket.ReplyCodeData' = None):
        """
        Create a new instance of LoginReplyServerPacket.

        Args:
            reply_code (LoginReply): 
            reply_code_data (LoginReplyServerPacket.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) -> LoginReply:
        return self._reply_code

    @property
    def reply_code_data(self) -> 'LoginReplyServerPacket.ReplyCodeData':
        """
        LoginReplyServerPacket.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.Login

    @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.
        """
        LoginReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "LoginReplyServerPacket") -> None:
        """
        Serializes an instance of `LoginReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (LoginReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._reply_code is None:
                raise SerializationError("reply_code must be provided.")
            writer.add_short(int(data._reply_code))
            if data._reply_code == LoginReply.WrongUser:
                if not isinstance(data._reply_code_data, LoginReplyServerPacket.ReplyCodeDataWrongUser):
                    raise SerializationError("Expected reply_code_data to be type LoginReplyServerPacket.ReplyCodeDataWrongUser for reply_code " + LoginReply(data._reply_code).name + ".")
                LoginReplyServerPacket.ReplyCodeDataWrongUser.serialize(writer, data._reply_code_data)
            elif data._reply_code == LoginReply.WrongUserPassword:
                if not isinstance(data._reply_code_data, LoginReplyServerPacket.ReplyCodeDataWrongUserPassword):
                    raise SerializationError("Expected reply_code_data to be type LoginReplyServerPacket.ReplyCodeDataWrongUserPassword for reply_code " + LoginReply(data._reply_code).name + ".")
                LoginReplyServerPacket.ReplyCodeDataWrongUserPassword.serialize(writer, data._reply_code_data)
            elif data._reply_code == LoginReply.Ok:
                if not isinstance(data._reply_code_data, LoginReplyServerPacket.ReplyCodeDataOk):
                    raise SerializationError("Expected reply_code_data to be type LoginReplyServerPacket.ReplyCodeDataOk for reply_code " + LoginReply(data._reply_code).name + ".")
                LoginReplyServerPacket.ReplyCodeDataOk.serialize(writer, data._reply_code_data)
            elif data._reply_code == LoginReply.Banned:
                if not isinstance(data._reply_code_data, LoginReplyServerPacket.ReplyCodeDataBanned):
                    raise SerializationError("Expected reply_code_data to be type LoginReplyServerPacket.ReplyCodeDataBanned for reply_code " + LoginReply(data._reply_code).name + ".")
                LoginReplyServerPacket.ReplyCodeDataBanned.serialize(writer, data._reply_code_data)
            elif data._reply_code == LoginReply.LoggedIn:
                if not isinstance(data._reply_code_data, LoginReplyServerPacket.ReplyCodeDataLoggedIn):
                    raise SerializationError("Expected reply_code_data to be type LoginReplyServerPacket.ReplyCodeDataLoggedIn for reply_code " + LoginReply(data._reply_code).name + ".")
                LoginReplyServerPacket.ReplyCodeDataLoggedIn.serialize(writer, data._reply_code_data)
            elif data._reply_code == LoginReply.Busy:
                if not isinstance(data._reply_code_data, LoginReplyServerPacket.ReplyCodeDataBusy):
                    raise SerializationError("Expected reply_code_data to be type LoginReplyServerPacket.ReplyCodeDataBusy for reply_code " + LoginReply(data._reply_code).name + ".")
                LoginReplyServerPacket.ReplyCodeDataBusy.serialize(writer, data._reply_code_data)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "LoginReplyServerPacket":
        """
        Deserializes an instance of `LoginReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            LoginReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            reply_code = LoginReply(reader.get_short())
            reply_code_data: LoginReplyServerPacket.ReplyCodeData = None
            if reply_code == LoginReply.WrongUser:
                reply_code_data = LoginReplyServerPacket.ReplyCodeDataWrongUser.deserialize(reader)
            elif reply_code == LoginReply.WrongUserPassword:
                reply_code_data = LoginReplyServerPacket.ReplyCodeDataWrongUserPassword.deserialize(reader)
            elif reply_code == LoginReply.Ok:
                reply_code_data = LoginReplyServerPacket.ReplyCodeDataOk.deserialize(reader)
            elif reply_code == LoginReply.Banned:
                reply_code_data = LoginReplyServerPacket.ReplyCodeDataBanned.deserialize(reader)
            elif reply_code == LoginReply.LoggedIn:
                reply_code_data = LoginReplyServerPacket.ReplyCodeDataLoggedIn.deserialize(reader)
            elif reply_code == LoginReply.Busy:
                reply_code_data = LoginReplyServerPacket.ReplyCodeDataBusy.deserialize(reader)
            reader.chunked_reading_mode = False
            result = LoginReplyServerPacket(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"LoginReplyServerPacket(byte_size={repr(self._byte_size)}, reply_code={repr(self._reply_code)}, reply_code_data={repr(self._reply_code_data)})"

    ReplyCodeData = Union['LoginReplyServerPacket.ReplyCodeDataWrongUser', 'LoginReplyServerPacket.ReplyCodeDataWrongUserPassword', 'LoginReplyServerPacket.ReplyCodeDataOk', 'LoginReplyServerPacket.ReplyCodeDataBanned', 'LoginReplyServerPacket.ReplyCodeDataLoggedIn', 'LoginReplyServerPacket.ReplyCodeDataBusy', None]
    """
    Data associated with different values of the `reply_code` field.
    """

    class ReplyCodeDataWrongUser:
        """
        Data associated with reply_code value LoginReply.WrongUser
        """
        _byte_size: int = 0

        def __init__(self):
            """
            Create a new instance of LoginReplyServerPacket.ReplyCodeDataWrongUser.
            """

        @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: "LoginReplyServerPacket.ReplyCodeDataWrongUser") -> None:
            """
            Serializes an instance of `LoginReplyServerPacket.ReplyCodeDataWrongUser` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (LoginReplyServerPacket.ReplyCodeDataWrongUser): 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) -> "LoginReplyServerPacket.ReplyCodeDataWrongUser":
            """
            Deserializes an instance of `LoginReplyServerPacket.ReplyCodeDataWrongUser` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                LoginReplyServerPacket.ReplyCodeDataWrongUser: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.get_string()
                result = LoginReplyServerPacket.ReplyCodeDataWrongUser()
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"LoginReplyServerPacket.ReplyCodeDataWrongUser(byte_size={repr(self._byte_size)})"

    class ReplyCodeDataWrongUserPassword:
        """
        Data associated with reply_code value LoginReply.WrongUserPassword
        """
        _byte_size: int = 0

        def __init__(self):
            """
            Create a new instance of LoginReplyServerPacket.ReplyCodeDataWrongUserPassword.
            """

        @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: "LoginReplyServerPacket.ReplyCodeDataWrongUserPassword") -> None:
            """
            Serializes an instance of `LoginReplyServerPacket.ReplyCodeDataWrongUserPassword` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (LoginReplyServerPacket.ReplyCodeDataWrongUserPassword): 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) -> "LoginReplyServerPacket.ReplyCodeDataWrongUserPassword":
            """
            Deserializes an instance of `LoginReplyServerPacket.ReplyCodeDataWrongUserPassword` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                LoginReplyServerPacket.ReplyCodeDataWrongUserPassword: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.get_string()
                result = LoginReplyServerPacket.ReplyCodeDataWrongUserPassword()
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"LoginReplyServerPacket.ReplyCodeDataWrongUserPassword(byte_size={repr(self._byte_size)})"

    class ReplyCodeDataOk:
        """
        Data associated with reply_code value LoginReply.Ok
        """
        _byte_size: int = 0
        _characters_count: int
        _characters: tuple[CharacterSelectionListEntry, ...]

        def __init__(self, *, characters: Iterable[CharacterSelectionListEntry]):
            """
            Create a new instance of LoginReplyServerPacket.ReplyCodeDataOk.

            Args:
                characters (Iterable[CharacterSelectionListEntry]): (Length must be 252 or less.)
            """
            self._characters = tuple(characters)
            self._characters_count = len(self._characters)

        @property
        def byte_size(self) -> int:
            """
            Returns the size of the data that this was deserialized from.

            Returns:
                int: The size of the data that this was deserialized from.
            """
            return self._byte_size

        @property
        def characters(self) -> tuple[CharacterSelectionListEntry, ...]:
            return self._characters

        @staticmethod
        def serialize(writer: EoWriter, data: "LoginReplyServerPacket.ReplyCodeDataOk") -> None:
            """
            Serializes an instance of `LoginReplyServerPacket.ReplyCodeDataOk` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (LoginReplyServerPacket.ReplyCodeDataOk): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._characters_count is None:
                    raise SerializationError("characters_count must be provided.")
                writer.add_char(data._characters_count)
                writer.add_char(0)
                writer.add_byte(0xFF)
                if data._characters is None:
                    raise SerializationError("characters must be provided.")
                if len(data._characters) > 252:
                    raise SerializationError(f"Expected length of characters to be 252 or less, got {len(data._characters)}.")
                for i in range(data._characters_count):
                    CharacterSelectionListEntry.serialize(writer, data._characters[i])
                    writer.add_byte(0xFF)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "LoginReplyServerPacket.ReplyCodeDataOk":
            """
            Deserializes an instance of `LoginReplyServerPacket.ReplyCodeDataOk` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                LoginReplyServerPacket.ReplyCodeDataOk: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                characters_count = reader.get_char()
                reader.get_char()
                reader.next_chunk()
                characters = []
                for i in range(characters_count):
                    characters.append(CharacterSelectionListEntry.deserialize(reader))
                    reader.next_chunk()
                result = LoginReplyServerPacket.ReplyCodeDataOk(characters=characters)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"LoginReplyServerPacket.ReplyCodeDataOk(byte_size={repr(self._byte_size)}, characters={repr(self._characters)})"

    class ReplyCodeDataBanned:
        """
        Data associated with reply_code value LoginReply.Banned
        """
        _byte_size: int = 0

        def __init__(self):
            """
            Create a new instance of LoginReplyServerPacket.ReplyCodeDataBanned.
            """

        @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: "LoginReplyServerPacket.ReplyCodeDataBanned") -> None:
            """
            Serializes an instance of `LoginReplyServerPacket.ReplyCodeDataBanned` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (LoginReplyServerPacket.ReplyCodeDataBanned): 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) -> "LoginReplyServerPacket.ReplyCodeDataBanned":
            """
            Deserializes an instance of `LoginReplyServerPacket.ReplyCodeDataBanned` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                LoginReplyServerPacket.ReplyCodeDataBanned: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.get_string()
                result = LoginReplyServerPacket.ReplyCodeDataBanned()
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"LoginReplyServerPacket.ReplyCodeDataBanned(byte_size={repr(self._byte_size)})"

    class ReplyCodeDataLoggedIn:
        """
        Data associated with reply_code value LoginReply.LoggedIn
        """
        _byte_size: int = 0

        def __init__(self):
            """
            Create a new instance of LoginReplyServerPacket.ReplyCodeDataLoggedIn.
            """

        @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: "LoginReplyServerPacket.ReplyCodeDataLoggedIn") -> None:
            """
            Serializes an instance of `LoginReplyServerPacket.ReplyCodeDataLoggedIn` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (LoginReplyServerPacket.ReplyCodeDataLoggedIn): 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) -> "LoginReplyServerPacket.ReplyCodeDataLoggedIn":
            """
            Deserializes an instance of `LoginReplyServerPacket.ReplyCodeDataLoggedIn` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                LoginReplyServerPacket.ReplyCodeDataLoggedIn: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.get_string()
                result = LoginReplyServerPacket.ReplyCodeDataLoggedIn()
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"LoginReplyServerPacket.ReplyCodeDataLoggedIn(byte_size={repr(self._byte_size)})"

    class ReplyCodeDataBusy:
        """
        Data associated with reply_code value LoginReply.Busy
        """
        _byte_size: int = 0

        def __init__(self):
            """
            Create a new instance of LoginReplyServerPacket.ReplyCodeDataBusy.
            """

        @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: "LoginReplyServerPacket.ReplyCodeDataBusy") -> None:
            """
            Serializes an instance of `LoginReplyServerPacket.ReplyCodeDataBusy` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (LoginReplyServerPacket.ReplyCodeDataBusy): 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) -> "LoginReplyServerPacket.ReplyCodeDataBusy":
            """
            Deserializes an instance of `LoginReplyServerPacket.ReplyCodeDataBusy` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                LoginReplyServerPacket.ReplyCodeDataBusy: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.get_string()
                result = LoginReplyServerPacket.ReplyCodeDataBusy()
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"LoginReplyServerPacket.ReplyCodeDataBusy(byte_size={repr(self._byte_size)})"

byte_size: int property

Returns the size of the data that this was deserialized from.

Returns:

Name Type Description
int int

The size of the data that this was deserialized from.

reply_code: LoginReply property

reply_code_data: 'LoginReplyServerPacket.ReplyCodeData' property

LoginReplyServerPacket.ReplyCodeData: Data associated with the reply_code field.

ReplyCodeData = Union['LoginReplyServerPacket.ReplyCodeDataWrongUser', 'LoginReplyServerPacket.ReplyCodeDataWrongUserPassword', 'LoginReplyServerPacket.ReplyCodeDataOk', 'LoginReplyServerPacket.ReplyCodeDataBanned', 'LoginReplyServerPacket.ReplyCodeDataLoggedIn', 'LoginReplyServerPacket.ReplyCodeDataBusy', None] class-attribute instance-attribute

Data associated with different values of the reply_code field.

ReplyCodeDataWrongUser

Data associated with reply_code value LoginReply.WrongUser

Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
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
class ReplyCodeDataWrongUser:
    """
    Data associated with reply_code value LoginReply.WrongUser
    """
    _byte_size: int = 0

    def __init__(self):
        """
        Create a new instance of LoginReplyServerPacket.ReplyCodeDataWrongUser.
        """

    @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: "LoginReplyServerPacket.ReplyCodeDataWrongUser") -> None:
        """
        Serializes an instance of `LoginReplyServerPacket.ReplyCodeDataWrongUser` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (LoginReplyServerPacket.ReplyCodeDataWrongUser): 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) -> "LoginReplyServerPacket.ReplyCodeDataWrongUser":
        """
        Deserializes an instance of `LoginReplyServerPacket.ReplyCodeDataWrongUser` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            LoginReplyServerPacket.ReplyCodeDataWrongUser: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            result = LoginReplyServerPacket.ReplyCodeDataWrongUser()
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"LoginReplyServerPacket.ReplyCodeDataWrongUser(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 LoginReplyServerPacket.ReplyCodeDataWrongUser.

Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
180
181
182
183
def __init__(self):
    """
    Create a new instance of LoginReplyServerPacket.ReplyCodeDataWrongUser.
    """

serialize(writer, data) staticmethod

Serializes an instance of LoginReplyServerPacket.ReplyCodeDataWrongUser to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataWrongUser

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
196
197
198
199
200
201
202
203
204
205
206
207
208
209
@staticmethod
def serialize(writer: EoWriter, data: "LoginReplyServerPacket.ReplyCodeDataWrongUser") -> None:
    """
    Serializes an instance of `LoginReplyServerPacket.ReplyCodeDataWrongUser` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (LoginReplyServerPacket.ReplyCodeDataWrongUser): 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 LoginReplyServerPacket.ReplyCodeDataWrongUser from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'LoginReplyServerPacket.ReplyCodeDataWrongUser'

LoginReplyServerPacket.ReplyCodeDataWrongUser: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
@staticmethod
def deserialize(reader: EoReader) -> "LoginReplyServerPacket.ReplyCodeDataWrongUser":
    """
    Deserializes an instance of `LoginReplyServerPacket.ReplyCodeDataWrongUser` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        LoginReplyServerPacket.ReplyCodeDataWrongUser: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        result = LoginReplyServerPacket.ReplyCodeDataWrongUser()
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataWrongUserPassword

Data associated with reply_code value LoginReply.WrongUserPassword

Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
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
class ReplyCodeDataWrongUserPassword:
    """
    Data associated with reply_code value LoginReply.WrongUserPassword
    """
    _byte_size: int = 0

    def __init__(self):
        """
        Create a new instance of LoginReplyServerPacket.ReplyCodeDataWrongUserPassword.
        """

    @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: "LoginReplyServerPacket.ReplyCodeDataWrongUserPassword") -> None:
        """
        Serializes an instance of `LoginReplyServerPacket.ReplyCodeDataWrongUserPassword` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (LoginReplyServerPacket.ReplyCodeDataWrongUserPassword): 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) -> "LoginReplyServerPacket.ReplyCodeDataWrongUserPassword":
        """
        Deserializes an instance of `LoginReplyServerPacket.ReplyCodeDataWrongUserPassword` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            LoginReplyServerPacket.ReplyCodeDataWrongUserPassword: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            result = LoginReplyServerPacket.ReplyCodeDataWrongUserPassword()
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"LoginReplyServerPacket.ReplyCodeDataWrongUserPassword(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 LoginReplyServerPacket.ReplyCodeDataWrongUserPassword.

Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
241
242
243
244
def __init__(self):
    """
    Create a new instance of LoginReplyServerPacket.ReplyCodeDataWrongUserPassword.
    """

serialize(writer, data) staticmethod

Serializes an instance of LoginReplyServerPacket.ReplyCodeDataWrongUserPassword to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataWrongUserPassword

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
257
258
259
260
261
262
263
264
265
266
267
268
269
270
@staticmethod
def serialize(writer: EoWriter, data: "LoginReplyServerPacket.ReplyCodeDataWrongUserPassword") -> None:
    """
    Serializes an instance of `LoginReplyServerPacket.ReplyCodeDataWrongUserPassword` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (LoginReplyServerPacket.ReplyCodeDataWrongUserPassword): 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 LoginReplyServerPacket.ReplyCodeDataWrongUserPassword from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'LoginReplyServerPacket.ReplyCodeDataWrongUserPassword'

LoginReplyServerPacket.ReplyCodeDataWrongUserPassword: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
@staticmethod
def deserialize(reader: EoReader) -> "LoginReplyServerPacket.ReplyCodeDataWrongUserPassword":
    """
    Deserializes an instance of `LoginReplyServerPacket.ReplyCodeDataWrongUserPassword` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        LoginReplyServerPacket.ReplyCodeDataWrongUserPassword: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        result = LoginReplyServerPacket.ReplyCodeDataWrongUserPassword()
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataOk

Data associated with reply_code value LoginReply.Ok

Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
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
class ReplyCodeDataOk:
    """
    Data associated with reply_code value LoginReply.Ok
    """
    _byte_size: int = 0
    _characters_count: int
    _characters: tuple[CharacterSelectionListEntry, ...]

    def __init__(self, *, characters: Iterable[CharacterSelectionListEntry]):
        """
        Create a new instance of LoginReplyServerPacket.ReplyCodeDataOk.

        Args:
            characters (Iterable[CharacterSelectionListEntry]): (Length must be 252 or less.)
        """
        self._characters = tuple(characters)
        self._characters_count = len(self._characters)

    @property
    def byte_size(self) -> int:
        """
        Returns the size of the data that this was deserialized from.

        Returns:
            int: The size of the data that this was deserialized from.
        """
        return self._byte_size

    @property
    def characters(self) -> tuple[CharacterSelectionListEntry, ...]:
        return self._characters

    @staticmethod
    def serialize(writer: EoWriter, data: "LoginReplyServerPacket.ReplyCodeDataOk") -> None:
        """
        Serializes an instance of `LoginReplyServerPacket.ReplyCodeDataOk` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (LoginReplyServerPacket.ReplyCodeDataOk): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._characters_count is None:
                raise SerializationError("characters_count must be provided.")
            writer.add_char(data._characters_count)
            writer.add_char(0)
            writer.add_byte(0xFF)
            if data._characters is None:
                raise SerializationError("characters must be provided.")
            if len(data._characters) > 252:
                raise SerializationError(f"Expected length of characters to be 252 or less, got {len(data._characters)}.")
            for i in range(data._characters_count):
                CharacterSelectionListEntry.serialize(writer, data._characters[i])
                writer.add_byte(0xFF)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "LoginReplyServerPacket.ReplyCodeDataOk":
        """
        Deserializes an instance of `LoginReplyServerPacket.ReplyCodeDataOk` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            LoginReplyServerPacket.ReplyCodeDataOk: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            characters_count = reader.get_char()
            reader.get_char()
            reader.next_chunk()
            characters = []
            for i in range(characters_count):
                characters.append(CharacterSelectionListEntry.deserialize(reader))
                reader.next_chunk()
            result = LoginReplyServerPacket.ReplyCodeDataOk(characters=characters)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"LoginReplyServerPacket.ReplyCodeDataOk(byte_size={repr(self._byte_size)}, characters={repr(self._characters)})"

byte_size: int property

Returns the size of the data that this was deserialized from.

Returns:

Name Type Description
int int

The size of the data that this was deserialized from.

characters: tuple[CharacterSelectionListEntry, ...] property

__init__(*, characters)

Create a new instance of LoginReplyServerPacket.ReplyCodeDataOk.

Parameters:

Name Type Description Default
characters Iterable[CharacterSelectionListEntry]

(Length must be 252 or less.)

required
Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
304
305
306
307
308
309
310
311
312
def __init__(self, *, characters: Iterable[CharacterSelectionListEntry]):
    """
    Create a new instance of LoginReplyServerPacket.ReplyCodeDataOk.

    Args:
        characters (Iterable[CharacterSelectionListEntry]): (Length must be 252 or less.)
    """
    self._characters = tuple(characters)
    self._characters_count = len(self._characters)

serialize(writer, data) staticmethod

Serializes an instance of LoginReplyServerPacket.ReplyCodeDataOk to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataOk

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
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
@staticmethod
def serialize(writer: EoWriter, data: "LoginReplyServerPacket.ReplyCodeDataOk") -> None:
    """
    Serializes an instance of `LoginReplyServerPacket.ReplyCodeDataOk` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (LoginReplyServerPacket.ReplyCodeDataOk): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._characters_count is None:
            raise SerializationError("characters_count must be provided.")
        writer.add_char(data._characters_count)
        writer.add_char(0)
        writer.add_byte(0xFF)
        if data._characters is None:
            raise SerializationError("characters must be provided.")
        if len(data._characters) > 252:
            raise SerializationError(f"Expected length of characters to be 252 or less, got {len(data._characters)}.")
        for i in range(data._characters_count):
            CharacterSelectionListEntry.serialize(writer, data._characters[i])
            writer.add_byte(0xFF)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of LoginReplyServerPacket.ReplyCodeDataOk from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'LoginReplyServerPacket.ReplyCodeDataOk'

LoginReplyServerPacket.ReplyCodeDataOk: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "LoginReplyServerPacket.ReplyCodeDataOk":
    """
    Deserializes an instance of `LoginReplyServerPacket.ReplyCodeDataOk` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        LoginReplyServerPacket.ReplyCodeDataOk: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        characters_count = reader.get_char()
        reader.get_char()
        reader.next_chunk()
        characters = []
        for i in range(characters_count):
            characters.append(CharacterSelectionListEntry.deserialize(reader))
            reader.next_chunk()
        result = LoginReplyServerPacket.ReplyCodeDataOk(characters=characters)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataBanned

Data associated with reply_code value LoginReply.Banned

Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
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
class ReplyCodeDataBanned:
    """
    Data associated with reply_code value LoginReply.Banned
    """
    _byte_size: int = 0

    def __init__(self):
        """
        Create a new instance of LoginReplyServerPacket.ReplyCodeDataBanned.
        """

    @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: "LoginReplyServerPacket.ReplyCodeDataBanned") -> None:
        """
        Serializes an instance of `LoginReplyServerPacket.ReplyCodeDataBanned` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (LoginReplyServerPacket.ReplyCodeDataBanned): 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) -> "LoginReplyServerPacket.ReplyCodeDataBanned":
        """
        Deserializes an instance of `LoginReplyServerPacket.ReplyCodeDataBanned` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            LoginReplyServerPacket.ReplyCodeDataBanned: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            result = LoginReplyServerPacket.ReplyCodeDataBanned()
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"LoginReplyServerPacket.ReplyCodeDataBanned(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 LoginReplyServerPacket.ReplyCodeDataBanned.

Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
390
391
392
393
def __init__(self):
    """
    Create a new instance of LoginReplyServerPacket.ReplyCodeDataBanned.
    """

serialize(writer, data) staticmethod

Serializes an instance of LoginReplyServerPacket.ReplyCodeDataBanned to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataBanned

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
406
407
408
409
410
411
412
413
414
415
416
417
418
419
@staticmethod
def serialize(writer: EoWriter, data: "LoginReplyServerPacket.ReplyCodeDataBanned") -> None:
    """
    Serializes an instance of `LoginReplyServerPacket.ReplyCodeDataBanned` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (LoginReplyServerPacket.ReplyCodeDataBanned): 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 LoginReplyServerPacket.ReplyCodeDataBanned from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'LoginReplyServerPacket.ReplyCodeDataBanned'

LoginReplyServerPacket.ReplyCodeDataBanned: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
@staticmethod
def deserialize(reader: EoReader) -> "LoginReplyServerPacket.ReplyCodeDataBanned":
    """
    Deserializes an instance of `LoginReplyServerPacket.ReplyCodeDataBanned` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        LoginReplyServerPacket.ReplyCodeDataBanned: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        result = LoginReplyServerPacket.ReplyCodeDataBanned()
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataLoggedIn

Data associated with reply_code value LoginReply.LoggedIn

Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
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
class ReplyCodeDataLoggedIn:
    """
    Data associated with reply_code value LoginReply.LoggedIn
    """
    _byte_size: int = 0

    def __init__(self):
        """
        Create a new instance of LoginReplyServerPacket.ReplyCodeDataLoggedIn.
        """

    @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: "LoginReplyServerPacket.ReplyCodeDataLoggedIn") -> None:
        """
        Serializes an instance of `LoginReplyServerPacket.ReplyCodeDataLoggedIn` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (LoginReplyServerPacket.ReplyCodeDataLoggedIn): 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) -> "LoginReplyServerPacket.ReplyCodeDataLoggedIn":
        """
        Deserializes an instance of `LoginReplyServerPacket.ReplyCodeDataLoggedIn` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            LoginReplyServerPacket.ReplyCodeDataLoggedIn: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            result = LoginReplyServerPacket.ReplyCodeDataLoggedIn()
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"LoginReplyServerPacket.ReplyCodeDataLoggedIn(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 LoginReplyServerPacket.ReplyCodeDataLoggedIn.

Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
451
452
453
454
def __init__(self):
    """
    Create a new instance of LoginReplyServerPacket.ReplyCodeDataLoggedIn.
    """

serialize(writer, data) staticmethod

Serializes an instance of LoginReplyServerPacket.ReplyCodeDataLoggedIn to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataLoggedIn

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
467
468
469
470
471
472
473
474
475
476
477
478
479
480
@staticmethod
def serialize(writer: EoWriter, data: "LoginReplyServerPacket.ReplyCodeDataLoggedIn") -> None:
    """
    Serializes an instance of `LoginReplyServerPacket.ReplyCodeDataLoggedIn` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (LoginReplyServerPacket.ReplyCodeDataLoggedIn): 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 LoginReplyServerPacket.ReplyCodeDataLoggedIn from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'LoginReplyServerPacket.ReplyCodeDataLoggedIn'

LoginReplyServerPacket.ReplyCodeDataLoggedIn: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
@staticmethod
def deserialize(reader: EoReader) -> "LoginReplyServerPacket.ReplyCodeDataLoggedIn":
    """
    Deserializes an instance of `LoginReplyServerPacket.ReplyCodeDataLoggedIn` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        LoginReplyServerPacket.ReplyCodeDataLoggedIn: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        result = LoginReplyServerPacket.ReplyCodeDataLoggedIn()
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataBusy

Data associated with reply_code value LoginReply.Busy

Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
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
class ReplyCodeDataBusy:
    """
    Data associated with reply_code value LoginReply.Busy
    """
    _byte_size: int = 0

    def __init__(self):
        """
        Create a new instance of LoginReplyServerPacket.ReplyCodeDataBusy.
        """

    @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: "LoginReplyServerPacket.ReplyCodeDataBusy") -> None:
        """
        Serializes an instance of `LoginReplyServerPacket.ReplyCodeDataBusy` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (LoginReplyServerPacket.ReplyCodeDataBusy): 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) -> "LoginReplyServerPacket.ReplyCodeDataBusy":
        """
        Deserializes an instance of `LoginReplyServerPacket.ReplyCodeDataBusy` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            LoginReplyServerPacket.ReplyCodeDataBusy: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            result = LoginReplyServerPacket.ReplyCodeDataBusy()
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"LoginReplyServerPacket.ReplyCodeDataBusy(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 LoginReplyServerPacket.ReplyCodeDataBusy.

Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
512
513
514
515
def __init__(self):
    """
    Create a new instance of LoginReplyServerPacket.ReplyCodeDataBusy.
    """

serialize(writer, data) staticmethod

Serializes an instance of LoginReplyServerPacket.ReplyCodeDataBusy to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataBusy

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
528
529
530
531
532
533
534
535
536
537
538
539
540
541
@staticmethod
def serialize(writer: EoWriter, data: "LoginReplyServerPacket.ReplyCodeDataBusy") -> None:
    """
    Serializes an instance of `LoginReplyServerPacket.ReplyCodeDataBusy` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (LoginReplyServerPacket.ReplyCodeDataBusy): 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 LoginReplyServerPacket.ReplyCodeDataBusy from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'LoginReplyServerPacket.ReplyCodeDataBusy'

LoginReplyServerPacket.ReplyCodeDataBusy: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
@staticmethod
def deserialize(reader: EoReader) -> "LoginReplyServerPacket.ReplyCodeDataBusy":
    """
    Deserializes an instance of `LoginReplyServerPacket.ReplyCodeDataBusy` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        LoginReplyServerPacket.ReplyCodeDataBusy: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        result = LoginReplyServerPacket.ReplyCodeDataBusy()
        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 LoginReplyServerPacket.

Parameters:

Name Type Description Default
reply_code LoginReply
required
reply_code_data ReplyCodeData

Data associated with the reply_code field.

None
Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
26
27
28
29
30
31
32
33
34
35
def __init__(self, *, reply_code: LoginReply, reply_code_data: 'LoginReplyServerPacket.ReplyCodeData' = None):
    """
    Create a new instance of LoginReplyServerPacket.

    Args:
        reply_code (LoginReply): 
        reply_code_data (LoginReplyServerPacket.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/login_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.Login

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/login_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/login_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.
    """
    LoginReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of LoginReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data LoginReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/login_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
@staticmethod
def serialize(writer: EoWriter, data: "LoginReplyServerPacket") -> None:
    """
    Serializes an instance of `LoginReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (LoginReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._reply_code is None:
            raise SerializationError("reply_code must be provided.")
        writer.add_short(int(data._reply_code))
        if data._reply_code == LoginReply.WrongUser:
            if not isinstance(data._reply_code_data, LoginReplyServerPacket.ReplyCodeDataWrongUser):
                raise SerializationError("Expected reply_code_data to be type LoginReplyServerPacket.ReplyCodeDataWrongUser for reply_code " + LoginReply(data._reply_code).name + ".")
            LoginReplyServerPacket.ReplyCodeDataWrongUser.serialize(writer, data._reply_code_data)
        elif data._reply_code == LoginReply.WrongUserPassword:
            if not isinstance(data._reply_code_data, LoginReplyServerPacket.ReplyCodeDataWrongUserPassword):
                raise SerializationError("Expected reply_code_data to be type LoginReplyServerPacket.ReplyCodeDataWrongUserPassword for reply_code " + LoginReply(data._reply_code).name + ".")
            LoginReplyServerPacket.ReplyCodeDataWrongUserPassword.serialize(writer, data._reply_code_data)
        elif data._reply_code == LoginReply.Ok:
            if not isinstance(data._reply_code_data, LoginReplyServerPacket.ReplyCodeDataOk):
                raise SerializationError("Expected reply_code_data to be type LoginReplyServerPacket.ReplyCodeDataOk for reply_code " + LoginReply(data._reply_code).name + ".")
            LoginReplyServerPacket.ReplyCodeDataOk.serialize(writer, data._reply_code_data)
        elif data._reply_code == LoginReply.Banned:
            if not isinstance(data._reply_code_data, LoginReplyServerPacket.ReplyCodeDataBanned):
                raise SerializationError("Expected reply_code_data to be type LoginReplyServerPacket.ReplyCodeDataBanned for reply_code " + LoginReply(data._reply_code).name + ".")
            LoginReplyServerPacket.ReplyCodeDataBanned.serialize(writer, data._reply_code_data)
        elif data._reply_code == LoginReply.LoggedIn:
            if not isinstance(data._reply_code_data, LoginReplyServerPacket.ReplyCodeDataLoggedIn):
                raise SerializationError("Expected reply_code_data to be type LoginReplyServerPacket.ReplyCodeDataLoggedIn for reply_code " + LoginReply(data._reply_code).name + ".")
            LoginReplyServerPacket.ReplyCodeDataLoggedIn.serialize(writer, data._reply_code_data)
        elif data._reply_code == LoginReply.Busy:
            if not isinstance(data._reply_code_data, LoginReplyServerPacket.ReplyCodeDataBusy):
                raise SerializationError("Expected reply_code_data to be type LoginReplyServerPacket.ReplyCodeDataBusy for reply_code " + LoginReply(data._reply_code).name + ".")
            LoginReplyServerPacket.ReplyCodeDataBusy.serialize(writer, data._reply_code_data)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of LoginReplyServerPacket 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
LoginReplyServerPacket 'LoginReplyServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "LoginReplyServerPacket":
    """
    Deserializes an instance of `LoginReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        LoginReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        reply_code = LoginReply(reader.get_short())
        reply_code_data: LoginReplyServerPacket.ReplyCodeData = None
        if reply_code == LoginReply.WrongUser:
            reply_code_data = LoginReplyServerPacket.ReplyCodeDataWrongUser.deserialize(reader)
        elif reply_code == LoginReply.WrongUserPassword:
            reply_code_data = LoginReplyServerPacket.ReplyCodeDataWrongUserPassword.deserialize(reader)
        elif reply_code == LoginReply.Ok:
            reply_code_data = LoginReplyServerPacket.ReplyCodeDataOk.deserialize(reader)
        elif reply_code == LoginReply.Banned:
            reply_code_data = LoginReplyServerPacket.ReplyCodeDataBanned.deserialize(reader)
        elif reply_code == LoginReply.LoggedIn:
            reply_code_data = LoginReplyServerPacket.ReplyCodeDataLoggedIn.deserialize(reader)
        elif reply_code == LoginReply.Busy:
            reply_code_data = LoginReplyServerPacket.ReplyCodeDataBusy.deserialize(reader)
        reader.chunked_reading_mode = False
        result = LoginReplyServerPacket(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

LoginReply

Bases: IntEnum

Reply code sent with LOGIN_REPLY packet. Indicates the result of a login attempt.

Source code in src/eolib/protocol/_generated/net/server/login_reply.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
class LoginReply(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Reply code sent with LOGIN_REPLY packet.
    Indicates the result of a login attempt.
    """
    WrongUser = 1
    WrongUserPassword = 2
    Ok = 3
    Banned = 4
    """
    The official client won't display a message until the connection from the server is closed
    """
    LoggedIn = 5
    Busy = 6
    """
    The official client won't display a message until the connection from the server is closed
    """

WrongUser = 1 class-attribute instance-attribute

WrongUserPassword = 2 class-attribute instance-attribute

Ok = 3 class-attribute instance-attribute

Banned = 4 class-attribute instance-attribute

The official client won't display a message until the connection from the server is closed

LoggedIn = 5 class-attribute instance-attribute

Busy = 6 class-attribute instance-attribute

The official client won't display a message until the connection from the server is closed

LoginMessageCode

Bases: IntEnum

Whether a warning message should be displayed upon entering the game

Source code in src/eolib/protocol/_generated/net/server/login_message_code.py
 9
10
11
12
13
14
class LoginMessageCode(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Whether a warning message should be displayed upon entering the game
    """
    No = 0
    Yes = 2

No = 0 class-attribute instance-attribute

Yes = 2 class-attribute instance-attribute

LockerSpecServerPacket

Bases: Packet

Reply to trying to add an item to a full locker

Source code in src/eolib/protocol/_generated/net/server/locker_spec_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class LockerSpecServerPacket(Packet):
    """
    Reply to trying to add an item to a full locker
    """
    _byte_size: int = 0
    _locker_max_items: int

    def __init__(self, *, locker_max_items: int):
        """
        Create a new instance of LockerSpecServerPacket.

        Args:
            locker_max_items (int): (Value range is 0-252.)
        """
        self._locker_max_items = locker_max_items

    @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 locker_max_items(self) -> int:
        return self._locker_max_items

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Locker

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Spec

    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.
        """
        LockerSpecServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "LockerSpecServerPacket") -> None:
        """
        Serializes an instance of `LockerSpecServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (LockerSpecServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._locker_max_items is None:
                raise SerializationError("locker_max_items must be provided.")
            writer.add_char(data._locker_max_items)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "LockerSpecServerPacket":
        """
        Deserializes an instance of `LockerSpecServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            LockerSpecServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            locker_max_items = reader.get_char()
            result = LockerSpecServerPacket(locker_max_items=locker_max_items)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"LockerSpecServerPacket(byte_size={repr(self._byte_size)}, locker_max_items={repr(self._locker_max_items)})"

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.

locker_max_items: int property

__init__(*, locker_max_items)

Create a new instance of LockerSpecServerPacket.

Parameters:

Name Type Description Default
locker_max_items int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/locker_spec_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, locker_max_items: int):
    """
    Create a new instance of LockerSpecServerPacket.

    Args:
        locker_max_items (int): (Value range is 0-252.)
    """
    self._locker_max_items = locker_max_items

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/locker_spec_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Locker

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/locker_spec_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Spec

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/locker_spec_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    LockerSpecServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of LockerSpecServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data LockerSpecServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/locker_spec_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "LockerSpecServerPacket") -> None:
    """
    Serializes an instance of `LockerSpecServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (LockerSpecServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._locker_max_items is None:
            raise SerializationError("locker_max_items must be provided.")
        writer.add_char(data._locker_max_items)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of LockerSpecServerPacket 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
LockerSpecServerPacket LockerSpecServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/locker_spec_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "LockerSpecServerPacket":
    """
    Deserializes an instance of `LockerSpecServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        LockerSpecServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        locker_max_items = reader.get_char()
        result = LockerSpecServerPacket(locker_max_items=locker_max_items)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

LockerReplyServerPacket

Bases: Packet

Response to adding an item to a bank locker

Source code in src/eolib/protocol/_generated/net/server/locker_reply_server_packet.py
 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
class LockerReplyServerPacket(Packet):
    """
    Response to adding an item to a bank locker
    """
    _byte_size: int = 0
    _deposited_item: Item
    _weight: Weight
    _locker_items: tuple[ThreeItem, ...]

    def __init__(self, *, deposited_item: Item, weight: Weight, locker_items: Iterable[ThreeItem]):
        """
        Create a new instance of LockerReplyServerPacket.

        Args:
            deposited_item (Item): 
            weight (Weight): 
            locker_items (Iterable[ThreeItem]): 
        """
        self._deposited_item = deposited_item
        self._weight = weight
        self._locker_items = tuple(locker_items)

    @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 deposited_item(self) -> Item:
        return self._deposited_item

    @property
    def weight(self) -> Weight:
        return self._weight

    @property
    def locker_items(self) -> tuple[ThreeItem, ...]:
        return self._locker_items

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Locker

    @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.
        """
        LockerReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "LockerReplyServerPacket") -> None:
        """
        Serializes an instance of `LockerReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (LockerReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._deposited_item is None:
                raise SerializationError("deposited_item must be provided.")
            Item.serialize(writer, data._deposited_item)
            if data._weight is None:
                raise SerializationError("weight must be provided.")
            Weight.serialize(writer, data._weight)
            if data._locker_items is None:
                raise SerializationError("locker_items must be provided.")
            for i in range(len(data._locker_items)):
                ThreeItem.serialize(writer, data._locker_items[i])
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "LockerReplyServerPacket":
        """
        Deserializes an instance of `LockerReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            LockerReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            deposited_item = Item.deserialize(reader)
            weight = Weight.deserialize(reader)
            locker_items_length = int(reader.remaining / 5)
            locker_items = []
            for i in range(locker_items_length):
                locker_items.append(ThreeItem.deserialize(reader))
            result = LockerReplyServerPacket(deposited_item=deposited_item, weight=weight, locker_items=locker_items)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"LockerReplyServerPacket(byte_size={repr(self._byte_size)}, deposited_item={repr(self._deposited_item)}, weight={repr(self._weight)}, locker_items={repr(self._locker_items)})"

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.

deposited_item: Item property

weight: Weight property

locker_items: tuple[ThreeItem, ...] property

__init__(*, deposited_item, weight, locker_items)

Create a new instance of LockerReplyServerPacket.

Parameters:

Name Type Description Default
deposited_item Item
required
weight Weight
required
locker_items Iterable[ThreeItem]
required
Source code in src/eolib/protocol/_generated/net/server/locker_reply_server_packet.py
27
28
29
30
31
32
33
34
35
36
37
38
def __init__(self, *, deposited_item: Item, weight: Weight, locker_items: Iterable[ThreeItem]):
    """
    Create a new instance of LockerReplyServerPacket.

    Args:
        deposited_item (Item): 
        weight (Weight): 
        locker_items (Iterable[ThreeItem]): 
    """
    self._deposited_item = deposited_item
    self._weight = weight
    self._locker_items = tuple(locker_items)

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/locker_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.Locker

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/locker_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/locker_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.
    """
    LockerReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of LockerReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data LockerReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/locker_reply_server_packet.py
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
@staticmethod
def serialize(writer: EoWriter, data: "LockerReplyServerPacket") -> None:
    """
    Serializes an instance of `LockerReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (LockerReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._deposited_item is None:
            raise SerializationError("deposited_item must be provided.")
        Item.serialize(writer, data._deposited_item)
        if data._weight is None:
            raise SerializationError("weight must be provided.")
        Weight.serialize(writer, data._weight)
        if data._locker_items is None:
            raise SerializationError("locker_items must be provided.")
        for i in range(len(data._locker_items)):
            ThreeItem.serialize(writer, data._locker_items[i])
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of LockerReplyServerPacket 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
LockerReplyServerPacket 'LockerReplyServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/locker_reply_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "LockerReplyServerPacket":
    """
    Deserializes an instance of `LockerReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        LockerReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        deposited_item = Item.deserialize(reader)
        weight = Weight.deserialize(reader)
        locker_items_length = int(reader.remaining / 5)
        locker_items = []
        for i in range(locker_items_length):
            locker_items.append(ThreeItem.deserialize(reader))
        result = LockerReplyServerPacket(deposited_item=deposited_item, weight=weight, locker_items=locker_items)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

LockerOpenServerPacket

Bases: Packet

Opening a bank locker

Source code in src/eolib/protocol/_generated/net/server/locker_open_server_packet.py
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
class LockerOpenServerPacket(Packet):
    """
    Opening a bank locker
    """
    _byte_size: int = 0
    _locker_coords: Coords
    _locker_items: tuple[ThreeItem, ...]

    def __init__(self, *, locker_coords: Coords, locker_items: Iterable[ThreeItem]):
        """
        Create a new instance of LockerOpenServerPacket.

        Args:
            locker_coords (Coords): 
            locker_items (Iterable[ThreeItem]): 
        """
        self._locker_coords = locker_coords
        self._locker_items = tuple(locker_items)

    @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 locker_coords(self) -> Coords:
        return self._locker_coords

    @property
    def locker_items(self) -> tuple[ThreeItem, ...]:
        return self._locker_items

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Locker

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Open

    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.
        """
        LockerOpenServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "LockerOpenServerPacket") -> None:
        """
        Serializes an instance of `LockerOpenServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (LockerOpenServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._locker_coords is None:
                raise SerializationError("locker_coords must be provided.")
            Coords.serialize(writer, data._locker_coords)
            if data._locker_items is None:
                raise SerializationError("locker_items must be provided.")
            for i in range(len(data._locker_items)):
                ThreeItem.serialize(writer, data._locker_items[i])
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "LockerOpenServerPacket":
        """
        Deserializes an instance of `LockerOpenServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            LockerOpenServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            locker_coords = Coords.deserialize(reader)
            locker_items_length = int(reader.remaining / 5)
            locker_items = []
            for i in range(locker_items_length):
                locker_items.append(ThreeItem.deserialize(reader))
            result = LockerOpenServerPacket(locker_coords=locker_coords, locker_items=locker_items)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"LockerOpenServerPacket(byte_size={repr(self._byte_size)}, locker_coords={repr(self._locker_coords)}, locker_items={repr(self._locker_items)})"

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.

locker_coords: Coords property

locker_items: tuple[ThreeItem, ...] property

__init__(*, locker_coords, locker_items)

Create a new instance of LockerOpenServerPacket.

Parameters:

Name Type Description Default
locker_coords Coords
required
locker_items Iterable[ThreeItem]
required
Source code in src/eolib/protocol/_generated/net/server/locker_open_server_packet.py
25
26
27
28
29
30
31
32
33
34
def __init__(self, *, locker_coords: Coords, locker_items: Iterable[ThreeItem]):
    """
    Create a new instance of LockerOpenServerPacket.

    Args:
        locker_coords (Coords): 
        locker_items (Iterable[ThreeItem]): 
    """
    self._locker_coords = locker_coords
    self._locker_items = tuple(locker_items)

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/locker_open_server_packet.py
54
55
56
57
58
59
60
61
62
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Locker

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/locker_open_server_packet.py
64
65
66
67
68
69
70
71
72
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Open

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/locker_open_server_packet.py
74
75
76
77
78
79
80
81
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.
    """
    LockerOpenServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of LockerOpenServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data LockerOpenServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/locker_open_server_packet.py
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
@staticmethod
def serialize(writer: EoWriter, data: "LockerOpenServerPacket") -> None:
    """
    Serializes an instance of `LockerOpenServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (LockerOpenServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._locker_coords is None:
            raise SerializationError("locker_coords must be provided.")
        Coords.serialize(writer, data._locker_coords)
        if data._locker_items is None:
            raise SerializationError("locker_items must be provided.")
        for i in range(len(data._locker_items)):
            ThreeItem.serialize(writer, data._locker_items[i])
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of LockerOpenServerPacket 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
LockerOpenServerPacket 'LockerOpenServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/locker_open_server_packet.py
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
@staticmethod
def deserialize(reader: EoReader) -> "LockerOpenServerPacket":
    """
    Deserializes an instance of `LockerOpenServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        LockerOpenServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        locker_coords = Coords.deserialize(reader)
        locker_items_length = int(reader.remaining / 5)
        locker_items = []
        for i in range(locker_items_length):
            locker_items.append(ThreeItem.deserialize(reader))
        result = LockerOpenServerPacket(locker_coords=locker_coords, locker_items=locker_items)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

LockerGetServerPacket

Bases: Packet

Response to taking an item from a bank locker

Source code in src/eolib/protocol/_generated/net/server/locker_get_server_packet.py
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
class LockerGetServerPacket(Packet):
    """
    Response to taking an item from a bank locker
    """
    _byte_size: int = 0
    _taken_item: ThreeItem
    _weight: Weight
    _locker_items: tuple[ThreeItem, ...]

    def __init__(self, *, taken_item: ThreeItem, weight: Weight, locker_items: Iterable[ThreeItem]):
        """
        Create a new instance of LockerGetServerPacket.

        Args:
            taken_item (ThreeItem): 
            weight (Weight): 
            locker_items (Iterable[ThreeItem]): 
        """
        self._taken_item = taken_item
        self._weight = weight
        self._locker_items = tuple(locker_items)

    @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 taken_item(self) -> ThreeItem:
        return self._taken_item

    @property
    def weight(self) -> Weight:
        return self._weight

    @property
    def locker_items(self) -> tuple[ThreeItem, ...]:
        return self._locker_items

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Locker

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Get

    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.
        """
        LockerGetServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "LockerGetServerPacket") -> None:
        """
        Serializes an instance of `LockerGetServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (LockerGetServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._taken_item is None:
                raise SerializationError("taken_item must be provided.")
            ThreeItem.serialize(writer, data._taken_item)
            if data._weight is None:
                raise SerializationError("weight must be provided.")
            Weight.serialize(writer, data._weight)
            if data._locker_items is None:
                raise SerializationError("locker_items must be provided.")
            for i in range(len(data._locker_items)):
                ThreeItem.serialize(writer, data._locker_items[i])
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "LockerGetServerPacket":
        """
        Deserializes an instance of `LockerGetServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            LockerGetServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            taken_item = ThreeItem.deserialize(reader)
            weight = Weight.deserialize(reader)
            locker_items_length = int(reader.remaining / 5)
            locker_items = []
            for i in range(locker_items_length):
                locker_items.append(ThreeItem.deserialize(reader))
            result = LockerGetServerPacket(taken_item=taken_item, weight=weight, locker_items=locker_items)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"LockerGetServerPacket(byte_size={repr(self._byte_size)}, taken_item={repr(self._taken_item)}, weight={repr(self._weight)}, locker_items={repr(self._locker_items)})"

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.

taken_item: ThreeItem property

weight: Weight property

locker_items: tuple[ThreeItem, ...] property

__init__(*, taken_item, weight, locker_items)

Create a new instance of LockerGetServerPacket.

Parameters:

Name Type Description Default
taken_item ThreeItem
required
weight Weight
required
locker_items Iterable[ThreeItem]
required
Source code in src/eolib/protocol/_generated/net/server/locker_get_server_packet.py
26
27
28
29
30
31
32
33
34
35
36
37
def __init__(self, *, taken_item: ThreeItem, weight: Weight, locker_items: Iterable[ThreeItem]):
    """
    Create a new instance of LockerGetServerPacket.

    Args:
        taken_item (ThreeItem): 
        weight (Weight): 
        locker_items (Iterable[ThreeItem]): 
    """
    self._taken_item = taken_item
    self._weight = weight
    self._locker_items = tuple(locker_items)

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/locker_get_server_packet.py
61
62
63
64
65
66
67
68
69
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Locker

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/locker_get_server_packet.py
71
72
73
74
75
76
77
78
79
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Get

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/locker_get_server_packet.py
81
82
83
84
85
86
87
88
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.
    """
    LockerGetServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of LockerGetServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data LockerGetServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/locker_get_server_packet.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
@staticmethod
def serialize(writer: EoWriter, data: "LockerGetServerPacket") -> None:
    """
    Serializes an instance of `LockerGetServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (LockerGetServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._taken_item is None:
            raise SerializationError("taken_item must be provided.")
        ThreeItem.serialize(writer, data._taken_item)
        if data._weight is None:
            raise SerializationError("weight must be provided.")
        Weight.serialize(writer, data._weight)
        if data._locker_items is None:
            raise SerializationError("locker_items must be provided.")
        for i in range(len(data._locker_items)):
            ThreeItem.serialize(writer, data._locker_items[i])
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of LockerGetServerPacket 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
LockerGetServerPacket 'LockerGetServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/locker_get_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "LockerGetServerPacket":
    """
    Deserializes an instance of `LockerGetServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        LockerGetServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        taken_item = ThreeItem.deserialize(reader)
        weight = Weight.deserialize(reader)
        locker_items_length = int(reader.remaining / 5)
        locker_items = []
        for i in range(locker_items_length):
            locker_items.append(ThreeItem.deserialize(reader))
        result = LockerGetServerPacket(taken_item=taken_item, weight=weight, locker_items=locker_items)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

LockerBuyServerPacket

Bases: Packet

Response to buying a locker space upgrade from a banker NPC

Source code in src/eolib/protocol/_generated/net/server/locker_buy_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
class LockerBuyServerPacket(Packet):
    """
    Response to buying a locker space upgrade from a banker NPC
    """
    _byte_size: int = 0
    _gold_amount: int
    _locker_upgrades: int

    def __init__(self, *, gold_amount: int, locker_upgrades: int):
        """
        Create a new instance of LockerBuyServerPacket.

        Args:
            gold_amount (int): (Value range is 0-4097152080.)
            locker_upgrades (int): (Value range is 0-252.)
        """
        self._gold_amount = gold_amount
        self._locker_upgrades = locker_upgrades

    @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 gold_amount(self) -> int:
        return self._gold_amount

    @property
    def locker_upgrades(self) -> int:
        return self._locker_upgrades

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Locker

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Buy

    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.
        """
        LockerBuyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "LockerBuyServerPacket") -> None:
        """
        Serializes an instance of `LockerBuyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (LockerBuyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._gold_amount is None:
                raise SerializationError("gold_amount must be provided.")
            writer.add_int(data._gold_amount)
            if data._locker_upgrades is None:
                raise SerializationError("locker_upgrades must be provided.")
            writer.add_char(data._locker_upgrades)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "LockerBuyServerPacket":
        """
        Deserializes an instance of `LockerBuyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            LockerBuyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            gold_amount = reader.get_int()
            locker_upgrades = reader.get_char()
            result = LockerBuyServerPacket(gold_amount=gold_amount, locker_upgrades=locker_upgrades)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"LockerBuyServerPacket(byte_size={repr(self._byte_size)}, gold_amount={repr(self._gold_amount)}, locker_upgrades={repr(self._locker_upgrades)})"

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.

gold_amount: int property

locker_upgrades: int property

__init__(*, gold_amount, locker_upgrades)

Create a new instance of LockerBuyServerPacket.

Parameters:

Name Type Description Default
gold_amount int

(Value range is 0-4097152080.)

required
locker_upgrades int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/locker_buy_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, gold_amount: int, locker_upgrades: int):
    """
    Create a new instance of LockerBuyServerPacket.

    Args:
        gold_amount (int): (Value range is 0-4097152080.)
        locker_upgrades (int): (Value range is 0-252.)
    """
    self._gold_amount = gold_amount
    self._locker_upgrades = locker_upgrades

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/locker_buy_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Locker

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/locker_buy_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Buy

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/locker_buy_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    LockerBuyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of LockerBuyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data LockerBuyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/locker_buy_server_packet.py
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@staticmethod
def serialize(writer: EoWriter, data: "LockerBuyServerPacket") -> None:
    """
    Serializes an instance of `LockerBuyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (LockerBuyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._gold_amount is None:
            raise SerializationError("gold_amount must be provided.")
        writer.add_int(data._gold_amount)
        if data._locker_upgrades is None:
            raise SerializationError("locker_upgrades must be provided.")
        writer.add_char(data._locker_upgrades)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of LockerBuyServerPacket 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
LockerBuyServerPacket LockerBuyServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/locker_buy_server_packet.py
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@staticmethod
def deserialize(reader: EoReader) -> "LockerBuyServerPacket":
    """
    Deserializes an instance of `LockerBuyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        LockerBuyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        gold_amount = reader.get_int()
        locker_upgrades = reader.get_char()
        result = LockerBuyServerPacket(gold_amount=gold_amount, locker_upgrades=locker_upgrades)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

JukeboxUseServerPacket

Bases: Packet

Play jukebox music

Source code in src/eolib/protocol/_generated/net/server/jukebox_use_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
class JukeboxUseServerPacket(Packet):
    """
    Play jukebox music
    """
    _byte_size: int = 0
    _track_id: int

    def __init__(self, *, track_id: int):
        """
        Create a new instance of JukeboxUseServerPacket.

        Args:
            track_id (int): This value is 1-indexed (Value range is 0-64008.)
        """
        self._track_id = track_id

    @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 track_id(self) -> int:
        """
        This value is 1-indexed
        """
        return self._track_id

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Jukebox

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Use

    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.
        """
        JukeboxUseServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "JukeboxUseServerPacket") -> None:
        """
        Serializes an instance of `JukeboxUseServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (JukeboxUseServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._track_id is None:
                raise SerializationError("track_id must be provided.")
            writer.add_short(data._track_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "JukeboxUseServerPacket":
        """
        Deserializes an instance of `JukeboxUseServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            JukeboxUseServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            track_id = reader.get_short()
            result = JukeboxUseServerPacket(track_id=track_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"JukeboxUseServerPacket(byte_size={repr(self._byte_size)}, track_id={repr(self._track_id)})"

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.

track_id: int property

This value is 1-indexed

__init__(*, track_id)

Create a new instance of JukeboxUseServerPacket.

Parameters:

Name Type Description Default
track_id int

This value is 1-indexed (Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/jukebox_use_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, track_id: int):
    """
    Create a new instance of JukeboxUseServerPacket.

    Args:
        track_id (int): This value is 1-indexed (Value range is 0-64008.)
    """
    self._track_id = track_id

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/jukebox_use_server_packet.py
46
47
48
49
50
51
52
53
54
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Jukebox

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/jukebox_use_server_packet.py
56
57
58
59
60
61
62
63
64
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Use

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/jukebox_use_server_packet.py
66
67
68
69
70
71
72
73
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.
    """
    JukeboxUseServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of JukeboxUseServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data JukeboxUseServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/jukebox_use_server_packet.py
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
@staticmethod
def serialize(writer: EoWriter, data: "JukeboxUseServerPacket") -> None:
    """
    Serializes an instance of `JukeboxUseServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (JukeboxUseServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._track_id is None:
            raise SerializationError("track_id must be provided.")
        writer.add_short(data._track_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of JukeboxUseServerPacket 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
JukeboxUseServerPacket JukeboxUseServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/jukebox_use_server_packet.py
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
@staticmethod
def deserialize(reader: EoReader) -> "JukeboxUseServerPacket":
    """
    Deserializes an instance of `JukeboxUseServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        JukeboxUseServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        track_id = reader.get_short()
        result = JukeboxUseServerPacket(track_id=track_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

JukeboxReplyServerPacket

Bases: Packet

Reply to unsuccessfully requesting a song

Source code in src/eolib/protocol/_generated/net/server/jukebox_reply_server_packet.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
class JukeboxReplyServerPacket(Packet):
    """
    Reply to unsuccessfully requesting a song
    """
    _byte_size: int = 0

    def __init__(self):
        """
        Create a new instance of JukeboxReplyServerPacket.
        """

    @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 family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Jukebox

    @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.
        """
        JukeboxReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "JukeboxReplyServerPacket") -> None:
        """
        Serializes an instance of `JukeboxReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (JukeboxReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.add_short(1)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "JukeboxReplyServerPacket":
        """
        Deserializes an instance of `JukeboxReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            JukeboxReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_short()
            result = JukeboxReplyServerPacket()
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"JukeboxReplyServerPacket(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 JukeboxReplyServerPacket.

Source code in src/eolib/protocol/_generated/net/server/jukebox_reply_server_packet.py
18
19
20
21
def __init__(self):
    """
    Create a new instance of JukeboxReplyServerPacket.
    """

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/jukebox_reply_server_packet.py
33
34
35
36
37
38
39
40
41
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Jukebox

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/jukebox_reply_server_packet.py
43
44
45
46
47
48
49
50
51
@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/jukebox_reply_server_packet.py
53
54
55
56
57
58
59
60
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.
    """
    JukeboxReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of JukeboxReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data JukeboxReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/jukebox_reply_server_packet.py
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@staticmethod
def serialize(writer: EoWriter, data: "JukeboxReplyServerPacket") -> None:
    """
    Serializes an instance of `JukeboxReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (JukeboxReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.add_short(1)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of JukeboxReplyServerPacket 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
JukeboxReplyServerPacket JukeboxReplyServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/jukebox_reply_server_packet.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@staticmethod
def deserialize(reader: EoReader) -> "JukeboxReplyServerPacket":
    """
    Deserializes an instance of `JukeboxReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        JukeboxReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_short()
        result = JukeboxReplyServerPacket()
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

JukeboxPlayerServerPacket

Bases: Packet

Play background music

Source code in src/eolib/protocol/_generated/net/server/jukebox_player_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class JukeboxPlayerServerPacket(Packet):
    """
    Play background music
    """
    _byte_size: int = 0
    _mfx_id: int

    def __init__(self, *, mfx_id: int):
        """
        Create a new instance of JukeboxPlayerServerPacket.

        Args:
            mfx_id (int): (Value range is 0-252.)
        """
        self._mfx_id = mfx_id

    @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 mfx_id(self) -> int:
        return self._mfx_id

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Jukebox

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Player

    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.
        """
        JukeboxPlayerServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "JukeboxPlayerServerPacket") -> None:
        """
        Serializes an instance of `JukeboxPlayerServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (JukeboxPlayerServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._mfx_id is None:
                raise SerializationError("mfx_id must be provided.")
            writer.add_char(data._mfx_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "JukeboxPlayerServerPacket":
        """
        Deserializes an instance of `JukeboxPlayerServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            JukeboxPlayerServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            mfx_id = reader.get_char()
            result = JukeboxPlayerServerPacket(mfx_id=mfx_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"JukeboxPlayerServerPacket(byte_size={repr(self._byte_size)}, mfx_id={repr(self._mfx_id)})"

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.

mfx_id: int property

__init__(*, mfx_id)

Create a new instance of JukeboxPlayerServerPacket.

Parameters:

Name Type Description Default
mfx_id int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/jukebox_player_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, mfx_id: int):
    """
    Create a new instance of JukeboxPlayerServerPacket.

    Args:
        mfx_id (int): (Value range is 0-252.)
    """
    self._mfx_id = mfx_id

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/jukebox_player_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Jukebox

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/jukebox_player_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Player

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/jukebox_player_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    JukeboxPlayerServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of JukeboxPlayerServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data JukeboxPlayerServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/jukebox_player_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "JukeboxPlayerServerPacket") -> None:
    """
    Serializes an instance of `JukeboxPlayerServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (JukeboxPlayerServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._mfx_id is None:
            raise SerializationError("mfx_id must be provided.")
        writer.add_char(data._mfx_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of JukeboxPlayerServerPacket 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
JukeboxPlayerServerPacket JukeboxPlayerServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/jukebox_player_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "JukeboxPlayerServerPacket":
    """
    Deserializes an instance of `JukeboxPlayerServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        JukeboxPlayerServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        mfx_id = reader.get_char()
        result = JukeboxPlayerServerPacket(mfx_id=mfx_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

JukeboxOpenServerPacket

Bases: Packet

Reply to opening the jukebox listing

Source code in src/eolib/protocol/_generated/net/server/jukebox_open_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
class JukeboxOpenServerPacket(Packet):
    """
    Reply to opening the jukebox listing
    """
    _byte_size: int = 0
    _map_id: int
    _jukebox_player: str

    def __init__(self, *, map_id: int, jukebox_player: str):
        """
        Create a new instance of JukeboxOpenServerPacket.

        Args:
            map_id (int): (Value range is 0-64008.)
            jukebox_player (str): 
        """
        self._map_id = map_id
        self._jukebox_player = jukebox_player

    @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 map_id(self) -> int:
        return self._map_id

    @property
    def jukebox_player(self) -> str:
        return self._jukebox_player

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Jukebox

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Open

    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.
        """
        JukeboxOpenServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "JukeboxOpenServerPacket") -> None:
        """
        Serializes an instance of `JukeboxOpenServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (JukeboxOpenServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._map_id is None:
                raise SerializationError("map_id must be provided.")
            writer.add_short(data._map_id)
            if data._jukebox_player is None:
                raise SerializationError("jukebox_player must be provided.")
            writer.add_string(data._jukebox_player)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "JukeboxOpenServerPacket":
        """
        Deserializes an instance of `JukeboxOpenServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            JukeboxOpenServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            map_id = reader.get_short()
            jukebox_player = reader.get_string()
            result = JukeboxOpenServerPacket(map_id=map_id, jukebox_player=jukebox_player)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"JukeboxOpenServerPacket(byte_size={repr(self._byte_size)}, map_id={repr(self._map_id)}, jukebox_player={repr(self._jukebox_player)})"

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.

map_id: int property

jukebox_player: str property

__init__(*, map_id, jukebox_player)

Create a new instance of JukeboxOpenServerPacket.

Parameters:

Name Type Description Default
map_id int

(Value range is 0-64008.)

required
jukebox_player str
required
Source code in src/eolib/protocol/_generated/net/server/jukebox_open_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, map_id: int, jukebox_player: str):
    """
    Create a new instance of JukeboxOpenServerPacket.

    Args:
        map_id (int): (Value range is 0-64008.)
        jukebox_player (str): 
    """
    self._map_id = map_id
    self._jukebox_player = jukebox_player

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/jukebox_open_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Jukebox

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/jukebox_open_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Open

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/jukebox_open_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    JukeboxOpenServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of JukeboxOpenServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data JukeboxOpenServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/jukebox_open_server_packet.py
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@staticmethod
def serialize(writer: EoWriter, data: "JukeboxOpenServerPacket") -> None:
    """
    Serializes an instance of `JukeboxOpenServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (JukeboxOpenServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._map_id is None:
            raise SerializationError("map_id must be provided.")
        writer.add_short(data._map_id)
        if data._jukebox_player is None:
            raise SerializationError("jukebox_player must be provided.")
        writer.add_string(data._jukebox_player)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of JukeboxOpenServerPacket 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
JukeboxOpenServerPacket JukeboxOpenServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/jukebox_open_server_packet.py
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@staticmethod
def deserialize(reader: EoReader) -> "JukeboxOpenServerPacket":
    """
    Deserializes an instance of `JukeboxOpenServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        JukeboxOpenServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        map_id = reader.get_short()
        jukebox_player = reader.get_string()
        result = JukeboxOpenServerPacket(map_id=map_id, jukebox_player=jukebox_player)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

JukeboxMsgServerPacket

Bases: Packet

Someone playing a note with the bard skill nearby

Source code in src/eolib/protocol/_generated/net/server/jukebox_msg_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
class JukeboxMsgServerPacket(Packet):
    """
    Someone playing a note with the bard skill nearby
    """
    _byte_size: int = 0
    _player_id: int
    _direction: Direction
    _instrument_id: int
    _note_id: int

    def __init__(self, *, player_id: int, direction: Direction, instrument_id: int, note_id: int):
        """
        Create a new instance of JukeboxMsgServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            direction (Direction): 
            instrument_id (int): (Value range is 0-252.)
            note_id (int): (Value range is 0-252.)
        """
        self._player_id = player_id
        self._direction = direction
        self._instrument_id = instrument_id
        self._note_id = note_id

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def direction(self) -> Direction:
        return self._direction

    @property
    def instrument_id(self) -> int:
        return self._instrument_id

    @property
    def note_id(self) -> int:
        return self._note_id

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Jukebox

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Msg

    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.
        """
        JukeboxMsgServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "JukeboxMsgServerPacket") -> None:
        """
        Serializes an instance of `JukeboxMsgServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (JukeboxMsgServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._direction is None:
                raise SerializationError("direction must be provided.")
            writer.add_char(int(data._direction))
            if data._instrument_id is None:
                raise SerializationError("instrument_id must be provided.")
            writer.add_char(data._instrument_id)
            if data._note_id is None:
                raise SerializationError("note_id must be provided.")
            writer.add_char(data._note_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "JukeboxMsgServerPacket":
        """
        Deserializes an instance of `JukeboxMsgServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            JukeboxMsgServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            direction = Direction(reader.get_char())
            instrument_id = reader.get_char()
            note_id = reader.get_char()
            result = JukeboxMsgServerPacket(player_id=player_id, direction=direction, instrument_id=instrument_id, note_id=note_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"JukeboxMsgServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, direction={repr(self._direction)}, instrument_id={repr(self._instrument_id)}, note_id={repr(self._note_id)})"

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.

player_id: int property

direction: Direction property

instrument_id: int property

note_id: int property

__init__(*, player_id, direction, instrument_id, note_id)

Create a new instance of JukeboxMsgServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
direction Direction
required
instrument_id int

(Value range is 0-252.)

required
note_id int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/jukebox_msg_server_packet.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
def __init__(self, *, player_id: int, direction: Direction, instrument_id: int, note_id: int):
    """
    Create a new instance of JukeboxMsgServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        direction (Direction): 
        instrument_id (int): (Value range is 0-252.)
        note_id (int): (Value range is 0-252.)
    """
    self._player_id = player_id
    self._direction = direction
    self._instrument_id = instrument_id
    self._note_id = note_id

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/jukebox_msg_server_packet.py
65
66
67
68
69
70
71
72
73
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Jukebox

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/jukebox_msg_server_packet.py
75
76
77
78
79
80
81
82
83
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Msg

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/jukebox_msg_server_packet.py
85
86
87
88
89
90
91
92
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.
    """
    JukeboxMsgServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of JukeboxMsgServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data JukeboxMsgServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/jukebox_msg_server_packet.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "JukeboxMsgServerPacket") -> None:
    """
    Serializes an instance of `JukeboxMsgServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (JukeboxMsgServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._direction is None:
            raise SerializationError("direction must be provided.")
        writer.add_char(int(data._direction))
        if data._instrument_id is None:
            raise SerializationError("instrument_id must be provided.")
        writer.add_char(data._instrument_id)
        if data._note_id is None:
            raise SerializationError("note_id must be provided.")
        writer.add_char(data._note_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of JukeboxMsgServerPacket 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
JukeboxMsgServerPacket JukeboxMsgServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/jukebox_msg_server_packet.py
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 deserialize(reader: EoReader) -> "JukeboxMsgServerPacket":
    """
    Deserializes an instance of `JukeboxMsgServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        JukeboxMsgServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        direction = Direction(reader.get_char())
        instrument_id = reader.get_char()
        note_id = reader.get_char()
        result = JukeboxMsgServerPacket(player_id=player_id, direction=direction, instrument_id=instrument_id, note_id=note_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

JukeboxAgreeServerPacket

Bases: Packet

Reply to successfully requesting a song

Source code in src/eolib/protocol/_generated/net/server/jukebox_agree_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class JukeboxAgreeServerPacket(Packet):
    """
    Reply to successfully requesting a song
    """
    _byte_size: int = 0
    _gold_amount: int

    def __init__(self, *, gold_amount: int):
        """
        Create a new instance of JukeboxAgreeServerPacket.

        Args:
            gold_amount (int): (Value range is 0-4097152080.)
        """
        self._gold_amount = gold_amount

    @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 gold_amount(self) -> int:
        return self._gold_amount

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Jukebox

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Agree

    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.
        """
        JukeboxAgreeServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "JukeboxAgreeServerPacket") -> None:
        """
        Serializes an instance of `JukeboxAgreeServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (JukeboxAgreeServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._gold_amount is None:
                raise SerializationError("gold_amount must be provided.")
            writer.add_int(data._gold_amount)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "JukeboxAgreeServerPacket":
        """
        Deserializes an instance of `JukeboxAgreeServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            JukeboxAgreeServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            gold_amount = reader.get_int()
            result = JukeboxAgreeServerPacket(gold_amount=gold_amount)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"JukeboxAgreeServerPacket(byte_size={repr(self._byte_size)}, gold_amount={repr(self._gold_amount)})"

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.

gold_amount: int property

__init__(*, gold_amount)

Create a new instance of JukeboxAgreeServerPacket.

Parameters:

Name Type Description Default
gold_amount int

(Value range is 0-4097152080.)

required
Source code in src/eolib/protocol/_generated/net/server/jukebox_agree_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, gold_amount: int):
    """
    Create a new instance of JukeboxAgreeServerPacket.

    Args:
        gold_amount (int): (Value range is 0-4097152080.)
    """
    self._gold_amount = gold_amount

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/jukebox_agree_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Jukebox

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/jukebox_agree_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Agree

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/jukebox_agree_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    JukeboxAgreeServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of JukeboxAgreeServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data JukeboxAgreeServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/jukebox_agree_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "JukeboxAgreeServerPacket") -> None:
    """
    Serializes an instance of `JukeboxAgreeServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (JukeboxAgreeServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._gold_amount is None:
            raise SerializationError("gold_amount must be provided.")
        writer.add_int(data._gold_amount)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of JukeboxAgreeServerPacket 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
JukeboxAgreeServerPacket JukeboxAgreeServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/jukebox_agree_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "JukeboxAgreeServerPacket":
    """
    Deserializes an instance of `JukeboxAgreeServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        JukeboxAgreeServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        gold_amount = reader.get_int()
        result = JukeboxAgreeServerPacket(gold_amount=gold_amount)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ItemSpecServerPacket

Bases: Packet

Reply to trying to take a protected item from the ground

Source code in src/eolib/protocol/_generated/net/server/item_spec_server_packet.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
class ItemSpecServerPacket(Packet):
    """
    Reply to trying to take a protected item from the ground
    """
    _byte_size: int = 0

    def __init__(self):
        """
        Create a new instance of ItemSpecServerPacket.
        """

    @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 family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Item

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Spec

    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.
        """
        ItemSpecServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ItemSpecServerPacket") -> None:
        """
        Serializes an instance of `ItemSpecServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ItemSpecServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.add_short(2)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ItemSpecServerPacket":
        """
        Deserializes an instance of `ItemSpecServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ItemSpecServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_short()
            result = ItemSpecServerPacket()
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ItemSpecServerPacket(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 ItemSpecServerPacket.

Source code in src/eolib/protocol/_generated/net/server/item_spec_server_packet.py
18
19
20
21
def __init__(self):
    """
    Create a new instance of ItemSpecServerPacket.
    """

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/item_spec_server_packet.py
33
34
35
36
37
38
39
40
41
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Item

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/item_spec_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Spec

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/item_spec_server_packet.py
53
54
55
56
57
58
59
60
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.
    """
    ItemSpecServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ItemSpecServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ItemSpecServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/item_spec_server_packet.py
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@staticmethod
def serialize(writer: EoWriter, data: "ItemSpecServerPacket") -> None:
    """
    Serializes an instance of `ItemSpecServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ItemSpecServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.add_short(2)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ItemSpecServerPacket 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
ItemSpecServerPacket ItemSpecServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/item_spec_server_packet.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@staticmethod
def deserialize(reader: EoReader) -> "ItemSpecServerPacket":
    """
    Deserializes an instance of `ItemSpecServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ItemSpecServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_short()
        result = ItemSpecServerPacket()
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ItemType

Bases: IntEnum

Source code in src/eolib/protocol/_generated/pub/item_type.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
class ItemType(IntEnum, metaclass=ProtocolEnumMeta):
    General = 0
    Reserved1 = 1
    Currency = 2
    Heal = 3
    Teleport = 4
    Reserved5 = 5
    ExpReward = 6
    Reserved7 = 7
    Reserved8 = 8
    Key = 9
    Weapon = 10
    Shield = 11
    Armor = 12
    Hat = 13
    Boots = 14
    Gloves = 15
    Accessory = 16
    Belt = 17
    Necklace = 18
    Ring = 19
    Armlet = 20
    Bracer = 21
    Alcohol = 22
    EffectPotion = 23
    HairDye = 24
    CureCurse = 25
    Reserved26 = 26
    Reserved27 = 27
    Reserved28 = 28
    Reserved29 = 29

General = 0 class-attribute instance-attribute

Reserved1 = 1 class-attribute instance-attribute

Currency = 2 class-attribute instance-attribute

Heal = 3 class-attribute instance-attribute

Teleport = 4 class-attribute instance-attribute

Reserved5 = 5 class-attribute instance-attribute

ExpReward = 6 class-attribute instance-attribute

Reserved7 = 7 class-attribute instance-attribute

Reserved8 = 8 class-attribute instance-attribute

Key = 9 class-attribute instance-attribute

Weapon = 10 class-attribute instance-attribute

Shield = 11 class-attribute instance-attribute

Armor = 12 class-attribute instance-attribute

Hat = 13 class-attribute instance-attribute

Boots = 14 class-attribute instance-attribute

Gloves = 15 class-attribute instance-attribute

Accessory = 16 class-attribute instance-attribute

Belt = 17 class-attribute instance-attribute

Necklace = 18 class-attribute instance-attribute

Ring = 19 class-attribute instance-attribute

Armlet = 20 class-attribute instance-attribute

Bracer = 21 class-attribute instance-attribute

Alcohol = 22 class-attribute instance-attribute

EffectPotion = 23 class-attribute instance-attribute

HairDye = 24 class-attribute instance-attribute

CureCurse = 25 class-attribute instance-attribute

Reserved26 = 26 class-attribute instance-attribute

Reserved27 = 27 class-attribute instance-attribute

Reserved28 = 28 class-attribute instance-attribute

Reserved29 = 29 class-attribute instance-attribute

ItemReplyServerPacket

Bases: Packet

Reply to using an item

Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
 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
class ItemReplyServerPacket(Packet):
    """
    Reply to using an item
    """
    _byte_size: int = 0
    _item_type: ItemType
    _used_item: Item
    _weight: Weight
    _item_type_data: 'ItemReplyServerPacket.ItemTypeData'

    def __init__(self, *, item_type: ItemType, used_item: Item, weight: Weight, item_type_data: 'ItemReplyServerPacket.ItemTypeData' = None):
        """
        Create a new instance of ItemReplyServerPacket.

        Args:
            item_type (ItemType): 
            used_item (Item): 
            weight (Weight): 
            item_type_data (ItemReplyServerPacket.ItemTypeData): Data associated with the `item_type` field.
        """
        self._item_type = item_type
        self._used_item = used_item
        self._weight = weight
        self._item_type_data = item_type_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 item_type(self) -> ItemType:
        return self._item_type

    @property
    def used_item(self) -> Item:
        return self._used_item

    @property
    def weight(self) -> Weight:
        return self._weight

    @property
    def item_type_data(self) -> 'ItemReplyServerPacket.ItemTypeData':
        """
        ItemReplyServerPacket.ItemTypeData: Data associated with the `item_type` field.
        """
        return self._item_type_data

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Item

    @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.
        """
        ItemReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ItemReplyServerPacket") -> None:
        """
        Serializes an instance of `ItemReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ItemReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._item_type is None:
                raise SerializationError("item_type must be provided.")
            writer.add_char(int(data._item_type))
            if data._used_item is None:
                raise SerializationError("used_item must be provided.")
            Item.serialize(writer, data._used_item)
            if data._weight is None:
                raise SerializationError("weight must be provided.")
            Weight.serialize(writer, data._weight)
            if data._item_type == ItemType.Heal:
                if not isinstance(data._item_type_data, ItemReplyServerPacket.ItemTypeDataHeal):
                    raise SerializationError("Expected item_type_data to be type ItemReplyServerPacket.ItemTypeDataHeal for item_type " + ItemType(data._item_type).name + ".")
                ItemReplyServerPacket.ItemTypeDataHeal.serialize(writer, data._item_type_data)
            elif data._item_type == ItemType.HairDye:
                if not isinstance(data._item_type_data, ItemReplyServerPacket.ItemTypeDataHairDye):
                    raise SerializationError("Expected item_type_data to be type ItemReplyServerPacket.ItemTypeDataHairDye for item_type " + ItemType(data._item_type).name + ".")
                ItemReplyServerPacket.ItemTypeDataHairDye.serialize(writer, data._item_type_data)
            elif data._item_type == ItemType.EffectPotion:
                if not isinstance(data._item_type_data, ItemReplyServerPacket.ItemTypeDataEffectPotion):
                    raise SerializationError("Expected item_type_data to be type ItemReplyServerPacket.ItemTypeDataEffectPotion for item_type " + ItemType(data._item_type).name + ".")
                ItemReplyServerPacket.ItemTypeDataEffectPotion.serialize(writer, data._item_type_data)
            elif data._item_type == ItemType.CureCurse:
                if not isinstance(data._item_type_data, ItemReplyServerPacket.ItemTypeDataCureCurse):
                    raise SerializationError("Expected item_type_data to be type ItemReplyServerPacket.ItemTypeDataCureCurse for item_type " + ItemType(data._item_type).name + ".")
                ItemReplyServerPacket.ItemTypeDataCureCurse.serialize(writer, data._item_type_data)
            elif data._item_type == ItemType.ExpReward:
                if not isinstance(data._item_type_data, ItemReplyServerPacket.ItemTypeDataExpReward):
                    raise SerializationError("Expected item_type_data to be type ItemReplyServerPacket.ItemTypeDataExpReward for item_type " + ItemType(data._item_type).name + ".")
                ItemReplyServerPacket.ItemTypeDataExpReward.serialize(writer, data._item_type_data)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ItemReplyServerPacket":
        """
        Deserializes an instance of `ItemReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ItemReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            item_type = ItemType(reader.get_char())
            used_item = Item.deserialize(reader)
            weight = Weight.deserialize(reader)
            item_type_data: ItemReplyServerPacket.ItemTypeData = None
            if item_type == ItemType.Heal:
                item_type_data = ItemReplyServerPacket.ItemTypeDataHeal.deserialize(reader)
            elif item_type == ItemType.HairDye:
                item_type_data = ItemReplyServerPacket.ItemTypeDataHairDye.deserialize(reader)
            elif item_type == ItemType.EffectPotion:
                item_type_data = ItemReplyServerPacket.ItemTypeDataEffectPotion.deserialize(reader)
            elif item_type == ItemType.CureCurse:
                item_type_data = ItemReplyServerPacket.ItemTypeDataCureCurse.deserialize(reader)
            elif item_type == ItemType.ExpReward:
                item_type_data = ItemReplyServerPacket.ItemTypeDataExpReward.deserialize(reader)
            result = ItemReplyServerPacket(item_type=item_type, used_item=used_item, weight=weight, item_type_data=item_type_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"ItemReplyServerPacket(byte_size={repr(self._byte_size)}, item_type={repr(self._item_type)}, used_item={repr(self._used_item)}, weight={repr(self._weight)}, item_type_data={repr(self._item_type_data)})"

    ItemTypeData = Union['ItemReplyServerPacket.ItemTypeDataHeal', 'ItemReplyServerPacket.ItemTypeDataHairDye', 'ItemReplyServerPacket.ItemTypeDataEffectPotion', 'ItemReplyServerPacket.ItemTypeDataCureCurse', 'ItemReplyServerPacket.ItemTypeDataExpReward', None]
    """
    Data associated with different values of the `item_type` field.
    """

    class ItemTypeDataHeal:
        """
        Data associated with item_type value ItemType.Heal
        """
        _byte_size: int = 0
        _hp_gain: int
        _hp: int
        _tp: int

        def __init__(self, *, hp_gain: int, hp: int, tp: int):
            """
            Create a new instance of ItemReplyServerPacket.ItemTypeDataHeal.

            Args:
                hp_gain (int): (Value range is 0-4097152080.)
                hp (int): (Value range is 0-64008.)
                tp (int): (Value range is 0-64008.)
            """
            self._hp_gain = hp_gain
            self._hp = hp
            self._tp = tp

        @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 hp_gain(self) -> int:
            return self._hp_gain

        @property
        def hp(self) -> int:
            return self._hp

        @property
        def tp(self) -> int:
            return self._tp

        @staticmethod
        def serialize(writer: EoWriter, data: "ItemReplyServerPacket.ItemTypeDataHeal") -> None:
            """
            Serializes an instance of `ItemReplyServerPacket.ItemTypeDataHeal` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (ItemReplyServerPacket.ItemTypeDataHeal): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._hp_gain is None:
                    raise SerializationError("hp_gain must be provided.")
                writer.add_int(data._hp_gain)
                if data._hp is None:
                    raise SerializationError("hp must be provided.")
                writer.add_short(data._hp)
                if data._tp is None:
                    raise SerializationError("tp must be provided.")
                writer.add_short(data._tp)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "ItemReplyServerPacket.ItemTypeDataHeal":
            """
            Deserializes an instance of `ItemReplyServerPacket.ItemTypeDataHeal` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                ItemReplyServerPacket.ItemTypeDataHeal: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                hp_gain = reader.get_int()
                hp = reader.get_short()
                tp = reader.get_short()
                result = ItemReplyServerPacket.ItemTypeDataHeal(hp_gain=hp_gain, hp=hp, tp=tp)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"ItemReplyServerPacket.ItemTypeDataHeal(byte_size={repr(self._byte_size)}, hp_gain={repr(self._hp_gain)}, hp={repr(self._hp)}, tp={repr(self._tp)})"

    class ItemTypeDataHairDye:
        """
        Data associated with item_type value ItemType.HairDye
        """
        _byte_size: int = 0
        _hair_color: int

        def __init__(self, *, hair_color: int):
            """
            Create a new instance of ItemReplyServerPacket.ItemTypeDataHairDye.

            Args:
                hair_color (int): (Value range is 0-252.)
            """
            self._hair_color = hair_color

        @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 hair_color(self) -> int:
            return self._hair_color

        @staticmethod
        def serialize(writer: EoWriter, data: "ItemReplyServerPacket.ItemTypeDataHairDye") -> None:
            """
            Serializes an instance of `ItemReplyServerPacket.ItemTypeDataHairDye` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (ItemReplyServerPacket.ItemTypeDataHairDye): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._hair_color is None:
                    raise SerializationError("hair_color must be provided.")
                writer.add_char(data._hair_color)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "ItemReplyServerPacket.ItemTypeDataHairDye":
            """
            Deserializes an instance of `ItemReplyServerPacket.ItemTypeDataHairDye` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                ItemReplyServerPacket.ItemTypeDataHairDye: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                hair_color = reader.get_char()
                result = ItemReplyServerPacket.ItemTypeDataHairDye(hair_color=hair_color)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"ItemReplyServerPacket.ItemTypeDataHairDye(byte_size={repr(self._byte_size)}, hair_color={repr(self._hair_color)})"

    class ItemTypeDataEffectPotion:
        """
        Data associated with item_type value ItemType.EffectPotion
        """
        _byte_size: int = 0
        _effect_id: int

        def __init__(self, *, effect_id: int):
            """
            Create a new instance of ItemReplyServerPacket.ItemTypeDataEffectPotion.

            Args:
                effect_id (int): (Value range is 0-64008.)
            """
            self._effect_id = effect_id

        @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 effect_id(self) -> int:
            return self._effect_id

        @staticmethod
        def serialize(writer: EoWriter, data: "ItemReplyServerPacket.ItemTypeDataEffectPotion") -> None:
            """
            Serializes an instance of `ItemReplyServerPacket.ItemTypeDataEffectPotion` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (ItemReplyServerPacket.ItemTypeDataEffectPotion): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._effect_id is None:
                    raise SerializationError("effect_id must be provided.")
                writer.add_short(data._effect_id)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "ItemReplyServerPacket.ItemTypeDataEffectPotion":
            """
            Deserializes an instance of `ItemReplyServerPacket.ItemTypeDataEffectPotion` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                ItemReplyServerPacket.ItemTypeDataEffectPotion: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                effect_id = reader.get_short()
                result = ItemReplyServerPacket.ItemTypeDataEffectPotion(effect_id=effect_id)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"ItemReplyServerPacket.ItemTypeDataEffectPotion(byte_size={repr(self._byte_size)}, effect_id={repr(self._effect_id)})"

    class ItemTypeDataCureCurse:
        """
        Data associated with item_type value ItemType.CureCurse
        """
        _byte_size: int = 0
        _stats: CharacterStatsEquipmentChange

        def __init__(self, *, stats: CharacterStatsEquipmentChange):
            """
            Create a new instance of ItemReplyServerPacket.ItemTypeDataCureCurse.

            Args:
                stats (CharacterStatsEquipmentChange): 
            """
            self._stats = stats

        @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 stats(self) -> CharacterStatsEquipmentChange:
            return self._stats

        @staticmethod
        def serialize(writer: EoWriter, data: "ItemReplyServerPacket.ItemTypeDataCureCurse") -> None:
            """
            Serializes an instance of `ItemReplyServerPacket.ItemTypeDataCureCurse` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (ItemReplyServerPacket.ItemTypeDataCureCurse): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._stats is None:
                    raise SerializationError("stats must be provided.")
                CharacterStatsEquipmentChange.serialize(writer, data._stats)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "ItemReplyServerPacket.ItemTypeDataCureCurse":
            """
            Deserializes an instance of `ItemReplyServerPacket.ItemTypeDataCureCurse` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                ItemReplyServerPacket.ItemTypeDataCureCurse: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                stats = CharacterStatsEquipmentChange.deserialize(reader)
                result = ItemReplyServerPacket.ItemTypeDataCureCurse(stats=stats)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"ItemReplyServerPacket.ItemTypeDataCureCurse(byte_size={repr(self._byte_size)}, stats={repr(self._stats)})"

    class ItemTypeDataExpReward:
        """
        Data associated with item_type value ItemType.ExpReward
        """
        _byte_size: int = 0
        _experience: int
        _level_up: int
        _stat_points: int
        _skill_points: int
        _max_hp: int
        _max_tp: int
        _max_sp: int

        def __init__(self, *, experience: int, level_up: int, stat_points: int, skill_points: int, max_hp: int, max_tp: int, max_sp: int):
            """
            Create a new instance of ItemReplyServerPacket.ItemTypeDataExpReward.

            Args:
                experience (int): (Value range is 0-4097152080.)
                level_up (int): A value greater than 0 is "new level" and indicates the player leveled up. (Value range is 0-252.)
                stat_points (int): (Value range is 0-64008.)
                skill_points (int): (Value range is 0-64008.)
                max_hp (int): (Value range is 0-64008.)
                max_tp (int): (Value range is 0-64008.)
                max_sp (int): (Value range is 0-64008.)
            """
            self._experience = experience
            self._level_up = level_up
            self._stat_points = stat_points
            self._skill_points = skill_points
            self._max_hp = max_hp
            self._max_tp = max_tp
            self._max_sp = max_sp

        @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 experience(self) -> int:
            return self._experience

        @property
        def level_up(self) -> int:
            """
            A value greater than 0 is "new level" and indicates the player leveled up.
            """
            return self._level_up

        @property
        def stat_points(self) -> int:
            return self._stat_points

        @property
        def skill_points(self) -> int:
            return self._skill_points

        @property
        def max_hp(self) -> int:
            return self._max_hp

        @property
        def max_tp(self) -> int:
            return self._max_tp

        @property
        def max_sp(self) -> int:
            return self._max_sp

        @staticmethod
        def serialize(writer: EoWriter, data: "ItemReplyServerPacket.ItemTypeDataExpReward") -> None:
            """
            Serializes an instance of `ItemReplyServerPacket.ItemTypeDataExpReward` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (ItemReplyServerPacket.ItemTypeDataExpReward): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._experience is None:
                    raise SerializationError("experience must be provided.")
                writer.add_int(data._experience)
                if data._level_up is None:
                    raise SerializationError("level_up must be provided.")
                writer.add_char(data._level_up)
                if data._stat_points is None:
                    raise SerializationError("stat_points must be provided.")
                writer.add_short(data._stat_points)
                if data._skill_points is None:
                    raise SerializationError("skill_points must be provided.")
                writer.add_short(data._skill_points)
                if data._max_hp is None:
                    raise SerializationError("max_hp must be provided.")
                writer.add_short(data._max_hp)
                if data._max_tp is None:
                    raise SerializationError("max_tp must be provided.")
                writer.add_short(data._max_tp)
                if data._max_sp is None:
                    raise SerializationError("max_sp must be provided.")
                writer.add_short(data._max_sp)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "ItemReplyServerPacket.ItemTypeDataExpReward":
            """
            Deserializes an instance of `ItemReplyServerPacket.ItemTypeDataExpReward` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                ItemReplyServerPacket.ItemTypeDataExpReward: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                experience = reader.get_int()
                level_up = reader.get_char()
                stat_points = reader.get_short()
                skill_points = reader.get_short()
                max_hp = reader.get_short()
                max_tp = reader.get_short()
                max_sp = reader.get_short()
                result = ItemReplyServerPacket.ItemTypeDataExpReward(experience=experience, level_up=level_up, stat_points=stat_points, skill_points=skill_points, max_hp=max_hp, max_tp=max_tp, max_sp=max_sp)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"ItemReplyServerPacket.ItemTypeDataExpReward(byte_size={repr(self._byte_size)}, experience={repr(self._experience)}, level_up={repr(self._level_up)}, stat_points={repr(self._stat_points)}, skill_points={repr(self._skill_points)}, max_hp={repr(self._max_hp)}, max_tp={repr(self._max_tp)}, max_sp={repr(self._max_sp)})"

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.

item_type: ItemType property

used_item: Item property

weight: Weight property

item_type_data: ItemReplyServerPacket.ItemTypeData property

ItemReplyServerPacket.ItemTypeData: Data associated with the item_type field.

ItemTypeData = Union['ItemReplyServerPacket.ItemTypeDataHeal', 'ItemReplyServerPacket.ItemTypeDataHairDye', 'ItemReplyServerPacket.ItemTypeDataEffectPotion', 'ItemReplyServerPacket.ItemTypeDataCureCurse', 'ItemReplyServerPacket.ItemTypeDataExpReward', None] class-attribute instance-attribute

Data associated with different values of the item_type field.

ItemTypeDataHeal

Data associated with item_type value ItemType.Heal

Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
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
class ItemTypeDataHeal:
    """
    Data associated with item_type value ItemType.Heal
    """
    _byte_size: int = 0
    _hp_gain: int
    _hp: int
    _tp: int

    def __init__(self, *, hp_gain: int, hp: int, tp: int):
        """
        Create a new instance of ItemReplyServerPacket.ItemTypeDataHeal.

        Args:
            hp_gain (int): (Value range is 0-4097152080.)
            hp (int): (Value range is 0-64008.)
            tp (int): (Value range is 0-64008.)
        """
        self._hp_gain = hp_gain
        self._hp = hp
        self._tp = tp

    @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 hp_gain(self) -> int:
        return self._hp_gain

    @property
    def hp(self) -> int:
        return self._hp

    @property
    def tp(self) -> int:
        return self._tp

    @staticmethod
    def serialize(writer: EoWriter, data: "ItemReplyServerPacket.ItemTypeDataHeal") -> None:
        """
        Serializes an instance of `ItemReplyServerPacket.ItemTypeDataHeal` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ItemReplyServerPacket.ItemTypeDataHeal): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._hp_gain is None:
                raise SerializationError("hp_gain must be provided.")
            writer.add_int(data._hp_gain)
            if data._hp is None:
                raise SerializationError("hp must be provided.")
            writer.add_short(data._hp)
            if data._tp is None:
                raise SerializationError("tp must be provided.")
            writer.add_short(data._tp)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ItemReplyServerPacket.ItemTypeDataHeal":
        """
        Deserializes an instance of `ItemReplyServerPacket.ItemTypeDataHeal` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ItemReplyServerPacket.ItemTypeDataHeal: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            hp_gain = reader.get_int()
            hp = reader.get_short()
            tp = reader.get_short()
            result = ItemReplyServerPacket.ItemTypeDataHeal(hp_gain=hp_gain, hp=hp, tp=tp)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ItemReplyServerPacket.ItemTypeDataHeal(byte_size={repr(self._byte_size)}, hp_gain={repr(self._hp_gain)}, hp={repr(self._hp)}, tp={repr(self._tp)})"

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.

hp_gain: int property

hp: int property

tp: int property

__init__(*, hp_gain, hp, tp)

Create a new instance of ItemReplyServerPacket.ItemTypeDataHeal.

Parameters:

Name Type Description Default
hp_gain int

(Value range is 0-4097152080.)

required
hp int

(Value range is 0-64008.)

required
tp int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
195
196
197
198
199
200
201
202
203
204
205
206
def __init__(self, *, hp_gain: int, hp: int, tp: int):
    """
    Create a new instance of ItemReplyServerPacket.ItemTypeDataHeal.

    Args:
        hp_gain (int): (Value range is 0-4097152080.)
        hp (int): (Value range is 0-64008.)
        tp (int): (Value range is 0-64008.)
    """
    self._hp_gain = hp_gain
    self._hp = hp
    self._tp = tp

serialize(writer, data) staticmethod

Serializes an instance of ItemReplyServerPacket.ItemTypeDataHeal to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ItemTypeDataHeal

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
@staticmethod
def serialize(writer: EoWriter, data: "ItemReplyServerPacket.ItemTypeDataHeal") -> None:
    """
    Serializes an instance of `ItemReplyServerPacket.ItemTypeDataHeal` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ItemReplyServerPacket.ItemTypeDataHeal): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._hp_gain is None:
            raise SerializationError("hp_gain must be provided.")
        writer.add_int(data._hp_gain)
        if data._hp is None:
            raise SerializationError("hp must be provided.")
        writer.add_short(data._hp)
        if data._tp is None:
            raise SerializationError("tp must be provided.")
        writer.add_short(data._tp)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ItemReplyServerPacket.ItemTypeDataHeal from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ItemTypeDataHeal

ItemReplyServerPacket.ItemTypeDataHeal: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
@staticmethod
def deserialize(reader: EoReader) -> "ItemReplyServerPacket.ItemTypeDataHeal":
    """
    Deserializes an instance of `ItemReplyServerPacket.ItemTypeDataHeal` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ItemReplyServerPacket.ItemTypeDataHeal: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        hp_gain = reader.get_int()
        hp = reader.get_short()
        tp = reader.get_short()
        result = ItemReplyServerPacket.ItemTypeDataHeal(hp_gain=hp_gain, hp=hp, tp=tp)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ItemTypeDataHairDye

Data associated with item_type value ItemType.HairDye

Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
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
class ItemTypeDataHairDye:
    """
    Data associated with item_type value ItemType.HairDye
    """
    _byte_size: int = 0
    _hair_color: int

    def __init__(self, *, hair_color: int):
        """
        Create a new instance of ItemReplyServerPacket.ItemTypeDataHairDye.

        Args:
            hair_color (int): (Value range is 0-252.)
        """
        self._hair_color = hair_color

    @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 hair_color(self) -> int:
        return self._hair_color

    @staticmethod
    def serialize(writer: EoWriter, data: "ItemReplyServerPacket.ItemTypeDataHairDye") -> None:
        """
        Serializes an instance of `ItemReplyServerPacket.ItemTypeDataHairDye` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ItemReplyServerPacket.ItemTypeDataHairDye): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._hair_color is None:
                raise SerializationError("hair_color must be provided.")
            writer.add_char(data._hair_color)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ItemReplyServerPacket.ItemTypeDataHairDye":
        """
        Deserializes an instance of `ItemReplyServerPacket.ItemTypeDataHairDye` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ItemReplyServerPacket.ItemTypeDataHairDye: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            hair_color = reader.get_char()
            result = ItemReplyServerPacket.ItemTypeDataHairDye(hair_color=hair_color)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ItemReplyServerPacket.ItemTypeDataHairDye(byte_size={repr(self._byte_size)}, hair_color={repr(self._hair_color)})"

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.

hair_color: int property

__init__(*, hair_color)

Create a new instance of ItemReplyServerPacket.ItemTypeDataHairDye.

Parameters:

Name Type Description Default
hair_color int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
286
287
288
289
290
291
292
293
def __init__(self, *, hair_color: int):
    """
    Create a new instance of ItemReplyServerPacket.ItemTypeDataHairDye.

    Args:
        hair_color (int): (Value range is 0-252.)
    """
    self._hair_color = hair_color

serialize(writer, data) staticmethod

Serializes an instance of ItemReplyServerPacket.ItemTypeDataHairDye to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ItemTypeDataHairDye

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
@staticmethod
def serialize(writer: EoWriter, data: "ItemReplyServerPacket.ItemTypeDataHairDye") -> None:
    """
    Serializes an instance of `ItemReplyServerPacket.ItemTypeDataHairDye` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ItemReplyServerPacket.ItemTypeDataHairDye): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._hair_color is None:
            raise SerializationError("hair_color must be provided.")
        writer.add_char(data._hair_color)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ItemReplyServerPacket.ItemTypeDataHairDye from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ItemTypeDataHairDye

ItemReplyServerPacket.ItemTypeDataHairDye: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
@staticmethod
def deserialize(reader: EoReader) -> "ItemReplyServerPacket.ItemTypeDataHairDye":
    """
    Deserializes an instance of `ItemReplyServerPacket.ItemTypeDataHairDye` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ItemReplyServerPacket.ItemTypeDataHairDye: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        hair_color = reader.get_char()
        result = ItemReplyServerPacket.ItemTypeDataHairDye(hair_color=hair_color)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ItemTypeDataEffectPotion

Data associated with item_type value ItemType.EffectPotion

Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
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
class ItemTypeDataEffectPotion:
    """
    Data associated with item_type value ItemType.EffectPotion
    """
    _byte_size: int = 0
    _effect_id: int

    def __init__(self, *, effect_id: int):
        """
        Create a new instance of ItemReplyServerPacket.ItemTypeDataEffectPotion.

        Args:
            effect_id (int): (Value range is 0-64008.)
        """
        self._effect_id = effect_id

    @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 effect_id(self) -> int:
        return self._effect_id

    @staticmethod
    def serialize(writer: EoWriter, data: "ItemReplyServerPacket.ItemTypeDataEffectPotion") -> None:
        """
        Serializes an instance of `ItemReplyServerPacket.ItemTypeDataEffectPotion` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ItemReplyServerPacket.ItemTypeDataEffectPotion): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._effect_id is None:
                raise SerializationError("effect_id must be provided.")
            writer.add_short(data._effect_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ItemReplyServerPacket.ItemTypeDataEffectPotion":
        """
        Deserializes an instance of `ItemReplyServerPacket.ItemTypeDataEffectPotion` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ItemReplyServerPacket.ItemTypeDataEffectPotion: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            effect_id = reader.get_short()
            result = ItemReplyServerPacket.ItemTypeDataEffectPotion(effect_id=effect_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ItemReplyServerPacket.ItemTypeDataEffectPotion(byte_size={repr(self._byte_size)}, effect_id={repr(self._effect_id)})"

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.

effect_id: int property

__init__(*, effect_id)

Create a new instance of ItemReplyServerPacket.ItemTypeDataEffectPotion.

Parameters:

Name Type Description Default
effect_id int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
357
358
359
360
361
362
363
364
def __init__(self, *, effect_id: int):
    """
    Create a new instance of ItemReplyServerPacket.ItemTypeDataEffectPotion.

    Args:
        effect_id (int): (Value range is 0-64008.)
    """
    self._effect_id = effect_id

serialize(writer, data) staticmethod

Serializes an instance of ItemReplyServerPacket.ItemTypeDataEffectPotion to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ItemTypeDataEffectPotion

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
@staticmethod
def serialize(writer: EoWriter, data: "ItemReplyServerPacket.ItemTypeDataEffectPotion") -> None:
    """
    Serializes an instance of `ItemReplyServerPacket.ItemTypeDataEffectPotion` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ItemReplyServerPacket.ItemTypeDataEffectPotion): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._effect_id is None:
            raise SerializationError("effect_id must be provided.")
        writer.add_short(data._effect_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ItemReplyServerPacket.ItemTypeDataEffectPotion from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ItemTypeDataEffectPotion

ItemReplyServerPacket.ItemTypeDataEffectPotion: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
@staticmethod
def deserialize(reader: EoReader) -> "ItemReplyServerPacket.ItemTypeDataEffectPotion":
    """
    Deserializes an instance of `ItemReplyServerPacket.ItemTypeDataEffectPotion` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ItemReplyServerPacket.ItemTypeDataEffectPotion: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        effect_id = reader.get_short()
        result = ItemReplyServerPacket.ItemTypeDataEffectPotion(effect_id=effect_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ItemTypeDataCureCurse

Data associated with item_type value ItemType.CureCurse

Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
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
class ItemTypeDataCureCurse:
    """
    Data associated with item_type value ItemType.CureCurse
    """
    _byte_size: int = 0
    _stats: CharacterStatsEquipmentChange

    def __init__(self, *, stats: CharacterStatsEquipmentChange):
        """
        Create a new instance of ItemReplyServerPacket.ItemTypeDataCureCurse.

        Args:
            stats (CharacterStatsEquipmentChange): 
        """
        self._stats = stats

    @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 stats(self) -> CharacterStatsEquipmentChange:
        return self._stats

    @staticmethod
    def serialize(writer: EoWriter, data: "ItemReplyServerPacket.ItemTypeDataCureCurse") -> None:
        """
        Serializes an instance of `ItemReplyServerPacket.ItemTypeDataCureCurse` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ItemReplyServerPacket.ItemTypeDataCureCurse): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._stats is None:
                raise SerializationError("stats must be provided.")
            CharacterStatsEquipmentChange.serialize(writer, data._stats)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ItemReplyServerPacket.ItemTypeDataCureCurse":
        """
        Deserializes an instance of `ItemReplyServerPacket.ItemTypeDataCureCurse` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ItemReplyServerPacket.ItemTypeDataCureCurse: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            stats = CharacterStatsEquipmentChange.deserialize(reader)
            result = ItemReplyServerPacket.ItemTypeDataCureCurse(stats=stats)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ItemReplyServerPacket.ItemTypeDataCureCurse(byte_size={repr(self._byte_size)}, stats={repr(self._stats)})"

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.

stats: CharacterStatsEquipmentChange property

__init__(*, stats)

Create a new instance of ItemReplyServerPacket.ItemTypeDataCureCurse.

Parameters:

Name Type Description Default
stats CharacterStatsEquipmentChange
required
Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
428
429
430
431
432
433
434
435
def __init__(self, *, stats: CharacterStatsEquipmentChange):
    """
    Create a new instance of ItemReplyServerPacket.ItemTypeDataCureCurse.

    Args:
        stats (CharacterStatsEquipmentChange): 
    """
    self._stats = stats

serialize(writer, data) staticmethod

Serializes an instance of ItemReplyServerPacket.ItemTypeDataCureCurse to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ItemTypeDataCureCurse

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
@staticmethod
def serialize(writer: EoWriter, data: "ItemReplyServerPacket.ItemTypeDataCureCurse") -> None:
    """
    Serializes an instance of `ItemReplyServerPacket.ItemTypeDataCureCurse` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ItemReplyServerPacket.ItemTypeDataCureCurse): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._stats is None:
            raise SerializationError("stats must be provided.")
        CharacterStatsEquipmentChange.serialize(writer, data._stats)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ItemReplyServerPacket.ItemTypeDataCureCurse from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ItemTypeDataCureCurse

ItemReplyServerPacket.ItemTypeDataCureCurse: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
@staticmethod
def deserialize(reader: EoReader) -> "ItemReplyServerPacket.ItemTypeDataCureCurse":
    """
    Deserializes an instance of `ItemReplyServerPacket.ItemTypeDataCureCurse` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ItemReplyServerPacket.ItemTypeDataCureCurse: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        stats = CharacterStatsEquipmentChange.deserialize(reader)
        result = ItemReplyServerPacket.ItemTypeDataCureCurse(stats=stats)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ItemTypeDataExpReward

Data associated with item_type value ItemType.ExpReward

Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
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
class ItemTypeDataExpReward:
    """
    Data associated with item_type value ItemType.ExpReward
    """
    _byte_size: int = 0
    _experience: int
    _level_up: int
    _stat_points: int
    _skill_points: int
    _max_hp: int
    _max_tp: int
    _max_sp: int

    def __init__(self, *, experience: int, level_up: int, stat_points: int, skill_points: int, max_hp: int, max_tp: int, max_sp: int):
        """
        Create a new instance of ItemReplyServerPacket.ItemTypeDataExpReward.

        Args:
            experience (int): (Value range is 0-4097152080.)
            level_up (int): A value greater than 0 is "new level" and indicates the player leveled up. (Value range is 0-252.)
            stat_points (int): (Value range is 0-64008.)
            skill_points (int): (Value range is 0-64008.)
            max_hp (int): (Value range is 0-64008.)
            max_tp (int): (Value range is 0-64008.)
            max_sp (int): (Value range is 0-64008.)
        """
        self._experience = experience
        self._level_up = level_up
        self._stat_points = stat_points
        self._skill_points = skill_points
        self._max_hp = max_hp
        self._max_tp = max_tp
        self._max_sp = max_sp

    @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 experience(self) -> int:
        return self._experience

    @property
    def level_up(self) -> int:
        """
        A value greater than 0 is "new level" and indicates the player leveled up.
        """
        return self._level_up

    @property
    def stat_points(self) -> int:
        return self._stat_points

    @property
    def skill_points(self) -> int:
        return self._skill_points

    @property
    def max_hp(self) -> int:
        return self._max_hp

    @property
    def max_tp(self) -> int:
        return self._max_tp

    @property
    def max_sp(self) -> int:
        return self._max_sp

    @staticmethod
    def serialize(writer: EoWriter, data: "ItemReplyServerPacket.ItemTypeDataExpReward") -> None:
        """
        Serializes an instance of `ItemReplyServerPacket.ItemTypeDataExpReward` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ItemReplyServerPacket.ItemTypeDataExpReward): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._experience is None:
                raise SerializationError("experience must be provided.")
            writer.add_int(data._experience)
            if data._level_up is None:
                raise SerializationError("level_up must be provided.")
            writer.add_char(data._level_up)
            if data._stat_points is None:
                raise SerializationError("stat_points must be provided.")
            writer.add_short(data._stat_points)
            if data._skill_points is None:
                raise SerializationError("skill_points must be provided.")
            writer.add_short(data._skill_points)
            if data._max_hp is None:
                raise SerializationError("max_hp must be provided.")
            writer.add_short(data._max_hp)
            if data._max_tp is None:
                raise SerializationError("max_tp must be provided.")
            writer.add_short(data._max_tp)
            if data._max_sp is None:
                raise SerializationError("max_sp must be provided.")
            writer.add_short(data._max_sp)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ItemReplyServerPacket.ItemTypeDataExpReward":
        """
        Deserializes an instance of `ItemReplyServerPacket.ItemTypeDataExpReward` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ItemReplyServerPacket.ItemTypeDataExpReward: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            experience = reader.get_int()
            level_up = reader.get_char()
            stat_points = reader.get_short()
            skill_points = reader.get_short()
            max_hp = reader.get_short()
            max_tp = reader.get_short()
            max_sp = reader.get_short()
            result = ItemReplyServerPacket.ItemTypeDataExpReward(experience=experience, level_up=level_up, stat_points=stat_points, skill_points=skill_points, max_hp=max_hp, max_tp=max_tp, max_sp=max_sp)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ItemReplyServerPacket.ItemTypeDataExpReward(byte_size={repr(self._byte_size)}, experience={repr(self._experience)}, level_up={repr(self._level_up)}, stat_points={repr(self._stat_points)}, skill_points={repr(self._skill_points)}, max_hp={repr(self._max_hp)}, max_tp={repr(self._max_tp)}, max_sp={repr(self._max_sp)})"

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.

experience: int property

level_up: int property

A value greater than 0 is "new level" and indicates the player leveled up.

stat_points: int property

skill_points: int property

max_hp: int property

max_tp: int property

max_sp: int property

__init__(*, experience, level_up, stat_points, skill_points, max_hp, max_tp, max_sp)

Create a new instance of ItemReplyServerPacket.ItemTypeDataExpReward.

Parameters:

Name Type Description Default
experience int

(Value range is 0-4097152080.)

required
level_up int

A value greater than 0 is "new level" and indicates the player leveled up. (Value range is 0-252.)

required
stat_points int

(Value range is 0-64008.)

required
skill_points int

(Value range is 0-64008.)

required
max_hp int

(Value range is 0-64008.)

required
max_tp int

(Value range is 0-64008.)

required
max_sp int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
def __init__(self, *, experience: int, level_up: int, stat_points: int, skill_points: int, max_hp: int, max_tp: int, max_sp: int):
    """
    Create a new instance of ItemReplyServerPacket.ItemTypeDataExpReward.

    Args:
        experience (int): (Value range is 0-4097152080.)
        level_up (int): A value greater than 0 is "new level" and indicates the player leveled up. (Value range is 0-252.)
        stat_points (int): (Value range is 0-64008.)
        skill_points (int): (Value range is 0-64008.)
        max_hp (int): (Value range is 0-64008.)
        max_tp (int): (Value range is 0-64008.)
        max_sp (int): (Value range is 0-64008.)
    """
    self._experience = experience
    self._level_up = level_up
    self._stat_points = stat_points
    self._skill_points = skill_points
    self._max_hp = max_hp
    self._max_tp = max_tp
    self._max_sp = max_sp

serialize(writer, data) staticmethod

Serializes an instance of ItemReplyServerPacket.ItemTypeDataExpReward to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ItemTypeDataExpReward

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
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
@staticmethod
def serialize(writer: EoWriter, data: "ItemReplyServerPacket.ItemTypeDataExpReward") -> None:
    """
    Serializes an instance of `ItemReplyServerPacket.ItemTypeDataExpReward` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ItemReplyServerPacket.ItemTypeDataExpReward): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._experience is None:
            raise SerializationError("experience must be provided.")
        writer.add_int(data._experience)
        if data._level_up is None:
            raise SerializationError("level_up must be provided.")
        writer.add_char(data._level_up)
        if data._stat_points is None:
            raise SerializationError("stat_points must be provided.")
        writer.add_short(data._stat_points)
        if data._skill_points is None:
            raise SerializationError("skill_points must be provided.")
        writer.add_short(data._skill_points)
        if data._max_hp is None:
            raise SerializationError("max_hp must be provided.")
        writer.add_short(data._max_hp)
        if data._max_tp is None:
            raise SerializationError("max_tp must be provided.")
        writer.add_short(data._max_tp)
        if data._max_sp is None:
            raise SerializationError("max_sp must be provided.")
        writer.add_short(data._max_sp)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ItemReplyServerPacket.ItemTypeDataExpReward from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ItemTypeDataExpReward

ItemReplyServerPacket.ItemTypeDataExpReward: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "ItemReplyServerPacket.ItemTypeDataExpReward":
    """
    Deserializes an instance of `ItemReplyServerPacket.ItemTypeDataExpReward` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ItemReplyServerPacket.ItemTypeDataExpReward: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        experience = reader.get_int()
        level_up = reader.get_char()
        stat_points = reader.get_short()
        skill_points = reader.get_short()
        max_hp = reader.get_short()
        max_tp = reader.get_short()
        max_sp = reader.get_short()
        result = ItemReplyServerPacket.ItemTypeDataExpReward(experience=experience, level_up=level_up, stat_points=stat_points, skill_points=skill_points, max_hp=max_hp, max_tp=max_tp, max_sp=max_sp)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

__init__(*, item_type, used_item, weight, item_type_data=None)

Create a new instance of ItemReplyServerPacket.

Parameters:

Name Type Description Default
item_type ItemType
required
used_item Item
required
weight Weight
required
item_type_data ItemTypeData

Data associated with the item_type field.

None
Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
def __init__(self, *, item_type: ItemType, used_item: Item, weight: Weight, item_type_data: 'ItemReplyServerPacket.ItemTypeData' = None):
    """
    Create a new instance of ItemReplyServerPacket.

    Args:
        item_type (ItemType): 
        used_item (Item): 
        weight (Weight): 
        item_type_data (ItemReplyServerPacket.ItemTypeData): Data associated with the `item_type` field.
    """
    self._item_type = item_type
    self._used_item = used_item
    self._weight = weight
    self._item_type_data = item_type_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/item_reply_server_packet.py
72
73
74
75
76
77
78
79
80
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Item

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/item_reply_server_packet.py
82
83
84
85
86
87
88
89
90
@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/item_reply_server_packet.py
92
93
94
95
96
97
98
99
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.
    """
    ItemReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ItemReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ItemReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/item_reply_server_packet.py
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: "ItemReplyServerPacket") -> None:
    """
    Serializes an instance of `ItemReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ItemReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._item_type is None:
            raise SerializationError("item_type must be provided.")
        writer.add_char(int(data._item_type))
        if data._used_item is None:
            raise SerializationError("used_item must be provided.")
        Item.serialize(writer, data._used_item)
        if data._weight is None:
            raise SerializationError("weight must be provided.")
        Weight.serialize(writer, data._weight)
        if data._item_type == ItemType.Heal:
            if not isinstance(data._item_type_data, ItemReplyServerPacket.ItemTypeDataHeal):
                raise SerializationError("Expected item_type_data to be type ItemReplyServerPacket.ItemTypeDataHeal for item_type " + ItemType(data._item_type).name + ".")
            ItemReplyServerPacket.ItemTypeDataHeal.serialize(writer, data._item_type_data)
        elif data._item_type == ItemType.HairDye:
            if not isinstance(data._item_type_data, ItemReplyServerPacket.ItemTypeDataHairDye):
                raise SerializationError("Expected item_type_data to be type ItemReplyServerPacket.ItemTypeDataHairDye for item_type " + ItemType(data._item_type).name + ".")
            ItemReplyServerPacket.ItemTypeDataHairDye.serialize(writer, data._item_type_data)
        elif data._item_type == ItemType.EffectPotion:
            if not isinstance(data._item_type_data, ItemReplyServerPacket.ItemTypeDataEffectPotion):
                raise SerializationError("Expected item_type_data to be type ItemReplyServerPacket.ItemTypeDataEffectPotion for item_type " + ItemType(data._item_type).name + ".")
            ItemReplyServerPacket.ItemTypeDataEffectPotion.serialize(writer, data._item_type_data)
        elif data._item_type == ItemType.CureCurse:
            if not isinstance(data._item_type_data, ItemReplyServerPacket.ItemTypeDataCureCurse):
                raise SerializationError("Expected item_type_data to be type ItemReplyServerPacket.ItemTypeDataCureCurse for item_type " + ItemType(data._item_type).name + ".")
            ItemReplyServerPacket.ItemTypeDataCureCurse.serialize(writer, data._item_type_data)
        elif data._item_type == ItemType.ExpReward:
            if not isinstance(data._item_type_data, ItemReplyServerPacket.ItemTypeDataExpReward):
                raise SerializationError("Expected item_type_data to be type ItemReplyServerPacket.ItemTypeDataExpReward for item_type " + ItemType(data._item_type).name + ".")
            ItemReplyServerPacket.ItemTypeDataExpReward.serialize(writer, data._item_type_data)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ItemReplyServerPacket 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
ItemReplyServerPacket ItemReplyServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/item_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
@staticmethod
def deserialize(reader: EoReader) -> "ItemReplyServerPacket":
    """
    Deserializes an instance of `ItemReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ItemReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        item_type = ItemType(reader.get_char())
        used_item = Item.deserialize(reader)
        weight = Weight.deserialize(reader)
        item_type_data: ItemReplyServerPacket.ItemTypeData = None
        if item_type == ItemType.Heal:
            item_type_data = ItemReplyServerPacket.ItemTypeDataHeal.deserialize(reader)
        elif item_type == ItemType.HairDye:
            item_type_data = ItemReplyServerPacket.ItemTypeDataHairDye.deserialize(reader)
        elif item_type == ItemType.EffectPotion:
            item_type_data = ItemReplyServerPacket.ItemTypeDataEffectPotion.deserialize(reader)
        elif item_type == ItemType.CureCurse:
            item_type_data = ItemReplyServerPacket.ItemTypeDataCureCurse.deserialize(reader)
        elif item_type == ItemType.ExpReward:
            item_type_data = ItemReplyServerPacket.ItemTypeDataExpReward.deserialize(reader)
        result = ItemReplyServerPacket(item_type=item_type, used_item=used_item, weight=weight, item_type_data=item_type_data)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ItemRemoveServerPacket

Bases: Packet

Item disappeared from the ground

Source code in src/eolib/protocol/_generated/net/server/item_remove_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class ItemRemoveServerPacket(Packet):
    """
    Item disappeared from the ground
    """
    _byte_size: int = 0
    _item_index: int

    def __init__(self, *, item_index: int):
        """
        Create a new instance of ItemRemoveServerPacket.

        Args:
            item_index (int): (Value range is 0-64008.)
        """
        self._item_index = item_index

    @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 item_index(self) -> int:
        return self._item_index

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Item

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Remove

    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.
        """
        ItemRemoveServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ItemRemoveServerPacket") -> None:
        """
        Serializes an instance of `ItemRemoveServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ItemRemoveServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._item_index is None:
                raise SerializationError("item_index must be provided.")
            writer.add_short(data._item_index)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ItemRemoveServerPacket":
        """
        Deserializes an instance of `ItemRemoveServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ItemRemoveServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            item_index = reader.get_short()
            result = ItemRemoveServerPacket(item_index=item_index)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ItemRemoveServerPacket(byte_size={repr(self._byte_size)}, item_index={repr(self._item_index)})"

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.

item_index: int property

__init__(*, item_index)

Create a new instance of ItemRemoveServerPacket.

Parameters:

Name Type Description Default
item_index int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/item_remove_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, item_index: int):
    """
    Create a new instance of ItemRemoveServerPacket.

    Args:
        item_index (int): (Value range is 0-64008.)
    """
    self._item_index = item_index

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/item_remove_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Item

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/item_remove_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Remove

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/item_remove_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    ItemRemoveServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ItemRemoveServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ItemRemoveServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/item_remove_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "ItemRemoveServerPacket") -> None:
    """
    Serializes an instance of `ItemRemoveServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ItemRemoveServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._item_index is None:
            raise SerializationError("item_index must be provided.")
        writer.add_short(data._item_index)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ItemRemoveServerPacket 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
ItemRemoveServerPacket ItemRemoveServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/item_remove_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "ItemRemoveServerPacket":
    """
    Deserializes an instance of `ItemRemoveServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ItemRemoveServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        item_index = reader.get_short()
        result = ItemRemoveServerPacket(item_index=item_index)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ItemObtainServerPacket

Bases: Packet

Receive item (from quest)

Source code in src/eolib/protocol/_generated/net/server/item_obtain_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class ItemObtainServerPacket(Packet):
    """
    Receive item (from quest)
    """
    _byte_size: int = 0
    _item: ThreeItem
    _current_weight: int

    def __init__(self, *, item: ThreeItem, current_weight: int):
        """
        Create a new instance of ItemObtainServerPacket.

        Args:
            item (ThreeItem): 
            current_weight (int): (Value range is 0-252.)
        """
        self._item = item
        self._current_weight = current_weight

    @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 item(self) -> ThreeItem:
        return self._item

    @property
    def current_weight(self) -> int:
        return self._current_weight

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Item

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Obtain

    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.
        """
        ItemObtainServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ItemObtainServerPacket") -> None:
        """
        Serializes an instance of `ItemObtainServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ItemObtainServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._item is None:
                raise SerializationError("item must be provided.")
            ThreeItem.serialize(writer, data._item)
            if data._current_weight is None:
                raise SerializationError("current_weight must be provided.")
            writer.add_char(data._current_weight)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ItemObtainServerPacket":
        """
        Deserializes an instance of `ItemObtainServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ItemObtainServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            item = ThreeItem.deserialize(reader)
            current_weight = reader.get_char()
            result = ItemObtainServerPacket(item=item, current_weight=current_weight)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ItemObtainServerPacket(byte_size={repr(self._byte_size)}, item={repr(self._item)}, current_weight={repr(self._current_weight)})"

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.

item: ThreeItem property

current_weight: int property

__init__(*, item, current_weight)

Create a new instance of ItemObtainServerPacket.

Parameters:

Name Type Description Default
item ThreeItem
required
current_weight int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/item_obtain_server_packet.py
22
23
24
25
26
27
28
29
30
31
def __init__(self, *, item: ThreeItem, current_weight: int):
    """
    Create a new instance of ItemObtainServerPacket.

    Args:
        item (ThreeItem): 
        current_weight (int): (Value range is 0-252.)
    """
    self._item = item
    self._current_weight = current_weight

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/item_obtain_server_packet.py
51
52
53
54
55
56
57
58
59
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Item

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/item_obtain_server_packet.py
61
62
63
64
65
66
67
68
69
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Obtain

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/item_obtain_server_packet.py
71
72
73
74
75
76
77
78
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.
    """
    ItemObtainServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ItemObtainServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ItemObtainServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/item_obtain_server_packet.py
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@staticmethod
def serialize(writer: EoWriter, data: "ItemObtainServerPacket") -> None:
    """
    Serializes an instance of `ItemObtainServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ItemObtainServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._item is None:
            raise SerializationError("item must be provided.")
        ThreeItem.serialize(writer, data._item)
        if data._current_weight is None:
            raise SerializationError("current_weight must be provided.")
        writer.add_char(data._current_weight)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ItemObtainServerPacket 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
ItemObtainServerPacket ItemObtainServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/item_obtain_server_packet.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@staticmethod
def deserialize(reader: EoReader) -> "ItemObtainServerPacket":
    """
    Deserializes an instance of `ItemObtainServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ItemObtainServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        item = ThreeItem.deserialize(reader)
        current_weight = reader.get_char()
        result = ItemObtainServerPacket(item=item, current_weight=current_weight)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ItemMapInfo

Information about a nearby item on the ground

Source code in src/eolib/protocol/_generated/net/server/item_map_info.py
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
class ItemMapInfo:
    """
    Information about a nearby item on the ground
    """
    _byte_size: int = 0
    _uid: int
    _id: int
    _coords: Coords
    _amount: int

    def __init__(self, *, uid: int, id: int, coords: Coords, amount: int):
        """
        Create a new instance of ItemMapInfo.

        Args:
            uid (int): (Value range is 0-64008.)
            id (int): (Value range is 0-64008.)
            coords (Coords): 
            amount (int): (Value range is 0-16194276.)
        """
        self._uid = uid
        self._id = id
        self._coords = coords
        self._amount = amount

    @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 uid(self) -> int:
        return self._uid

    @property
    def id(self) -> int:
        return self._id

    @property
    def coords(self) -> Coords:
        return self._coords

    @property
    def amount(self) -> int:
        return self._amount

    @staticmethod
    def serialize(writer: EoWriter, data: "ItemMapInfo") -> None:
        """
        Serializes an instance of `ItemMapInfo` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ItemMapInfo): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._uid is None:
                raise SerializationError("uid must be provided.")
            writer.add_short(data._uid)
            if data._id is None:
                raise SerializationError("id must be provided.")
            writer.add_short(data._id)
            if data._coords is None:
                raise SerializationError("coords must be provided.")
            Coords.serialize(writer, data._coords)
            if data._amount is None:
                raise SerializationError("amount must be provided.")
            writer.add_three(data._amount)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ItemMapInfo":
        """
        Deserializes an instance of `ItemMapInfo` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ItemMapInfo: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            uid = reader.get_short()
            id = reader.get_short()
            coords = Coords.deserialize(reader)
            amount = reader.get_three()
            result = ItemMapInfo(uid=uid, id=id, coords=coords, amount=amount)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ItemMapInfo(byte_size={repr(self._byte_size)}, uid={repr(self._uid)}, id={repr(self._id)}, coords={repr(self._coords)}, amount={repr(self._amount)})"

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.

uid: int property

id: int property

coords: Coords property

amount: int property

__init__(*, uid, id, coords, amount)

Create a new instance of ItemMapInfo.

Parameters:

Name Type Description Default
uid int

(Value range is 0-64008.)

required
id int

(Value range is 0-64008.)

required
coords Coords
required
amount int

(Value range is 0-16194276.)

required
Source code in src/eolib/protocol/_generated/net/server/item_map_info.py
21
22
23
24
25
26
27
28
29
30
31
32
33
34
def __init__(self, *, uid: int, id: int, coords: Coords, amount: int):
    """
    Create a new instance of ItemMapInfo.

    Args:
        uid (int): (Value range is 0-64008.)
        id (int): (Value range is 0-64008.)
        coords (Coords): 
        amount (int): (Value range is 0-16194276.)
    """
    self._uid = uid
    self._id = id
    self._coords = coords
    self._amount = amount

serialize(writer, data) staticmethod

Serializes an instance of ItemMapInfo to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ItemMapInfo

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/item_map_info.py
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
@staticmethod
def serialize(writer: EoWriter, data: "ItemMapInfo") -> None:
    """
    Serializes an instance of `ItemMapInfo` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ItemMapInfo): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._uid is None:
            raise SerializationError("uid must be provided.")
        writer.add_short(data._uid)
        if data._id is None:
            raise SerializationError("id must be provided.")
        writer.add_short(data._id)
        if data._coords is None:
            raise SerializationError("coords must be provided.")
        Coords.serialize(writer, data._coords)
        if data._amount is None:
            raise SerializationError("amount must be provided.")
        writer.add_three(data._amount)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ItemMapInfo 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
ItemMapInfo ItemMapInfo

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/item_map_info.py
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
@staticmethod
def deserialize(reader: EoReader) -> "ItemMapInfo":
    """
    Deserializes an instance of `ItemMapInfo` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ItemMapInfo: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        uid = reader.get_short()
        id = reader.get_short()
        coords = Coords.deserialize(reader)
        amount = reader.get_three()
        result = ItemMapInfo(uid=uid, id=id, coords=coords, amount=amount)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ItemKickServerPacket

Bases: Packet

Lose item (from quest)

Source code in src/eolib/protocol/_generated/net/server/item_kick_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class ItemKickServerPacket(Packet):
    """
    Lose item (from quest)
    """
    _byte_size: int = 0
    _item: Item
    _current_weight: int

    def __init__(self, *, item: Item, current_weight: int):
        """
        Create a new instance of ItemKickServerPacket.

        Args:
            item (Item): 
            current_weight (int): (Value range is 0-252.)
        """
        self._item = item
        self._current_weight = current_weight

    @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 item(self) -> Item:
        return self._item

    @property
    def current_weight(self) -> int:
        return self._current_weight

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Item

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Kick

    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.
        """
        ItemKickServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ItemKickServerPacket") -> None:
        """
        Serializes an instance of `ItemKickServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ItemKickServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._item is None:
                raise SerializationError("item must be provided.")
            Item.serialize(writer, data._item)
            if data._current_weight is None:
                raise SerializationError("current_weight must be provided.")
            writer.add_char(data._current_weight)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ItemKickServerPacket":
        """
        Deserializes an instance of `ItemKickServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ItemKickServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            item = Item.deserialize(reader)
            current_weight = reader.get_char()
            result = ItemKickServerPacket(item=item, current_weight=current_weight)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ItemKickServerPacket(byte_size={repr(self._byte_size)}, item={repr(self._item)}, current_weight={repr(self._current_weight)})"

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.

item: Item property

current_weight: int property

__init__(*, item, current_weight)

Create a new instance of ItemKickServerPacket.

Parameters:

Name Type Description Default
item Item
required
current_weight int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/item_kick_server_packet.py
22
23
24
25
26
27
28
29
30
31
def __init__(self, *, item: Item, current_weight: int):
    """
    Create a new instance of ItemKickServerPacket.

    Args:
        item (Item): 
        current_weight (int): (Value range is 0-252.)
    """
    self._item = item
    self._current_weight = current_weight

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/item_kick_server_packet.py
51
52
53
54
55
56
57
58
59
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Item

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/item_kick_server_packet.py
61
62
63
64
65
66
67
68
69
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Kick

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/item_kick_server_packet.py
71
72
73
74
75
76
77
78
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.
    """
    ItemKickServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ItemKickServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ItemKickServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/item_kick_server_packet.py
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@staticmethod
def serialize(writer: EoWriter, data: "ItemKickServerPacket") -> None:
    """
    Serializes an instance of `ItemKickServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ItemKickServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._item is None:
            raise SerializationError("item must be provided.")
        Item.serialize(writer, data._item)
        if data._current_weight is None:
            raise SerializationError("current_weight must be provided.")
        writer.add_char(data._current_weight)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ItemKickServerPacket 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
ItemKickServerPacket ItemKickServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/item_kick_server_packet.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@staticmethod
def deserialize(reader: EoReader) -> "ItemKickServerPacket":
    """
    Deserializes an instance of `ItemKickServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ItemKickServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        item = Item.deserialize(reader)
        current_weight = reader.get_char()
        result = ItemKickServerPacket(item=item, current_weight=current_weight)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ItemJunkServerPacket

Bases: Packet

Reply to junking items

Source code in src/eolib/protocol/_generated/net/server/item_junk_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
class ItemJunkServerPacket(Packet):
    """
    Reply to junking items
    """
    _byte_size: int = 0
    _junked_item: ThreeItem
    _remaining_amount: int
    _weight: Weight

    def __init__(self, *, junked_item: ThreeItem, remaining_amount: int, weight: Weight):
        """
        Create a new instance of ItemJunkServerPacket.

        Args:
            junked_item (ThreeItem): 
            remaining_amount (int): (Value range is 0-4097152080.)
            weight (Weight): 
        """
        self._junked_item = junked_item
        self._remaining_amount = remaining_amount
        self._weight = weight

    @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 junked_item(self) -> ThreeItem:
        return self._junked_item

    @property
    def remaining_amount(self) -> int:
        return self._remaining_amount

    @property
    def weight(self) -> Weight:
        return self._weight

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Item

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Junk

    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.
        """
        ItemJunkServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ItemJunkServerPacket") -> None:
        """
        Serializes an instance of `ItemJunkServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ItemJunkServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._junked_item is None:
                raise SerializationError("junked_item must be provided.")
            ThreeItem.serialize(writer, data._junked_item)
            if data._remaining_amount is None:
                raise SerializationError("remaining_amount must be provided.")
            writer.add_int(data._remaining_amount)
            if data._weight is None:
                raise SerializationError("weight must be provided.")
            Weight.serialize(writer, data._weight)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ItemJunkServerPacket":
        """
        Deserializes an instance of `ItemJunkServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ItemJunkServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            junked_item = ThreeItem.deserialize(reader)
            remaining_amount = reader.get_int()
            weight = Weight.deserialize(reader)
            result = ItemJunkServerPacket(junked_item=junked_item, remaining_amount=remaining_amount, weight=weight)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ItemJunkServerPacket(byte_size={repr(self._byte_size)}, junked_item={repr(self._junked_item)}, remaining_amount={repr(self._remaining_amount)}, weight={repr(self._weight)})"

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.

junked_item: ThreeItem property

remaining_amount: int property

weight: Weight property

__init__(*, junked_item, remaining_amount, weight)

Create a new instance of ItemJunkServerPacket.

Parameters:

Name Type Description Default
junked_item ThreeItem
required
remaining_amount int

(Value range is 0-4097152080.)

required
weight Weight
required
Source code in src/eolib/protocol/_generated/net/server/item_junk_server_packet.py
24
25
26
27
28
29
30
31
32
33
34
35
def __init__(self, *, junked_item: ThreeItem, remaining_amount: int, weight: Weight):
    """
    Create a new instance of ItemJunkServerPacket.

    Args:
        junked_item (ThreeItem): 
        remaining_amount (int): (Value range is 0-4097152080.)
        weight (Weight): 
    """
    self._junked_item = junked_item
    self._remaining_amount = remaining_amount
    self._weight = weight

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/item_junk_server_packet.py
59
60
61
62
63
64
65
66
67
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Item

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/item_junk_server_packet.py
69
70
71
72
73
74
75
76
77
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Junk

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/item_junk_server_packet.py
79
80
81
82
83
84
85
86
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.
    """
    ItemJunkServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ItemJunkServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ItemJunkServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/item_junk_server_packet.py
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@staticmethod
def serialize(writer: EoWriter, data: "ItemJunkServerPacket") -> None:
    """
    Serializes an instance of `ItemJunkServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ItemJunkServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._junked_item is None:
            raise SerializationError("junked_item must be provided.")
        ThreeItem.serialize(writer, data._junked_item)
        if data._remaining_amount is None:
            raise SerializationError("remaining_amount must be provided.")
        writer.add_int(data._remaining_amount)
        if data._weight is None:
            raise SerializationError("weight must be provided.")
        Weight.serialize(writer, data._weight)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ItemJunkServerPacket 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
ItemJunkServerPacket ItemJunkServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/item_junk_server_packet.py
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
@staticmethod
def deserialize(reader: EoReader) -> "ItemJunkServerPacket":
    """
    Deserializes an instance of `ItemJunkServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ItemJunkServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        junked_item = ThreeItem.deserialize(reader)
        remaining_amount = reader.get_int()
        weight = Weight.deserialize(reader)
        result = ItemJunkServerPacket(junked_item=junked_item, remaining_amount=remaining_amount, weight=weight)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ItemGetServerPacket

Bases: Packet

Reply to taking items from the ground

Source code in src/eolib/protocol/_generated/net/server/item_get_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
class ItemGetServerPacket(Packet):
    """
    Reply to taking items from the ground
    """
    _byte_size: int = 0
    _taken_item_index: int
    _taken_item: ThreeItem
    _weight: Weight

    def __init__(self, *, taken_item_index: int, taken_item: ThreeItem, weight: Weight):
        """
        Create a new instance of ItemGetServerPacket.

        Args:
            taken_item_index (int): (Value range is 0-64008.)
            taken_item (ThreeItem): 
            weight (Weight): 
        """
        self._taken_item_index = taken_item_index
        self._taken_item = taken_item
        self._weight = weight

    @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 taken_item_index(self) -> int:
        return self._taken_item_index

    @property
    def taken_item(self) -> ThreeItem:
        return self._taken_item

    @property
    def weight(self) -> Weight:
        return self._weight

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Item

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Get

    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.
        """
        ItemGetServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ItemGetServerPacket") -> None:
        """
        Serializes an instance of `ItemGetServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ItemGetServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._taken_item_index is None:
                raise SerializationError("taken_item_index must be provided.")
            writer.add_short(data._taken_item_index)
            if data._taken_item is None:
                raise SerializationError("taken_item must be provided.")
            ThreeItem.serialize(writer, data._taken_item)
            if data._weight is None:
                raise SerializationError("weight must be provided.")
            Weight.serialize(writer, data._weight)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ItemGetServerPacket":
        """
        Deserializes an instance of `ItemGetServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ItemGetServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            taken_item_index = reader.get_short()
            taken_item = ThreeItem.deserialize(reader)
            weight = Weight.deserialize(reader)
            result = ItemGetServerPacket(taken_item_index=taken_item_index, taken_item=taken_item, weight=weight)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ItemGetServerPacket(byte_size={repr(self._byte_size)}, taken_item_index={repr(self._taken_item_index)}, taken_item={repr(self._taken_item)}, weight={repr(self._weight)})"

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.

taken_item_index: int property

taken_item: ThreeItem property

weight: Weight property

__init__(*, taken_item_index, taken_item, weight)

Create a new instance of ItemGetServerPacket.

Parameters:

Name Type Description Default
taken_item_index int

(Value range is 0-64008.)

required
taken_item ThreeItem
required
weight Weight
required
Source code in src/eolib/protocol/_generated/net/server/item_get_server_packet.py
24
25
26
27
28
29
30
31
32
33
34
35
def __init__(self, *, taken_item_index: int, taken_item: ThreeItem, weight: Weight):
    """
    Create a new instance of ItemGetServerPacket.

    Args:
        taken_item_index (int): (Value range is 0-64008.)
        taken_item (ThreeItem): 
        weight (Weight): 
    """
    self._taken_item_index = taken_item_index
    self._taken_item = taken_item
    self._weight = weight

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/item_get_server_packet.py
59
60
61
62
63
64
65
66
67
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Item

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/item_get_server_packet.py
69
70
71
72
73
74
75
76
77
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Get

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/item_get_server_packet.py
79
80
81
82
83
84
85
86
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.
    """
    ItemGetServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ItemGetServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ItemGetServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/item_get_server_packet.py
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@staticmethod
def serialize(writer: EoWriter, data: "ItemGetServerPacket") -> None:
    """
    Serializes an instance of `ItemGetServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ItemGetServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._taken_item_index is None:
            raise SerializationError("taken_item_index must be provided.")
        writer.add_short(data._taken_item_index)
        if data._taken_item is None:
            raise SerializationError("taken_item must be provided.")
        ThreeItem.serialize(writer, data._taken_item)
        if data._weight is None:
            raise SerializationError("weight must be provided.")
        Weight.serialize(writer, data._weight)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ItemGetServerPacket 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
ItemGetServerPacket ItemGetServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/item_get_server_packet.py
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
@staticmethod
def deserialize(reader: EoReader) -> "ItemGetServerPacket":
    """
    Deserializes an instance of `ItemGetServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ItemGetServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        taken_item_index = reader.get_short()
        taken_item = ThreeItem.deserialize(reader)
        weight = Weight.deserialize(reader)
        result = ItemGetServerPacket(taken_item_index=taken_item_index, taken_item=taken_item, weight=weight)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ItemDropServerPacket

Bases: Packet

Reply to dropping items on the ground

Source code in src/eolib/protocol/_generated/net/server/item_drop_server_packet.py
 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
class ItemDropServerPacket(Packet):
    """
    Reply to dropping items on the ground
    """
    _byte_size: int = 0
    _dropped_item: ThreeItem
    _remaining_amount: int
    _item_index: int
    _coords: Coords
    _weight: Weight

    def __init__(self, *, dropped_item: ThreeItem, remaining_amount: int, item_index: int, coords: Coords, weight: Weight):
        """
        Create a new instance of ItemDropServerPacket.

        Args:
            dropped_item (ThreeItem): 
            remaining_amount (int): (Value range is 0-4097152080.)
            item_index (int): (Value range is 0-64008.)
            coords (Coords): 
            weight (Weight): 
        """
        self._dropped_item = dropped_item
        self._remaining_amount = remaining_amount
        self._item_index = item_index
        self._coords = coords
        self._weight = weight

    @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 dropped_item(self) -> ThreeItem:
        return self._dropped_item

    @property
    def remaining_amount(self) -> int:
        return self._remaining_amount

    @property
    def item_index(self) -> int:
        return self._item_index

    @property
    def coords(self) -> Coords:
        return self._coords

    @property
    def weight(self) -> Weight:
        return self._weight

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Item

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Drop

    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.
        """
        ItemDropServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ItemDropServerPacket") -> None:
        """
        Serializes an instance of `ItemDropServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ItemDropServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._dropped_item is None:
                raise SerializationError("dropped_item must be provided.")
            ThreeItem.serialize(writer, data._dropped_item)
            if data._remaining_amount is None:
                raise SerializationError("remaining_amount must be provided.")
            writer.add_int(data._remaining_amount)
            if data._item_index is None:
                raise SerializationError("item_index must be provided.")
            writer.add_short(data._item_index)
            if data._coords is None:
                raise SerializationError("coords must be provided.")
            Coords.serialize(writer, data._coords)
            if data._weight is None:
                raise SerializationError("weight must be provided.")
            Weight.serialize(writer, data._weight)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ItemDropServerPacket":
        """
        Deserializes an instance of `ItemDropServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ItemDropServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            dropped_item = ThreeItem.deserialize(reader)
            remaining_amount = reader.get_int()
            item_index = reader.get_short()
            coords = Coords.deserialize(reader)
            weight = Weight.deserialize(reader)
            result = ItemDropServerPacket(dropped_item=dropped_item, remaining_amount=remaining_amount, item_index=item_index, coords=coords, weight=weight)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ItemDropServerPacket(byte_size={repr(self._byte_size)}, dropped_item={repr(self._dropped_item)}, remaining_amount={repr(self._remaining_amount)}, item_index={repr(self._item_index)}, coords={repr(self._coords)}, weight={repr(self._weight)})"

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.

dropped_item: ThreeItem property

remaining_amount: int property

item_index: int property

coords: Coords property

weight: Weight property

__init__(*, dropped_item, remaining_amount, item_index, coords, weight)

Create a new instance of ItemDropServerPacket.

Parameters:

Name Type Description Default
dropped_item ThreeItem
required
remaining_amount int

(Value range is 0-4097152080.)

required
item_index int

(Value range is 0-64008.)

required
coords Coords
required
weight Weight
required
Source code in src/eolib/protocol/_generated/net/server/item_drop_server_packet.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
def __init__(self, *, dropped_item: ThreeItem, remaining_amount: int, item_index: int, coords: Coords, weight: Weight):
    """
    Create a new instance of ItemDropServerPacket.

    Args:
        dropped_item (ThreeItem): 
        remaining_amount (int): (Value range is 0-4097152080.)
        item_index (int): (Value range is 0-64008.)
        coords (Coords): 
        weight (Weight): 
    """
    self._dropped_item = dropped_item
    self._remaining_amount = remaining_amount
    self._item_index = item_index
    self._coords = coords
    self._weight = weight

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/item_drop_server_packet.py
74
75
76
77
78
79
80
81
82
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Item

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/item_drop_server_packet.py
84
85
86
87
88
89
90
91
92
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Drop

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/item_drop_server_packet.py
 94
 95
 96
 97
 98
 99
100
101
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.
    """
    ItemDropServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ItemDropServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ItemDropServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/item_drop_server_packet.py
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
@staticmethod
def serialize(writer: EoWriter, data: "ItemDropServerPacket") -> None:
    """
    Serializes an instance of `ItemDropServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ItemDropServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._dropped_item is None:
            raise SerializationError("dropped_item must be provided.")
        ThreeItem.serialize(writer, data._dropped_item)
        if data._remaining_amount is None:
            raise SerializationError("remaining_amount must be provided.")
        writer.add_int(data._remaining_amount)
        if data._item_index is None:
            raise SerializationError("item_index must be provided.")
        writer.add_short(data._item_index)
        if data._coords is None:
            raise SerializationError("coords must be provided.")
        Coords.serialize(writer, data._coords)
        if data._weight is None:
            raise SerializationError("weight must be provided.")
        Weight.serialize(writer, data._weight)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ItemDropServerPacket 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
ItemDropServerPacket ItemDropServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/item_drop_server_packet.py
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
@staticmethod
def deserialize(reader: EoReader) -> "ItemDropServerPacket":
    """
    Deserializes an instance of `ItemDropServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ItemDropServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        dropped_item = ThreeItem.deserialize(reader)
        remaining_amount = reader.get_int()
        item_index = reader.get_short()
        coords = Coords.deserialize(reader)
        weight = Weight.deserialize(reader)
        result = ItemDropServerPacket(dropped_item=dropped_item, remaining_amount=remaining_amount, item_index=item_index, coords=coords, weight=weight)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ItemAgreeServerPacket

Bases: Packet

Reply to using an item that you don't have

Source code in src/eolib/protocol/_generated/net/server/item_agree_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class ItemAgreeServerPacket(Packet):
    """
    Reply to using an item that you don't have
    """
    _byte_size: int = 0
    _item_id: int

    def __init__(self, *, item_id: int):
        """
        Create a new instance of ItemAgreeServerPacket.

        Args:
            item_id (int): (Value range is 0-64008.)
        """
        self._item_id = item_id

    @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 item_id(self) -> int:
        return self._item_id

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Item

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Agree

    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.
        """
        ItemAgreeServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ItemAgreeServerPacket") -> None:
        """
        Serializes an instance of `ItemAgreeServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ItemAgreeServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._item_id is None:
                raise SerializationError("item_id must be provided.")
            writer.add_short(data._item_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ItemAgreeServerPacket":
        """
        Deserializes an instance of `ItemAgreeServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ItemAgreeServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            item_id = reader.get_short()
            result = ItemAgreeServerPacket(item_id=item_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ItemAgreeServerPacket(byte_size={repr(self._byte_size)}, item_id={repr(self._item_id)})"

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.

item_id: int property

__init__(*, item_id)

Create a new instance of ItemAgreeServerPacket.

Parameters:

Name Type Description Default
item_id int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/item_agree_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, item_id: int):
    """
    Create a new instance of ItemAgreeServerPacket.

    Args:
        item_id (int): (Value range is 0-64008.)
    """
    self._item_id = item_id

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/item_agree_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Item

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/item_agree_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Agree

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/item_agree_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    ItemAgreeServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ItemAgreeServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ItemAgreeServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/item_agree_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "ItemAgreeServerPacket") -> None:
    """
    Serializes an instance of `ItemAgreeServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ItemAgreeServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._item_id is None:
            raise SerializationError("item_id must be provided.")
        writer.add_short(data._item_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ItemAgreeServerPacket 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
ItemAgreeServerPacket ItemAgreeServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/item_agree_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "ItemAgreeServerPacket":
    """
    Deserializes an instance of `ItemAgreeServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ItemAgreeServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        item_id = reader.get_short()
        result = ItemAgreeServerPacket(item_id=item_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ItemAddServerPacket

Bases: Packet

Item appeared on the ground

Source code in src/eolib/protocol/_generated/net/server/item_add_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
class ItemAddServerPacket(Packet):
    """
    Item appeared on the ground
    """
    _byte_size: int = 0
    _item_id: int
    _item_index: int
    _item_amount: int
    _coords: Coords

    def __init__(self, *, item_id: int, item_index: int, item_amount: int, coords: Coords):
        """
        Create a new instance of ItemAddServerPacket.

        Args:
            item_id (int): (Value range is 0-64008.)
            item_index (int): (Value range is 0-64008.)
            item_amount (int): (Value range is 0-16194276.)
            coords (Coords): 
        """
        self._item_id = item_id
        self._item_index = item_index
        self._item_amount = item_amount
        self._coords = coords

    @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 item_id(self) -> int:
        return self._item_id

    @property
    def item_index(self) -> int:
        return self._item_index

    @property
    def item_amount(self) -> int:
        return self._item_amount

    @property
    def coords(self) -> Coords:
        return self._coords

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Item

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Add

    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.
        """
        ItemAddServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ItemAddServerPacket") -> None:
        """
        Serializes an instance of `ItemAddServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ItemAddServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._item_id is None:
                raise SerializationError("item_id must be provided.")
            writer.add_short(data._item_id)
            if data._item_index is None:
                raise SerializationError("item_index must be provided.")
            writer.add_short(data._item_index)
            if data._item_amount is None:
                raise SerializationError("item_amount must be provided.")
            writer.add_three(data._item_amount)
            if data._coords is None:
                raise SerializationError("coords must be provided.")
            Coords.serialize(writer, data._coords)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ItemAddServerPacket":
        """
        Deserializes an instance of `ItemAddServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ItemAddServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            item_id = reader.get_short()
            item_index = reader.get_short()
            item_amount = reader.get_three()
            coords = Coords.deserialize(reader)
            result = ItemAddServerPacket(item_id=item_id, item_index=item_index, item_amount=item_amount, coords=coords)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ItemAddServerPacket(byte_size={repr(self._byte_size)}, item_id={repr(self._item_id)}, item_index={repr(self._item_index)}, item_amount={repr(self._item_amount)}, coords={repr(self._coords)})"

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.

item_id: int property

item_index: int property

item_amount: int property

coords: Coords property

__init__(*, item_id, item_index, item_amount, coords)

Create a new instance of ItemAddServerPacket.

Parameters:

Name Type Description Default
item_id int

(Value range is 0-64008.)

required
item_index int

(Value range is 0-64008.)

required
item_amount int

(Value range is 0-16194276.)

required
coords Coords
required
Source code in src/eolib/protocol/_generated/net/server/item_add_server_packet.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
def __init__(self, *, item_id: int, item_index: int, item_amount: int, coords: Coords):
    """
    Create a new instance of ItemAddServerPacket.

    Args:
        item_id (int): (Value range is 0-64008.)
        item_index (int): (Value range is 0-64008.)
        item_amount (int): (Value range is 0-16194276.)
        coords (Coords): 
    """
    self._item_id = item_id
    self._item_index = item_index
    self._item_amount = item_amount
    self._coords = coords

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/item_add_server_packet.py
65
66
67
68
69
70
71
72
73
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Item

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/item_add_server_packet.py
75
76
77
78
79
80
81
82
83
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Add

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/item_add_server_packet.py
85
86
87
88
89
90
91
92
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.
    """
    ItemAddServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ItemAddServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ItemAddServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/item_add_server_packet.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "ItemAddServerPacket") -> None:
    """
    Serializes an instance of `ItemAddServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ItemAddServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._item_id is None:
            raise SerializationError("item_id must be provided.")
        writer.add_short(data._item_id)
        if data._item_index is None:
            raise SerializationError("item_index must be provided.")
        writer.add_short(data._item_index)
        if data._item_amount is None:
            raise SerializationError("item_amount must be provided.")
        writer.add_three(data._item_amount)
        if data._coords is None:
            raise SerializationError("coords must be provided.")
        Coords.serialize(writer, data._coords)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ItemAddServerPacket 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
ItemAddServerPacket ItemAddServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/item_add_server_packet.py
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 deserialize(reader: EoReader) -> "ItemAddServerPacket":
    """
    Deserializes an instance of `ItemAddServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ItemAddServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        item_id = reader.get_short()
        item_index = reader.get_short()
        item_amount = reader.get_three()
        coords = Coords.deserialize(reader)
        result = ItemAddServerPacket(item_id=item_id, item_index=item_index, item_amount=item_amount, coords=coords)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ItemAcceptServerPacket

Bases: Packet

Nearby player leveled up from quest

Source code in src/eolib/protocol/_generated/net/server/item_accept_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class ItemAcceptServerPacket(Packet):
    """
    Nearby player leveled up from quest
    """
    _byte_size: int = 0
    _player_id: int

    def __init__(self, *, player_id: int):
        """
        Create a new instance of ItemAcceptServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
        """
        self._player_id = player_id

    @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 player_id(self) -> int:
        return self._player_id

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Item

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Accept

    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.
        """
        ItemAcceptServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ItemAcceptServerPacket") -> None:
        """
        Serializes an instance of `ItemAcceptServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ItemAcceptServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ItemAcceptServerPacket":
        """
        Deserializes an instance of `ItemAcceptServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ItemAcceptServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            result = ItemAcceptServerPacket(player_id=player_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ItemAcceptServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)})"

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.

player_id: int property

__init__(*, player_id)

Create a new instance of ItemAcceptServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/item_accept_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, player_id: int):
    """
    Create a new instance of ItemAcceptServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
    """
    self._player_id = player_id

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/item_accept_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Item

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/item_accept_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Accept

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/item_accept_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    ItemAcceptServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ItemAcceptServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ItemAcceptServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/item_accept_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "ItemAcceptServerPacket") -> None:
    """
    Serializes an instance of `ItemAcceptServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ItemAcceptServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ItemAcceptServerPacket 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
ItemAcceptServerPacket ItemAcceptServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/item_accept_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "ItemAcceptServerPacket":
    """
    Deserializes an instance of `ItemAcceptServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ItemAcceptServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        result = ItemAcceptServerPacket(player_id=player_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PubFile

A pub file (EIF, ENF, ECF, ESF)

Source code in src/eolib/protocol/_generated/net/server/pub_file.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
class PubFile:
    """
    A pub file (EIF, ENF, ECF, ESF)
    """
    _byte_size: int = 0
    _file_id: int
    _content: bytes

    def __init__(self, *, file_id: int, content: bytes):
        """
        Create a new instance of PubFile.

        Args:
            file_id (int): (Value range is 0-252.)
            content (bytes): 
        """
        self._file_id = file_id
        self._content = content

    @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 file_id(self) -> int:
        return self._file_id

    @property
    def content(self) -> bytes:
        return self._content

    @staticmethod
    def serialize(writer: EoWriter, data: "PubFile") -> None:
        """
        Serializes an instance of `PubFile` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PubFile): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._file_id is None:
                raise SerializationError("file_id must be provided.")
            writer.add_char(data._file_id)
            if data._content is None:
                raise SerializationError("content must be provided.")
            writer.add_bytes(data._content)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PubFile":
        """
        Deserializes an instance of `PubFile` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PubFile: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            file_id = reader.get_char()
            content = reader.get_bytes(reader.remaining)
            result = PubFile(file_id=file_id, content=content)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PubFile(byte_size={repr(self._byte_size)}, file_id={repr(self._file_id)}, content={repr(self._content)})"

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.

file_id: int property

content: bytes property

__init__(*, file_id, content)

Create a new instance of PubFile.

Parameters:

Name Type Description Default
file_id int

(Value range is 0-252.)

required
content bytes
required
Source code in src/eolib/protocol/_generated/net/server/pub_file.py
18
19
20
21
22
23
24
25
26
27
def __init__(self, *, file_id: int, content: bytes):
    """
    Create a new instance of PubFile.

    Args:
        file_id (int): (Value range is 0-252.)
        content (bytes): 
    """
    self._file_id = file_id
    self._content = content

serialize(writer, data) staticmethod

Serializes an instance of PubFile to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PubFile

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/pub_file.py
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@staticmethod
def serialize(writer: EoWriter, data: "PubFile") -> None:
    """
    Serializes an instance of `PubFile` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PubFile): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._file_id is None:
            raise SerializationError("file_id must be provided.")
        writer.add_char(data._file_id)
        if data._content is None:
            raise SerializationError("content must be provided.")
        writer.add_bytes(data._content)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PubFile 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
PubFile PubFile

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/pub_file.py
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def deserialize(reader: EoReader) -> "PubFile":
    """
    Deserializes an instance of `PubFile` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PubFile: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        file_id = reader.get_char()
        content = reader.get_bytes(reader.remaining)
        result = PubFile(file_id=file_id, content=content)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

MapFile

A map file (EMF)

Source code in src/eolib/protocol/_generated/net/server/map_file.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
class MapFile:
    """
    A map file (EMF)
    """
    _byte_size: int = 0
    _content: bytes

    def __init__(self, *, content: bytes):
        """
        Create a new instance of MapFile.

        Args:
            content (bytes): 
        """
        self._content = content

    @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 content(self) -> bytes:
        return self._content

    @staticmethod
    def serialize(writer: EoWriter, data: "MapFile") -> None:
        """
        Serializes an instance of `MapFile` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (MapFile): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._content is None:
                raise SerializationError("content must be provided.")
            writer.add_bytes(data._content)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "MapFile":
        """
        Deserializes an instance of `MapFile` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            MapFile: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            content = reader.get_bytes(reader.remaining)
            result = MapFile(content=content)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"MapFile(byte_size={repr(self._byte_size)}, content={repr(self._content)})"

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.

content: bytes property

__init__(*, content)

Create a new instance of MapFile.

Parameters:

Name Type Description Default
content bytes
required
Source code in src/eolib/protocol/_generated/net/server/map_file.py
17
18
19
20
21
22
23
24
def __init__(self, *, content: bytes):
    """
    Create a new instance of MapFile.

    Args:
        content (bytes): 
    """
    self._content = content

serialize(writer, data) staticmethod

Serializes an instance of MapFile to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data MapFile

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/map_file.py
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
@staticmethod
def serialize(writer: EoWriter, data: "MapFile") -> None:
    """
    Serializes an instance of `MapFile` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (MapFile): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._content is None:
            raise SerializationError("content must be provided.")
        writer.add_bytes(data._content)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of MapFile 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
MapFile MapFile

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/map_file.py
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
@staticmethod
def deserialize(reader: EoReader) -> "MapFile":
    """
    Deserializes an instance of `MapFile` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        MapFile: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        content = reader.get_bytes(reader.remaining)
        result = MapFile(content=content)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PlayersListFriends

Information about online players. Sent in reply to friends list requests.

Source code in src/eolib/protocol/_generated/net/server/players_list_friends.py
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
class PlayersListFriends:
    """
    Information about online players.
    Sent in reply to friends list requests.
    """
    _byte_size: int = 0
    _players_count: int
    _players: tuple[str, ...]

    def __init__(self, *, players: Iterable[str]):
        """
        Create a new instance of PlayersListFriends.

        Args:
            players (Iterable[str]): (Length must be 64008 or less.)
        """
        self._players = tuple(players)
        self._players_count = len(self._players)

    @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 players(self) -> tuple[str, ...]:
        return self._players

    @staticmethod
    def serialize(writer: EoWriter, data: "PlayersListFriends") -> None:
        """
        Serializes an instance of `PlayersListFriends` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PlayersListFriends): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._players_count is None:
                raise SerializationError("players_count must be provided.")
            writer.add_short(data._players_count)
            writer.add_byte(0xFF)
            if data._players is None:
                raise SerializationError("players must be provided.")
            if len(data._players) > 64008:
                raise SerializationError(f"Expected length of players to be 64008 or less, got {len(data._players)}.")
            for i in range(data._players_count):
                writer.add_string(data._players[i])
                writer.add_byte(0xFF)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PlayersListFriends":
        """
        Deserializes an instance of `PlayersListFriends` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PlayersListFriends: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            players_count = reader.get_short()
            reader.next_chunk()
            players = []
            for i in range(players_count):
                players.append(reader.get_string())
                reader.next_chunk()
            reader.chunked_reading_mode = False
            result = PlayersListFriends(players=players)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PlayersListFriends(byte_size={repr(self._byte_size)}, players={repr(self._players)})"

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.

players: tuple[str, ...] property

__init__(*, players)

Create a new instance of PlayersListFriends.

Parameters:

Name Type Description Default
players Iterable[str]

(Length must be 64008 or less.)

required
Source code in src/eolib/protocol/_generated/net/server/players_list_friends.py
21
22
23
24
25
26
27
28
29
def __init__(self, *, players: Iterable[str]):
    """
    Create a new instance of PlayersListFriends.

    Args:
        players (Iterable[str]): (Length must be 64008 or less.)
    """
    self._players = tuple(players)
    self._players_count = len(self._players)

serialize(writer, data) staticmethod

Serializes an instance of PlayersListFriends to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PlayersListFriends

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/players_list_friends.py
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
@staticmethod
def serialize(writer: EoWriter, data: "PlayersListFriends") -> None:
    """
    Serializes an instance of `PlayersListFriends` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PlayersListFriends): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._players_count is None:
            raise SerializationError("players_count must be provided.")
        writer.add_short(data._players_count)
        writer.add_byte(0xFF)
        if data._players is None:
            raise SerializationError("players must be provided.")
        if len(data._players) > 64008:
            raise SerializationError(f"Expected length of players to be 64008 or less, got {len(data._players)}.")
        for i in range(data._players_count):
            writer.add_string(data._players[i])
            writer.add_byte(0xFF)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PlayersListFriends 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
PlayersListFriends 'PlayersListFriends'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/players_list_friends.py
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
@staticmethod
def deserialize(reader: EoReader) -> "PlayersListFriends":
    """
    Deserializes an instance of `PlayersListFriends` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PlayersListFriends: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        players_count = reader.get_short()
        reader.next_chunk()
        players = []
        for i in range(players_count):
            players.append(reader.get_string())
            reader.next_chunk()
        reader.chunked_reading_mode = False
        result = PlayersListFriends(players=players)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PlayersList

Information about online players

Source code in src/eolib/protocol/_generated/net/server/players_list.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
class PlayersList:
    """
    Information about online players
    """
    _byte_size: int = 0
    _players_count: int
    _players: tuple[OnlinePlayer, ...]

    def __init__(self, *, players: Iterable[OnlinePlayer]):
        """
        Create a new instance of PlayersList.

        Args:
            players (Iterable[OnlinePlayer]): (Length must be 64008 or less.)
        """
        self._players = tuple(players)
        self._players_count = len(self._players)

    @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 players(self) -> tuple[OnlinePlayer, ...]:
        return self._players

    @staticmethod
    def serialize(writer: EoWriter, data: "PlayersList") -> None:
        """
        Serializes an instance of `PlayersList` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PlayersList): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._players_count is None:
                raise SerializationError("players_count must be provided.")
            writer.add_short(data._players_count)
            writer.add_byte(0xFF)
            if data._players is None:
                raise SerializationError("players must be provided.")
            if len(data._players) > 64008:
                raise SerializationError(f"Expected length of players to be 64008 or less, got {len(data._players)}.")
            for i in range(data._players_count):
                OnlinePlayer.serialize(writer, data._players[i])
                writer.add_byte(0xFF)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PlayersList":
        """
        Deserializes an instance of `PlayersList` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PlayersList: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            players_count = reader.get_short()
            reader.next_chunk()
            players = []
            for i in range(players_count):
                players.append(OnlinePlayer.deserialize(reader))
                reader.next_chunk()
            reader.chunked_reading_mode = False
            result = PlayersList(players=players)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PlayersList(byte_size={repr(self._byte_size)}, players={repr(self._players)})"

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.

players: tuple[OnlinePlayer, ...] property

__init__(*, players)

Create a new instance of PlayersList.

Parameters:

Name Type Description Default
players Iterable[OnlinePlayer]

(Length must be 64008 or less.)

required
Source code in src/eolib/protocol/_generated/net/server/players_list.py
21
22
23
24
25
26
27
28
29
def __init__(self, *, players: Iterable[OnlinePlayer]):
    """
    Create a new instance of PlayersList.

    Args:
        players (Iterable[OnlinePlayer]): (Length must be 64008 or less.)
    """
    self._players = tuple(players)
    self._players_count = len(self._players)

serialize(writer, data) staticmethod

Serializes an instance of PlayersList to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PlayersList

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/players_list.py
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
@staticmethod
def serialize(writer: EoWriter, data: "PlayersList") -> None:
    """
    Serializes an instance of `PlayersList` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PlayersList): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._players_count is None:
            raise SerializationError("players_count must be provided.")
        writer.add_short(data._players_count)
        writer.add_byte(0xFF)
        if data._players is None:
            raise SerializationError("players must be provided.")
        if len(data._players) > 64008:
            raise SerializationError(f"Expected length of players to be 64008 or less, got {len(data._players)}.")
        for i in range(data._players_count):
            OnlinePlayer.serialize(writer, data._players[i])
            writer.add_byte(0xFF)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PlayersList 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
PlayersList 'PlayersList'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/players_list.py
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
@staticmethod
def deserialize(reader: EoReader) -> "PlayersList":
    """
    Deserializes an instance of `PlayersList` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PlayersList: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        players_count = reader.get_short()
        reader.next_chunk()
        players = []
        for i in range(players_count):
            players.append(OnlinePlayer.deserialize(reader))
            reader.next_chunk()
        reader.chunked_reading_mode = False
        result = PlayersList(players=players)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

InitReply

Bases: IntEnum

Reply code sent with INIT_INIT packet

Source code in src/eolib/protocol/_generated/net/server/init_reply.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class InitReply(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Reply code sent with INIT_INIT packet
    """
    OutOfDate = 1
    Ok = 2
    Banned = 3
    """
    The official client won't display a message until the connection from the server is closed
    """
    WarpMap = 4
    FileEmf = 5
    FileEif = 6
    FileEnf = 7
    FileEsf = 8
    PlayersList = 9
    MapMutation = 10
    PlayersListFriends = 11
    FileEcf = 12

OutOfDate = 1 class-attribute instance-attribute

Ok = 2 class-attribute instance-attribute

Banned = 3 class-attribute instance-attribute

The official client won't display a message until the connection from the server is closed

WarpMap = 4 class-attribute instance-attribute

FileEmf = 5 class-attribute instance-attribute

FileEif = 6 class-attribute instance-attribute

FileEnf = 7 class-attribute instance-attribute

FileEsf = 8 class-attribute instance-attribute

PlayersList = 9 class-attribute instance-attribute

MapMutation = 10 class-attribute instance-attribute

PlayersListFriends = 11 class-attribute instance-attribute

FileEcf = 12 class-attribute instance-attribute

Version

Client version

Source code in src/eolib/protocol/_generated/net/version.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
class Version:
    """
    Client version
    """
    _byte_size: int = 0
    _major: int
    _minor: int
    _patch: int

    def __init__(self, *, major: int, minor: int, patch: int):
        """
        Create a new instance of Version.

        Args:
            major (int): (Value range is 0-252.)
            minor (int): (Value range is 0-252.)
            patch (int): (Value range is 0-252.)
        """
        self._major = major
        self._minor = minor
        self._patch = patch

    @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 major(self) -> int:
        return self._major

    @property
    def minor(self) -> int:
        return self._minor

    @property
    def patch(self) -> int:
        return self._patch

    @staticmethod
    def serialize(writer: EoWriter, data: "Version") -> None:
        """
        Serializes an instance of `Version` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (Version): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._major is None:
                raise SerializationError("major must be provided.")
            writer.add_char(data._major)
            if data._minor is None:
                raise SerializationError("minor must be provided.")
            writer.add_char(data._minor)
            if data._patch is None:
                raise SerializationError("patch must be provided.")
            writer.add_char(data._patch)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "Version":
        """
        Deserializes an instance of `Version` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            Version: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            major = reader.get_char()
            minor = reader.get_char()
            patch = reader.get_char()
            result = Version(major=major, minor=minor, patch=patch)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"Version(byte_size={repr(self._byte_size)}, major={repr(self._major)}, minor={repr(self._minor)}, patch={repr(self._patch)})"

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.

major: int property

minor: int property

patch: int property

__init__(*, major, minor, patch)

Create a new instance of Version.

Parameters:

Name Type Description Default
major int

(Value range is 0-252.)

required
minor int

(Value range is 0-252.)

required
patch int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/version.py
19
20
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, major: int, minor: int, patch: int):
    """
    Create a new instance of Version.

    Args:
        major (int): (Value range is 0-252.)
        minor (int): (Value range is 0-252.)
        patch (int): (Value range is 0-252.)
    """
    self._major = major
    self._minor = minor
    self._patch = patch

serialize(writer, data) staticmethod

Serializes an instance of Version to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data Version

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/version.py
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@staticmethod
def serialize(writer: EoWriter, data: "Version") -> None:
    """
    Serializes an instance of `Version` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (Version): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._major is None:
            raise SerializationError("major must be provided.")
        writer.add_char(data._major)
        if data._minor is None:
            raise SerializationError("minor must be provided.")
        writer.add_char(data._minor)
        if data._patch is None:
            raise SerializationError("patch must be provided.")
        writer.add_char(data._patch)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of Version 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
Version Version

The data to serialize.

Source code in src/eolib/protocol/_generated/net/version.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@staticmethod
def deserialize(reader: EoReader) -> "Version":
    """
    Deserializes an instance of `Version` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        Version: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        major = reader.get_char()
        minor = reader.get_char()
        patch = reader.get_char()
        result = Version(major=major, minor=minor, patch=patch)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

InitInitServerPacket

Bases: Packet

Reply to connection initialization and requests for unencrypted data. This packet is unencrypted.

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
  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
 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
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
class InitInitServerPacket(Packet):
    """
    Reply to connection initialization and requests for unencrypted data.
    This packet is unencrypted.
    """
    _byte_size: int = 0
    _reply_code: InitReply
    _reply_code_data: 'InitInitServerPacket.ReplyCodeData'

    def __init__(self, *, reply_code: InitReply, reply_code_data: 'InitInitServerPacket.ReplyCodeData' = None):
        """
        Create a new instance of InitInitServerPacket.

        Args:
            reply_code (InitReply): 
            reply_code_data (InitInitServerPacket.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) -> InitReply:
        return self._reply_code

    @property
    def reply_code_data(self) -> 'InitInitServerPacket.ReplyCodeData':
        """
        InitInitServerPacket.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.Init

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Init

    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.
        """
        InitInitServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "InitInitServerPacket") -> None:
        """
        Serializes an instance of `InitInitServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (InitInitServerPacket): 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_byte(int(data._reply_code))
            if data._reply_code == InitReply.OutOfDate:
                if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataOutOfDate):
                    raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataOutOfDate for reply_code " + InitReply(data._reply_code).name + ".")
                InitInitServerPacket.ReplyCodeDataOutOfDate.serialize(writer, data._reply_code_data)
            elif data._reply_code == InitReply.Ok:
                if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataOk):
                    raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataOk for reply_code " + InitReply(data._reply_code).name + ".")
                InitInitServerPacket.ReplyCodeDataOk.serialize(writer, data._reply_code_data)
            elif data._reply_code == InitReply.Banned:
                if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataBanned):
                    raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataBanned for reply_code " + InitReply(data._reply_code).name + ".")
                InitInitServerPacket.ReplyCodeDataBanned.serialize(writer, data._reply_code_data)
            elif data._reply_code == InitReply.WarpMap:
                if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataWarpMap):
                    raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataWarpMap for reply_code " + InitReply(data._reply_code).name + ".")
                InitInitServerPacket.ReplyCodeDataWarpMap.serialize(writer, data._reply_code_data)
            elif data._reply_code == InitReply.FileEmf:
                if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataFileEmf):
                    raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataFileEmf for reply_code " + InitReply(data._reply_code).name + ".")
                InitInitServerPacket.ReplyCodeDataFileEmf.serialize(writer, data._reply_code_data)
            elif data._reply_code == InitReply.FileEif:
                if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataFileEif):
                    raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataFileEif for reply_code " + InitReply(data._reply_code).name + ".")
                InitInitServerPacket.ReplyCodeDataFileEif.serialize(writer, data._reply_code_data)
            elif data._reply_code == InitReply.FileEnf:
                if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataFileEnf):
                    raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataFileEnf for reply_code " + InitReply(data._reply_code).name + ".")
                InitInitServerPacket.ReplyCodeDataFileEnf.serialize(writer, data._reply_code_data)
            elif data._reply_code == InitReply.FileEsf:
                if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataFileEsf):
                    raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataFileEsf for reply_code " + InitReply(data._reply_code).name + ".")
                InitInitServerPacket.ReplyCodeDataFileEsf.serialize(writer, data._reply_code_data)
            elif data._reply_code == InitReply.FileEcf:
                if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataFileEcf):
                    raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataFileEcf for reply_code " + InitReply(data._reply_code).name + ".")
                InitInitServerPacket.ReplyCodeDataFileEcf.serialize(writer, data._reply_code_data)
            elif data._reply_code == InitReply.MapMutation:
                if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataMapMutation):
                    raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataMapMutation for reply_code " + InitReply(data._reply_code).name + ".")
                InitInitServerPacket.ReplyCodeDataMapMutation.serialize(writer, data._reply_code_data)
            elif data._reply_code == InitReply.PlayersList:
                if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataPlayersList):
                    raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataPlayersList for reply_code " + InitReply(data._reply_code).name + ".")
                InitInitServerPacket.ReplyCodeDataPlayersList.serialize(writer, data._reply_code_data)
            elif data._reply_code == InitReply.PlayersListFriends:
                if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataPlayersListFriends):
                    raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataPlayersListFriends for reply_code " + InitReply(data._reply_code).name + ".")
                InitInitServerPacket.ReplyCodeDataPlayersListFriends.serialize(writer, data._reply_code_data)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "InitInitServerPacket":
        """
        Deserializes an instance of `InitInitServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            InitInitServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reply_code = InitReply(reader.get_byte())
            reply_code_data: InitInitServerPacket.ReplyCodeData = None
            if reply_code == InitReply.OutOfDate:
                reply_code_data = InitInitServerPacket.ReplyCodeDataOutOfDate.deserialize(reader)
            elif reply_code == InitReply.Ok:
                reply_code_data = InitInitServerPacket.ReplyCodeDataOk.deserialize(reader)
            elif reply_code == InitReply.Banned:
                reply_code_data = InitInitServerPacket.ReplyCodeDataBanned.deserialize(reader)
            elif reply_code == InitReply.WarpMap:
                reply_code_data = InitInitServerPacket.ReplyCodeDataWarpMap.deserialize(reader)
            elif reply_code == InitReply.FileEmf:
                reply_code_data = InitInitServerPacket.ReplyCodeDataFileEmf.deserialize(reader)
            elif reply_code == InitReply.FileEif:
                reply_code_data = InitInitServerPacket.ReplyCodeDataFileEif.deserialize(reader)
            elif reply_code == InitReply.FileEnf:
                reply_code_data = InitInitServerPacket.ReplyCodeDataFileEnf.deserialize(reader)
            elif reply_code == InitReply.FileEsf:
                reply_code_data = InitInitServerPacket.ReplyCodeDataFileEsf.deserialize(reader)
            elif reply_code == InitReply.FileEcf:
                reply_code_data = InitInitServerPacket.ReplyCodeDataFileEcf.deserialize(reader)
            elif reply_code == InitReply.MapMutation:
                reply_code_data = InitInitServerPacket.ReplyCodeDataMapMutation.deserialize(reader)
            elif reply_code == InitReply.PlayersList:
                reply_code_data = InitInitServerPacket.ReplyCodeDataPlayersList.deserialize(reader)
            elif reply_code == InitReply.PlayersListFriends:
                reply_code_data = InitInitServerPacket.ReplyCodeDataPlayersListFriends.deserialize(reader)
            result = InitInitServerPacket(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"InitInitServerPacket(byte_size={repr(self._byte_size)}, reply_code={repr(self._reply_code)}, reply_code_data={repr(self._reply_code_data)})"

    ReplyCodeData = Union['InitInitServerPacket.ReplyCodeDataOutOfDate', 'InitInitServerPacket.ReplyCodeDataOk', 'InitInitServerPacket.ReplyCodeDataBanned', 'InitInitServerPacket.ReplyCodeDataWarpMap', 'InitInitServerPacket.ReplyCodeDataFileEmf', 'InitInitServerPacket.ReplyCodeDataFileEif', 'InitInitServerPacket.ReplyCodeDataFileEnf', 'InitInitServerPacket.ReplyCodeDataFileEsf', 'InitInitServerPacket.ReplyCodeDataFileEcf', 'InitInitServerPacket.ReplyCodeDataMapMutation', 'InitInitServerPacket.ReplyCodeDataPlayersList', 'InitInitServerPacket.ReplyCodeDataPlayersListFriends', None]
    """
    Data associated with different values of the `reply_code` field.
    """

    class ReplyCodeDataOutOfDate:
        """
        Data associated with reply_code value InitReply.OutOfDate
        """
        _byte_size: int = 0
        _version: Version

        def __init__(self, *, version: Version):
            """
            Create a new instance of InitInitServerPacket.ReplyCodeDataOutOfDate.

            Args:
                version (Version): 
            """
            self._version = version

        @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 version(self) -> Version:
            return self._version

        @staticmethod
        def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataOutOfDate") -> None:
            """
            Serializes an instance of `InitInitServerPacket.ReplyCodeDataOutOfDate` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (InitInitServerPacket.ReplyCodeDataOutOfDate): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._version is None:
                    raise SerializationError("version must be provided.")
                Version.serialize(writer, data._version)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataOutOfDate":
            """
            Deserializes an instance of `InitInitServerPacket.ReplyCodeDataOutOfDate` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                InitInitServerPacket.ReplyCodeDataOutOfDate: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                version = Version.deserialize(reader)
                result = InitInitServerPacket.ReplyCodeDataOutOfDate(version=version)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"InitInitServerPacket.ReplyCodeDataOutOfDate(byte_size={repr(self._byte_size)}, version={repr(self._version)})"

    class ReplyCodeDataOk:
        """
        Data associated with reply_code value InitReply.Ok
        """
        _byte_size: int = 0
        _seq1: int
        _seq2: int
        _server_encryption_multiple: int
        _client_encryption_multiple: int
        _player_id: int
        _challenge_response: int

        def __init__(self, *, seq1: int, seq2: int, server_encryption_multiple: int, client_encryption_multiple: int, player_id: int, challenge_response: int):
            """
            Create a new instance of InitInitServerPacket.ReplyCodeDataOk.

            Args:
                seq1 (int): (Value range is 0-255.)
                seq2 (int): (Value range is 0-255.)
                server_encryption_multiple (int): (Value range is 0-255.)
                client_encryption_multiple (int): (Value range is 0-255.)
                player_id (int): (Value range is 0-64008.)
                challenge_response (int): (Value range is 0-16194276.)
            """
            self._seq1 = seq1
            self._seq2 = seq2
            self._server_encryption_multiple = server_encryption_multiple
            self._client_encryption_multiple = client_encryption_multiple
            self._player_id = player_id
            self._challenge_response = challenge_response

        @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 seq1(self) -> int:
            return self._seq1

        @property
        def seq2(self) -> int:
            return self._seq2

        @property
        def server_encryption_multiple(self) -> int:
            return self._server_encryption_multiple

        @property
        def client_encryption_multiple(self) -> int:
            return self._client_encryption_multiple

        @property
        def player_id(self) -> int:
            return self._player_id

        @property
        def challenge_response(self) -> int:
            return self._challenge_response

        @staticmethod
        def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataOk") -> None:
            """
            Serializes an instance of `InitInitServerPacket.ReplyCodeDataOk` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (InitInitServerPacket.ReplyCodeDataOk): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._seq1 is None:
                    raise SerializationError("seq1 must be provided.")
                writer.add_byte(data._seq1)
                if data._seq2 is None:
                    raise SerializationError("seq2 must be provided.")
                writer.add_byte(data._seq2)
                if data._server_encryption_multiple is None:
                    raise SerializationError("server_encryption_multiple must be provided.")
                writer.add_byte(data._server_encryption_multiple)
                if data._client_encryption_multiple is None:
                    raise SerializationError("client_encryption_multiple must be provided.")
                writer.add_byte(data._client_encryption_multiple)
                if data._player_id is None:
                    raise SerializationError("player_id must be provided.")
                writer.add_short(data._player_id)
                if data._challenge_response is None:
                    raise SerializationError("challenge_response must be provided.")
                writer.add_three(data._challenge_response)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataOk":
            """
            Deserializes an instance of `InitInitServerPacket.ReplyCodeDataOk` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                InitInitServerPacket.ReplyCodeDataOk: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                seq1 = reader.get_byte()
                seq2 = reader.get_byte()
                server_encryption_multiple = reader.get_byte()
                client_encryption_multiple = reader.get_byte()
                player_id = reader.get_short()
                challenge_response = reader.get_three()
                result = InitInitServerPacket.ReplyCodeDataOk(seq1=seq1, seq2=seq2, server_encryption_multiple=server_encryption_multiple, client_encryption_multiple=client_encryption_multiple, player_id=player_id, challenge_response=challenge_response)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"InitInitServerPacket.ReplyCodeDataOk(byte_size={repr(self._byte_size)}, seq1={repr(self._seq1)}, seq2={repr(self._seq2)}, server_encryption_multiple={repr(self._server_encryption_multiple)}, client_encryption_multiple={repr(self._client_encryption_multiple)}, player_id={repr(self._player_id)}, challenge_response={repr(self._challenge_response)})"

    class ReplyCodeDataBanned:
        """
        Data associated with reply_code value InitReply.Banned
        """
        _byte_size: int = 0
        _ban_type: InitBanType
        _ban_type_data: 'InitInitServerPacket.ReplyCodeDataBanned.BanTypeData'

        def __init__(self, *, ban_type: InitBanType, ban_type_data: 'InitInitServerPacket.ReplyCodeDataBanned.BanTypeData' = None):
            """
            Create a new instance of InitInitServerPacket.ReplyCodeDataBanned.

            Args:
                ban_type (InitBanType): 
                ban_type_data (InitInitServerPacket.ReplyCodeDataBanned.BanTypeData): Data associated with the `ban_type` field.
            """
            self._ban_type = ban_type
            self._ban_type_data = ban_type_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 ban_type(self) -> InitBanType:
            return self._ban_type

        @property
        def ban_type_data(self) -> 'InitInitServerPacket.ReplyCodeDataBanned.BanTypeData':
            """
            InitInitServerPacket.ReplyCodeDataBanned.BanTypeData: Data associated with the `ban_type` field.
            """
            return self._ban_type_data

        @staticmethod
        def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataBanned") -> None:
            """
            Serializes an instance of `InitInitServerPacket.ReplyCodeDataBanned` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (InitInitServerPacket.ReplyCodeDataBanned): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._ban_type is None:
                    raise SerializationError("ban_type must be provided.")
                writer.add_byte(int(data._ban_type))
                if data._ban_type == 0:
                    if not isinstance(data._ban_type_data, InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0):
                        raise SerializationError("Expected ban_type_data to be type InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0 for ban_type " + InitBanType(data._ban_type).name + ".")
                    InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0.serialize(writer, data._ban_type_data)
                elif data._ban_type == InitBanType.Temporary:
                    if not isinstance(data._ban_type_data, InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary):
                        raise SerializationError("Expected ban_type_data to be type InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary for ban_type " + InitBanType(data._ban_type).name + ".")
                    InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary.serialize(writer, data._ban_type_data)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataBanned":
            """
            Deserializes an instance of `InitInitServerPacket.ReplyCodeDataBanned` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                InitInitServerPacket.ReplyCodeDataBanned: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                ban_type = InitBanType(reader.get_byte())
                ban_type_data: InitInitServerPacket.ReplyCodeDataBanned.BanTypeData = None
                if ban_type == 0:
                    ban_type_data = InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0.deserialize(reader)
                elif ban_type == InitBanType.Temporary:
                    ban_type_data = InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary.deserialize(reader)
                result = InitInitServerPacket.ReplyCodeDataBanned(ban_type=ban_type, ban_type_data=ban_type_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"InitInitServerPacket.ReplyCodeDataBanned(byte_size={repr(self._byte_size)}, ban_type={repr(self._ban_type)}, ban_type_data={repr(self._ban_type_data)})"

        BanTypeData = Union['InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0', 'InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary', None]
        """
        Data associated with different values of the `ban_type` field.
        """

        class BanTypeData0:
            """
            Data associated with ban_type value 0

            The official client treats any value below 2 as a temporary ban.
            The official server sends 1, but some game server implementations
            erroneously send 0.
            """
            _byte_size: int = 0
            _minutes_remaining: int

            def __init__(self, *, minutes_remaining: int):
                """
                Create a new instance of InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0.

                Args:
                    minutes_remaining (int): (Value range is 0-255.)
                """
                self._minutes_remaining = minutes_remaining

            @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 minutes_remaining(self) -> int:
                return self._minutes_remaining

            @staticmethod
            def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0") -> None:
                """
                Serializes an instance of `InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0` to the provided `EoWriter`.

                Args:
                    writer (EoWriter): The writer that the data will be serialized to.
                    data (InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0): The data to serialize.
                """
                old_string_sanitization_mode: bool = writer.string_sanitization_mode
                try:
                    if data._minutes_remaining is None:
                        raise SerializationError("minutes_remaining must be provided.")
                    writer.add_byte(data._minutes_remaining)
                finally:
                    writer.string_sanitization_mode = old_string_sanitization_mode

            @staticmethod
            def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0":
                """
                Deserializes an instance of `InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0` from the provided `EoReader`.

                Args:
                    reader (EoReader): The writer that the data will be serialized to.

                Returns:
                    InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0: The data to serialize.
                """
                old_chunked_reading_mode: bool = reader.chunked_reading_mode
                try:
                    reader_start_position: int = reader.position
                    minutes_remaining = reader.get_byte()
                    result = InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0(minutes_remaining=minutes_remaining)
                    result._byte_size = reader.position - reader_start_position
                    return result
                finally:
                    reader.chunked_reading_mode = old_chunked_reading_mode

            def __repr__(self):
                return f"InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0(byte_size={repr(self._byte_size)}, minutes_remaining={repr(self._minutes_remaining)})"

        class BanTypeDataTemporary:
            """
            Data associated with ban_type value InitBanType.Temporary
            """
            _byte_size: int = 0
            _minutes_remaining: int

            def __init__(self, *, minutes_remaining: int):
                """
                Create a new instance of InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary.

                Args:
                    minutes_remaining (int): (Value range is 0-255.)
                """
                self._minutes_remaining = minutes_remaining

            @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 minutes_remaining(self) -> int:
                return self._minutes_remaining

            @staticmethod
            def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary") -> None:
                """
                Serializes an instance of `InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary` to the provided `EoWriter`.

                Args:
                    writer (EoWriter): The writer that the data will be serialized to.
                    data (InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary): The data to serialize.
                """
                old_string_sanitization_mode: bool = writer.string_sanitization_mode
                try:
                    if data._minutes_remaining is None:
                        raise SerializationError("minutes_remaining must be provided.")
                    writer.add_byte(data._minutes_remaining)
                finally:
                    writer.string_sanitization_mode = old_string_sanitization_mode

            @staticmethod
            def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary":
                """
                Deserializes an instance of `InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary` from the provided `EoReader`.

                Args:
                    reader (EoReader): The writer that the data will be serialized to.

                Returns:
                    InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary: The data to serialize.
                """
                old_chunked_reading_mode: bool = reader.chunked_reading_mode
                try:
                    reader_start_position: int = reader.position
                    minutes_remaining = reader.get_byte()
                    result = InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary(minutes_remaining=minutes_remaining)
                    result._byte_size = reader.position - reader_start_position
                    return result
                finally:
                    reader.chunked_reading_mode = old_chunked_reading_mode

            def __repr__(self):
                return f"InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary(byte_size={repr(self._byte_size)}, minutes_remaining={repr(self._minutes_remaining)})"

    class ReplyCodeDataWarpMap:
        """
        Data associated with reply_code value InitReply.WarpMap
        """
        _byte_size: int = 0
        _map_file: MapFile

        def __init__(self, *, map_file: MapFile):
            """
            Create a new instance of InitInitServerPacket.ReplyCodeDataWarpMap.

            Args:
                map_file (MapFile): 
            """
            self._map_file = map_file

        @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 map_file(self) -> MapFile:
            return self._map_file

        @staticmethod
        def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataWarpMap") -> None:
            """
            Serializes an instance of `InitInitServerPacket.ReplyCodeDataWarpMap` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (InitInitServerPacket.ReplyCodeDataWarpMap): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._map_file is None:
                    raise SerializationError("map_file must be provided.")
                MapFile.serialize(writer, data._map_file)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataWarpMap":
            """
            Deserializes an instance of `InitInitServerPacket.ReplyCodeDataWarpMap` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                InitInitServerPacket.ReplyCodeDataWarpMap: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                map_file = MapFile.deserialize(reader)
                result = InitInitServerPacket.ReplyCodeDataWarpMap(map_file=map_file)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"InitInitServerPacket.ReplyCodeDataWarpMap(byte_size={repr(self._byte_size)}, map_file={repr(self._map_file)})"

    class ReplyCodeDataFileEmf:
        """
        Data associated with reply_code value InitReply.FileEmf
        """
        _byte_size: int = 0
        _map_file: MapFile

        def __init__(self, *, map_file: MapFile):
            """
            Create a new instance of InitInitServerPacket.ReplyCodeDataFileEmf.

            Args:
                map_file (MapFile): 
            """
            self._map_file = map_file

        @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 map_file(self) -> MapFile:
            return self._map_file

        @staticmethod
        def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataFileEmf") -> None:
            """
            Serializes an instance of `InitInitServerPacket.ReplyCodeDataFileEmf` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (InitInitServerPacket.ReplyCodeDataFileEmf): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._map_file is None:
                    raise SerializationError("map_file must be provided.")
                MapFile.serialize(writer, data._map_file)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataFileEmf":
            """
            Deserializes an instance of `InitInitServerPacket.ReplyCodeDataFileEmf` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                InitInitServerPacket.ReplyCodeDataFileEmf: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                map_file = MapFile.deserialize(reader)
                result = InitInitServerPacket.ReplyCodeDataFileEmf(map_file=map_file)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"InitInitServerPacket.ReplyCodeDataFileEmf(byte_size={repr(self._byte_size)}, map_file={repr(self._map_file)})"

    class ReplyCodeDataFileEif:
        """
        Data associated with reply_code value InitReply.FileEif
        """
        _byte_size: int = 0
        _pub_file: PubFile

        def __init__(self, *, pub_file: PubFile):
            """
            Create a new instance of InitInitServerPacket.ReplyCodeDataFileEif.

            Args:
                pub_file (PubFile): 
            """
            self._pub_file = pub_file

        @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 pub_file(self) -> PubFile:
            return self._pub_file

        @staticmethod
        def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataFileEif") -> None:
            """
            Serializes an instance of `InitInitServerPacket.ReplyCodeDataFileEif` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (InitInitServerPacket.ReplyCodeDataFileEif): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._pub_file is None:
                    raise SerializationError("pub_file must be provided.")
                PubFile.serialize(writer, data._pub_file)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataFileEif":
            """
            Deserializes an instance of `InitInitServerPacket.ReplyCodeDataFileEif` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                InitInitServerPacket.ReplyCodeDataFileEif: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                pub_file = PubFile.deserialize(reader)
                result = InitInitServerPacket.ReplyCodeDataFileEif(pub_file=pub_file)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"InitInitServerPacket.ReplyCodeDataFileEif(byte_size={repr(self._byte_size)}, pub_file={repr(self._pub_file)})"

    class ReplyCodeDataFileEnf:
        """
        Data associated with reply_code value InitReply.FileEnf
        """
        _byte_size: int = 0
        _pub_file: PubFile

        def __init__(self, *, pub_file: PubFile):
            """
            Create a new instance of InitInitServerPacket.ReplyCodeDataFileEnf.

            Args:
                pub_file (PubFile): 
            """
            self._pub_file = pub_file

        @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 pub_file(self) -> PubFile:
            return self._pub_file

        @staticmethod
        def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataFileEnf") -> None:
            """
            Serializes an instance of `InitInitServerPacket.ReplyCodeDataFileEnf` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (InitInitServerPacket.ReplyCodeDataFileEnf): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._pub_file is None:
                    raise SerializationError("pub_file must be provided.")
                PubFile.serialize(writer, data._pub_file)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataFileEnf":
            """
            Deserializes an instance of `InitInitServerPacket.ReplyCodeDataFileEnf` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                InitInitServerPacket.ReplyCodeDataFileEnf: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                pub_file = PubFile.deserialize(reader)
                result = InitInitServerPacket.ReplyCodeDataFileEnf(pub_file=pub_file)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"InitInitServerPacket.ReplyCodeDataFileEnf(byte_size={repr(self._byte_size)}, pub_file={repr(self._pub_file)})"

    class ReplyCodeDataFileEsf:
        """
        Data associated with reply_code value InitReply.FileEsf
        """
        _byte_size: int = 0
        _pub_file: PubFile

        def __init__(self, *, pub_file: PubFile):
            """
            Create a new instance of InitInitServerPacket.ReplyCodeDataFileEsf.

            Args:
                pub_file (PubFile): 
            """
            self._pub_file = pub_file

        @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 pub_file(self) -> PubFile:
            return self._pub_file

        @staticmethod
        def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataFileEsf") -> None:
            """
            Serializes an instance of `InitInitServerPacket.ReplyCodeDataFileEsf` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (InitInitServerPacket.ReplyCodeDataFileEsf): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._pub_file is None:
                    raise SerializationError("pub_file must be provided.")
                PubFile.serialize(writer, data._pub_file)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataFileEsf":
            """
            Deserializes an instance of `InitInitServerPacket.ReplyCodeDataFileEsf` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                InitInitServerPacket.ReplyCodeDataFileEsf: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                pub_file = PubFile.deserialize(reader)
                result = InitInitServerPacket.ReplyCodeDataFileEsf(pub_file=pub_file)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"InitInitServerPacket.ReplyCodeDataFileEsf(byte_size={repr(self._byte_size)}, pub_file={repr(self._pub_file)})"

    class ReplyCodeDataFileEcf:
        """
        Data associated with reply_code value InitReply.FileEcf
        """
        _byte_size: int = 0
        _pub_file: PubFile

        def __init__(self, *, pub_file: PubFile):
            """
            Create a new instance of InitInitServerPacket.ReplyCodeDataFileEcf.

            Args:
                pub_file (PubFile): 
            """
            self._pub_file = pub_file

        @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 pub_file(self) -> PubFile:
            return self._pub_file

        @staticmethod
        def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataFileEcf") -> None:
            """
            Serializes an instance of `InitInitServerPacket.ReplyCodeDataFileEcf` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (InitInitServerPacket.ReplyCodeDataFileEcf): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._pub_file is None:
                    raise SerializationError("pub_file must be provided.")
                PubFile.serialize(writer, data._pub_file)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataFileEcf":
            """
            Deserializes an instance of `InitInitServerPacket.ReplyCodeDataFileEcf` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                InitInitServerPacket.ReplyCodeDataFileEcf: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                pub_file = PubFile.deserialize(reader)
                result = InitInitServerPacket.ReplyCodeDataFileEcf(pub_file=pub_file)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"InitInitServerPacket.ReplyCodeDataFileEcf(byte_size={repr(self._byte_size)}, pub_file={repr(self._pub_file)})"

    class ReplyCodeDataMapMutation:
        """
        Data associated with reply_code value InitReply.MapMutation
        """
        _byte_size: int = 0
        _map_file: MapFile

        def __init__(self, *, map_file: MapFile):
            """
            Create a new instance of InitInitServerPacket.ReplyCodeDataMapMutation.

            Args:
                map_file (MapFile): 
            """
            self._map_file = map_file

        @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 map_file(self) -> MapFile:
            return self._map_file

        @staticmethod
        def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataMapMutation") -> None:
            """
            Serializes an instance of `InitInitServerPacket.ReplyCodeDataMapMutation` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (InitInitServerPacket.ReplyCodeDataMapMutation): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._map_file is None:
                    raise SerializationError("map_file must be provided.")
                MapFile.serialize(writer, data._map_file)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataMapMutation":
            """
            Deserializes an instance of `InitInitServerPacket.ReplyCodeDataMapMutation` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                InitInitServerPacket.ReplyCodeDataMapMutation: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                map_file = MapFile.deserialize(reader)
                result = InitInitServerPacket.ReplyCodeDataMapMutation(map_file=map_file)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"InitInitServerPacket.ReplyCodeDataMapMutation(byte_size={repr(self._byte_size)}, map_file={repr(self._map_file)})"

    class ReplyCodeDataPlayersList:
        """
        Data associated with reply_code value InitReply.PlayersList
        """
        _byte_size: int = 0
        _players_list: PlayersList

        def __init__(self, *, players_list: PlayersList):
            """
            Create a new instance of InitInitServerPacket.ReplyCodeDataPlayersList.

            Args:
                players_list (PlayersList): 
            """
            self._players_list = players_list

        @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 players_list(self) -> PlayersList:
            return self._players_list

        @staticmethod
        def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataPlayersList") -> None:
            """
            Serializes an instance of `InitInitServerPacket.ReplyCodeDataPlayersList` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (InitInitServerPacket.ReplyCodeDataPlayersList): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                writer.string_sanitization_mode = True
                if data._players_list is None:
                    raise SerializationError("players_list must be provided.")
                PlayersList.serialize(writer, data._players_list)
                writer.string_sanitization_mode = False
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataPlayersList":
            """
            Deserializes an instance of `InitInitServerPacket.ReplyCodeDataPlayersList` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                InitInitServerPacket.ReplyCodeDataPlayersList: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.chunked_reading_mode = True
                players_list = PlayersList.deserialize(reader)
                reader.chunked_reading_mode = False
                result = InitInitServerPacket.ReplyCodeDataPlayersList(players_list=players_list)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"InitInitServerPacket.ReplyCodeDataPlayersList(byte_size={repr(self._byte_size)}, players_list={repr(self._players_list)})"

    class ReplyCodeDataPlayersListFriends:
        """
        Data associated with reply_code value InitReply.PlayersListFriends
        """
        _byte_size: int = 0
        _players_list: PlayersListFriends

        def __init__(self, *, players_list: PlayersListFriends):
            """
            Create a new instance of InitInitServerPacket.ReplyCodeDataPlayersListFriends.

            Args:
                players_list (PlayersListFriends): 
            """
            self._players_list = players_list

        @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 players_list(self) -> PlayersListFriends:
            return self._players_list

        @staticmethod
        def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataPlayersListFriends") -> None:
            """
            Serializes an instance of `InitInitServerPacket.ReplyCodeDataPlayersListFriends` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (InitInitServerPacket.ReplyCodeDataPlayersListFriends): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                writer.string_sanitization_mode = True
                if data._players_list is None:
                    raise SerializationError("players_list must be provided.")
                PlayersListFriends.serialize(writer, data._players_list)
                writer.string_sanitization_mode = False
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataPlayersListFriends":
            """
            Deserializes an instance of `InitInitServerPacket.ReplyCodeDataPlayersListFriends` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                InitInitServerPacket.ReplyCodeDataPlayersListFriends: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.chunked_reading_mode = True
                players_list = PlayersListFriends.deserialize(reader)
                reader.chunked_reading_mode = False
                result = InitInitServerPacket.ReplyCodeDataPlayersListFriends(players_list=players_list)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"InitInitServerPacket.ReplyCodeDataPlayersListFriends(byte_size={repr(self._byte_size)}, players_list={repr(self._players_list)})"

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: InitReply property

reply_code_data: InitInitServerPacket.ReplyCodeData property

InitInitServerPacket.ReplyCodeData: Data associated with the reply_code field.

ReplyCodeData = Union['InitInitServerPacket.ReplyCodeDataOutOfDate', 'InitInitServerPacket.ReplyCodeDataOk', 'InitInitServerPacket.ReplyCodeDataBanned', 'InitInitServerPacket.ReplyCodeDataWarpMap', 'InitInitServerPacket.ReplyCodeDataFileEmf', 'InitInitServerPacket.ReplyCodeDataFileEif', 'InitInitServerPacket.ReplyCodeDataFileEnf', 'InitInitServerPacket.ReplyCodeDataFileEsf', 'InitInitServerPacket.ReplyCodeDataFileEcf', 'InitInitServerPacket.ReplyCodeDataMapMutation', 'InitInitServerPacket.ReplyCodeDataPlayersList', 'InitInitServerPacket.ReplyCodeDataPlayersListFriends', None] class-attribute instance-attribute

Data associated with different values of the reply_code field.

ReplyCodeDataOutOfDate

Data associated with reply_code value InitReply.OutOfDate

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
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
class ReplyCodeDataOutOfDate:
    """
    Data associated with reply_code value InitReply.OutOfDate
    """
    _byte_size: int = 0
    _version: Version

    def __init__(self, *, version: Version):
        """
        Create a new instance of InitInitServerPacket.ReplyCodeDataOutOfDate.

        Args:
            version (Version): 
        """
        self._version = version

    @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 version(self) -> Version:
        return self._version

    @staticmethod
    def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataOutOfDate") -> None:
        """
        Serializes an instance of `InitInitServerPacket.ReplyCodeDataOutOfDate` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (InitInitServerPacket.ReplyCodeDataOutOfDate): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._version is None:
                raise SerializationError("version must be provided.")
            Version.serialize(writer, data._version)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataOutOfDate":
        """
        Deserializes an instance of `InitInitServerPacket.ReplyCodeDataOutOfDate` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            InitInitServerPacket.ReplyCodeDataOutOfDate: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            version = Version.deserialize(reader)
            result = InitInitServerPacket.ReplyCodeDataOutOfDate(version=version)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"InitInitServerPacket.ReplyCodeDataOutOfDate(byte_size={repr(self._byte_size)}, version={repr(self._version)})"

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.

version: Version property

__init__(*, version)

Create a new instance of InitInitServerPacket.ReplyCodeDataOutOfDate.

Parameters:

Name Type Description Default
version Version
required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
217
218
219
220
221
222
223
224
def __init__(self, *, version: Version):
    """
    Create a new instance of InitInitServerPacket.ReplyCodeDataOutOfDate.

    Args:
        version (Version): 
    """
    self._version = version

serialize(writer, data) staticmethod

Serializes an instance of InitInitServerPacket.ReplyCodeDataOutOfDate to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataOutOfDate

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
@staticmethod
def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataOutOfDate") -> None:
    """
    Serializes an instance of `InitInitServerPacket.ReplyCodeDataOutOfDate` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (InitInitServerPacket.ReplyCodeDataOutOfDate): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._version is None:
            raise SerializationError("version must be provided.")
        Version.serialize(writer, data._version)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of InitInitServerPacket.ReplyCodeDataOutOfDate from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataOutOfDate

InitInitServerPacket.ReplyCodeDataOutOfDate: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
@staticmethod
def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataOutOfDate":
    """
    Deserializes an instance of `InitInitServerPacket.ReplyCodeDataOutOfDate` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        InitInitServerPacket.ReplyCodeDataOutOfDate: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        version = Version.deserialize(reader)
        result = InitInitServerPacket.ReplyCodeDataOutOfDate(version=version)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataOk

Data associated with reply_code value InitReply.Ok

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
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
class ReplyCodeDataOk:
    """
    Data associated with reply_code value InitReply.Ok
    """
    _byte_size: int = 0
    _seq1: int
    _seq2: int
    _server_encryption_multiple: int
    _client_encryption_multiple: int
    _player_id: int
    _challenge_response: int

    def __init__(self, *, seq1: int, seq2: int, server_encryption_multiple: int, client_encryption_multiple: int, player_id: int, challenge_response: int):
        """
        Create a new instance of InitInitServerPacket.ReplyCodeDataOk.

        Args:
            seq1 (int): (Value range is 0-255.)
            seq2 (int): (Value range is 0-255.)
            server_encryption_multiple (int): (Value range is 0-255.)
            client_encryption_multiple (int): (Value range is 0-255.)
            player_id (int): (Value range is 0-64008.)
            challenge_response (int): (Value range is 0-16194276.)
        """
        self._seq1 = seq1
        self._seq2 = seq2
        self._server_encryption_multiple = server_encryption_multiple
        self._client_encryption_multiple = client_encryption_multiple
        self._player_id = player_id
        self._challenge_response = challenge_response

    @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 seq1(self) -> int:
        return self._seq1

    @property
    def seq2(self) -> int:
        return self._seq2

    @property
    def server_encryption_multiple(self) -> int:
        return self._server_encryption_multiple

    @property
    def client_encryption_multiple(self) -> int:
        return self._client_encryption_multiple

    @property
    def player_id(self) -> int:
        return self._player_id

    @property
    def challenge_response(self) -> int:
        return self._challenge_response

    @staticmethod
    def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataOk") -> None:
        """
        Serializes an instance of `InitInitServerPacket.ReplyCodeDataOk` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (InitInitServerPacket.ReplyCodeDataOk): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._seq1 is None:
                raise SerializationError("seq1 must be provided.")
            writer.add_byte(data._seq1)
            if data._seq2 is None:
                raise SerializationError("seq2 must be provided.")
            writer.add_byte(data._seq2)
            if data._server_encryption_multiple is None:
                raise SerializationError("server_encryption_multiple must be provided.")
            writer.add_byte(data._server_encryption_multiple)
            if data._client_encryption_multiple is None:
                raise SerializationError("client_encryption_multiple must be provided.")
            writer.add_byte(data._client_encryption_multiple)
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._challenge_response is None:
                raise SerializationError("challenge_response must be provided.")
            writer.add_three(data._challenge_response)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataOk":
        """
        Deserializes an instance of `InitInitServerPacket.ReplyCodeDataOk` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            InitInitServerPacket.ReplyCodeDataOk: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            seq1 = reader.get_byte()
            seq2 = reader.get_byte()
            server_encryption_multiple = reader.get_byte()
            client_encryption_multiple = reader.get_byte()
            player_id = reader.get_short()
            challenge_response = reader.get_three()
            result = InitInitServerPacket.ReplyCodeDataOk(seq1=seq1, seq2=seq2, server_encryption_multiple=server_encryption_multiple, client_encryption_multiple=client_encryption_multiple, player_id=player_id, challenge_response=challenge_response)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"InitInitServerPacket.ReplyCodeDataOk(byte_size={repr(self._byte_size)}, seq1={repr(self._seq1)}, seq2={repr(self._seq2)}, server_encryption_multiple={repr(self._server_encryption_multiple)}, client_encryption_multiple={repr(self._client_encryption_multiple)}, player_id={repr(self._player_id)}, challenge_response={repr(self._challenge_response)})"

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.

seq1: int property

seq2: int property

server_encryption_multiple: int property

client_encryption_multiple: int property

player_id: int property

challenge_response: int property

__init__(*, seq1, seq2, server_encryption_multiple, client_encryption_multiple, player_id, challenge_response)

Create a new instance of InitInitServerPacket.ReplyCodeDataOk.

Parameters:

Name Type Description Default
seq1 int

(Value range is 0-255.)

required
seq2 int

(Value range is 0-255.)

required
server_encryption_multiple int

(Value range is 0-255.)

required
client_encryption_multiple int

(Value range is 0-255.)

required
player_id int

(Value range is 0-64008.)

required
challenge_response int

(Value range is 0-16194276.)

required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
def __init__(self, *, seq1: int, seq2: int, server_encryption_multiple: int, client_encryption_multiple: int, player_id: int, challenge_response: int):
    """
    Create a new instance of InitInitServerPacket.ReplyCodeDataOk.

    Args:
        seq1 (int): (Value range is 0-255.)
        seq2 (int): (Value range is 0-255.)
        server_encryption_multiple (int): (Value range is 0-255.)
        client_encryption_multiple (int): (Value range is 0-255.)
        player_id (int): (Value range is 0-64008.)
        challenge_response (int): (Value range is 0-16194276.)
    """
    self._seq1 = seq1
    self._seq2 = seq2
    self._server_encryption_multiple = server_encryption_multiple
    self._client_encryption_multiple = client_encryption_multiple
    self._player_id = player_id
    self._challenge_response = challenge_response

serialize(writer, data) staticmethod

Serializes an instance of InitInitServerPacket.ReplyCodeDataOk to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataOk

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
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
@staticmethod
def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataOk") -> None:
    """
    Serializes an instance of `InitInitServerPacket.ReplyCodeDataOk` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (InitInitServerPacket.ReplyCodeDataOk): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._seq1 is None:
            raise SerializationError("seq1 must be provided.")
        writer.add_byte(data._seq1)
        if data._seq2 is None:
            raise SerializationError("seq2 must be provided.")
        writer.add_byte(data._seq2)
        if data._server_encryption_multiple is None:
            raise SerializationError("server_encryption_multiple must be provided.")
        writer.add_byte(data._server_encryption_multiple)
        if data._client_encryption_multiple is None:
            raise SerializationError("client_encryption_multiple must be provided.")
        writer.add_byte(data._client_encryption_multiple)
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._challenge_response is None:
            raise SerializationError("challenge_response must be provided.")
        writer.add_three(data._challenge_response)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of InitInitServerPacket.ReplyCodeDataOk from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataOk

InitInitServerPacket.ReplyCodeDataOk: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataOk":
    """
    Deserializes an instance of `InitInitServerPacket.ReplyCodeDataOk` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        InitInitServerPacket.ReplyCodeDataOk: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        seq1 = reader.get_byte()
        seq2 = reader.get_byte()
        server_encryption_multiple = reader.get_byte()
        client_encryption_multiple = reader.get_byte()
        player_id = reader.get_short()
        challenge_response = reader.get_three()
        result = InitInitServerPacket.ReplyCodeDataOk(seq1=seq1, seq2=seq2, server_encryption_multiple=server_encryption_multiple, client_encryption_multiple=client_encryption_multiple, player_id=player_id, challenge_response=challenge_response)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataBanned

Data associated with reply_code value InitReply.Banned

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
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
class ReplyCodeDataBanned:
    """
    Data associated with reply_code value InitReply.Banned
    """
    _byte_size: int = 0
    _ban_type: InitBanType
    _ban_type_data: 'InitInitServerPacket.ReplyCodeDataBanned.BanTypeData'

    def __init__(self, *, ban_type: InitBanType, ban_type_data: 'InitInitServerPacket.ReplyCodeDataBanned.BanTypeData' = None):
        """
        Create a new instance of InitInitServerPacket.ReplyCodeDataBanned.

        Args:
            ban_type (InitBanType): 
            ban_type_data (InitInitServerPacket.ReplyCodeDataBanned.BanTypeData): Data associated with the `ban_type` field.
        """
        self._ban_type = ban_type
        self._ban_type_data = ban_type_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 ban_type(self) -> InitBanType:
        return self._ban_type

    @property
    def ban_type_data(self) -> 'InitInitServerPacket.ReplyCodeDataBanned.BanTypeData':
        """
        InitInitServerPacket.ReplyCodeDataBanned.BanTypeData: Data associated with the `ban_type` field.
        """
        return self._ban_type_data

    @staticmethod
    def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataBanned") -> None:
        """
        Serializes an instance of `InitInitServerPacket.ReplyCodeDataBanned` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (InitInitServerPacket.ReplyCodeDataBanned): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._ban_type is None:
                raise SerializationError("ban_type must be provided.")
            writer.add_byte(int(data._ban_type))
            if data._ban_type == 0:
                if not isinstance(data._ban_type_data, InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0):
                    raise SerializationError("Expected ban_type_data to be type InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0 for ban_type " + InitBanType(data._ban_type).name + ".")
                InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0.serialize(writer, data._ban_type_data)
            elif data._ban_type == InitBanType.Temporary:
                if not isinstance(data._ban_type_data, InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary):
                    raise SerializationError("Expected ban_type_data to be type InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary for ban_type " + InitBanType(data._ban_type).name + ".")
                InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary.serialize(writer, data._ban_type_data)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataBanned":
        """
        Deserializes an instance of `InitInitServerPacket.ReplyCodeDataBanned` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            InitInitServerPacket.ReplyCodeDataBanned: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            ban_type = InitBanType(reader.get_byte())
            ban_type_data: InitInitServerPacket.ReplyCodeDataBanned.BanTypeData = None
            if ban_type == 0:
                ban_type_data = InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0.deserialize(reader)
            elif ban_type == InitBanType.Temporary:
                ban_type_data = InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary.deserialize(reader)
            result = InitInitServerPacket.ReplyCodeDataBanned(ban_type=ban_type, ban_type_data=ban_type_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"InitInitServerPacket.ReplyCodeDataBanned(byte_size={repr(self._byte_size)}, ban_type={repr(self._ban_type)}, ban_type_data={repr(self._ban_type_data)})"

    BanTypeData = Union['InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0', 'InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary', None]
    """
    Data associated with different values of the `ban_type` field.
    """

    class BanTypeData0:
        """
        Data associated with ban_type value 0

        The official client treats any value below 2 as a temporary ban.
        The official server sends 1, but some game server implementations
        erroneously send 0.
        """
        _byte_size: int = 0
        _minutes_remaining: int

        def __init__(self, *, minutes_remaining: int):
            """
            Create a new instance of InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0.

            Args:
                minutes_remaining (int): (Value range is 0-255.)
            """
            self._minutes_remaining = minutes_remaining

        @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 minutes_remaining(self) -> int:
            return self._minutes_remaining

        @staticmethod
        def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0") -> None:
            """
            Serializes an instance of `InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._minutes_remaining is None:
                    raise SerializationError("minutes_remaining must be provided.")
                writer.add_byte(data._minutes_remaining)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0":
            """
            Deserializes an instance of `InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                minutes_remaining = reader.get_byte()
                result = InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0(minutes_remaining=minutes_remaining)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0(byte_size={repr(self._byte_size)}, minutes_remaining={repr(self._minutes_remaining)})"

    class BanTypeDataTemporary:
        """
        Data associated with ban_type value InitBanType.Temporary
        """
        _byte_size: int = 0
        _minutes_remaining: int

        def __init__(self, *, minutes_remaining: int):
            """
            Create a new instance of InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary.

            Args:
                minutes_remaining (int): (Value range is 0-255.)
            """
            self._minutes_remaining = minutes_remaining

        @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 minutes_remaining(self) -> int:
            return self._minutes_remaining

        @staticmethod
        def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary") -> None:
            """
            Serializes an instance of `InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._minutes_remaining is None:
                    raise SerializationError("minutes_remaining must be provided.")
                writer.add_byte(data._minutes_remaining)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary":
            """
            Deserializes an instance of `InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                minutes_remaining = reader.get_byte()
                result = InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary(minutes_remaining=minutes_remaining)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary(byte_size={repr(self._byte_size)}, minutes_remaining={repr(self._minutes_remaining)})"

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.

ban_type: InitBanType property

ban_type_data: InitInitServerPacket.ReplyCodeDataBanned.BanTypeData property

InitInitServerPacket.ReplyCodeDataBanned.BanTypeData: Data associated with the ban_type field.

BanTypeData = Union['InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0', 'InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary', None] class-attribute instance-attribute

Data associated with different values of the ban_type field.

BanTypeData0

Data associated with ban_type value 0

The official client treats any value below 2 as a temporary ban. The official server sends 1, but some game server implementations erroneously send 0.

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
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
class BanTypeData0:
    """
    Data associated with ban_type value 0

    The official client treats any value below 2 as a temporary ban.
    The official server sends 1, but some game server implementations
    erroneously send 0.
    """
    _byte_size: int = 0
    _minutes_remaining: int

    def __init__(self, *, minutes_remaining: int):
        """
        Create a new instance of InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0.

        Args:
            minutes_remaining (int): (Value range is 0-255.)
        """
        self._minutes_remaining = minutes_remaining

    @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 minutes_remaining(self) -> int:
        return self._minutes_remaining

    @staticmethod
    def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0") -> None:
        """
        Serializes an instance of `InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._minutes_remaining is None:
                raise SerializationError("minutes_remaining must be provided.")
            writer.add_byte(data._minutes_remaining)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0":
        """
        Deserializes an instance of `InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            minutes_remaining = reader.get_byte()
            result = InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0(minutes_remaining=minutes_remaining)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0(byte_size={repr(self._byte_size)}, minutes_remaining={repr(self._minutes_remaining)})"
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.

minutes_remaining: int property
__init__(*, minutes_remaining)

Create a new instance of InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0.

Parameters:

Name Type Description Default
minutes_remaining int

(Value range is 0-255.)

required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
517
518
519
520
521
522
523
524
def __init__(self, *, minutes_remaining: int):
    """
    Create a new instance of InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0.

    Args:
        minutes_remaining (int): (Value range is 0-255.)
    """
    self._minutes_remaining = minutes_remaining
serialize(writer, data) staticmethod

Serializes an instance of InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0 to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data BanTypeData0

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
@staticmethod
def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0") -> None:
    """
    Serializes an instance of `InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._minutes_remaining is None:
            raise SerializationError("minutes_remaining must be provided.")
        writer.add_byte(data._minutes_remaining)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode
deserialize(reader) staticmethod

Deserializes an instance of InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0 from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
BanTypeData0

InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
@staticmethod
def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0":
    """
    Deserializes an instance of `InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        minutes_remaining = reader.get_byte()
        result = InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0(minutes_remaining=minutes_remaining)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

BanTypeDataTemporary

Data associated with ban_type value InitBanType.Temporary

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
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
class BanTypeDataTemporary:
    """
    Data associated with ban_type value InitBanType.Temporary
    """
    _byte_size: int = 0
    _minutes_remaining: int

    def __init__(self, *, minutes_remaining: int):
        """
        Create a new instance of InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary.

        Args:
            minutes_remaining (int): (Value range is 0-255.)
        """
        self._minutes_remaining = minutes_remaining

    @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 minutes_remaining(self) -> int:
        return self._minutes_remaining

    @staticmethod
    def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary") -> None:
        """
        Serializes an instance of `InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._minutes_remaining is None:
                raise SerializationError("minutes_remaining must be provided.")
            writer.add_byte(data._minutes_remaining)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary":
        """
        Deserializes an instance of `InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            minutes_remaining = reader.get_byte()
            result = InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary(minutes_remaining=minutes_remaining)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary(byte_size={repr(self._byte_size)}, minutes_remaining={repr(self._minutes_remaining)})"
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.

minutes_remaining: int property
__init__(*, minutes_remaining)

Create a new instance of InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary.

Parameters:

Name Type Description Default
minutes_remaining int

(Value range is 0-255.)

required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
588
589
590
591
592
593
594
595
def __init__(self, *, minutes_remaining: int):
    """
    Create a new instance of InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary.

    Args:
        minutes_remaining (int): (Value range is 0-255.)
    """
    self._minutes_remaining = minutes_remaining
serialize(writer, data) staticmethod

Serializes an instance of InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data BanTypeDataTemporary

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
@staticmethod
def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary") -> None:
    """
    Serializes an instance of `InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._minutes_remaining is None:
            raise SerializationError("minutes_remaining must be provided.")
        writer.add_byte(data._minutes_remaining)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode
deserialize(reader) staticmethod

Deserializes an instance of InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
BanTypeDataTemporary

InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
@staticmethod
def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary":
    """
    Deserializes an instance of `InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        minutes_remaining = reader.get_byte()
        result = InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary(minutes_remaining=minutes_remaining)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

__init__(*, ban_type, ban_type_data=None)

Create a new instance of InitInitServerPacket.ReplyCodeDataBanned.

Parameters:

Name Type Description Default
ban_type InitBanType
required
ban_type_data BanTypeData

Data associated with the ban_type field.

None
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
415
416
417
418
419
420
421
422
423
424
def __init__(self, *, ban_type: InitBanType, ban_type_data: 'InitInitServerPacket.ReplyCodeDataBanned.BanTypeData' = None):
    """
    Create a new instance of InitInitServerPacket.ReplyCodeDataBanned.

    Args:
        ban_type (InitBanType): 
        ban_type_data (InitInitServerPacket.ReplyCodeDataBanned.BanTypeData): Data associated with the `ban_type` field.
    """
    self._ban_type = ban_type
    self._ban_type_data = ban_type_data

serialize(writer, data) staticmethod

Serializes an instance of InitInitServerPacket.ReplyCodeDataBanned to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataBanned

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
@staticmethod
def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataBanned") -> None:
    """
    Serializes an instance of `InitInitServerPacket.ReplyCodeDataBanned` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (InitInitServerPacket.ReplyCodeDataBanned): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._ban_type is None:
            raise SerializationError("ban_type must be provided.")
        writer.add_byte(int(data._ban_type))
        if data._ban_type == 0:
            if not isinstance(data._ban_type_data, InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0):
                raise SerializationError("Expected ban_type_data to be type InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0 for ban_type " + InitBanType(data._ban_type).name + ".")
            InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0.serialize(writer, data._ban_type_data)
        elif data._ban_type == InitBanType.Temporary:
            if not isinstance(data._ban_type_data, InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary):
                raise SerializationError("Expected ban_type_data to be type InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary for ban_type " + InitBanType(data._ban_type).name + ".")
            InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary.serialize(writer, data._ban_type_data)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of InitInitServerPacket.ReplyCodeDataBanned from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataBanned

InitInitServerPacket.ReplyCodeDataBanned: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataBanned":
    """
    Deserializes an instance of `InitInitServerPacket.ReplyCodeDataBanned` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        InitInitServerPacket.ReplyCodeDataBanned: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        ban_type = InitBanType(reader.get_byte())
        ban_type_data: InitInitServerPacket.ReplyCodeDataBanned.BanTypeData = None
        if ban_type == 0:
            ban_type_data = InitInitServerPacket.ReplyCodeDataBanned.BanTypeData0.deserialize(reader)
        elif ban_type == InitBanType.Temporary:
            ban_type_data = InitInitServerPacket.ReplyCodeDataBanned.BanTypeDataTemporary.deserialize(reader)
        result = InitInitServerPacket.ReplyCodeDataBanned(ban_type=ban_type, ban_type_data=ban_type_data)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataWarpMap

Data associated with reply_code value InitReply.WarpMap

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
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
class ReplyCodeDataWarpMap:
    """
    Data associated with reply_code value InitReply.WarpMap
    """
    _byte_size: int = 0
    _map_file: MapFile

    def __init__(self, *, map_file: MapFile):
        """
        Create a new instance of InitInitServerPacket.ReplyCodeDataWarpMap.

        Args:
            map_file (MapFile): 
        """
        self._map_file = map_file

    @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 map_file(self) -> MapFile:
        return self._map_file

    @staticmethod
    def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataWarpMap") -> None:
        """
        Serializes an instance of `InitInitServerPacket.ReplyCodeDataWarpMap` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (InitInitServerPacket.ReplyCodeDataWarpMap): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._map_file is None:
                raise SerializationError("map_file must be provided.")
            MapFile.serialize(writer, data._map_file)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataWarpMap":
        """
        Deserializes an instance of `InitInitServerPacket.ReplyCodeDataWarpMap` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            InitInitServerPacket.ReplyCodeDataWarpMap: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            map_file = MapFile.deserialize(reader)
            result = InitInitServerPacket.ReplyCodeDataWarpMap(map_file=map_file)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"InitInitServerPacket.ReplyCodeDataWarpMap(byte_size={repr(self._byte_size)}, map_file={repr(self._map_file)})"

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.

map_file: MapFile property

__init__(*, map_file)

Create a new instance of InitInitServerPacket.ReplyCodeDataWarpMap.

Parameters:

Name Type Description Default
map_file MapFile
required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
659
660
661
662
663
664
665
666
def __init__(self, *, map_file: MapFile):
    """
    Create a new instance of InitInitServerPacket.ReplyCodeDataWarpMap.

    Args:
        map_file (MapFile): 
    """
    self._map_file = map_file

serialize(writer, data) staticmethod

Serializes an instance of InitInitServerPacket.ReplyCodeDataWarpMap to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataWarpMap

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
@staticmethod
def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataWarpMap") -> None:
    """
    Serializes an instance of `InitInitServerPacket.ReplyCodeDataWarpMap` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (InitInitServerPacket.ReplyCodeDataWarpMap): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._map_file is None:
            raise SerializationError("map_file must be provided.")
        MapFile.serialize(writer, data._map_file)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of InitInitServerPacket.ReplyCodeDataWarpMap from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataWarpMap

InitInitServerPacket.ReplyCodeDataWarpMap: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
@staticmethod
def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataWarpMap":
    """
    Deserializes an instance of `InitInitServerPacket.ReplyCodeDataWarpMap` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        InitInitServerPacket.ReplyCodeDataWarpMap: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        map_file = MapFile.deserialize(reader)
        result = InitInitServerPacket.ReplyCodeDataWarpMap(map_file=map_file)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataFileEmf

Data associated with reply_code value InitReply.FileEmf

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
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
class ReplyCodeDataFileEmf:
    """
    Data associated with reply_code value InitReply.FileEmf
    """
    _byte_size: int = 0
    _map_file: MapFile

    def __init__(self, *, map_file: MapFile):
        """
        Create a new instance of InitInitServerPacket.ReplyCodeDataFileEmf.

        Args:
            map_file (MapFile): 
        """
        self._map_file = map_file

    @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 map_file(self) -> MapFile:
        return self._map_file

    @staticmethod
    def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataFileEmf") -> None:
        """
        Serializes an instance of `InitInitServerPacket.ReplyCodeDataFileEmf` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (InitInitServerPacket.ReplyCodeDataFileEmf): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._map_file is None:
                raise SerializationError("map_file must be provided.")
            MapFile.serialize(writer, data._map_file)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataFileEmf":
        """
        Deserializes an instance of `InitInitServerPacket.ReplyCodeDataFileEmf` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            InitInitServerPacket.ReplyCodeDataFileEmf: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            map_file = MapFile.deserialize(reader)
            result = InitInitServerPacket.ReplyCodeDataFileEmf(map_file=map_file)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"InitInitServerPacket.ReplyCodeDataFileEmf(byte_size={repr(self._byte_size)}, map_file={repr(self._map_file)})"

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.

map_file: MapFile property

__init__(*, map_file)

Create a new instance of InitInitServerPacket.ReplyCodeDataFileEmf.

Parameters:

Name Type Description Default
map_file MapFile
required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
730
731
732
733
734
735
736
737
def __init__(self, *, map_file: MapFile):
    """
    Create a new instance of InitInitServerPacket.ReplyCodeDataFileEmf.

    Args:
        map_file (MapFile): 
    """
    self._map_file = map_file

serialize(writer, data) staticmethod

Serializes an instance of InitInitServerPacket.ReplyCodeDataFileEmf to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataFileEmf

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
@staticmethod
def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataFileEmf") -> None:
    """
    Serializes an instance of `InitInitServerPacket.ReplyCodeDataFileEmf` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (InitInitServerPacket.ReplyCodeDataFileEmf): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._map_file is None:
            raise SerializationError("map_file must be provided.")
        MapFile.serialize(writer, data._map_file)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of InitInitServerPacket.ReplyCodeDataFileEmf from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataFileEmf

InitInitServerPacket.ReplyCodeDataFileEmf: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
@staticmethod
def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataFileEmf":
    """
    Deserializes an instance of `InitInitServerPacket.ReplyCodeDataFileEmf` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        InitInitServerPacket.ReplyCodeDataFileEmf: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        map_file = MapFile.deserialize(reader)
        result = InitInitServerPacket.ReplyCodeDataFileEmf(map_file=map_file)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataFileEif

Data associated with reply_code value InitReply.FileEif

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
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
class ReplyCodeDataFileEif:
    """
    Data associated with reply_code value InitReply.FileEif
    """
    _byte_size: int = 0
    _pub_file: PubFile

    def __init__(self, *, pub_file: PubFile):
        """
        Create a new instance of InitInitServerPacket.ReplyCodeDataFileEif.

        Args:
            pub_file (PubFile): 
        """
        self._pub_file = pub_file

    @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 pub_file(self) -> PubFile:
        return self._pub_file

    @staticmethod
    def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataFileEif") -> None:
        """
        Serializes an instance of `InitInitServerPacket.ReplyCodeDataFileEif` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (InitInitServerPacket.ReplyCodeDataFileEif): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._pub_file is None:
                raise SerializationError("pub_file must be provided.")
            PubFile.serialize(writer, data._pub_file)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataFileEif":
        """
        Deserializes an instance of `InitInitServerPacket.ReplyCodeDataFileEif` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            InitInitServerPacket.ReplyCodeDataFileEif: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            pub_file = PubFile.deserialize(reader)
            result = InitInitServerPacket.ReplyCodeDataFileEif(pub_file=pub_file)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"InitInitServerPacket.ReplyCodeDataFileEif(byte_size={repr(self._byte_size)}, pub_file={repr(self._pub_file)})"

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.

pub_file: PubFile property

__init__(*, pub_file)

Create a new instance of InitInitServerPacket.ReplyCodeDataFileEif.

Parameters:

Name Type Description Default
pub_file PubFile
required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
801
802
803
804
805
806
807
808
def __init__(self, *, pub_file: PubFile):
    """
    Create a new instance of InitInitServerPacket.ReplyCodeDataFileEif.

    Args:
        pub_file (PubFile): 
    """
    self._pub_file = pub_file

serialize(writer, data) staticmethod

Serializes an instance of InitInitServerPacket.ReplyCodeDataFileEif to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataFileEif

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
@staticmethod
def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataFileEif") -> None:
    """
    Serializes an instance of `InitInitServerPacket.ReplyCodeDataFileEif` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (InitInitServerPacket.ReplyCodeDataFileEif): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._pub_file is None:
            raise SerializationError("pub_file must be provided.")
        PubFile.serialize(writer, data._pub_file)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of InitInitServerPacket.ReplyCodeDataFileEif from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataFileEif

InitInitServerPacket.ReplyCodeDataFileEif: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
@staticmethod
def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataFileEif":
    """
    Deserializes an instance of `InitInitServerPacket.ReplyCodeDataFileEif` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        InitInitServerPacket.ReplyCodeDataFileEif: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        pub_file = PubFile.deserialize(reader)
        result = InitInitServerPacket.ReplyCodeDataFileEif(pub_file=pub_file)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataFileEnf

Data associated with reply_code value InitReply.FileEnf

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
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
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
class ReplyCodeDataFileEnf:
    """
    Data associated with reply_code value InitReply.FileEnf
    """
    _byte_size: int = 0
    _pub_file: PubFile

    def __init__(self, *, pub_file: PubFile):
        """
        Create a new instance of InitInitServerPacket.ReplyCodeDataFileEnf.

        Args:
            pub_file (PubFile): 
        """
        self._pub_file = pub_file

    @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 pub_file(self) -> PubFile:
        return self._pub_file

    @staticmethod
    def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataFileEnf") -> None:
        """
        Serializes an instance of `InitInitServerPacket.ReplyCodeDataFileEnf` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (InitInitServerPacket.ReplyCodeDataFileEnf): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._pub_file is None:
                raise SerializationError("pub_file must be provided.")
            PubFile.serialize(writer, data._pub_file)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataFileEnf":
        """
        Deserializes an instance of `InitInitServerPacket.ReplyCodeDataFileEnf` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            InitInitServerPacket.ReplyCodeDataFileEnf: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            pub_file = PubFile.deserialize(reader)
            result = InitInitServerPacket.ReplyCodeDataFileEnf(pub_file=pub_file)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"InitInitServerPacket.ReplyCodeDataFileEnf(byte_size={repr(self._byte_size)}, pub_file={repr(self._pub_file)})"

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.

pub_file: PubFile property

__init__(*, pub_file)

Create a new instance of InitInitServerPacket.ReplyCodeDataFileEnf.

Parameters:

Name Type Description Default
pub_file PubFile
required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
872
873
874
875
876
877
878
879
def __init__(self, *, pub_file: PubFile):
    """
    Create a new instance of InitInitServerPacket.ReplyCodeDataFileEnf.

    Args:
        pub_file (PubFile): 
    """
    self._pub_file = pub_file

serialize(writer, data) staticmethod

Serializes an instance of InitInitServerPacket.ReplyCodeDataFileEnf to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataFileEnf

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
@staticmethod
def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataFileEnf") -> None:
    """
    Serializes an instance of `InitInitServerPacket.ReplyCodeDataFileEnf` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (InitInitServerPacket.ReplyCodeDataFileEnf): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._pub_file is None:
            raise SerializationError("pub_file must be provided.")
        PubFile.serialize(writer, data._pub_file)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of InitInitServerPacket.ReplyCodeDataFileEnf from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataFileEnf

InitInitServerPacket.ReplyCodeDataFileEnf: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
@staticmethod
def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataFileEnf":
    """
    Deserializes an instance of `InitInitServerPacket.ReplyCodeDataFileEnf` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        InitInitServerPacket.ReplyCodeDataFileEnf: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        pub_file = PubFile.deserialize(reader)
        result = InitInitServerPacket.ReplyCodeDataFileEnf(pub_file=pub_file)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataFileEsf

Data associated with reply_code value InitReply.FileEsf

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
class ReplyCodeDataFileEsf:
    """
    Data associated with reply_code value InitReply.FileEsf
    """
    _byte_size: int = 0
    _pub_file: PubFile

    def __init__(self, *, pub_file: PubFile):
        """
        Create a new instance of InitInitServerPacket.ReplyCodeDataFileEsf.

        Args:
            pub_file (PubFile): 
        """
        self._pub_file = pub_file

    @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 pub_file(self) -> PubFile:
        return self._pub_file

    @staticmethod
    def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataFileEsf") -> None:
        """
        Serializes an instance of `InitInitServerPacket.ReplyCodeDataFileEsf` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (InitInitServerPacket.ReplyCodeDataFileEsf): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._pub_file is None:
                raise SerializationError("pub_file must be provided.")
            PubFile.serialize(writer, data._pub_file)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataFileEsf":
        """
        Deserializes an instance of `InitInitServerPacket.ReplyCodeDataFileEsf` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            InitInitServerPacket.ReplyCodeDataFileEsf: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            pub_file = PubFile.deserialize(reader)
            result = InitInitServerPacket.ReplyCodeDataFileEsf(pub_file=pub_file)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"InitInitServerPacket.ReplyCodeDataFileEsf(byte_size={repr(self._byte_size)}, pub_file={repr(self._pub_file)})"

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.

pub_file: PubFile property

__init__(*, pub_file)

Create a new instance of InitInitServerPacket.ReplyCodeDataFileEsf.

Parameters:

Name Type Description Default
pub_file PubFile
required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
943
944
945
946
947
948
949
950
def __init__(self, *, pub_file: PubFile):
    """
    Create a new instance of InitInitServerPacket.ReplyCodeDataFileEsf.

    Args:
        pub_file (PubFile): 
    """
    self._pub_file = pub_file

serialize(writer, data) staticmethod

Serializes an instance of InitInitServerPacket.ReplyCodeDataFileEsf to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataFileEsf

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
@staticmethod
def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataFileEsf") -> None:
    """
    Serializes an instance of `InitInitServerPacket.ReplyCodeDataFileEsf` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (InitInitServerPacket.ReplyCodeDataFileEsf): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._pub_file is None:
            raise SerializationError("pub_file must be provided.")
        PubFile.serialize(writer, data._pub_file)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of InitInitServerPacket.ReplyCodeDataFileEsf from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataFileEsf

InitInitServerPacket.ReplyCodeDataFileEsf: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
@staticmethod
def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataFileEsf":
    """
    Deserializes an instance of `InitInitServerPacket.ReplyCodeDataFileEsf` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        InitInitServerPacket.ReplyCodeDataFileEsf: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        pub_file = PubFile.deserialize(reader)
        result = InitInitServerPacket.ReplyCodeDataFileEsf(pub_file=pub_file)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataFileEcf

Data associated with reply_code value InitReply.FileEcf

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
class ReplyCodeDataFileEcf:
    """
    Data associated with reply_code value InitReply.FileEcf
    """
    _byte_size: int = 0
    _pub_file: PubFile

    def __init__(self, *, pub_file: PubFile):
        """
        Create a new instance of InitInitServerPacket.ReplyCodeDataFileEcf.

        Args:
            pub_file (PubFile): 
        """
        self._pub_file = pub_file

    @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 pub_file(self) -> PubFile:
        return self._pub_file

    @staticmethod
    def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataFileEcf") -> None:
        """
        Serializes an instance of `InitInitServerPacket.ReplyCodeDataFileEcf` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (InitInitServerPacket.ReplyCodeDataFileEcf): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._pub_file is None:
                raise SerializationError("pub_file must be provided.")
            PubFile.serialize(writer, data._pub_file)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataFileEcf":
        """
        Deserializes an instance of `InitInitServerPacket.ReplyCodeDataFileEcf` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            InitInitServerPacket.ReplyCodeDataFileEcf: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            pub_file = PubFile.deserialize(reader)
            result = InitInitServerPacket.ReplyCodeDataFileEcf(pub_file=pub_file)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"InitInitServerPacket.ReplyCodeDataFileEcf(byte_size={repr(self._byte_size)}, pub_file={repr(self._pub_file)})"

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.

pub_file: PubFile property

__init__(*, pub_file)

Create a new instance of InitInitServerPacket.ReplyCodeDataFileEcf.

Parameters:

Name Type Description Default
pub_file PubFile
required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
1014
1015
1016
1017
1018
1019
1020
1021
def __init__(self, *, pub_file: PubFile):
    """
    Create a new instance of InitInitServerPacket.ReplyCodeDataFileEcf.

    Args:
        pub_file (PubFile): 
    """
    self._pub_file = pub_file

serialize(writer, data) staticmethod

Serializes an instance of InitInitServerPacket.ReplyCodeDataFileEcf to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataFileEcf

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
@staticmethod
def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataFileEcf") -> None:
    """
    Serializes an instance of `InitInitServerPacket.ReplyCodeDataFileEcf` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (InitInitServerPacket.ReplyCodeDataFileEcf): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._pub_file is None:
            raise SerializationError("pub_file must be provided.")
        PubFile.serialize(writer, data._pub_file)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of InitInitServerPacket.ReplyCodeDataFileEcf from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataFileEcf

InitInitServerPacket.ReplyCodeDataFileEcf: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
@staticmethod
def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataFileEcf":
    """
    Deserializes an instance of `InitInitServerPacket.ReplyCodeDataFileEcf` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        InitInitServerPacket.ReplyCodeDataFileEcf: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        pub_file = PubFile.deserialize(reader)
        result = InitInitServerPacket.ReplyCodeDataFileEcf(pub_file=pub_file)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataMapMutation

Data associated with reply_code value InitReply.MapMutation

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
class ReplyCodeDataMapMutation:
    """
    Data associated with reply_code value InitReply.MapMutation
    """
    _byte_size: int = 0
    _map_file: MapFile

    def __init__(self, *, map_file: MapFile):
        """
        Create a new instance of InitInitServerPacket.ReplyCodeDataMapMutation.

        Args:
            map_file (MapFile): 
        """
        self._map_file = map_file

    @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 map_file(self) -> MapFile:
        return self._map_file

    @staticmethod
    def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataMapMutation") -> None:
        """
        Serializes an instance of `InitInitServerPacket.ReplyCodeDataMapMutation` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (InitInitServerPacket.ReplyCodeDataMapMutation): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._map_file is None:
                raise SerializationError("map_file must be provided.")
            MapFile.serialize(writer, data._map_file)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataMapMutation":
        """
        Deserializes an instance of `InitInitServerPacket.ReplyCodeDataMapMutation` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            InitInitServerPacket.ReplyCodeDataMapMutation: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            map_file = MapFile.deserialize(reader)
            result = InitInitServerPacket.ReplyCodeDataMapMutation(map_file=map_file)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"InitInitServerPacket.ReplyCodeDataMapMutation(byte_size={repr(self._byte_size)}, map_file={repr(self._map_file)})"

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.

map_file: MapFile property

__init__(*, map_file)

Create a new instance of InitInitServerPacket.ReplyCodeDataMapMutation.

Parameters:

Name Type Description Default
map_file MapFile
required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
1085
1086
1087
1088
1089
1090
1091
1092
def __init__(self, *, map_file: MapFile):
    """
    Create a new instance of InitInitServerPacket.ReplyCodeDataMapMutation.

    Args:
        map_file (MapFile): 
    """
    self._map_file = map_file

serialize(writer, data) staticmethod

Serializes an instance of InitInitServerPacket.ReplyCodeDataMapMutation to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataMapMutation

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
@staticmethod
def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataMapMutation") -> None:
    """
    Serializes an instance of `InitInitServerPacket.ReplyCodeDataMapMutation` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (InitInitServerPacket.ReplyCodeDataMapMutation): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._map_file is None:
            raise SerializationError("map_file must be provided.")
        MapFile.serialize(writer, data._map_file)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of InitInitServerPacket.ReplyCodeDataMapMutation from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataMapMutation

InitInitServerPacket.ReplyCodeDataMapMutation: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
@staticmethod
def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataMapMutation":
    """
    Deserializes an instance of `InitInitServerPacket.ReplyCodeDataMapMutation` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        InitInitServerPacket.ReplyCodeDataMapMutation: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        map_file = MapFile.deserialize(reader)
        result = InitInitServerPacket.ReplyCodeDataMapMutation(map_file=map_file)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataPlayersList

Data associated with reply_code value InitReply.PlayersList

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
class ReplyCodeDataPlayersList:
    """
    Data associated with reply_code value InitReply.PlayersList
    """
    _byte_size: int = 0
    _players_list: PlayersList

    def __init__(self, *, players_list: PlayersList):
        """
        Create a new instance of InitInitServerPacket.ReplyCodeDataPlayersList.

        Args:
            players_list (PlayersList): 
        """
        self._players_list = players_list

    @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 players_list(self) -> PlayersList:
        return self._players_list

    @staticmethod
    def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataPlayersList") -> None:
        """
        Serializes an instance of `InitInitServerPacket.ReplyCodeDataPlayersList` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (InitInitServerPacket.ReplyCodeDataPlayersList): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._players_list is None:
                raise SerializationError("players_list must be provided.")
            PlayersList.serialize(writer, data._players_list)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataPlayersList":
        """
        Deserializes an instance of `InitInitServerPacket.ReplyCodeDataPlayersList` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            InitInitServerPacket.ReplyCodeDataPlayersList: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            players_list = PlayersList.deserialize(reader)
            reader.chunked_reading_mode = False
            result = InitInitServerPacket.ReplyCodeDataPlayersList(players_list=players_list)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"InitInitServerPacket.ReplyCodeDataPlayersList(byte_size={repr(self._byte_size)}, players_list={repr(self._players_list)})"

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.

players_list: PlayersList property

__init__(*, players_list)

Create a new instance of InitInitServerPacket.ReplyCodeDataPlayersList.

Parameters:

Name Type Description Default
players_list PlayersList
required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
1156
1157
1158
1159
1160
1161
1162
1163
def __init__(self, *, players_list: PlayersList):
    """
    Create a new instance of InitInitServerPacket.ReplyCodeDataPlayersList.

    Args:
        players_list (PlayersList): 
    """
    self._players_list = players_list

serialize(writer, data) staticmethod

Serializes an instance of InitInitServerPacket.ReplyCodeDataPlayersList to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataPlayersList

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
@staticmethod
def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataPlayersList") -> None:
    """
    Serializes an instance of `InitInitServerPacket.ReplyCodeDataPlayersList` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (InitInitServerPacket.ReplyCodeDataPlayersList): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._players_list is None:
            raise SerializationError("players_list must be provided.")
        PlayersList.serialize(writer, data._players_list)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of InitInitServerPacket.ReplyCodeDataPlayersList from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataPlayersList

InitInitServerPacket.ReplyCodeDataPlayersList: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
@staticmethod
def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataPlayersList":
    """
    Deserializes an instance of `InitInitServerPacket.ReplyCodeDataPlayersList` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        InitInitServerPacket.ReplyCodeDataPlayersList: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        players_list = PlayersList.deserialize(reader)
        reader.chunked_reading_mode = False
        result = InitInitServerPacket.ReplyCodeDataPlayersList(players_list=players_list)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataPlayersListFriends

Data associated with reply_code value InitReply.PlayersListFriends

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
class ReplyCodeDataPlayersListFriends:
    """
    Data associated with reply_code value InitReply.PlayersListFriends
    """
    _byte_size: int = 0
    _players_list: PlayersListFriends

    def __init__(self, *, players_list: PlayersListFriends):
        """
        Create a new instance of InitInitServerPacket.ReplyCodeDataPlayersListFriends.

        Args:
            players_list (PlayersListFriends): 
        """
        self._players_list = players_list

    @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 players_list(self) -> PlayersListFriends:
        return self._players_list

    @staticmethod
    def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataPlayersListFriends") -> None:
        """
        Serializes an instance of `InitInitServerPacket.ReplyCodeDataPlayersListFriends` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (InitInitServerPacket.ReplyCodeDataPlayersListFriends): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._players_list is None:
                raise SerializationError("players_list must be provided.")
            PlayersListFriends.serialize(writer, data._players_list)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataPlayersListFriends":
        """
        Deserializes an instance of `InitInitServerPacket.ReplyCodeDataPlayersListFriends` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            InitInitServerPacket.ReplyCodeDataPlayersListFriends: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            players_list = PlayersListFriends.deserialize(reader)
            reader.chunked_reading_mode = False
            result = InitInitServerPacket.ReplyCodeDataPlayersListFriends(players_list=players_list)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"InitInitServerPacket.ReplyCodeDataPlayersListFriends(byte_size={repr(self._byte_size)}, players_list={repr(self._players_list)})"

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.

players_list: PlayersListFriends property

__init__(*, players_list)

Create a new instance of InitInitServerPacket.ReplyCodeDataPlayersListFriends.

Parameters:

Name Type Description Default
players_list PlayersListFriends
required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
1231
1232
1233
1234
1235
1236
1237
1238
def __init__(self, *, players_list: PlayersListFriends):
    """
    Create a new instance of InitInitServerPacket.ReplyCodeDataPlayersListFriends.

    Args:
        players_list (PlayersListFriends): 
    """
    self._players_list = players_list

serialize(writer, data) staticmethod

Serializes an instance of InitInitServerPacket.ReplyCodeDataPlayersListFriends to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataPlayersListFriends

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
@staticmethod
def serialize(writer: EoWriter, data: "InitInitServerPacket.ReplyCodeDataPlayersListFriends") -> None:
    """
    Serializes an instance of `InitInitServerPacket.ReplyCodeDataPlayersListFriends` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (InitInitServerPacket.ReplyCodeDataPlayersListFriends): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._players_list is None:
            raise SerializationError("players_list must be provided.")
        PlayersListFriends.serialize(writer, data._players_list)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of InitInitServerPacket.ReplyCodeDataPlayersListFriends from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataPlayersListFriends

InitInitServerPacket.ReplyCodeDataPlayersListFriends: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
@staticmethod
def deserialize(reader: EoReader) -> "InitInitServerPacket.ReplyCodeDataPlayersListFriends":
    """
    Deserializes an instance of `InitInitServerPacket.ReplyCodeDataPlayersListFriends` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        InitInitServerPacket.ReplyCodeDataPlayersListFriends: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        players_list = PlayersListFriends.deserialize(reader)
        reader.chunked_reading_mode = False
        result = InitInitServerPacket.ReplyCodeDataPlayersListFriends(players_list=players_list)
        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 InitInitServerPacket.

Parameters:

Name Type Description Default
reply_code InitReply
required
reply_code_data ReplyCodeData

Data associated with the reply_code field.

None
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
30
31
32
33
34
35
36
37
38
39
def __init__(self, *, reply_code: InitReply, reply_code_data: 'InitInitServerPacket.ReplyCodeData' = None):
    """
    Create a new instance of InitInitServerPacket.

    Args:
        reply_code (InitReply): 
        reply_code_data (InitInitServerPacket.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/init_init_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.Init

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/init_init_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.Init

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/init_init_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.
    """
    InitInitServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of InitInitServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data InitInitServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "InitInitServerPacket") -> None:
    """
    Serializes an instance of `InitInitServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (InitInitServerPacket): 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_byte(int(data._reply_code))
        if data._reply_code == InitReply.OutOfDate:
            if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataOutOfDate):
                raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataOutOfDate for reply_code " + InitReply(data._reply_code).name + ".")
            InitInitServerPacket.ReplyCodeDataOutOfDate.serialize(writer, data._reply_code_data)
        elif data._reply_code == InitReply.Ok:
            if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataOk):
                raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataOk for reply_code " + InitReply(data._reply_code).name + ".")
            InitInitServerPacket.ReplyCodeDataOk.serialize(writer, data._reply_code_data)
        elif data._reply_code == InitReply.Banned:
            if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataBanned):
                raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataBanned for reply_code " + InitReply(data._reply_code).name + ".")
            InitInitServerPacket.ReplyCodeDataBanned.serialize(writer, data._reply_code_data)
        elif data._reply_code == InitReply.WarpMap:
            if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataWarpMap):
                raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataWarpMap for reply_code " + InitReply(data._reply_code).name + ".")
            InitInitServerPacket.ReplyCodeDataWarpMap.serialize(writer, data._reply_code_data)
        elif data._reply_code == InitReply.FileEmf:
            if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataFileEmf):
                raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataFileEmf for reply_code " + InitReply(data._reply_code).name + ".")
            InitInitServerPacket.ReplyCodeDataFileEmf.serialize(writer, data._reply_code_data)
        elif data._reply_code == InitReply.FileEif:
            if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataFileEif):
                raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataFileEif for reply_code " + InitReply(data._reply_code).name + ".")
            InitInitServerPacket.ReplyCodeDataFileEif.serialize(writer, data._reply_code_data)
        elif data._reply_code == InitReply.FileEnf:
            if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataFileEnf):
                raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataFileEnf for reply_code " + InitReply(data._reply_code).name + ".")
            InitInitServerPacket.ReplyCodeDataFileEnf.serialize(writer, data._reply_code_data)
        elif data._reply_code == InitReply.FileEsf:
            if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataFileEsf):
                raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataFileEsf for reply_code " + InitReply(data._reply_code).name + ".")
            InitInitServerPacket.ReplyCodeDataFileEsf.serialize(writer, data._reply_code_data)
        elif data._reply_code == InitReply.FileEcf:
            if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataFileEcf):
                raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataFileEcf for reply_code " + InitReply(data._reply_code).name + ".")
            InitInitServerPacket.ReplyCodeDataFileEcf.serialize(writer, data._reply_code_data)
        elif data._reply_code == InitReply.MapMutation:
            if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataMapMutation):
                raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataMapMutation for reply_code " + InitReply(data._reply_code).name + ".")
            InitInitServerPacket.ReplyCodeDataMapMutation.serialize(writer, data._reply_code_data)
        elif data._reply_code == InitReply.PlayersList:
            if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataPlayersList):
                raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataPlayersList for reply_code " + InitReply(data._reply_code).name + ".")
            InitInitServerPacket.ReplyCodeDataPlayersList.serialize(writer, data._reply_code_data)
        elif data._reply_code == InitReply.PlayersListFriends:
            if not isinstance(data._reply_code_data, InitInitServerPacket.ReplyCodeDataPlayersListFriends):
                raise SerializationError("Expected reply_code_data to be type InitInitServerPacket.ReplyCodeDataPlayersListFriends for reply_code " + InitReply(data._reply_code).name + ".")
            InitInitServerPacket.ReplyCodeDataPlayersListFriends.serialize(writer, data._reply_code_data)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of InitInitServerPacket 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
InitInitServerPacket InitInitServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/init_init_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "InitInitServerPacket":
    """
    Deserializes an instance of `InitInitServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        InitInitServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reply_code = InitReply(reader.get_byte())
        reply_code_data: InitInitServerPacket.ReplyCodeData = None
        if reply_code == InitReply.OutOfDate:
            reply_code_data = InitInitServerPacket.ReplyCodeDataOutOfDate.deserialize(reader)
        elif reply_code == InitReply.Ok:
            reply_code_data = InitInitServerPacket.ReplyCodeDataOk.deserialize(reader)
        elif reply_code == InitReply.Banned:
            reply_code_data = InitInitServerPacket.ReplyCodeDataBanned.deserialize(reader)
        elif reply_code == InitReply.WarpMap:
            reply_code_data = InitInitServerPacket.ReplyCodeDataWarpMap.deserialize(reader)
        elif reply_code == InitReply.FileEmf:
            reply_code_data = InitInitServerPacket.ReplyCodeDataFileEmf.deserialize(reader)
        elif reply_code == InitReply.FileEif:
            reply_code_data = InitInitServerPacket.ReplyCodeDataFileEif.deserialize(reader)
        elif reply_code == InitReply.FileEnf:
            reply_code_data = InitInitServerPacket.ReplyCodeDataFileEnf.deserialize(reader)
        elif reply_code == InitReply.FileEsf:
            reply_code_data = InitInitServerPacket.ReplyCodeDataFileEsf.deserialize(reader)
        elif reply_code == InitReply.FileEcf:
            reply_code_data = InitInitServerPacket.ReplyCodeDataFileEcf.deserialize(reader)
        elif reply_code == InitReply.MapMutation:
            reply_code_data = InitInitServerPacket.ReplyCodeDataMapMutation.deserialize(reader)
        elif reply_code == InitReply.PlayersList:
            reply_code_data = InitInitServerPacket.ReplyCodeDataPlayersList.deserialize(reader)
        elif reply_code == InitReply.PlayersListFriends:
            reply_code_data = InitInitServerPacket.ReplyCodeDataPlayersListFriends.deserialize(reader)
        result = InitInitServerPacket(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

InitBanType

Bases: IntEnum

Ban type sent with INIT_INIT packet. The official client treats a value >= 2 as Permanent. Otherwise, it's Temporary.

Source code in src/eolib/protocol/_generated/net/server/init_ban_type.py
 9
10
11
12
13
14
15
class InitBanType(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Ban type sent with INIT_INIT packet.
    The official client treats a value >= 2 as Permanent. Otherwise, it's Temporary.
    """
    Temporary = 1
    Permanent = 2

Temporary = 1 class-attribute instance-attribute

Permanent = 2 class-attribute instance-attribute

GuildTellServerPacket

Bases: Packet

Get guild member list reply

Source code in src/eolib/protocol/_generated/net/server/guild_tell_server_packet.py
 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
class GuildTellServerPacket(Packet):
    """
    Get guild member list reply
    """
    _byte_size: int = 0
    _members_count: int
    _members: tuple[GuildMember, ...]

    def __init__(self, *, members: Iterable[GuildMember]):
        """
        Create a new instance of GuildTellServerPacket.

        Args:
            members (Iterable[GuildMember]): (Length must be 64008 or less.)
        """
        self._members = tuple(members)
        self._members_count = len(self._members)

    @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 members(self) -> tuple[GuildMember, ...]:
        return self._members

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Guild

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Tell

    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.
        """
        GuildTellServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "GuildTellServerPacket") -> None:
        """
        Serializes an instance of `GuildTellServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (GuildTellServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._members_count is None:
                raise SerializationError("members_count must be provided.")
            writer.add_short(data._members_count)
            writer.add_byte(0xFF)
            if data._members is None:
                raise SerializationError("members must be provided.")
            if len(data._members) > 64008:
                raise SerializationError(f"Expected length of members to be 64008 or less, got {len(data._members)}.")
            for i in range(data._members_count):
                GuildMember.serialize(writer, data._members[i])
                writer.add_byte(0xFF)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "GuildTellServerPacket":
        """
        Deserializes an instance of `GuildTellServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            GuildTellServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            members_count = reader.get_short()
            reader.next_chunk()
            members = []
            for i in range(members_count):
                members.append(GuildMember.deserialize(reader))
                reader.next_chunk()
            reader.chunked_reading_mode = False
            result = GuildTellServerPacket(members=members)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"GuildTellServerPacket(byte_size={repr(self._byte_size)}, members={repr(self._members)})"

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.

members: tuple[GuildMember, ...] property

__init__(*, members)

Create a new instance of GuildTellServerPacket.

Parameters:

Name Type Description Default
members Iterable[GuildMember]

(Length must be 64008 or less.)

required
Source code in src/eolib/protocol/_generated/net/server/guild_tell_server_packet.py
24
25
26
27
28
29
30
31
32
def __init__(self, *, members: Iterable[GuildMember]):
    """
    Create a new instance of GuildTellServerPacket.

    Args:
        members (Iterable[GuildMember]): (Length must be 64008 or less.)
    """
    self._members = tuple(members)
    self._members_count = len(self._members)

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/guild_tell_server_packet.py
48
49
50
51
52
53
54
55
56
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Guild

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/guild_tell_server_packet.py
58
59
60
61
62
63
64
65
66
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Tell

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/guild_tell_server_packet.py
68
69
70
71
72
73
74
75
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.
    """
    GuildTellServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of GuildTellServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data GuildTellServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/guild_tell_server_packet.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "GuildTellServerPacket") -> None:
    """
    Serializes an instance of `GuildTellServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (GuildTellServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._members_count is None:
            raise SerializationError("members_count must be provided.")
        writer.add_short(data._members_count)
        writer.add_byte(0xFF)
        if data._members is None:
            raise SerializationError("members must be provided.")
        if len(data._members) > 64008:
            raise SerializationError(f"Expected length of members to be 64008 or less, got {len(data._members)}.")
        for i in range(data._members_count):
            GuildMember.serialize(writer, data._members[i])
            writer.add_byte(0xFF)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of GuildTellServerPacket 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
GuildTellServerPacket 'GuildTellServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/guild_tell_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "GuildTellServerPacket":
    """
    Deserializes an instance of `GuildTellServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        GuildTellServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        members_count = reader.get_short()
        reader.next_chunk()
        members = []
        for i in range(members_count):
            members.append(GuildMember.deserialize(reader))
            reader.next_chunk()
        reader.chunked_reading_mode = False
        result = GuildTellServerPacket(members=members)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

GuildTakeServerPacket

Bases: Packet

Get guild description reply

Source code in src/eolib/protocol/_generated/net/server/guild_take_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class GuildTakeServerPacket(Packet):
    """
    Get guild description reply
    """
    _byte_size: int = 0
    _description: str

    def __init__(self, *, description: str):
        """
        Create a new instance of GuildTakeServerPacket.

        Args:
            description (str): 
        """
        self._description = description

    @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 description(self) -> str:
        return self._description

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Guild

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Take

    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.
        """
        GuildTakeServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "GuildTakeServerPacket") -> None:
        """
        Serializes an instance of `GuildTakeServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (GuildTakeServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._description is None:
                raise SerializationError("description must be provided.")
            writer.add_string(data._description)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "GuildTakeServerPacket":
        """
        Deserializes an instance of `GuildTakeServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            GuildTakeServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            description = reader.get_string()
            result = GuildTakeServerPacket(description=description)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"GuildTakeServerPacket(byte_size={repr(self._byte_size)}, description={repr(self._description)})"

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.

description: str property

__init__(*, description)

Create a new instance of GuildTakeServerPacket.

Parameters:

Name Type Description Default
description str
required
Source code in src/eolib/protocol/_generated/net/server/guild_take_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, description: str):
    """
    Create a new instance of GuildTakeServerPacket.

    Args:
        description (str): 
    """
    self._description = description

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/guild_take_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Guild

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/guild_take_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Take

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/guild_take_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    GuildTakeServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of GuildTakeServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data GuildTakeServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/guild_take_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "GuildTakeServerPacket") -> None:
    """
    Serializes an instance of `GuildTakeServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (GuildTakeServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._description is None:
            raise SerializationError("description must be provided.")
        writer.add_string(data._description)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of GuildTakeServerPacket 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
GuildTakeServerPacket GuildTakeServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/guild_take_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "GuildTakeServerPacket":
    """
    Deserializes an instance of `GuildTakeServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        GuildTakeServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        description = reader.get_string()
        result = GuildTakeServerPacket(description=description)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

GuildSellServerPacket

Bases: Packet

Get guild bank reply

Source code in src/eolib/protocol/_generated/net/server/guild_sell_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class GuildSellServerPacket(Packet):
    """
    Get guild bank reply
    """
    _byte_size: int = 0
    _gold_amount: int

    def __init__(self, *, gold_amount: int):
        """
        Create a new instance of GuildSellServerPacket.

        Args:
            gold_amount (int): (Value range is 0-4097152080.)
        """
        self._gold_amount = gold_amount

    @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 gold_amount(self) -> int:
        return self._gold_amount

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Guild

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Sell

    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.
        """
        GuildSellServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "GuildSellServerPacket") -> None:
        """
        Serializes an instance of `GuildSellServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (GuildSellServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._gold_amount is None:
                raise SerializationError("gold_amount must be provided.")
            writer.add_int(data._gold_amount)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "GuildSellServerPacket":
        """
        Deserializes an instance of `GuildSellServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            GuildSellServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            gold_amount = reader.get_int()
            result = GuildSellServerPacket(gold_amount=gold_amount)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"GuildSellServerPacket(byte_size={repr(self._byte_size)}, gold_amount={repr(self._gold_amount)})"

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.

gold_amount: int property

__init__(*, gold_amount)

Create a new instance of GuildSellServerPacket.

Parameters:

Name Type Description Default
gold_amount int

(Value range is 0-4097152080.)

required
Source code in src/eolib/protocol/_generated/net/server/guild_sell_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, gold_amount: int):
    """
    Create a new instance of GuildSellServerPacket.

    Args:
        gold_amount (int): (Value range is 0-4097152080.)
    """
    self._gold_amount = gold_amount

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/guild_sell_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Guild

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/guild_sell_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Sell

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/guild_sell_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    GuildSellServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of GuildSellServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data GuildSellServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/guild_sell_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "GuildSellServerPacket") -> None:
    """
    Serializes an instance of `GuildSellServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (GuildSellServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._gold_amount is None:
            raise SerializationError("gold_amount must be provided.")
        writer.add_int(data._gold_amount)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of GuildSellServerPacket 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
GuildSellServerPacket GuildSellServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/guild_sell_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "GuildSellServerPacket":
    """
    Deserializes an instance of `GuildSellServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        GuildSellServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        gold_amount = reader.get_int()
        result = GuildSellServerPacket(gold_amount=gold_amount)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

GuildRequestServerPacket

Bases: Packet

Guild create request

Source code in src/eolib/protocol/_generated/net/server/guild_request_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
class GuildRequestServerPacket(Packet):
    """
    Guild create request
    """
    _byte_size: int = 0
    _player_id: int
    _guild_identity: str

    def __init__(self, *, player_id: int, guild_identity: str):
        """
        Create a new instance of GuildRequestServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            guild_identity (str): 
        """
        self._player_id = player_id
        self._guild_identity = guild_identity

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def guild_identity(self) -> str:
        return self._guild_identity

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Guild

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Request

    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.
        """
        GuildRequestServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "GuildRequestServerPacket") -> None:
        """
        Serializes an instance of `GuildRequestServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (GuildRequestServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._guild_identity is None:
                raise SerializationError("guild_identity must be provided.")
            writer.add_string(data._guild_identity)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "GuildRequestServerPacket":
        """
        Deserializes an instance of `GuildRequestServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            GuildRequestServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            guild_identity = reader.get_string()
            result = GuildRequestServerPacket(player_id=player_id, guild_identity=guild_identity)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"GuildRequestServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, guild_identity={repr(self._guild_identity)})"

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.

player_id: int property

guild_identity: str property

__init__(*, player_id, guild_identity)

Create a new instance of GuildRequestServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
guild_identity str
required
Source code in src/eolib/protocol/_generated/net/server/guild_request_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, player_id: int, guild_identity: str):
    """
    Create a new instance of GuildRequestServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        guild_identity (str): 
    """
    self._player_id = player_id
    self._guild_identity = guild_identity

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/guild_request_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Guild

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/guild_request_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Request

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/guild_request_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    GuildRequestServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of GuildRequestServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data GuildRequestServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/guild_request_server_packet.py
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@staticmethod
def serialize(writer: EoWriter, data: "GuildRequestServerPacket") -> None:
    """
    Serializes an instance of `GuildRequestServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (GuildRequestServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._guild_identity is None:
            raise SerializationError("guild_identity must be provided.")
        writer.add_string(data._guild_identity)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of GuildRequestServerPacket 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
GuildRequestServerPacket GuildRequestServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/guild_request_server_packet.py
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@staticmethod
def deserialize(reader: EoReader) -> "GuildRequestServerPacket":
    """
    Deserializes an instance of `GuildRequestServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        GuildRequestServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        guild_identity = reader.get_string()
        result = GuildRequestServerPacket(player_id=player_id, guild_identity=guild_identity)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

GuildStaff

Information about a guild staff member (recruiter or leader)

Source code in src/eolib/protocol/_generated/net/server/guild_staff.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
class GuildStaff:
    """
    Information about a guild staff member (recruiter or leader)
    """
    _byte_size: int = 0
    _rank: int
    _name: str

    def __init__(self, *, rank: int, name: str):
        """
        Create a new instance of GuildStaff.

        Args:
            rank (int): (Value range is 0-252.)
            name (str): 
        """
        self._rank = rank
        self._name = name

    @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 rank(self) -> int:
        return self._rank

    @property
    def name(self) -> str:
        return self._name

    @staticmethod
    def serialize(writer: EoWriter, data: "GuildStaff") -> None:
        """
        Serializes an instance of `GuildStaff` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (GuildStaff): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._rank is None:
                raise SerializationError("rank must be provided.")
            writer.add_char(data._rank)
            writer.add_byte(0xFF)
            if data._name is None:
                raise SerializationError("name must be provided.")
            writer.add_string(data._name)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "GuildStaff":
        """
        Deserializes an instance of `GuildStaff` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            GuildStaff: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            rank = reader.get_char()
            reader.next_chunk()
            name = reader.get_string()
            reader.chunked_reading_mode = False
            result = GuildStaff(rank=rank, name=name)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"GuildStaff(byte_size={repr(self._byte_size)}, rank={repr(self._rank)}, name={repr(self._name)})"

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.

rank: int property

name: str property

__init__(*, rank, name)

Create a new instance of GuildStaff.

Parameters:

Name Type Description Default
rank int

(Value range is 0-252.)

required
name str
required
Source code in src/eolib/protocol/_generated/net/server/guild_staff.py
18
19
20
21
22
23
24
25
26
27
def __init__(self, *, rank: int, name: str):
    """
    Create a new instance of GuildStaff.

    Args:
        rank (int): (Value range is 0-252.)
        name (str): 
    """
    self._rank = rank
    self._name = name

serialize(writer, data) staticmethod

Serializes an instance of GuildStaff to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data GuildStaff

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/guild_staff.py
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
@staticmethod
def serialize(writer: EoWriter, data: "GuildStaff") -> None:
    """
    Serializes an instance of `GuildStaff` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (GuildStaff): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._rank is None:
            raise SerializationError("rank must be provided.")
        writer.add_char(data._rank)
        writer.add_byte(0xFF)
        if data._name is None:
            raise SerializationError("name must be provided.")
        writer.add_string(data._name)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of GuildStaff 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
GuildStaff GuildStaff

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/guild_staff.py
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
@staticmethod
def deserialize(reader: EoReader) -> "GuildStaff":
    """
    Deserializes an instance of `GuildStaff` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        GuildStaff: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        rank = reader.get_char()
        reader.next_chunk()
        name = reader.get_string()
        reader.chunked_reading_mode = False
        result = GuildStaff(rank=rank, name=name)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

GuildReportServerPacket

Bases: Packet

Get guild info reply

Source code in src/eolib/protocol/_generated/net/server/guild_report_server_packet.py
 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
class GuildReportServerPacket(Packet):
    """
    Get guild info reply
    """
    _byte_size: int = 0
    _name: str
    _tag: str
    _create_date: str
    _description: str
    _wealth: str
    _ranks: tuple[str, ...]
    _staff_count: int
    _staff: tuple[GuildStaff, ...]

    def __init__(self, *, name: str, tag: str, create_date: str, description: str, wealth: str, ranks: Iterable[str], staff: Iterable[GuildStaff]):
        """
        Create a new instance of GuildReportServerPacket.

        Args:
            name (str): 
            tag (str): 
            create_date (str): 
            description (str): 
            wealth (str): 
            ranks (Iterable[str]): (Length must be `9`.)
            staff (Iterable[GuildStaff]): (Length must be 64008 or less.)
        """
        self._name = name
        self._tag = tag
        self._create_date = create_date
        self._description = description
        self._wealth = wealth
        self._ranks = tuple(ranks)
        self._staff = tuple(staff)
        self._staff_count = len(self._staff)

    @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 name(self) -> str:
        return self._name

    @property
    def tag(self) -> str:
        return self._tag

    @property
    def create_date(self) -> str:
        return self._create_date

    @property
    def description(self) -> str:
        return self._description

    @property
    def wealth(self) -> str:
        return self._wealth

    @property
    def ranks(self) -> tuple[str, ...]:
        return self._ranks

    @property
    def staff(self) -> tuple[GuildStaff, ...]:
        return self._staff

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Guild

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Report

    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.
        """
        GuildReportServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "GuildReportServerPacket") -> None:
        """
        Serializes an instance of `GuildReportServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (GuildReportServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._name is None:
                raise SerializationError("name must be provided.")
            writer.add_string(data._name)
            writer.add_byte(0xFF)
            if data._tag is None:
                raise SerializationError("tag must be provided.")
            writer.add_string(data._tag)
            writer.add_byte(0xFF)
            if data._create_date is None:
                raise SerializationError("create_date must be provided.")
            writer.add_string(data._create_date)
            writer.add_byte(0xFF)
            if data._description is None:
                raise SerializationError("description must be provided.")
            writer.add_string(data._description)
            writer.add_byte(0xFF)
            if data._wealth is None:
                raise SerializationError("wealth must be provided.")
            writer.add_string(data._wealth)
            writer.add_byte(0xFF)
            if data._ranks is None:
                raise SerializationError("ranks must be provided.")
            if len(data._ranks) != 9:
                raise SerializationError(f"Expected length of ranks to be exactly 9, got {len(data._ranks)}.")
            for i in range(9):
                writer.add_string(data._ranks[i])
                writer.add_byte(0xFF)
            if data._staff_count is None:
                raise SerializationError("staff_count must be provided.")
            writer.add_short(data._staff_count)
            writer.add_byte(0xFF)
            if data._staff is None:
                raise SerializationError("staff must be provided.")
            if len(data._staff) > 64008:
                raise SerializationError(f"Expected length of staff to be 64008 or less, got {len(data._staff)}.")
            for i in range(data._staff_count):
                GuildStaff.serialize(writer, data._staff[i])
                writer.add_byte(0xFF)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "GuildReportServerPacket":
        """
        Deserializes an instance of `GuildReportServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            GuildReportServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            name = reader.get_string()
            reader.next_chunk()
            tag = reader.get_string()
            reader.next_chunk()
            create_date = reader.get_string()
            reader.next_chunk()
            description = reader.get_string()
            reader.next_chunk()
            wealth = reader.get_string()
            reader.next_chunk()
            ranks = []
            for i in range(9):
                ranks.append(reader.get_string())
                reader.next_chunk()
            staff_count = reader.get_short()
            reader.next_chunk()
            staff = []
            for i in range(staff_count):
                staff.append(GuildStaff.deserialize(reader))
                reader.next_chunk()
            reader.chunked_reading_mode = False
            result = GuildReportServerPacket(name=name, tag=tag, create_date=create_date, description=description, wealth=wealth, ranks=ranks, staff=staff)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"GuildReportServerPacket(byte_size={repr(self._byte_size)}, name={repr(self._name)}, tag={repr(self._tag)}, create_date={repr(self._create_date)}, description={repr(self._description)}, wealth={repr(self._wealth)}, ranks={repr(self._ranks)}, staff={repr(self._staff)})"

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.

name: str property

tag: str property

create_date: str property

description: str property

wealth: str property

ranks: tuple[str, ...] property

staff: tuple[GuildStaff, ...] property

__init__(*, name, tag, create_date, description, wealth, ranks, staff)

Create a new instance of GuildReportServerPacket.

Parameters:

Name Type Description Default
name str
required
tag str
required
create_date str
required
description str
required
wealth str
required
ranks Iterable[str]

(Length must be 9.)

required
staff Iterable[GuildStaff]

(Length must be 64008 or less.)

required
Source code in src/eolib/protocol/_generated/net/server/guild_report_server_packet.py
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
def __init__(self, *, name: str, tag: str, create_date: str, description: str, wealth: str, ranks: Iterable[str], staff: Iterable[GuildStaff]):
    """
    Create a new instance of GuildReportServerPacket.

    Args:
        name (str): 
        tag (str): 
        create_date (str): 
        description (str): 
        wealth (str): 
        ranks (Iterable[str]): (Length must be `9`.)
        staff (Iterable[GuildStaff]): (Length must be 64008 or less.)
    """
    self._name = name
    self._tag = tag
    self._create_date = create_date
    self._description = description
    self._wealth = wealth
    self._ranks = tuple(ranks)
    self._staff = tuple(staff)
    self._staff_count = len(self._staff)

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/guild_report_server_packet.py
90
91
92
93
94
95
96
97
98
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Guild

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/guild_report_server_packet.py
100
101
102
103
104
105
106
107
108
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Report

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/guild_report_server_packet.py
110
111
112
113
114
115
116
117
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.
    """
    GuildReportServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of GuildReportServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data GuildReportServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/guild_report_server_packet.py
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
@staticmethod
def serialize(writer: EoWriter, data: "GuildReportServerPacket") -> None:
    """
    Serializes an instance of `GuildReportServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (GuildReportServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._name is None:
            raise SerializationError("name must be provided.")
        writer.add_string(data._name)
        writer.add_byte(0xFF)
        if data._tag is None:
            raise SerializationError("tag must be provided.")
        writer.add_string(data._tag)
        writer.add_byte(0xFF)
        if data._create_date is None:
            raise SerializationError("create_date must be provided.")
        writer.add_string(data._create_date)
        writer.add_byte(0xFF)
        if data._description is None:
            raise SerializationError("description must be provided.")
        writer.add_string(data._description)
        writer.add_byte(0xFF)
        if data._wealth is None:
            raise SerializationError("wealth must be provided.")
        writer.add_string(data._wealth)
        writer.add_byte(0xFF)
        if data._ranks is None:
            raise SerializationError("ranks must be provided.")
        if len(data._ranks) != 9:
            raise SerializationError(f"Expected length of ranks to be exactly 9, got {len(data._ranks)}.")
        for i in range(9):
            writer.add_string(data._ranks[i])
            writer.add_byte(0xFF)
        if data._staff_count is None:
            raise SerializationError("staff_count must be provided.")
        writer.add_short(data._staff_count)
        writer.add_byte(0xFF)
        if data._staff is None:
            raise SerializationError("staff must be provided.")
        if len(data._staff) > 64008:
            raise SerializationError(f"Expected length of staff to be 64008 or less, got {len(data._staff)}.")
        for i in range(data._staff_count):
            GuildStaff.serialize(writer, data._staff[i])
            writer.add_byte(0xFF)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of GuildReportServerPacket 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
GuildReportServerPacket 'GuildReportServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/guild_report_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "GuildReportServerPacket":
    """
    Deserializes an instance of `GuildReportServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        GuildReportServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        name = reader.get_string()
        reader.next_chunk()
        tag = reader.get_string()
        reader.next_chunk()
        create_date = reader.get_string()
        reader.next_chunk()
        description = reader.get_string()
        reader.next_chunk()
        wealth = reader.get_string()
        reader.next_chunk()
        ranks = []
        for i in range(9):
            ranks.append(reader.get_string())
            reader.next_chunk()
        staff_count = reader.get_short()
        reader.next_chunk()
        staff = []
        for i in range(staff_count):
            staff.append(GuildStaff.deserialize(reader))
            reader.next_chunk()
        reader.chunked_reading_mode = False
        result = GuildReportServerPacket(name=name, tag=tag, create_date=create_date, description=description, wealth=wealth, ranks=ranks, staff=staff)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

GuildReplyServerPacket

Bases: Packet

Generic guild reply messages

Source code in src/eolib/protocol/_generated/net/server/guild_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
class GuildReplyServerPacket(Packet):
    """
    Generic guild reply messages
    """
    _byte_size: int = 0
    _reply_code: GuildReply
    _reply_code_data: 'GuildReplyServerPacket.ReplyCodeData'

    def __init__(self, *, reply_code: GuildReply, reply_code_data: 'GuildReplyServerPacket.ReplyCodeData' = None):
        """
        Create a new instance of GuildReplyServerPacket.

        Args:
            reply_code (GuildReply): 
            reply_code_data (GuildReplyServerPacket.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) -> GuildReply:
        return self._reply_code

    @property
    def reply_code_data(self) -> 'GuildReplyServerPacket.ReplyCodeData':
        """
        GuildReplyServerPacket.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.Guild

    @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.
        """
        GuildReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "GuildReplyServerPacket") -> None:
        """
        Serializes an instance of `GuildReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (GuildReplyServerPacket): 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 == GuildReply.CreateAdd:
                if not isinstance(data._reply_code_data, GuildReplyServerPacket.ReplyCodeDataCreateAdd):
                    raise SerializationError("Expected reply_code_data to be type GuildReplyServerPacket.ReplyCodeDataCreateAdd for reply_code " + GuildReply(data._reply_code).name + ".")
                GuildReplyServerPacket.ReplyCodeDataCreateAdd.serialize(writer, data._reply_code_data)
            elif data._reply_code == GuildReply.CreateAddConfirm:
                if not isinstance(data._reply_code_data, GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm):
                    raise SerializationError("Expected reply_code_data to be type GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm for reply_code " + GuildReply(data._reply_code).name + ".")
                GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm.serialize(writer, data._reply_code_data)
            elif data._reply_code == GuildReply.JoinRequest:
                if not isinstance(data._reply_code_data, GuildReplyServerPacket.ReplyCodeDataJoinRequest):
                    raise SerializationError("Expected reply_code_data to be type GuildReplyServerPacket.ReplyCodeDataJoinRequest for reply_code " + GuildReply(data._reply_code).name + ".")
                GuildReplyServerPacket.ReplyCodeDataJoinRequest.serialize(writer, data._reply_code_data)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "GuildReplyServerPacket":
        """
        Deserializes an instance of `GuildReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            GuildReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reply_code = GuildReply(reader.get_short())
            reply_code_data: GuildReplyServerPacket.ReplyCodeData = None
            if reply_code == GuildReply.CreateAdd:
                reply_code_data = GuildReplyServerPacket.ReplyCodeDataCreateAdd.deserialize(reader)
            elif reply_code == GuildReply.CreateAddConfirm:
                reply_code_data = GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm.deserialize(reader)
            elif reply_code == GuildReply.JoinRequest:
                reply_code_data = GuildReplyServerPacket.ReplyCodeDataJoinRequest.deserialize(reader)
            result = GuildReplyServerPacket(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"GuildReplyServerPacket(byte_size={repr(self._byte_size)}, reply_code={repr(self._reply_code)}, reply_code_data={repr(self._reply_code_data)})"

    ReplyCodeData = Union['GuildReplyServerPacket.ReplyCodeDataCreateAdd', 'GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm', 'GuildReplyServerPacket.ReplyCodeDataJoinRequest', None]
    """
    Data associated with different values of the `reply_code` field.
    """

    class ReplyCodeDataCreateAdd:
        """
        Data associated with reply_code value GuildReply.CreateAdd
        """
        _byte_size: int = 0
        _name: str

        def __init__(self, *, name: str):
            """
            Create a new instance of GuildReplyServerPacket.ReplyCodeDataCreateAdd.

            Args:
                name (str): 
            """
            self._name = name

        @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 name(self) -> str:
            return self._name

        @staticmethod
        def serialize(writer: EoWriter, data: "GuildReplyServerPacket.ReplyCodeDataCreateAdd") -> None:
            """
            Serializes an instance of `GuildReplyServerPacket.ReplyCodeDataCreateAdd` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (GuildReplyServerPacket.ReplyCodeDataCreateAdd): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._name is None:
                    raise SerializationError("name must be provided.")
                writer.add_string(data._name)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "GuildReplyServerPacket.ReplyCodeDataCreateAdd":
            """
            Deserializes an instance of `GuildReplyServerPacket.ReplyCodeDataCreateAdd` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                GuildReplyServerPacket.ReplyCodeDataCreateAdd: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                name = reader.get_string()
                result = GuildReplyServerPacket.ReplyCodeDataCreateAdd(name=name)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"GuildReplyServerPacket.ReplyCodeDataCreateAdd(byte_size={repr(self._byte_size)}, name={repr(self._name)})"

    class ReplyCodeDataCreateAddConfirm:
        """
        Data associated with reply_code value GuildReply.CreateAddConfirm
        """
        _byte_size: int = 0
        _name: str

        def __init__(self, *, name: str):
            """
            Create a new instance of GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm.

            Args:
                name (str): 
            """
            self._name = name

        @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 name(self) -> str:
            return self._name

        @staticmethod
        def serialize(writer: EoWriter, data: "GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm") -> None:
            """
            Serializes an instance of `GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._name is None:
                    raise SerializationError("name must be provided.")
                writer.add_string(data._name)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm":
            """
            Deserializes an instance of `GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                name = reader.get_string()
                result = GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm(name=name)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm(byte_size={repr(self._byte_size)}, name={repr(self._name)})"

    class ReplyCodeDataJoinRequest:
        """
        Data associated with reply_code value GuildReply.JoinRequest
        """
        _byte_size: int = 0
        _player_id: int
        _name: str

        def __init__(self, *, player_id: int, name: str):
            """
            Create a new instance of GuildReplyServerPacket.ReplyCodeDataJoinRequest.

            Args:
                player_id (int): (Value range is 0-64008.)
                name (str): 
            """
            self._player_id = player_id
            self._name = name

        @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 player_id(self) -> int:
            return self._player_id

        @property
        def name(self) -> str:
            return self._name

        @staticmethod
        def serialize(writer: EoWriter, data: "GuildReplyServerPacket.ReplyCodeDataJoinRequest") -> None:
            """
            Serializes an instance of `GuildReplyServerPacket.ReplyCodeDataJoinRequest` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (GuildReplyServerPacket.ReplyCodeDataJoinRequest): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._player_id is None:
                    raise SerializationError("player_id must be provided.")
                writer.add_short(data._player_id)
                if data._name is None:
                    raise SerializationError("name must be provided.")
                writer.add_string(data._name)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "GuildReplyServerPacket.ReplyCodeDataJoinRequest":
            """
            Deserializes an instance of `GuildReplyServerPacket.ReplyCodeDataJoinRequest` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                GuildReplyServerPacket.ReplyCodeDataJoinRequest: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                player_id = reader.get_short()
                name = reader.get_string()
                result = GuildReplyServerPacket.ReplyCodeDataJoinRequest(player_id=player_id, name=name)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"GuildReplyServerPacket.ReplyCodeDataJoinRequest(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, name={repr(self._name)})"

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: GuildReply property

reply_code_data: GuildReplyServerPacket.ReplyCodeData property

GuildReplyServerPacket.ReplyCodeData: Data associated with the reply_code field.

ReplyCodeData = Union['GuildReplyServerPacket.ReplyCodeDataCreateAdd', 'GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm', 'GuildReplyServerPacket.ReplyCodeDataJoinRequest', None] class-attribute instance-attribute

Data associated with different values of the reply_code field.

ReplyCodeDataCreateAdd

Data associated with reply_code value GuildReply.CreateAdd

Source code in src/eolib/protocol/_generated/net/server/guild_reply_server_packet.py
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
class ReplyCodeDataCreateAdd:
    """
    Data associated with reply_code value GuildReply.CreateAdd
    """
    _byte_size: int = 0
    _name: str

    def __init__(self, *, name: str):
        """
        Create a new instance of GuildReplyServerPacket.ReplyCodeDataCreateAdd.

        Args:
            name (str): 
        """
        self._name = name

    @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 name(self) -> str:
        return self._name

    @staticmethod
    def serialize(writer: EoWriter, data: "GuildReplyServerPacket.ReplyCodeDataCreateAdd") -> None:
        """
        Serializes an instance of `GuildReplyServerPacket.ReplyCodeDataCreateAdd` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (GuildReplyServerPacket.ReplyCodeDataCreateAdd): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._name is None:
                raise SerializationError("name must be provided.")
            writer.add_string(data._name)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "GuildReplyServerPacket.ReplyCodeDataCreateAdd":
        """
        Deserializes an instance of `GuildReplyServerPacket.ReplyCodeDataCreateAdd` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            GuildReplyServerPacket.ReplyCodeDataCreateAdd: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            name = reader.get_string()
            result = GuildReplyServerPacket.ReplyCodeDataCreateAdd(name=name)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"GuildReplyServerPacket.ReplyCodeDataCreateAdd(byte_size={repr(self._byte_size)}, name={repr(self._name)})"

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.

name: str property

__init__(*, name)

Create a new instance of GuildReplyServerPacket.ReplyCodeDataCreateAdd.

Parameters:

Name Type Description Default
name str
required
Source code in src/eolib/protocol/_generated/net/server/guild_reply_server_packet.py
156
157
158
159
160
161
162
163
def __init__(self, *, name: str):
    """
    Create a new instance of GuildReplyServerPacket.ReplyCodeDataCreateAdd.

    Args:
        name (str): 
    """
    self._name = name

serialize(writer, data) staticmethod

Serializes an instance of GuildReplyServerPacket.ReplyCodeDataCreateAdd to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataCreateAdd

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/guild_reply_server_packet.py
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
@staticmethod
def serialize(writer: EoWriter, data: "GuildReplyServerPacket.ReplyCodeDataCreateAdd") -> None:
    """
    Serializes an instance of `GuildReplyServerPacket.ReplyCodeDataCreateAdd` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (GuildReplyServerPacket.ReplyCodeDataCreateAdd): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._name is None:
            raise SerializationError("name must be provided.")
        writer.add_string(data._name)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of GuildReplyServerPacket.ReplyCodeDataCreateAdd from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataCreateAdd

GuildReplyServerPacket.ReplyCodeDataCreateAdd: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/guild_reply_server_packet.py
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
@staticmethod
def deserialize(reader: EoReader) -> "GuildReplyServerPacket.ReplyCodeDataCreateAdd":
    """
    Deserializes an instance of `GuildReplyServerPacket.ReplyCodeDataCreateAdd` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        GuildReplyServerPacket.ReplyCodeDataCreateAdd: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        name = reader.get_string()
        result = GuildReplyServerPacket.ReplyCodeDataCreateAdd(name=name)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataCreateAddConfirm

Data associated with reply_code value GuildReply.CreateAddConfirm

Source code in src/eolib/protocol/_generated/net/server/guild_reply_server_packet.py
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
class ReplyCodeDataCreateAddConfirm:
    """
    Data associated with reply_code value GuildReply.CreateAddConfirm
    """
    _byte_size: int = 0
    _name: str

    def __init__(self, *, name: str):
        """
        Create a new instance of GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm.

        Args:
            name (str): 
        """
        self._name = name

    @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 name(self) -> str:
        return self._name

    @staticmethod
    def serialize(writer: EoWriter, data: "GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm") -> None:
        """
        Serializes an instance of `GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._name is None:
                raise SerializationError("name must be provided.")
            writer.add_string(data._name)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm":
        """
        Deserializes an instance of `GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            name = reader.get_string()
            result = GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm(name=name)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm(byte_size={repr(self._byte_size)}, name={repr(self._name)})"

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.

name: str property

__init__(*, name)

Create a new instance of GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm.

Parameters:

Name Type Description Default
name str
required
Source code in src/eolib/protocol/_generated/net/server/guild_reply_server_packet.py
227
228
229
230
231
232
233
234
def __init__(self, *, name: str):
    """
    Create a new instance of GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm.

    Args:
        name (str): 
    """
    self._name = name

serialize(writer, data) staticmethod

Serializes an instance of GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataCreateAddConfirm

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/guild_reply_server_packet.py
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
@staticmethod
def serialize(writer: EoWriter, data: "GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm") -> None:
    """
    Serializes an instance of `GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._name is None:
            raise SerializationError("name must be provided.")
        writer.add_string(data._name)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataCreateAddConfirm

GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/guild_reply_server_packet.py
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
@staticmethod
def deserialize(reader: EoReader) -> "GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm":
    """
    Deserializes an instance of `GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        name = reader.get_string()
        result = GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm(name=name)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataJoinRequest

Data associated with reply_code value GuildReply.JoinRequest

Source code in src/eolib/protocol/_generated/net/server/guild_reply_server_packet.py
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
class ReplyCodeDataJoinRequest:
    """
    Data associated with reply_code value GuildReply.JoinRequest
    """
    _byte_size: int = 0
    _player_id: int
    _name: str

    def __init__(self, *, player_id: int, name: str):
        """
        Create a new instance of GuildReplyServerPacket.ReplyCodeDataJoinRequest.

        Args:
            player_id (int): (Value range is 0-64008.)
            name (str): 
        """
        self._player_id = player_id
        self._name = name

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def name(self) -> str:
        return self._name

    @staticmethod
    def serialize(writer: EoWriter, data: "GuildReplyServerPacket.ReplyCodeDataJoinRequest") -> None:
        """
        Serializes an instance of `GuildReplyServerPacket.ReplyCodeDataJoinRequest` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (GuildReplyServerPacket.ReplyCodeDataJoinRequest): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._name is None:
                raise SerializationError("name must be provided.")
            writer.add_string(data._name)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "GuildReplyServerPacket.ReplyCodeDataJoinRequest":
        """
        Deserializes an instance of `GuildReplyServerPacket.ReplyCodeDataJoinRequest` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            GuildReplyServerPacket.ReplyCodeDataJoinRequest: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            name = reader.get_string()
            result = GuildReplyServerPacket.ReplyCodeDataJoinRequest(player_id=player_id, name=name)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"GuildReplyServerPacket.ReplyCodeDataJoinRequest(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, name={repr(self._name)})"

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.

player_id: int property

name: str property

__init__(*, player_id, name)

Create a new instance of GuildReplyServerPacket.ReplyCodeDataJoinRequest.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
name str
required
Source code in src/eolib/protocol/_generated/net/server/guild_reply_server_packet.py
299
300
301
302
303
304
305
306
307
308
def __init__(self, *, player_id: int, name: str):
    """
    Create a new instance of GuildReplyServerPacket.ReplyCodeDataJoinRequest.

    Args:
        player_id (int): (Value range is 0-64008.)
        name (str): 
    """
    self._player_id = player_id
    self._name = name

serialize(writer, data) staticmethod

Serializes an instance of GuildReplyServerPacket.ReplyCodeDataJoinRequest to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataJoinRequest

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/guild_reply_server_packet.py
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
@staticmethod
def serialize(writer: EoWriter, data: "GuildReplyServerPacket.ReplyCodeDataJoinRequest") -> None:
    """
    Serializes an instance of `GuildReplyServerPacket.ReplyCodeDataJoinRequest` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (GuildReplyServerPacket.ReplyCodeDataJoinRequest): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._name is None:
            raise SerializationError("name must be provided.")
        writer.add_string(data._name)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of GuildReplyServerPacket.ReplyCodeDataJoinRequest from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ReplyCodeDataJoinRequest

GuildReplyServerPacket.ReplyCodeDataJoinRequest: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/guild_reply_server_packet.py
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
@staticmethod
def deserialize(reader: EoReader) -> "GuildReplyServerPacket.ReplyCodeDataJoinRequest":
    """
    Deserializes an instance of `GuildReplyServerPacket.ReplyCodeDataJoinRequest` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        GuildReplyServerPacket.ReplyCodeDataJoinRequest: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        name = reader.get_string()
        result = GuildReplyServerPacket.ReplyCodeDataJoinRequest(player_id=player_id, name=name)
        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 GuildReplyServerPacket.

Parameters:

Name Type Description Default
reply_code GuildReply
required
reply_code_data ReplyCodeData

Data associated with the reply_code field.

None
Source code in src/eolib/protocol/_generated/net/server/guild_reply_server_packet.py
23
24
25
26
27
28
29
30
31
32
def __init__(self, *, reply_code: GuildReply, reply_code_data: 'GuildReplyServerPacket.ReplyCodeData' = None):
    """
    Create a new instance of GuildReplyServerPacket.

    Args:
        reply_code (GuildReply): 
        reply_code_data (GuildReplyServerPacket.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/guild_reply_server_packet.py
55
56
57
58
59
60
61
62
63
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Guild

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/guild_reply_server_packet.py
65
66
67
68
69
70
71
72
73
@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/guild_reply_server_packet.py
75
76
77
78
79
80
81
82
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.
    """
    GuildReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of GuildReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data GuildReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/guild_reply_server_packet.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "GuildReplyServerPacket") -> None:
    """
    Serializes an instance of `GuildReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (GuildReplyServerPacket): 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 == GuildReply.CreateAdd:
            if not isinstance(data._reply_code_data, GuildReplyServerPacket.ReplyCodeDataCreateAdd):
                raise SerializationError("Expected reply_code_data to be type GuildReplyServerPacket.ReplyCodeDataCreateAdd for reply_code " + GuildReply(data._reply_code).name + ".")
            GuildReplyServerPacket.ReplyCodeDataCreateAdd.serialize(writer, data._reply_code_data)
        elif data._reply_code == GuildReply.CreateAddConfirm:
            if not isinstance(data._reply_code_data, GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm):
                raise SerializationError("Expected reply_code_data to be type GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm for reply_code " + GuildReply(data._reply_code).name + ".")
            GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm.serialize(writer, data._reply_code_data)
        elif data._reply_code == GuildReply.JoinRequest:
            if not isinstance(data._reply_code_data, GuildReplyServerPacket.ReplyCodeDataJoinRequest):
                raise SerializationError("Expected reply_code_data to be type GuildReplyServerPacket.ReplyCodeDataJoinRequest for reply_code " + GuildReply(data._reply_code).name + ".")
            GuildReplyServerPacket.ReplyCodeDataJoinRequest.serialize(writer, data._reply_code_data)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of GuildReplyServerPacket 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
GuildReplyServerPacket GuildReplyServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/guild_reply_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "GuildReplyServerPacket":
    """
    Deserializes an instance of `GuildReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        GuildReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reply_code = GuildReply(reader.get_short())
        reply_code_data: GuildReplyServerPacket.ReplyCodeData = None
        if reply_code == GuildReply.CreateAdd:
            reply_code_data = GuildReplyServerPacket.ReplyCodeDataCreateAdd.deserialize(reader)
        elif reply_code == GuildReply.CreateAddConfirm:
            reply_code_data = GuildReplyServerPacket.ReplyCodeDataCreateAddConfirm.deserialize(reader)
        elif reply_code == GuildReply.JoinRequest:
            reply_code_data = GuildReplyServerPacket.ReplyCodeDataJoinRequest.deserialize(reader)
        result = GuildReplyServerPacket(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

GuildReply

Bases: IntEnum

Reply code sent with GUILD_REPLY packet

Source code in src/eolib/protocol/_generated/net/server/guild_reply.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
class GuildReply(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Reply code sent with GUILD_REPLY packet
    """
    Busy = 1
    NotApproved = 2
    AlreadyMember = 3
    NoCandidates = 4
    Exists = 5
    CreateBegin = 6
    CreateAddConfirm = 7
    CreateAdd = 8
    RecruiterOffline = 9
    RecruiterNotHere = 10
    RecruiterWrongGuild = 11
    NotRecruiter = 12
    JoinRequest = 13
    NotPresent = 14
    AccountLow = 15
    Accepted = 16
    NotFound = 17
    Updated = 18
    RanksUpdated = 19
    RemoveLeader = 20
    RemoveNotMember = 21
    Removed = 22
    RankingLeader = 23
    RankingNotMember = 24

Busy = 1 class-attribute instance-attribute

NotApproved = 2 class-attribute instance-attribute

AlreadyMember = 3 class-attribute instance-attribute

NoCandidates = 4 class-attribute instance-attribute

Exists = 5 class-attribute instance-attribute

CreateBegin = 6 class-attribute instance-attribute

CreateAddConfirm = 7 class-attribute instance-attribute

CreateAdd = 8 class-attribute instance-attribute

RecruiterOffline = 9 class-attribute instance-attribute

RecruiterNotHere = 10 class-attribute instance-attribute

RecruiterWrongGuild = 11 class-attribute instance-attribute

NotRecruiter = 12 class-attribute instance-attribute

JoinRequest = 13 class-attribute instance-attribute

NotPresent = 14 class-attribute instance-attribute

AccountLow = 15 class-attribute instance-attribute

Accepted = 16 class-attribute instance-attribute

NotFound = 17 class-attribute instance-attribute

Updated = 18 class-attribute instance-attribute

RanksUpdated = 19 class-attribute instance-attribute

RemoveLeader = 20 class-attribute instance-attribute

RemoveNotMember = 21 class-attribute instance-attribute

Removed = 22 class-attribute instance-attribute

RankingLeader = 23 class-attribute instance-attribute

RankingNotMember = 24 class-attribute instance-attribute

GuildRankServerPacket

Bases: Packet

Get guild rank list reply

Source code in src/eolib/protocol/_generated/net/server/guild_rank_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
class GuildRankServerPacket(Packet):
    """
    Get guild rank list reply
    """
    _byte_size: int = 0
    _ranks: tuple[str, ...]

    def __init__(self, *, ranks: Iterable[str]):
        """
        Create a new instance of GuildRankServerPacket.

        Args:
            ranks (Iterable[str]): (Length must be `9`.)
        """
        self._ranks = tuple(ranks)

    @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 ranks(self) -> tuple[str, ...]:
        return self._ranks

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Guild

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Rank

    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.
        """
        GuildRankServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "GuildRankServerPacket") -> None:
        """
        Serializes an instance of `GuildRankServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (GuildRankServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._ranks is None:
                raise SerializationError("ranks must be provided.")
            if len(data._ranks) != 9:
                raise SerializationError(f"Expected length of ranks to be exactly 9, got {len(data._ranks)}.")
            for i in range(9):
                writer.add_string(data._ranks[i])
                writer.add_byte(0xFF)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "GuildRankServerPacket":
        """
        Deserializes an instance of `GuildRankServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            GuildRankServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            ranks = []
            for i in range(9):
                ranks.append(reader.get_string())
                reader.next_chunk()
            reader.chunked_reading_mode = False
            result = GuildRankServerPacket(ranks=ranks)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"GuildRankServerPacket(byte_size={repr(self._byte_size)}, ranks={repr(self._ranks)})"

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.

ranks: tuple[str, ...] property

__init__(*, ranks)

Create a new instance of GuildRankServerPacket.

Parameters:

Name Type Description Default
ranks Iterable[str]

(Length must be 9.)

required
Source code in src/eolib/protocol/_generated/net/server/guild_rank_server_packet.py
22
23
24
25
26
27
28
29
def __init__(self, *, ranks: Iterable[str]):
    """
    Create a new instance of GuildRankServerPacket.

    Args:
        ranks (Iterable[str]): (Length must be `9`.)
    """
    self._ranks = tuple(ranks)

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/guild_rank_server_packet.py
45
46
47
48
49
50
51
52
53
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Guild

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/guild_rank_server_packet.py
55
56
57
58
59
60
61
62
63
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Rank

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/guild_rank_server_packet.py
65
66
67
68
69
70
71
72
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.
    """
    GuildRankServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of GuildRankServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data GuildRankServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/guild_rank_server_packet.py
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
@staticmethod
def serialize(writer: EoWriter, data: "GuildRankServerPacket") -> None:
    """
    Serializes an instance of `GuildRankServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (GuildRankServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._ranks is None:
            raise SerializationError("ranks must be provided.")
        if len(data._ranks) != 9:
            raise SerializationError(f"Expected length of ranks to be exactly 9, got {len(data._ranks)}.")
        for i in range(9):
            writer.add_string(data._ranks[i])
            writer.add_byte(0xFF)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of GuildRankServerPacket 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
GuildRankServerPacket 'GuildRankServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/guild_rank_server_packet.py
 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
@staticmethod
def deserialize(reader: EoReader) -> "GuildRankServerPacket":
    """
    Deserializes an instance of `GuildRankServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        GuildRankServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        ranks = []
        for i in range(9):
            ranks.append(reader.get_string())
            reader.next_chunk()
        reader.chunked_reading_mode = False
        result = GuildRankServerPacket(ranks=ranks)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

GuildOpenServerPacket

Bases: Packet

Talk to guild master NPC reply

Source code in src/eolib/protocol/_generated/net/server/guild_open_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class GuildOpenServerPacket(Packet):
    """
    Talk to guild master NPC reply
    """
    _byte_size: int = 0
    _session_id: int

    def __init__(self, *, session_id: int):
        """
        Create a new instance of GuildOpenServerPacket.

        Args:
            session_id (int): (Value range is 0-16194276.)
        """
        self._session_id = session_id

    @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:
        return self._session_id

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Guild

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Open

    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.
        """
        GuildOpenServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "GuildOpenServerPacket") -> None:
        """
        Serializes an instance of `GuildOpenServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (GuildOpenServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._session_id is None:
                raise SerializationError("session_id must be provided.")
            writer.add_three(data._session_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "GuildOpenServerPacket":
        """
        Deserializes an instance of `GuildOpenServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            GuildOpenServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            session_id = reader.get_three()
            result = GuildOpenServerPacket(session_id=session_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"GuildOpenServerPacket(byte_size={repr(self._byte_size)}, session_id={repr(self._session_id)})"

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

__init__(*, session_id)

Create a new instance of GuildOpenServerPacket.

Parameters:

Name Type Description Default
session_id int

(Value range is 0-16194276.)

required
Source code in src/eolib/protocol/_generated/net/server/guild_open_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, session_id: int):
    """
    Create a new instance of GuildOpenServerPacket.

    Args:
        session_id (int): (Value range is 0-16194276.)
    """
    self._session_id = session_id

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/guild_open_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Guild

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/guild_open_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Open

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/guild_open_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    GuildOpenServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of GuildOpenServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data GuildOpenServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/guild_open_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "GuildOpenServerPacket") -> None:
    """
    Serializes an instance of `GuildOpenServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (GuildOpenServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._session_id is None:
            raise SerializationError("session_id must be provided.")
        writer.add_three(data._session_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of GuildOpenServerPacket 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
GuildOpenServerPacket GuildOpenServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/guild_open_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "GuildOpenServerPacket":
    """
    Deserializes an instance of `GuildOpenServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        GuildOpenServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        session_id = reader.get_three()
        result = GuildOpenServerPacket(session_id=session_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

GuildMember

Information about a guild member

Source code in src/eolib/protocol/_generated/net/server/guild_member.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
class GuildMember:
    """
    Information about a guild member
    """
    _byte_size: int = 0
    _rank: int
    _name: str
    _rank_name: str

    def __init__(self, *, rank: int, name: str, rank_name: str):
        """
        Create a new instance of GuildMember.

        Args:
            rank (int): (Value range is 0-252.)
            name (str): 
            rank_name (str): 
        """
        self._rank = rank
        self._name = name
        self._rank_name = rank_name

    @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 rank(self) -> int:
        return self._rank

    @property
    def name(self) -> str:
        return self._name

    @property
    def rank_name(self) -> str:
        return self._rank_name

    @staticmethod
    def serialize(writer: EoWriter, data: "GuildMember") -> None:
        """
        Serializes an instance of `GuildMember` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (GuildMember): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._rank is None:
                raise SerializationError("rank must be provided.")
            writer.add_char(data._rank)
            writer.add_byte(0xFF)
            if data._name is None:
                raise SerializationError("name must be provided.")
            writer.add_string(data._name)
            writer.add_byte(0xFF)
            if data._rank_name is None:
                raise SerializationError("rank_name must be provided.")
            writer.add_string(data._rank_name)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "GuildMember":
        """
        Deserializes an instance of `GuildMember` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            GuildMember: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            rank = reader.get_char()
            reader.next_chunk()
            name = reader.get_string()
            reader.next_chunk()
            rank_name = reader.get_string()
            reader.chunked_reading_mode = False
            result = GuildMember(rank=rank, name=name, rank_name=rank_name)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"GuildMember(byte_size={repr(self._byte_size)}, rank={repr(self._rank)}, name={repr(self._name)}, rank_name={repr(self._rank_name)})"

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.

rank: int property

name: str property

rank_name: str property

__init__(*, rank, name, rank_name)

Create a new instance of GuildMember.

Parameters:

Name Type Description Default
rank int

(Value range is 0-252.)

required
name str
required
rank_name str
required
Source code in src/eolib/protocol/_generated/net/server/guild_member.py
19
20
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, rank: int, name: str, rank_name: str):
    """
    Create a new instance of GuildMember.

    Args:
        rank (int): (Value range is 0-252.)
        name (str): 
        rank_name (str): 
    """
    self._rank = rank
    self._name = name
    self._rank_name = rank_name

serialize(writer, data) staticmethod

Serializes an instance of GuildMember to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data GuildMember

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/guild_member.py
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
@staticmethod
def serialize(writer: EoWriter, data: "GuildMember") -> None:
    """
    Serializes an instance of `GuildMember` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (GuildMember): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._rank is None:
            raise SerializationError("rank must be provided.")
        writer.add_char(data._rank)
        writer.add_byte(0xFF)
        if data._name is None:
            raise SerializationError("name must be provided.")
        writer.add_string(data._name)
        writer.add_byte(0xFF)
        if data._rank_name is None:
            raise SerializationError("rank_name must be provided.")
        writer.add_string(data._rank_name)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of GuildMember 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
GuildMember GuildMember

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/guild_member.py
 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
@staticmethod
def deserialize(reader: EoReader) -> "GuildMember":
    """
    Deserializes an instance of `GuildMember` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        GuildMember: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        rank = reader.get_char()
        reader.next_chunk()
        name = reader.get_string()
        reader.next_chunk()
        rank_name = reader.get_string()
        reader.chunked_reading_mode = False
        result = GuildMember(rank=rank, name=name, rank_name=rank_name)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

GuildKickServerPacket

Bases: Packet

Left the guild

Source code in src/eolib/protocol/_generated/net/server/guild_kick_server_packet.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
class GuildKickServerPacket(Packet):
    """
    Left the guild
    """
    _byte_size: int = 0

    def __init__(self):
        """
        Create a new instance of GuildKickServerPacket.
        """

    @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 family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Guild

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Kick

    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.
        """
        GuildKickServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "GuildKickServerPacket") -> None:
        """
        Serializes an instance of `GuildKickServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (GuildKickServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.add_byte(255)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "GuildKickServerPacket":
        """
        Deserializes an instance of `GuildKickServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            GuildKickServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_byte()
            result = GuildKickServerPacket()
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"GuildKickServerPacket(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 GuildKickServerPacket.

Source code in src/eolib/protocol/_generated/net/server/guild_kick_server_packet.py
18
19
20
21
def __init__(self):
    """
    Create a new instance of GuildKickServerPacket.
    """

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/guild_kick_server_packet.py
33
34
35
36
37
38
39
40
41
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Guild

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/guild_kick_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Kick

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/guild_kick_server_packet.py
53
54
55
56
57
58
59
60
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.
    """
    GuildKickServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of GuildKickServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data GuildKickServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/guild_kick_server_packet.py
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@staticmethod
def serialize(writer: EoWriter, data: "GuildKickServerPacket") -> None:
    """
    Serializes an instance of `GuildKickServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (GuildKickServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.add_byte(255)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of GuildKickServerPacket 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
GuildKickServerPacket GuildKickServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/guild_kick_server_packet.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@staticmethod
def deserialize(reader: EoReader) -> "GuildKickServerPacket":
    """
    Deserializes an instance of `GuildKickServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        GuildKickServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_byte()
        result = GuildKickServerPacket()
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

GuildCreateServerPacket

Bases: Packet

Guild created

Source code in src/eolib/protocol/_generated/net/server/guild_create_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
class GuildCreateServerPacket(Packet):
    """
    Guild created
    """
    _byte_size: int = 0
    _leader_player_id: int
    _guild_tag: str
    _guild_name: str
    _rank_name: str
    _gold_amount: int

    def __init__(self, *, leader_player_id: int, guild_tag: str, guild_name: str, rank_name: str, gold_amount: int):
        """
        Create a new instance of GuildCreateServerPacket.

        Args:
            leader_player_id (int): (Value range is 0-64008.)
            guild_tag (str): 
            guild_name (str): 
            rank_name (str): 
            gold_amount (int): (Value range is 0-4097152080.)
        """
        self._leader_player_id = leader_player_id
        self._guild_tag = guild_tag
        self._guild_name = guild_name
        self._rank_name = rank_name
        self._gold_amount = gold_amount

    @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 leader_player_id(self) -> int:
        return self._leader_player_id

    @property
    def guild_tag(self) -> str:
        return self._guild_tag

    @property
    def guild_name(self) -> str:
        return self._guild_name

    @property
    def rank_name(self) -> str:
        return self._rank_name

    @property
    def gold_amount(self) -> int:
        return self._gold_amount

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Guild

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Create

    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.
        """
        GuildCreateServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "GuildCreateServerPacket") -> None:
        """
        Serializes an instance of `GuildCreateServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (GuildCreateServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._leader_player_id is None:
                raise SerializationError("leader_player_id must be provided.")
            writer.add_short(data._leader_player_id)
            writer.add_byte(0xFF)
            if data._guild_tag is None:
                raise SerializationError("guild_tag must be provided.")
            writer.add_string(data._guild_tag)
            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._rank_name is None:
                raise SerializationError("rank_name must be provided.")
            writer.add_string(data._rank_name)
            writer.add_byte(0xFF)
            if data._gold_amount is None:
                raise SerializationError("gold_amount must be provided.")
            writer.add_int(data._gold_amount)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "GuildCreateServerPacket":
        """
        Deserializes an instance of `GuildCreateServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            GuildCreateServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            leader_player_id = reader.get_short()
            reader.next_chunk()
            guild_tag = reader.get_string()
            reader.next_chunk()
            guild_name = reader.get_string()
            reader.next_chunk()
            rank_name = reader.get_string()
            reader.next_chunk()
            gold_amount = reader.get_int()
            reader.chunked_reading_mode = False
            result = GuildCreateServerPacket(leader_player_id=leader_player_id, guild_tag=guild_tag, guild_name=guild_name, rank_name=rank_name, gold_amount=gold_amount)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"GuildCreateServerPacket(byte_size={repr(self._byte_size)}, leader_player_id={repr(self._leader_player_id)}, guild_tag={repr(self._guild_tag)}, guild_name={repr(self._guild_name)}, rank_name={repr(self._rank_name)}, gold_amount={repr(self._gold_amount)})"

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.

leader_player_id: int property

guild_tag: str property

guild_name: str property

rank_name: str property

gold_amount: int property

__init__(*, leader_player_id, guild_tag, guild_name, rank_name, gold_amount)

Create a new instance of GuildCreateServerPacket.

Parameters:

Name Type Description Default
leader_player_id int

(Value range is 0-64008.)

required
guild_tag str
required
guild_name str
required
rank_name str
required
gold_amount int

(Value range is 0-4097152080.)

required
Source code in src/eolib/protocol/_generated/net/server/guild_create_server_packet.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
def __init__(self, *, leader_player_id: int, guild_tag: str, guild_name: str, rank_name: str, gold_amount: int):
    """
    Create a new instance of GuildCreateServerPacket.

    Args:
        leader_player_id (int): (Value range is 0-64008.)
        guild_tag (str): 
        guild_name (str): 
        rank_name (str): 
        gold_amount (int): (Value range is 0-4097152080.)
    """
    self._leader_player_id = leader_player_id
    self._guild_tag = guild_tag
    self._guild_name = guild_name
    self._rank_name = rank_name
    self._gold_amount = gold_amount

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/guild_create_server_packet.py
71
72
73
74
75
76
77
78
79
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Guild

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/guild_create_server_packet.py
81
82
83
84
85
86
87
88
89
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Create

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/guild_create_server_packet.py
91
92
93
94
95
96
97
98
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.
    """
    GuildCreateServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of GuildCreateServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data GuildCreateServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/guild_create_server_packet.py
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
@staticmethod
def serialize(writer: EoWriter, data: "GuildCreateServerPacket") -> None:
    """
    Serializes an instance of `GuildCreateServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (GuildCreateServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._leader_player_id is None:
            raise SerializationError("leader_player_id must be provided.")
        writer.add_short(data._leader_player_id)
        writer.add_byte(0xFF)
        if data._guild_tag is None:
            raise SerializationError("guild_tag must be provided.")
        writer.add_string(data._guild_tag)
        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._rank_name is None:
            raise SerializationError("rank_name must be provided.")
        writer.add_string(data._rank_name)
        writer.add_byte(0xFF)
        if data._gold_amount is None:
            raise SerializationError("gold_amount must be provided.")
        writer.add_int(data._gold_amount)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of GuildCreateServerPacket 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
GuildCreateServerPacket GuildCreateServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/guild_create_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "GuildCreateServerPacket":
    """
    Deserializes an instance of `GuildCreateServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        GuildCreateServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        leader_player_id = reader.get_short()
        reader.next_chunk()
        guild_tag = reader.get_string()
        reader.next_chunk()
        guild_name = reader.get_string()
        reader.next_chunk()
        rank_name = reader.get_string()
        reader.next_chunk()
        gold_amount = reader.get_int()
        reader.chunked_reading_mode = False
        result = GuildCreateServerPacket(leader_player_id=leader_player_id, guild_tag=guild_tag, guild_name=guild_name, rank_name=rank_name, gold_amount=gold_amount)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

GuildBuyServerPacket

Bases: Packet

Deposit guild bank reply

Source code in src/eolib/protocol/_generated/net/server/guild_buy_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class GuildBuyServerPacket(Packet):
    """
    Deposit guild bank reply
    """
    _byte_size: int = 0
    _gold_amount: int

    def __init__(self, *, gold_amount: int):
        """
        Create a new instance of GuildBuyServerPacket.

        Args:
            gold_amount (int): (Value range is 0-4097152080.)
        """
        self._gold_amount = gold_amount

    @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 gold_amount(self) -> int:
        return self._gold_amount

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Guild

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Buy

    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.
        """
        GuildBuyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "GuildBuyServerPacket") -> None:
        """
        Serializes an instance of `GuildBuyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (GuildBuyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._gold_amount is None:
                raise SerializationError("gold_amount must be provided.")
            writer.add_int(data._gold_amount)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "GuildBuyServerPacket":
        """
        Deserializes an instance of `GuildBuyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            GuildBuyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            gold_amount = reader.get_int()
            result = GuildBuyServerPacket(gold_amount=gold_amount)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"GuildBuyServerPacket(byte_size={repr(self._byte_size)}, gold_amount={repr(self._gold_amount)})"

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.

gold_amount: int property

__init__(*, gold_amount)

Create a new instance of GuildBuyServerPacket.

Parameters:

Name Type Description Default
gold_amount int

(Value range is 0-4097152080.)

required
Source code in src/eolib/protocol/_generated/net/server/guild_buy_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, gold_amount: int):
    """
    Create a new instance of GuildBuyServerPacket.

    Args:
        gold_amount (int): (Value range is 0-4097152080.)
    """
    self._gold_amount = gold_amount

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/guild_buy_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Guild

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/guild_buy_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Buy

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/guild_buy_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    GuildBuyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of GuildBuyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data GuildBuyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/guild_buy_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "GuildBuyServerPacket") -> None:
    """
    Serializes an instance of `GuildBuyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (GuildBuyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._gold_amount is None:
            raise SerializationError("gold_amount must be provided.")
        writer.add_int(data._gold_amount)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of GuildBuyServerPacket 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
GuildBuyServerPacket GuildBuyServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/guild_buy_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "GuildBuyServerPacket":
    """
    Deserializes an instance of `GuildBuyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        GuildBuyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        gold_amount = reader.get_int()
        result = GuildBuyServerPacket(gold_amount=gold_amount)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

GuildAgreeServerPacket

Bases: Packet

Joined guild info

Source code in src/eolib/protocol/_generated/net/server/guild_agree_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
class GuildAgreeServerPacket(Packet):
    """
    Joined guild info
    """
    _byte_size: int = 0
    _recruiter_id: int
    _guild_tag: str
    _guild_name: str
    _rank_name: str

    def __init__(self, *, recruiter_id: int, guild_tag: str, guild_name: str, rank_name: str):
        """
        Create a new instance of GuildAgreeServerPacket.

        Args:
            recruiter_id (int): (Value range is 0-64008.)
            guild_tag (str): 
            guild_name (str): 
            rank_name (str): 
        """
        self._recruiter_id = recruiter_id
        self._guild_tag = guild_tag
        self._guild_name = guild_name
        self._rank_name = rank_name

    @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 recruiter_id(self) -> int:
        return self._recruiter_id

    @property
    def guild_tag(self) -> str:
        return self._guild_tag

    @property
    def guild_name(self) -> str:
        return self._guild_name

    @property
    def rank_name(self) -> str:
        return self._rank_name

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Guild

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Agree

    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.
        """
        GuildAgreeServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "GuildAgreeServerPacket") -> None:
        """
        Serializes an instance of `GuildAgreeServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (GuildAgreeServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._recruiter_id is None:
                raise SerializationError("recruiter_id must be provided.")
            writer.add_short(data._recruiter_id)
            writer.add_byte(0xFF)
            if data._guild_tag is None:
                raise SerializationError("guild_tag must be provided.")
            writer.add_string(data._guild_tag)
            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._rank_name is None:
                raise SerializationError("rank_name must be provided.")
            writer.add_string(data._rank_name)
            writer.add_byte(0xFF)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "GuildAgreeServerPacket":
        """
        Deserializes an instance of `GuildAgreeServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            GuildAgreeServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            recruiter_id = reader.get_short()
            reader.next_chunk()
            guild_tag = reader.get_string()
            reader.next_chunk()
            guild_name = reader.get_string()
            reader.next_chunk()
            rank_name = reader.get_string()
            reader.next_chunk()
            reader.chunked_reading_mode = False
            result = GuildAgreeServerPacket(recruiter_id=recruiter_id, guild_tag=guild_tag, guild_name=guild_name, rank_name=rank_name)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"GuildAgreeServerPacket(byte_size={repr(self._byte_size)}, recruiter_id={repr(self._recruiter_id)}, guild_tag={repr(self._guild_tag)}, guild_name={repr(self._guild_name)}, rank_name={repr(self._rank_name)})"

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.

recruiter_id: int property

guild_tag: str property

guild_name: str property

rank_name: str property

__init__(*, recruiter_id, guild_tag, guild_name, rank_name)

Create a new instance of GuildAgreeServerPacket.

Parameters:

Name Type Description Default
recruiter_id int

(Value range is 0-64008.)

required
guild_tag str
required
guild_name str
required
rank_name str
required
Source code in src/eolib/protocol/_generated/net/server/guild_agree_server_packet.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
def __init__(self, *, recruiter_id: int, guild_tag: str, guild_name: str, rank_name: str):
    """
    Create a new instance of GuildAgreeServerPacket.

    Args:
        recruiter_id (int): (Value range is 0-64008.)
        guild_tag (str): 
        guild_name (str): 
        rank_name (str): 
    """
    self._recruiter_id = recruiter_id
    self._guild_tag = guild_tag
    self._guild_name = guild_name
    self._rank_name = rank_name

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/guild_agree_server_packet.py
64
65
66
67
68
69
70
71
72
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Guild

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/guild_agree_server_packet.py
74
75
76
77
78
79
80
81
82
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Agree

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/guild_agree_server_packet.py
84
85
86
87
88
89
90
91
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.
    """
    GuildAgreeServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of GuildAgreeServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data GuildAgreeServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/guild_agree_server_packet.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "GuildAgreeServerPacket") -> None:
    """
    Serializes an instance of `GuildAgreeServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (GuildAgreeServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._recruiter_id is None:
            raise SerializationError("recruiter_id must be provided.")
        writer.add_short(data._recruiter_id)
        writer.add_byte(0xFF)
        if data._guild_tag is None:
            raise SerializationError("guild_tag must be provided.")
        writer.add_string(data._guild_tag)
        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._rank_name is None:
            raise SerializationError("rank_name must be provided.")
        writer.add_string(data._rank_name)
        writer.add_byte(0xFF)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of GuildAgreeServerPacket 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
GuildAgreeServerPacket GuildAgreeServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/guild_agree_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "GuildAgreeServerPacket":
    """
    Deserializes an instance of `GuildAgreeServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        GuildAgreeServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        recruiter_id = reader.get_short()
        reader.next_chunk()
        guild_tag = reader.get_string()
        reader.next_chunk()
        guild_name = reader.get_string()
        reader.next_chunk()
        rank_name = reader.get_string()
        reader.next_chunk()
        reader.chunked_reading_mode = False
        result = GuildAgreeServerPacket(recruiter_id=recruiter_id, guild_tag=guild_tag, guild_name=guild_name, rank_name=rank_name)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

GuildAcceptServerPacket

Bases: Packet

Update guild rank

Source code in src/eolib/protocol/_generated/net/server/guild_accept_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class GuildAcceptServerPacket(Packet):
    """
    Update guild rank
    """
    _byte_size: int = 0
    _rank: int

    def __init__(self, *, rank: int):
        """
        Create a new instance of GuildAcceptServerPacket.

        Args:
            rank (int): (Value range is 0-252.)
        """
        self._rank = rank

    @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 rank(self) -> int:
        return self._rank

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Guild

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Accept

    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.
        """
        GuildAcceptServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "GuildAcceptServerPacket") -> None:
        """
        Serializes an instance of `GuildAcceptServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (GuildAcceptServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._rank is None:
                raise SerializationError("rank must be provided.")
            writer.add_char(data._rank)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "GuildAcceptServerPacket":
        """
        Deserializes an instance of `GuildAcceptServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            GuildAcceptServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            rank = reader.get_char()
            result = GuildAcceptServerPacket(rank=rank)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"GuildAcceptServerPacket(byte_size={repr(self._byte_size)}, rank={repr(self._rank)})"

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.

rank: int property

__init__(*, rank)

Create a new instance of GuildAcceptServerPacket.

Parameters:

Name Type Description Default
rank int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/guild_accept_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, rank: int):
    """
    Create a new instance of GuildAcceptServerPacket.

    Args:
        rank (int): (Value range is 0-252.)
    """
    self._rank = rank

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/guild_accept_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Guild

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/guild_accept_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Accept

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/guild_accept_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    GuildAcceptServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of GuildAcceptServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data GuildAcceptServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/guild_accept_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "GuildAcceptServerPacket") -> None:
    """
    Serializes an instance of `GuildAcceptServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (GuildAcceptServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._rank is None:
            raise SerializationError("rank must be provided.")
        writer.add_char(data._rank)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of GuildAcceptServerPacket 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
GuildAcceptServerPacket GuildAcceptServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/guild_accept_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "GuildAcceptServerPacket":
    """
    Deserializes an instance of `GuildAcceptServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        GuildAcceptServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        rank = reader.get_char()
        result = GuildAcceptServerPacket(rank=rank)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

GroupHealTargetPlayer

Nearby player hit by a group heal spell

Source code in src/eolib/protocol/_generated/net/server/group_heal_target_player.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
class GroupHealTargetPlayer:
    """
    Nearby player hit by a group heal spell
    """
    _byte_size: int = 0
    _player_id: int
    _hp_percentage: int
    _hp: int

    def __init__(self, *, player_id: int, hp_percentage: int, hp: int):
        """
        Create a new instance of GroupHealTargetPlayer.

        Args:
            player_id (int): (Value range is 0-64008.)
            hp_percentage (int): (Value range is 0-252.)
            hp (int): (Value range is 0-64008.)
        """
        self._player_id = player_id
        self._hp_percentage = hp_percentage
        self._hp = hp

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def hp_percentage(self) -> int:
        return self._hp_percentage

    @property
    def hp(self) -> int:
        return self._hp

    @staticmethod
    def serialize(writer: EoWriter, data: "GroupHealTargetPlayer") -> None:
        """
        Serializes an instance of `GroupHealTargetPlayer` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (GroupHealTargetPlayer): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._hp_percentage is None:
                raise SerializationError("hp_percentage must be provided.")
            writer.add_char(data._hp_percentage)
            if data._hp is None:
                raise SerializationError("hp must be provided.")
            writer.add_short(data._hp)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "GroupHealTargetPlayer":
        """
        Deserializes an instance of `GroupHealTargetPlayer` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            GroupHealTargetPlayer: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            hp_percentage = reader.get_char()
            hp = reader.get_short()
            result = GroupHealTargetPlayer(player_id=player_id, hp_percentage=hp_percentage, hp=hp)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"GroupHealTargetPlayer(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, hp_percentage={repr(self._hp_percentage)}, hp={repr(self._hp)})"

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.

player_id: int property

hp_percentage: int property

hp: int property

__init__(*, player_id, hp_percentage, hp)

Create a new instance of GroupHealTargetPlayer.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
hp_percentage int

(Value range is 0-252.)

required
hp int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/group_heal_target_player.py
19
20
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, player_id: int, hp_percentage: int, hp: int):
    """
    Create a new instance of GroupHealTargetPlayer.

    Args:
        player_id (int): (Value range is 0-64008.)
        hp_percentage (int): (Value range is 0-252.)
        hp (int): (Value range is 0-64008.)
    """
    self._player_id = player_id
    self._hp_percentage = hp_percentage
    self._hp = hp

serialize(writer, data) staticmethod

Serializes an instance of GroupHealTargetPlayer to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data GroupHealTargetPlayer

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/group_heal_target_player.py
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@staticmethod
def serialize(writer: EoWriter, data: "GroupHealTargetPlayer") -> None:
    """
    Serializes an instance of `GroupHealTargetPlayer` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (GroupHealTargetPlayer): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._hp_percentage is None:
            raise SerializationError("hp_percentage must be provided.")
        writer.add_char(data._hp_percentage)
        if data._hp is None:
            raise SerializationError("hp must be provided.")
        writer.add_short(data._hp)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of GroupHealTargetPlayer 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
GroupHealTargetPlayer GroupHealTargetPlayer

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/group_heal_target_player.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@staticmethod
def deserialize(reader: EoReader) -> "GroupHealTargetPlayer":
    """
    Deserializes an instance of `GroupHealTargetPlayer` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        GroupHealTargetPlayer: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        hp_percentage = reader.get_char()
        hp = reader.get_short()
        result = GroupHealTargetPlayer(player_id=player_id, hp_percentage=hp_percentage, hp=hp)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

GlobalBackfillMessage

A backfilled global chat message

Source code in src/eolib/protocol/_generated/net/server/global_backfill_message.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
class GlobalBackfillMessage:
    """
    A backfilled global chat message
    """
    _byte_size: int = 0
    _player_name: str
    _message: str

    def __init__(self, *, player_name: str, message: str):
        """
        Create a new instance of GlobalBackfillMessage.

        Args:
            player_name (str): 
            message (str): 
        """
        self._player_name = player_name
        self._message = message

    @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 player_name(self) -> str:
        return self._player_name

    @property
    def message(self) -> str:
        return self._message

    @staticmethod
    def serialize(writer: EoWriter, data: "GlobalBackfillMessage") -> None:
        """
        Serializes an instance of `GlobalBackfillMessage` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (GlobalBackfillMessage): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._player_name is None:
                raise SerializationError("player_name must be provided.")
            writer.add_string(data._player_name)
            writer.add_byte(0xFF)
            if data._message is None:
                raise SerializationError("message must be provided.")
            writer.add_string(data._message)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "GlobalBackfillMessage":
        """
        Deserializes an instance of `GlobalBackfillMessage` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            GlobalBackfillMessage: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            player_name = reader.get_string()
            reader.next_chunk()
            message = reader.get_string()
            reader.chunked_reading_mode = False
            result = GlobalBackfillMessage(player_name=player_name, message=message)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"GlobalBackfillMessage(byte_size={repr(self._byte_size)}, player_name={repr(self._player_name)}, message={repr(self._message)})"

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.

player_name: str property

message: str property

__init__(*, player_name, message)

Create a new instance of GlobalBackfillMessage.

Parameters:

Name Type Description Default
player_name str
required
message str
required
Source code in src/eolib/protocol/_generated/net/server/global_backfill_message.py
18
19
20
21
22
23
24
25
26
27
def __init__(self, *, player_name: str, message: str):
    """
    Create a new instance of GlobalBackfillMessage.

    Args:
        player_name (str): 
        message (str): 
    """
    self._player_name = player_name
    self._message = message

serialize(writer, data) staticmethod

Serializes an instance of GlobalBackfillMessage to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data GlobalBackfillMessage

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/global_backfill_message.py
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
@staticmethod
def serialize(writer: EoWriter, data: "GlobalBackfillMessage") -> None:
    """
    Serializes an instance of `GlobalBackfillMessage` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (GlobalBackfillMessage): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._player_name is None:
            raise SerializationError("player_name must be provided.")
        writer.add_string(data._player_name)
        writer.add_byte(0xFF)
        if data._message is None:
            raise SerializationError("message must be provided.")
        writer.add_string(data._message)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of GlobalBackfillMessage 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
GlobalBackfillMessage GlobalBackfillMessage

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/global_backfill_message.py
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
@staticmethod
def deserialize(reader: EoReader) -> "GlobalBackfillMessage":
    """
    Deserializes an instance of `GlobalBackfillMessage` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        GlobalBackfillMessage: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        player_name = reader.get_string()
        reader.next_chunk()
        message = reader.get_string()
        reader.chunked_reading_mode = False
        result = GlobalBackfillMessage(player_name=player_name, message=message)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

FacePlayerServerPacket

Bases: Packet

Nearby player facing a direction

Source code in src/eolib/protocol/_generated/net/server/face_player_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class FacePlayerServerPacket(Packet):
    """
    Nearby player facing a direction
    """
    _byte_size: int = 0
    _player_id: int
    _direction: Direction

    def __init__(self, *, player_id: int, direction: Direction):
        """
        Create a new instance of FacePlayerServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            direction (Direction): 
        """
        self._player_id = player_id
        self._direction = direction

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def direction(self) -> Direction:
        return self._direction

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Face

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Player

    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.
        """
        FacePlayerServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "FacePlayerServerPacket") -> None:
        """
        Serializes an instance of `FacePlayerServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (FacePlayerServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._direction is None:
                raise SerializationError("direction must be provided.")
            writer.add_char(int(data._direction))
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "FacePlayerServerPacket":
        """
        Deserializes an instance of `FacePlayerServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            FacePlayerServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            direction = Direction(reader.get_char())
            result = FacePlayerServerPacket(player_id=player_id, direction=direction)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"FacePlayerServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, direction={repr(self._direction)})"

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.

player_id: int property

direction: Direction property

__init__(*, player_id, direction)

Create a new instance of FacePlayerServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
direction Direction
required
Source code in src/eolib/protocol/_generated/net/server/face_player_server_packet.py
22
23
24
25
26
27
28
29
30
31
def __init__(self, *, player_id: int, direction: Direction):
    """
    Create a new instance of FacePlayerServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        direction (Direction): 
    """
    self._player_id = player_id
    self._direction = direction

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/face_player_server_packet.py
51
52
53
54
55
56
57
58
59
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Face

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/face_player_server_packet.py
61
62
63
64
65
66
67
68
69
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Player

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/face_player_server_packet.py
71
72
73
74
75
76
77
78
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.
    """
    FacePlayerServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of FacePlayerServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data FacePlayerServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/face_player_server_packet.py
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@staticmethod
def serialize(writer: EoWriter, data: "FacePlayerServerPacket") -> None:
    """
    Serializes an instance of `FacePlayerServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (FacePlayerServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._direction is None:
            raise SerializationError("direction must be provided.")
        writer.add_char(int(data._direction))
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of FacePlayerServerPacket 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
FacePlayerServerPacket FacePlayerServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/face_player_server_packet.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@staticmethod
def deserialize(reader: EoReader) -> "FacePlayerServerPacket":
    """
    Deserializes an instance of `FacePlayerServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        FacePlayerServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        direction = Direction(reader.get_char())
        result = FacePlayerServerPacket(player_id=player_id, direction=direction)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

EquipmentWelcome

Player equipment data. Sent upon selecting a character and entering the game. Note that these values are item IDs.

Source code in src/eolib/protocol/_generated/net/server/equipment_welcome.py
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
class EquipmentWelcome:
    """
    Player equipment data.
    Sent upon selecting a character and entering the game.
    Note that these values are item IDs.
    """
    _byte_size: int = 0
    _boots: int
    _gloves: int
    _accessory: int
    _armor: int
    _belt: int
    _necklace: int
    _hat: int
    _shield: int
    _weapon: int
    _ring: tuple[int, ...]
    _armlet: tuple[int, ...]
    _bracer: tuple[int, ...]

    def __init__(self, *, boots: int, gloves: int, accessory: int, armor: int, belt: int, necklace: int, hat: int, shield: int, weapon: int, ring: Iterable[int], armlet: Iterable[int], bracer: Iterable[int]):
        """
        Create a new instance of EquipmentWelcome.

        Args:
            boots (int): (Value range is 0-64008.)
            gloves (int): (Value range is 0-64008.)
            accessory (int): (Value range is 0-64008.)
            armor (int): (Value range is 0-64008.)
            belt (int): (Value range is 0-64008.)
            necklace (int): (Value range is 0-64008.)
            hat (int): (Value range is 0-64008.)
            shield (int): (Value range is 0-64008.)
            weapon (int): (Value range is 0-64008.)
            ring (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
            armlet (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
            bracer (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
        """
        self._boots = boots
        self._gloves = gloves
        self._accessory = accessory
        self._armor = armor
        self._belt = belt
        self._necklace = necklace
        self._hat = hat
        self._shield = shield
        self._weapon = weapon
        self._ring = tuple(ring)
        self._armlet = tuple(armlet)
        self._bracer = tuple(bracer)

    @property
    def byte_size(self) -> int:
        """
        Returns the size of the data that this was deserialized from.

        Returns:
            int: The size of the data that this was deserialized from.
        """
        return self._byte_size

    @property
    def boots(self) -> int:
        return self._boots

    @property
    def gloves(self) -> int:
        return self._gloves

    @property
    def accessory(self) -> int:
        return self._accessory

    @property
    def armor(self) -> int:
        return self._armor

    @property
    def belt(self) -> int:
        return self._belt

    @property
    def necklace(self) -> int:
        return self._necklace

    @property
    def hat(self) -> int:
        return self._hat

    @property
    def shield(self) -> int:
        return self._shield

    @property
    def weapon(self) -> int:
        return self._weapon

    @property
    def ring(self) -> tuple[int, ...]:
        return self._ring

    @property
    def armlet(self) -> tuple[int, ...]:
        return self._armlet

    @property
    def bracer(self) -> tuple[int, ...]:
        return self._bracer

    @staticmethod
    def serialize(writer: EoWriter, data: "EquipmentWelcome") -> None:
        """
        Serializes an instance of `EquipmentWelcome` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (EquipmentWelcome): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._boots is None:
                raise SerializationError("boots must be provided.")
            writer.add_short(data._boots)
            if data._gloves is None:
                raise SerializationError("gloves must be provided.")
            writer.add_short(data._gloves)
            if data._accessory is None:
                raise SerializationError("accessory must be provided.")
            writer.add_short(data._accessory)
            if data._armor is None:
                raise SerializationError("armor must be provided.")
            writer.add_short(data._armor)
            if data._belt is None:
                raise SerializationError("belt must be provided.")
            writer.add_short(data._belt)
            if data._necklace is None:
                raise SerializationError("necklace must be provided.")
            writer.add_short(data._necklace)
            if data._hat is None:
                raise SerializationError("hat must be provided.")
            writer.add_short(data._hat)
            if data._shield is None:
                raise SerializationError("shield must be provided.")
            writer.add_short(data._shield)
            if data._weapon is None:
                raise SerializationError("weapon must be provided.")
            writer.add_short(data._weapon)
            if data._ring is None:
                raise SerializationError("ring must be provided.")
            if len(data._ring) != 2:
                raise SerializationError(f"Expected length of ring to be exactly 2, got {len(data._ring)}.")
            for i in range(2):
                writer.add_short(data._ring[i])
            if data._armlet is None:
                raise SerializationError("armlet must be provided.")
            if len(data._armlet) != 2:
                raise SerializationError(f"Expected length of armlet to be exactly 2, got {len(data._armlet)}.")
            for i in range(2):
                writer.add_short(data._armlet[i])
            if data._bracer is None:
                raise SerializationError("bracer must be provided.")
            if len(data._bracer) != 2:
                raise SerializationError(f"Expected length of bracer to be exactly 2, got {len(data._bracer)}.")
            for i in range(2):
                writer.add_short(data._bracer[i])
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "EquipmentWelcome":
        """
        Deserializes an instance of `EquipmentWelcome` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            EquipmentWelcome: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            boots = reader.get_short()
            gloves = reader.get_short()
            accessory = reader.get_short()
            armor = reader.get_short()
            belt = reader.get_short()
            necklace = reader.get_short()
            hat = reader.get_short()
            shield = reader.get_short()
            weapon = reader.get_short()
            ring = []
            for i in range(2):
                ring.append(reader.get_short())
            armlet = []
            for i in range(2):
                armlet.append(reader.get_short())
            bracer = []
            for i in range(2):
                bracer.append(reader.get_short())
            result = EquipmentWelcome(boots=boots, gloves=gloves, accessory=accessory, armor=armor, belt=belt, necklace=necklace, hat=hat, shield=shield, weapon=weapon, ring=ring, armlet=armlet, bracer=bracer)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"EquipmentWelcome(byte_size={repr(self._byte_size)}, boots={repr(self._boots)}, gloves={repr(self._gloves)}, accessory={repr(self._accessory)}, armor={repr(self._armor)}, belt={repr(self._belt)}, necklace={repr(self._necklace)}, hat={repr(self._hat)}, shield={repr(self._shield)}, weapon={repr(self._weapon)}, ring={repr(self._ring)}, armlet={repr(self._armlet)}, bracer={repr(self._bracer)})"

byte_size: int property

Returns the size of the data that this was deserialized from.

Returns:

Name Type Description
int int

The size of the data that this was deserialized from.

boots: int property

gloves: int property

accessory: int property

armor: int property

belt: int property

necklace: int property

hat: int property

shield: int property

weapon: int property

ring: tuple[int, ...] property

armlet: tuple[int, ...] property

bracer: tuple[int, ...] property

__init__(*, boots, gloves, accessory, armor, belt, necklace, hat, shield, weapon, ring, armlet, bracer)

Create a new instance of EquipmentWelcome.

Parameters:

Name Type Description Default
boots int

(Value range is 0-64008.)

required
gloves int

(Value range is 0-64008.)

required
accessory int

(Value range is 0-64008.)

required
armor int

(Value range is 0-64008.)

required
belt int

(Value range is 0-64008.)

required
necklace int

(Value range is 0-64008.)

required
hat int

(Value range is 0-64008.)

required
shield int

(Value range is 0-64008.)

required
weapon int

(Value range is 0-64008.)

required
ring Iterable[int]

(Length must be 2.) (Element value range is 0-64008.)

required
armlet Iterable[int]

(Length must be 2.) (Element value range is 0-64008.)

required
bracer Iterable[int]

(Length must be 2.) (Element value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/equipment_welcome.py
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
def __init__(self, *, boots: int, gloves: int, accessory: int, armor: int, belt: int, necklace: int, hat: int, shield: int, weapon: int, ring: Iterable[int], armlet: Iterable[int], bracer: Iterable[int]):
    """
    Create a new instance of EquipmentWelcome.

    Args:
        boots (int): (Value range is 0-64008.)
        gloves (int): (Value range is 0-64008.)
        accessory (int): (Value range is 0-64008.)
        armor (int): (Value range is 0-64008.)
        belt (int): (Value range is 0-64008.)
        necklace (int): (Value range is 0-64008.)
        hat (int): (Value range is 0-64008.)
        shield (int): (Value range is 0-64008.)
        weapon (int): (Value range is 0-64008.)
        ring (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
        armlet (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
        bracer (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
    """
    self._boots = boots
    self._gloves = gloves
    self._accessory = accessory
    self._armor = armor
    self._belt = belt
    self._necklace = necklace
    self._hat = hat
    self._shield = shield
    self._weapon = weapon
    self._ring = tuple(ring)
    self._armlet = tuple(armlet)
    self._bracer = tuple(bracer)

serialize(writer, data) staticmethod

Serializes an instance of EquipmentWelcome to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data EquipmentWelcome

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/equipment_welcome.py
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
@staticmethod
def serialize(writer: EoWriter, data: "EquipmentWelcome") -> None:
    """
    Serializes an instance of `EquipmentWelcome` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (EquipmentWelcome): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._boots is None:
            raise SerializationError("boots must be provided.")
        writer.add_short(data._boots)
        if data._gloves is None:
            raise SerializationError("gloves must be provided.")
        writer.add_short(data._gloves)
        if data._accessory is None:
            raise SerializationError("accessory must be provided.")
        writer.add_short(data._accessory)
        if data._armor is None:
            raise SerializationError("armor must be provided.")
        writer.add_short(data._armor)
        if data._belt is None:
            raise SerializationError("belt must be provided.")
        writer.add_short(data._belt)
        if data._necklace is None:
            raise SerializationError("necklace must be provided.")
        writer.add_short(data._necklace)
        if data._hat is None:
            raise SerializationError("hat must be provided.")
        writer.add_short(data._hat)
        if data._shield is None:
            raise SerializationError("shield must be provided.")
        writer.add_short(data._shield)
        if data._weapon is None:
            raise SerializationError("weapon must be provided.")
        writer.add_short(data._weapon)
        if data._ring is None:
            raise SerializationError("ring must be provided.")
        if len(data._ring) != 2:
            raise SerializationError(f"Expected length of ring to be exactly 2, got {len(data._ring)}.")
        for i in range(2):
            writer.add_short(data._ring[i])
        if data._armlet is None:
            raise SerializationError("armlet must be provided.")
        if len(data._armlet) != 2:
            raise SerializationError(f"Expected length of armlet to be exactly 2, got {len(data._armlet)}.")
        for i in range(2):
            writer.add_short(data._armlet[i])
        if data._bracer is None:
            raise SerializationError("bracer must be provided.")
        if len(data._bracer) != 2:
            raise SerializationError(f"Expected length of bracer to be exactly 2, got {len(data._bracer)}.")
        for i in range(2):
            writer.add_short(data._bracer[i])
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of EquipmentWelcome 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
EquipmentWelcome 'EquipmentWelcome'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/equipment_welcome.py
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
@staticmethod
def deserialize(reader: EoReader) -> "EquipmentWelcome":
    """
    Deserializes an instance of `EquipmentWelcome` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        EquipmentWelcome: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        boots = reader.get_short()
        gloves = reader.get_short()
        accessory = reader.get_short()
        armor = reader.get_short()
        belt = reader.get_short()
        necklace = reader.get_short()
        hat = reader.get_short()
        shield = reader.get_short()
        weapon = reader.get_short()
        ring = []
        for i in range(2):
            ring.append(reader.get_short())
        armlet = []
        for i in range(2):
            armlet.append(reader.get_short())
        bracer = []
        for i in range(2):
            bracer.append(reader.get_short())
        result = EquipmentWelcome(boots=boots, gloves=gloves, accessory=accessory, armor=armor, belt=belt, necklace=necklace, hat=hat, shield=shield, weapon=weapon, ring=ring, armlet=armlet, bracer=bracer)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

EquipmentPaperdoll

Player equipment data. Sent with information about a player's paperdoll. Note that these values are item IDs.

Source code in src/eolib/protocol/_generated/net/server/equipment_paperdoll.py
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
class EquipmentPaperdoll:
    """
    Player equipment data.
    Sent with information about a player's paperdoll.
    Note that these values are item IDs.
    """
    _byte_size: int = 0
    _boots: int
    _accessory: int
    _gloves: int
    _belt: int
    _armor: int
    _necklace: int
    _hat: int
    _shield: int
    _weapon: int
    _ring: tuple[int, ...]
    _armlet: tuple[int, ...]
    _bracer: tuple[int, ...]

    def __init__(self, *, boots: int, accessory: int, gloves: int, belt: int, armor: int, necklace: int, hat: int, shield: int, weapon: int, ring: Iterable[int], armlet: Iterable[int], bracer: Iterable[int]):
        """
        Create a new instance of EquipmentPaperdoll.

        Args:
            boots (int): (Value range is 0-64008.)
            accessory (int): (Value range is 0-64008.)
            gloves (int): (Value range is 0-64008.)
            belt (int): (Value range is 0-64008.)
            armor (int): (Value range is 0-64008.)
            necklace (int): (Value range is 0-64008.)
            hat (int): (Value range is 0-64008.)
            shield (int): (Value range is 0-64008.)
            weapon (int): (Value range is 0-64008.)
            ring (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
            armlet (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
            bracer (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
        """
        self._boots = boots
        self._accessory = accessory
        self._gloves = gloves
        self._belt = belt
        self._armor = armor
        self._necklace = necklace
        self._hat = hat
        self._shield = shield
        self._weapon = weapon
        self._ring = tuple(ring)
        self._armlet = tuple(armlet)
        self._bracer = tuple(bracer)

    @property
    def byte_size(self) -> int:
        """
        Returns the size of the data that this was deserialized from.

        Returns:
            int: The size of the data that this was deserialized from.
        """
        return self._byte_size

    @property
    def boots(self) -> int:
        return self._boots

    @property
    def accessory(self) -> int:
        return self._accessory

    @property
    def gloves(self) -> int:
        return self._gloves

    @property
    def belt(self) -> int:
        return self._belt

    @property
    def armor(self) -> int:
        return self._armor

    @property
    def necklace(self) -> int:
        return self._necklace

    @property
    def hat(self) -> int:
        return self._hat

    @property
    def shield(self) -> int:
        return self._shield

    @property
    def weapon(self) -> int:
        return self._weapon

    @property
    def ring(self) -> tuple[int, ...]:
        return self._ring

    @property
    def armlet(self) -> tuple[int, ...]:
        return self._armlet

    @property
    def bracer(self) -> tuple[int, ...]:
        return self._bracer

    @staticmethod
    def serialize(writer: EoWriter, data: "EquipmentPaperdoll") -> None:
        """
        Serializes an instance of `EquipmentPaperdoll` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (EquipmentPaperdoll): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._boots is None:
                raise SerializationError("boots must be provided.")
            writer.add_short(data._boots)
            if data._accessory is None:
                raise SerializationError("accessory must be provided.")
            writer.add_short(data._accessory)
            if data._gloves is None:
                raise SerializationError("gloves must be provided.")
            writer.add_short(data._gloves)
            if data._belt is None:
                raise SerializationError("belt must be provided.")
            writer.add_short(data._belt)
            if data._armor is None:
                raise SerializationError("armor must be provided.")
            writer.add_short(data._armor)
            if data._necklace is None:
                raise SerializationError("necklace must be provided.")
            writer.add_short(data._necklace)
            if data._hat is None:
                raise SerializationError("hat must be provided.")
            writer.add_short(data._hat)
            if data._shield is None:
                raise SerializationError("shield must be provided.")
            writer.add_short(data._shield)
            if data._weapon is None:
                raise SerializationError("weapon must be provided.")
            writer.add_short(data._weapon)
            if data._ring is None:
                raise SerializationError("ring must be provided.")
            if len(data._ring) != 2:
                raise SerializationError(f"Expected length of ring to be exactly 2, got {len(data._ring)}.")
            for i in range(2):
                writer.add_short(data._ring[i])
            if data._armlet is None:
                raise SerializationError("armlet must be provided.")
            if len(data._armlet) != 2:
                raise SerializationError(f"Expected length of armlet to be exactly 2, got {len(data._armlet)}.")
            for i in range(2):
                writer.add_short(data._armlet[i])
            if data._bracer is None:
                raise SerializationError("bracer must be provided.")
            if len(data._bracer) != 2:
                raise SerializationError(f"Expected length of bracer to be exactly 2, got {len(data._bracer)}.")
            for i in range(2):
                writer.add_short(data._bracer[i])
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "EquipmentPaperdoll":
        """
        Deserializes an instance of `EquipmentPaperdoll` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            EquipmentPaperdoll: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            boots = reader.get_short()
            accessory = reader.get_short()
            gloves = reader.get_short()
            belt = reader.get_short()
            armor = reader.get_short()
            necklace = reader.get_short()
            hat = reader.get_short()
            shield = reader.get_short()
            weapon = reader.get_short()
            ring = []
            for i in range(2):
                ring.append(reader.get_short())
            armlet = []
            for i in range(2):
                armlet.append(reader.get_short())
            bracer = []
            for i in range(2):
                bracer.append(reader.get_short())
            result = EquipmentPaperdoll(boots=boots, accessory=accessory, gloves=gloves, belt=belt, armor=armor, necklace=necklace, hat=hat, shield=shield, weapon=weapon, ring=ring, armlet=armlet, bracer=bracer)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"EquipmentPaperdoll(byte_size={repr(self._byte_size)}, boots={repr(self._boots)}, accessory={repr(self._accessory)}, gloves={repr(self._gloves)}, belt={repr(self._belt)}, armor={repr(self._armor)}, necklace={repr(self._necklace)}, hat={repr(self._hat)}, shield={repr(self._shield)}, weapon={repr(self._weapon)}, ring={repr(self._ring)}, armlet={repr(self._armlet)}, bracer={repr(self._bracer)})"

byte_size: int property

Returns the size of the data that this was deserialized from.

Returns:

Name Type Description
int int

The size of the data that this was deserialized from.

boots: int property

accessory: int property

gloves: int property

belt: int property

armor: int property

necklace: int property

hat: int property

shield: int property

weapon: int property

ring: tuple[int, ...] property

armlet: tuple[int, ...] property

bracer: tuple[int, ...] property

__init__(*, boots, accessory, gloves, belt, armor, necklace, hat, shield, weapon, ring, armlet, bracer)

Create a new instance of EquipmentPaperdoll.

Parameters:

Name Type Description Default
boots int

(Value range is 0-64008.)

required
accessory int

(Value range is 0-64008.)

required
gloves int

(Value range is 0-64008.)

required
belt int

(Value range is 0-64008.)

required
armor int

(Value range is 0-64008.)

required
necklace int

(Value range is 0-64008.)

required
hat int

(Value range is 0-64008.)

required
shield int

(Value range is 0-64008.)

required
weapon int

(Value range is 0-64008.)

required
ring Iterable[int]

(Length must be 2.) (Element value range is 0-64008.)

required
armlet Iterable[int]

(Length must be 2.) (Element value range is 0-64008.)

required
bracer Iterable[int]

(Length must be 2.) (Element value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/equipment_paperdoll.py
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
def __init__(self, *, boots: int, accessory: int, gloves: int, belt: int, armor: int, necklace: int, hat: int, shield: int, weapon: int, ring: Iterable[int], armlet: Iterable[int], bracer: Iterable[int]):
    """
    Create a new instance of EquipmentPaperdoll.

    Args:
        boots (int): (Value range is 0-64008.)
        accessory (int): (Value range is 0-64008.)
        gloves (int): (Value range is 0-64008.)
        belt (int): (Value range is 0-64008.)
        armor (int): (Value range is 0-64008.)
        necklace (int): (Value range is 0-64008.)
        hat (int): (Value range is 0-64008.)
        shield (int): (Value range is 0-64008.)
        weapon (int): (Value range is 0-64008.)
        ring (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
        armlet (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
        bracer (Iterable[int]): (Length must be `2`.) (Element value range is 0-64008.)
    """
    self._boots = boots
    self._accessory = accessory
    self._gloves = gloves
    self._belt = belt
    self._armor = armor
    self._necklace = necklace
    self._hat = hat
    self._shield = shield
    self._weapon = weapon
    self._ring = tuple(ring)
    self._armlet = tuple(armlet)
    self._bracer = tuple(bracer)

serialize(writer, data) staticmethod

Serializes an instance of EquipmentPaperdoll to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data EquipmentPaperdoll

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/equipment_paperdoll.py
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
@staticmethod
def serialize(writer: EoWriter, data: "EquipmentPaperdoll") -> None:
    """
    Serializes an instance of `EquipmentPaperdoll` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (EquipmentPaperdoll): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._boots is None:
            raise SerializationError("boots must be provided.")
        writer.add_short(data._boots)
        if data._accessory is None:
            raise SerializationError("accessory must be provided.")
        writer.add_short(data._accessory)
        if data._gloves is None:
            raise SerializationError("gloves must be provided.")
        writer.add_short(data._gloves)
        if data._belt is None:
            raise SerializationError("belt must be provided.")
        writer.add_short(data._belt)
        if data._armor is None:
            raise SerializationError("armor must be provided.")
        writer.add_short(data._armor)
        if data._necklace is None:
            raise SerializationError("necklace must be provided.")
        writer.add_short(data._necklace)
        if data._hat is None:
            raise SerializationError("hat must be provided.")
        writer.add_short(data._hat)
        if data._shield is None:
            raise SerializationError("shield must be provided.")
        writer.add_short(data._shield)
        if data._weapon is None:
            raise SerializationError("weapon must be provided.")
        writer.add_short(data._weapon)
        if data._ring is None:
            raise SerializationError("ring must be provided.")
        if len(data._ring) != 2:
            raise SerializationError(f"Expected length of ring to be exactly 2, got {len(data._ring)}.")
        for i in range(2):
            writer.add_short(data._ring[i])
        if data._armlet is None:
            raise SerializationError("armlet must be provided.")
        if len(data._armlet) != 2:
            raise SerializationError(f"Expected length of armlet to be exactly 2, got {len(data._armlet)}.")
        for i in range(2):
            writer.add_short(data._armlet[i])
        if data._bracer is None:
            raise SerializationError("bracer must be provided.")
        if len(data._bracer) != 2:
            raise SerializationError(f"Expected length of bracer to be exactly 2, got {len(data._bracer)}.")
        for i in range(2):
            writer.add_short(data._bracer[i])
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of EquipmentPaperdoll from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Name Type Description
EquipmentPaperdoll 'EquipmentPaperdoll'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/equipment_paperdoll.py
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
@staticmethod
def deserialize(reader: EoReader) -> "EquipmentPaperdoll":
    """
    Deserializes an instance of `EquipmentPaperdoll` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        EquipmentPaperdoll: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        boots = reader.get_short()
        accessory = reader.get_short()
        gloves = reader.get_short()
        belt = reader.get_short()
        armor = reader.get_short()
        necklace = reader.get_short()
        hat = reader.get_short()
        shield = reader.get_short()
        weapon = reader.get_short()
        ring = []
        for i in range(2):
            ring.append(reader.get_short())
        armlet = []
        for i in range(2):
            armlet.append(reader.get_short())
        bracer = []
        for i in range(2):
            bracer.append(reader.get_short())
        result = EquipmentPaperdoll(boots=boots, accessory=accessory, gloves=gloves, belt=belt, armor=armor, necklace=necklace, hat=hat, shield=shield, weapon=weapon, ring=ring, armlet=armlet, bracer=bracer)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

Emote

Bases: IntEnum

Emote that can be played over a player's head

Source code in src/eolib/protocol/_generated/emote.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class Emote(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Emote that can be played over a player's head
    """
    Happy = 1
    Depressed = 2
    Sad = 3
    Angry = 4
    Confused = 5
    Surprised = 6
    Hearts = 7
    Moon = 8
    Suicidal = 9
    Embarrassed = 10
    Drunk = 11
    Trade = 12
    LevelUp = 13
    Playful = 14

Happy = 1 class-attribute instance-attribute

Depressed = 2 class-attribute instance-attribute

Sad = 3 class-attribute instance-attribute

Angry = 4 class-attribute instance-attribute

Confused = 5 class-attribute instance-attribute

Surprised = 6 class-attribute instance-attribute

Hearts = 7 class-attribute instance-attribute

Moon = 8 class-attribute instance-attribute

Suicidal = 9 class-attribute instance-attribute

Embarrassed = 10 class-attribute instance-attribute

Drunk = 11 class-attribute instance-attribute

Trade = 12 class-attribute instance-attribute

LevelUp = 13 class-attribute instance-attribute

Playful = 14 class-attribute instance-attribute

EmotePlayerServerPacket

Bases: Packet

Nearby player doing an emote

Source code in src/eolib/protocol/_generated/net/server/emote_player_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class EmotePlayerServerPacket(Packet):
    """
    Nearby player doing an emote
    """
    _byte_size: int = 0
    _player_id: int
    _emote: Emote

    def __init__(self, *, player_id: int, emote: Emote):
        """
        Create a new instance of EmotePlayerServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            emote (Emote): 
        """
        self._player_id = player_id
        self._emote = emote

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def emote(self) -> Emote:
        return self._emote

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Emote

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Player

    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.
        """
        EmotePlayerServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "EmotePlayerServerPacket") -> None:
        """
        Serializes an instance of `EmotePlayerServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (EmotePlayerServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._emote is None:
                raise SerializationError("emote must be provided.")
            writer.add_char(int(data._emote))
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "EmotePlayerServerPacket":
        """
        Deserializes an instance of `EmotePlayerServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            EmotePlayerServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            emote = Emote(reader.get_char())
            result = EmotePlayerServerPacket(player_id=player_id, emote=emote)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"EmotePlayerServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, emote={repr(self._emote)})"

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.

player_id: int property

emote: Emote property

__init__(*, player_id, emote)

Create a new instance of EmotePlayerServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
emote Emote
required
Source code in src/eolib/protocol/_generated/net/server/emote_player_server_packet.py
22
23
24
25
26
27
28
29
30
31
def __init__(self, *, player_id: int, emote: Emote):
    """
    Create a new instance of EmotePlayerServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        emote (Emote): 
    """
    self._player_id = player_id
    self._emote = emote

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/emote_player_server_packet.py
51
52
53
54
55
56
57
58
59
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Emote

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/emote_player_server_packet.py
61
62
63
64
65
66
67
68
69
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Player

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/emote_player_server_packet.py
71
72
73
74
75
76
77
78
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.
    """
    EmotePlayerServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of EmotePlayerServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data EmotePlayerServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/emote_player_server_packet.py
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@staticmethod
def serialize(writer: EoWriter, data: "EmotePlayerServerPacket") -> None:
    """
    Serializes an instance of `EmotePlayerServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (EmotePlayerServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._emote is None:
            raise SerializationError("emote must be provided.")
        writer.add_char(int(data._emote))
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of EmotePlayerServerPacket 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
EmotePlayerServerPacket EmotePlayerServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/emote_player_server_packet.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@staticmethod
def deserialize(reader: EoReader) -> "EmotePlayerServerPacket":
    """
    Deserializes an instance of `EmotePlayerServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        EmotePlayerServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        emote = Emote(reader.get_char())
        result = EmotePlayerServerPacket(player_id=player_id, emote=emote)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

MapEffect

Bases: IntEnum

An effect that occurs for all players on a map

Source code in src/eolib/protocol/_generated/net/server/map_effect.py
 9
10
11
12
13
class MapEffect(IntEnum, metaclass=ProtocolEnumMeta):
    """
    An effect that occurs for all players on a map
    """
    Quake = 1

Quake = 1 class-attribute instance-attribute

EffectUseServerPacket

Bases: Packet

Map effect

Source code in src/eolib/protocol/_generated/net/server/effect_use_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
class EffectUseServerPacket(Packet):
    """
    Map effect
    """
    _byte_size: int = 0
    _effect: MapEffect
    _effect_data: 'EffectUseServerPacket.EffectData'

    def __init__(self, *, effect: MapEffect, effect_data: 'EffectUseServerPacket.EffectData' = None):
        """
        Create a new instance of EffectUseServerPacket.

        Args:
            effect (MapEffect): 
            effect_data (EffectUseServerPacket.EffectData): Data associated with the `effect` field.
        """
        self._effect = effect
        self._effect_data = effect_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 effect(self) -> MapEffect:
        return self._effect

    @property
    def effect_data(self) -> 'EffectUseServerPacket.EffectData':
        """
        EffectUseServerPacket.EffectData: Data associated with the `effect` field.
        """
        return self._effect_data

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Effect

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Use

    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.
        """
        EffectUseServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "EffectUseServerPacket") -> None:
        """
        Serializes an instance of `EffectUseServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (EffectUseServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._effect is None:
                raise SerializationError("effect must be provided.")
            writer.add_char(int(data._effect))
            if data._effect == MapEffect.Quake:
                if not isinstance(data._effect_data, EffectUseServerPacket.EffectDataQuake):
                    raise SerializationError("Expected effect_data to be type EffectUseServerPacket.EffectDataQuake for effect " + MapEffect(data._effect).name + ".")
                EffectUseServerPacket.EffectDataQuake.serialize(writer, data._effect_data)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "EffectUseServerPacket":
        """
        Deserializes an instance of `EffectUseServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            EffectUseServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            effect = MapEffect(reader.get_char())
            effect_data: EffectUseServerPacket.EffectData = None
            if effect == MapEffect.Quake:
                effect_data = EffectUseServerPacket.EffectDataQuake.deserialize(reader)
            result = EffectUseServerPacket(effect=effect, effect_data=effect_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"EffectUseServerPacket(byte_size={repr(self._byte_size)}, effect={repr(self._effect)}, effect_data={repr(self._effect_data)})"

    EffectData = Union['EffectUseServerPacket.EffectDataQuake', None]
    """
    Data associated with different values of the `effect` field.
    """

    class EffectDataQuake:
        """
        Data associated with effect value MapEffect.Quake
        """
        _byte_size: int = 0
        _quake_strength: int

        def __init__(self, *, quake_strength: int):
            """
            Create a new instance of EffectUseServerPacket.EffectDataQuake.

            Args:
                quake_strength (int): (Value range is 0-252.)
            """
            self._quake_strength = quake_strength

        @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 quake_strength(self) -> int:
            return self._quake_strength

        @staticmethod
        def serialize(writer: EoWriter, data: "EffectUseServerPacket.EffectDataQuake") -> None:
            """
            Serializes an instance of `EffectUseServerPacket.EffectDataQuake` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (EffectUseServerPacket.EffectDataQuake): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._quake_strength is None:
                    raise SerializationError("quake_strength must be provided.")
                writer.add_char(data._quake_strength)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "EffectUseServerPacket.EffectDataQuake":
            """
            Deserializes an instance of `EffectUseServerPacket.EffectDataQuake` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                EffectUseServerPacket.EffectDataQuake: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                quake_strength = reader.get_char()
                result = EffectUseServerPacket.EffectDataQuake(quake_strength=quake_strength)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"EffectUseServerPacket.EffectDataQuake(byte_size={repr(self._byte_size)}, quake_strength={repr(self._quake_strength)})"

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.

effect: MapEffect property

effect_data: EffectUseServerPacket.EffectData property

EffectUseServerPacket.EffectData: Data associated with the effect field.

EffectData = Union['EffectUseServerPacket.EffectDataQuake', None] class-attribute instance-attribute

Data associated with different values of the effect field.

EffectDataQuake

Data associated with effect value MapEffect.Quake

Source code in src/eolib/protocol/_generated/net/server/effect_use_server_packet.py
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
class EffectDataQuake:
    """
    Data associated with effect value MapEffect.Quake
    """
    _byte_size: int = 0
    _quake_strength: int

    def __init__(self, *, quake_strength: int):
        """
        Create a new instance of EffectUseServerPacket.EffectDataQuake.

        Args:
            quake_strength (int): (Value range is 0-252.)
        """
        self._quake_strength = quake_strength

    @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 quake_strength(self) -> int:
        return self._quake_strength

    @staticmethod
    def serialize(writer: EoWriter, data: "EffectUseServerPacket.EffectDataQuake") -> None:
        """
        Serializes an instance of `EffectUseServerPacket.EffectDataQuake` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (EffectUseServerPacket.EffectDataQuake): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._quake_strength is None:
                raise SerializationError("quake_strength must be provided.")
            writer.add_char(data._quake_strength)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "EffectUseServerPacket.EffectDataQuake":
        """
        Deserializes an instance of `EffectUseServerPacket.EffectDataQuake` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            EffectUseServerPacket.EffectDataQuake: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            quake_strength = reader.get_char()
            result = EffectUseServerPacket.EffectDataQuake(quake_strength=quake_strength)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"EffectUseServerPacket.EffectDataQuake(byte_size={repr(self._byte_size)}, quake_strength={repr(self._quake_strength)})"

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.

quake_strength: int property

__init__(*, quake_strength)

Create a new instance of EffectUseServerPacket.EffectDataQuake.

Parameters:

Name Type Description Default
quake_strength int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/effect_use_server_packet.py
144
145
146
147
148
149
150
151
def __init__(self, *, quake_strength: int):
    """
    Create a new instance of EffectUseServerPacket.EffectDataQuake.

    Args:
        quake_strength (int): (Value range is 0-252.)
    """
    self._quake_strength = quake_strength

serialize(writer, data) staticmethod

Serializes an instance of EffectUseServerPacket.EffectDataQuake to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data EffectDataQuake

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/effect_use_server_packet.py
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
@staticmethod
def serialize(writer: EoWriter, data: "EffectUseServerPacket.EffectDataQuake") -> None:
    """
    Serializes an instance of `EffectUseServerPacket.EffectDataQuake` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (EffectUseServerPacket.EffectDataQuake): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._quake_strength is None:
            raise SerializationError("quake_strength must be provided.")
        writer.add_char(data._quake_strength)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of EffectUseServerPacket.EffectDataQuake from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
EffectDataQuake

EffectUseServerPacket.EffectDataQuake: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/effect_use_server_packet.py
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
@staticmethod
def deserialize(reader: EoReader) -> "EffectUseServerPacket.EffectDataQuake":
    """
    Deserializes an instance of `EffectUseServerPacket.EffectDataQuake` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        EffectUseServerPacket.EffectDataQuake: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        quake_strength = reader.get_char()
        result = EffectUseServerPacket.EffectDataQuake(quake_strength=quake_strength)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

__init__(*, effect, effect_data=None)

Create a new instance of EffectUseServerPacket.

Parameters:

Name Type Description Default
effect MapEffect
required
effect_data EffectData

Data associated with the effect field.

None
Source code in src/eolib/protocol/_generated/net/server/effect_use_server_packet.py
23
24
25
26
27
28
29
30
31
32
def __init__(self, *, effect: MapEffect, effect_data: 'EffectUseServerPacket.EffectData' = None):
    """
    Create a new instance of EffectUseServerPacket.

    Args:
        effect (MapEffect): 
        effect_data (EffectUseServerPacket.EffectData): Data associated with the `effect` field.
    """
    self._effect = effect
    self._effect_data = effect_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/effect_use_server_packet.py
55
56
57
58
59
60
61
62
63
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Effect

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/effect_use_server_packet.py
65
66
67
68
69
70
71
72
73
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Use

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/effect_use_server_packet.py
75
76
77
78
79
80
81
82
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.
    """
    EffectUseServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of EffectUseServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data EffectUseServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/effect_use_server_packet.py
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
@staticmethod
def serialize(writer: EoWriter, data: "EffectUseServerPacket") -> None:
    """
    Serializes an instance of `EffectUseServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (EffectUseServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._effect is None:
            raise SerializationError("effect must be provided.")
        writer.add_char(int(data._effect))
        if data._effect == MapEffect.Quake:
            if not isinstance(data._effect_data, EffectUseServerPacket.EffectDataQuake):
                raise SerializationError("Expected effect_data to be type EffectUseServerPacket.EffectDataQuake for effect " + MapEffect(data._effect).name + ".")
            EffectUseServerPacket.EffectDataQuake.serialize(writer, data._effect_data)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of EffectUseServerPacket 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
EffectUseServerPacket EffectUseServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/effect_use_server_packet.py
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
@staticmethod
def deserialize(reader: EoReader) -> "EffectUseServerPacket":
    """
    Deserializes an instance of `EffectUseServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        EffectUseServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        effect = MapEffect(reader.get_char())
        effect_data: EffectUseServerPacket.EffectData = None
        if effect == MapEffect.Quake:
            effect_data = EffectUseServerPacket.EffectDataQuake.deserialize(reader)
        result = EffectUseServerPacket(effect=effect, effect_data=effect_data)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

MapDrainDamageOther

Another player taking damage from a map HP drain

Source code in src/eolib/protocol/_generated/net/server/map_drain_damage_other.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
class MapDrainDamageOther:
    """
    Another player taking damage from a map HP drain
    """
    _byte_size: int = 0
    _player_id: int
    _hp_percentage: int
    _damage: int

    def __init__(self, *, player_id: int, hp_percentage: int, damage: int):
        """
        Create a new instance of MapDrainDamageOther.

        Args:
            player_id (int): (Value range is 0-64008.)
            hp_percentage (int): (Value range is 0-252.)
            damage (int): (Value range is 0-64008.)
        """
        self._player_id = player_id
        self._hp_percentage = hp_percentage
        self._damage = damage

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def hp_percentage(self) -> int:
        return self._hp_percentage

    @property
    def damage(self) -> int:
        return self._damage

    @staticmethod
    def serialize(writer: EoWriter, data: "MapDrainDamageOther") -> None:
        """
        Serializes an instance of `MapDrainDamageOther` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (MapDrainDamageOther): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._hp_percentage is None:
                raise SerializationError("hp_percentage must be provided.")
            writer.add_char(data._hp_percentage)
            if data._damage is None:
                raise SerializationError("damage must be provided.")
            writer.add_short(data._damage)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "MapDrainDamageOther":
        """
        Deserializes an instance of `MapDrainDamageOther` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            MapDrainDamageOther: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            hp_percentage = reader.get_char()
            damage = reader.get_short()
            result = MapDrainDamageOther(player_id=player_id, hp_percentage=hp_percentage, damage=damage)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"MapDrainDamageOther(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, hp_percentage={repr(self._hp_percentage)}, damage={repr(self._damage)})"

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.

player_id: int property

hp_percentage: int property

damage: int property

__init__(*, player_id, hp_percentage, damage)

Create a new instance of MapDrainDamageOther.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
hp_percentage int

(Value range is 0-252.)

required
damage int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/map_drain_damage_other.py
19
20
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, player_id: int, hp_percentage: int, damage: int):
    """
    Create a new instance of MapDrainDamageOther.

    Args:
        player_id (int): (Value range is 0-64008.)
        hp_percentage (int): (Value range is 0-252.)
        damage (int): (Value range is 0-64008.)
    """
    self._player_id = player_id
    self._hp_percentage = hp_percentage
    self._damage = damage

serialize(writer, data) staticmethod

Serializes an instance of MapDrainDamageOther to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data MapDrainDamageOther

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/map_drain_damage_other.py
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@staticmethod
def serialize(writer: EoWriter, data: "MapDrainDamageOther") -> None:
    """
    Serializes an instance of `MapDrainDamageOther` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (MapDrainDamageOther): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._hp_percentage is None:
            raise SerializationError("hp_percentage must be provided.")
        writer.add_char(data._hp_percentage)
        if data._damage is None:
            raise SerializationError("damage must be provided.")
        writer.add_short(data._damage)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of MapDrainDamageOther 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
MapDrainDamageOther MapDrainDamageOther

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/map_drain_damage_other.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@staticmethod
def deserialize(reader: EoReader) -> "MapDrainDamageOther":
    """
    Deserializes an instance of `MapDrainDamageOther` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        MapDrainDamageOther: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        hp_percentage = reader.get_char()
        damage = reader.get_short()
        result = MapDrainDamageOther(player_id=player_id, hp_percentage=hp_percentage, damage=damage)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

EffectTargetOtherServerPacket

Bases: Packet

Map drain damage

Source code in src/eolib/protocol/_generated/net/server/effect_target_other_server_packet.py
 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
class EffectTargetOtherServerPacket(Packet):
    """
    Map drain damage
    """
    _byte_size: int = 0
    _damage: int
    _hp: int
    _max_hp: int
    _others: tuple[MapDrainDamageOther, ...]

    def __init__(self, *, damage: int, hp: int, max_hp: int, others: Iterable[MapDrainDamageOther]):
        """
        Create a new instance of EffectTargetOtherServerPacket.

        Args:
            damage (int): (Value range is 0-64008.)
            hp (int): (Value range is 0-64008.)
            max_hp (int): (Value range is 0-64008.)
            others (Iterable[MapDrainDamageOther]): 
        """
        self._damage = damage
        self._hp = hp
        self._max_hp = max_hp
        self._others = tuple(others)

    @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 damage(self) -> int:
        return self._damage

    @property
    def hp(self) -> int:
        return self._hp

    @property
    def max_hp(self) -> int:
        return self._max_hp

    @property
    def others(self) -> tuple[MapDrainDamageOther, ...]:
        return self._others

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Effect

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.TargetOther

    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.
        """
        EffectTargetOtherServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "EffectTargetOtherServerPacket") -> None:
        """
        Serializes an instance of `EffectTargetOtherServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (EffectTargetOtherServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._damage is None:
                raise SerializationError("damage must be provided.")
            writer.add_short(data._damage)
            if data._hp is None:
                raise SerializationError("hp must be provided.")
            writer.add_short(data._hp)
            if data._max_hp is None:
                raise SerializationError("max_hp must be provided.")
            writer.add_short(data._max_hp)
            if data._others is None:
                raise SerializationError("others must be provided.")
            for i in range(len(data._others)):
                MapDrainDamageOther.serialize(writer, data._others[i])
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "EffectTargetOtherServerPacket":
        """
        Deserializes an instance of `EffectTargetOtherServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            EffectTargetOtherServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            damage = reader.get_short()
            hp = reader.get_short()
            max_hp = reader.get_short()
            others_length = int(reader.remaining / 5)
            others = []
            for i in range(others_length):
                others.append(MapDrainDamageOther.deserialize(reader))
            result = EffectTargetOtherServerPacket(damage=damage, hp=hp, max_hp=max_hp, others=others)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"EffectTargetOtherServerPacket(byte_size={repr(self._byte_size)}, damage={repr(self._damage)}, hp={repr(self._hp)}, max_hp={repr(self._max_hp)}, others={repr(self._others)})"

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.

damage: int property

hp: int property

max_hp: int property

others: tuple[MapDrainDamageOther, ...] property

__init__(*, damage, hp, max_hp, others)

Create a new instance of EffectTargetOtherServerPacket.

Parameters:

Name Type Description Default
damage int

(Value range is 0-64008.)

required
hp int

(Value range is 0-64008.)

required
max_hp int

(Value range is 0-64008.)

required
others Iterable[MapDrainDamageOther]
required
Source code in src/eolib/protocol/_generated/net/server/effect_target_other_server_packet.py
26
27
28
29
30
31
32
33
34
35
36
37
38
39
def __init__(self, *, damage: int, hp: int, max_hp: int, others: Iterable[MapDrainDamageOther]):
    """
    Create a new instance of EffectTargetOtherServerPacket.

    Args:
        damage (int): (Value range is 0-64008.)
        hp (int): (Value range is 0-64008.)
        max_hp (int): (Value range is 0-64008.)
        others (Iterable[MapDrainDamageOther]): 
    """
    self._damage = damage
    self._hp = hp
    self._max_hp = max_hp
    self._others = tuple(others)

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/effect_target_other_server_packet.py
67
68
69
70
71
72
73
74
75
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Effect

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/effect_target_other_server_packet.py
77
78
79
80
81
82
83
84
85
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.TargetOther

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/effect_target_other_server_packet.py
87
88
89
90
91
92
93
94
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.
    """
    EffectTargetOtherServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of EffectTargetOtherServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data EffectTargetOtherServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/effect_target_other_server_packet.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "EffectTargetOtherServerPacket") -> None:
    """
    Serializes an instance of `EffectTargetOtherServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (EffectTargetOtherServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._damage is None:
            raise SerializationError("damage must be provided.")
        writer.add_short(data._damage)
        if data._hp is None:
            raise SerializationError("hp must be provided.")
        writer.add_short(data._hp)
        if data._max_hp is None:
            raise SerializationError("max_hp must be provided.")
        writer.add_short(data._max_hp)
        if data._others is None:
            raise SerializationError("others must be provided.")
        for i in range(len(data._others)):
            MapDrainDamageOther.serialize(writer, data._others[i])
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of EffectTargetOtherServerPacket 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
EffectTargetOtherServerPacket 'EffectTargetOtherServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/effect_target_other_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "EffectTargetOtherServerPacket":
    """
    Deserializes an instance of `EffectTargetOtherServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        EffectTargetOtherServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        damage = reader.get_short()
        hp = reader.get_short()
        max_hp = reader.get_short()
        others_length = int(reader.remaining / 5)
        others = []
        for i in range(others_length):
            others.append(MapDrainDamageOther.deserialize(reader))
        result = EffectTargetOtherServerPacket(damage=damage, hp=hp, max_hp=max_hp, others=others)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

MapDamageType

Bases: IntEnum

Type of damage being caused by the environment

Source code in src/eolib/protocol/_generated/net/server/map_damage_type.py
 9
10
11
12
13
14
class MapDamageType(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Type of damage being caused by the environment
    """
    TpDrain = 1
    Spikes = 2

TpDrain = 1 class-attribute instance-attribute

Spikes = 2 class-attribute instance-attribute

EffectSpecServerPacket

Bases: Packet

Taking spike or tp drain damage

Source code in src/eolib/protocol/_generated/net/server/effect_spec_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
class EffectSpecServerPacket(Packet):
    """
    Taking spike or tp drain damage
    """
    _byte_size: int = 0
    _map_damage_type: MapDamageType
    _map_damage_type_data: 'EffectSpecServerPacket.MapDamageTypeData'

    def __init__(self, *, map_damage_type: MapDamageType, map_damage_type_data: 'EffectSpecServerPacket.MapDamageTypeData' = None):
        """
        Create a new instance of EffectSpecServerPacket.

        Args:
            map_damage_type (MapDamageType): 
            map_damage_type_data (EffectSpecServerPacket.MapDamageTypeData): Data associated with the `map_damage_type` field.
        """
        self._map_damage_type = map_damage_type
        self._map_damage_type_data = map_damage_type_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 map_damage_type(self) -> MapDamageType:
        return self._map_damage_type

    @property
    def map_damage_type_data(self) -> 'EffectSpecServerPacket.MapDamageTypeData':
        """
        EffectSpecServerPacket.MapDamageTypeData: Data associated with the `map_damage_type` field.
        """
        return self._map_damage_type_data

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Effect

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Spec

    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.
        """
        EffectSpecServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "EffectSpecServerPacket") -> None:
        """
        Serializes an instance of `EffectSpecServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (EffectSpecServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._map_damage_type is None:
                raise SerializationError("map_damage_type must be provided.")
            writer.add_char(int(data._map_damage_type))
            if data._map_damage_type == MapDamageType.TpDrain:
                if not isinstance(data._map_damage_type_data, EffectSpecServerPacket.MapDamageTypeDataTpDrain):
                    raise SerializationError("Expected map_damage_type_data to be type EffectSpecServerPacket.MapDamageTypeDataTpDrain for map_damage_type " + MapDamageType(data._map_damage_type).name + ".")
                EffectSpecServerPacket.MapDamageTypeDataTpDrain.serialize(writer, data._map_damage_type_data)
            elif data._map_damage_type == MapDamageType.Spikes:
                if not isinstance(data._map_damage_type_data, EffectSpecServerPacket.MapDamageTypeDataSpikes):
                    raise SerializationError("Expected map_damage_type_data to be type EffectSpecServerPacket.MapDamageTypeDataSpikes for map_damage_type " + MapDamageType(data._map_damage_type).name + ".")
                EffectSpecServerPacket.MapDamageTypeDataSpikes.serialize(writer, data._map_damage_type_data)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "EffectSpecServerPacket":
        """
        Deserializes an instance of `EffectSpecServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            EffectSpecServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            map_damage_type = MapDamageType(reader.get_char())
            map_damage_type_data: EffectSpecServerPacket.MapDamageTypeData = None
            if map_damage_type == MapDamageType.TpDrain:
                map_damage_type_data = EffectSpecServerPacket.MapDamageTypeDataTpDrain.deserialize(reader)
            elif map_damage_type == MapDamageType.Spikes:
                map_damage_type_data = EffectSpecServerPacket.MapDamageTypeDataSpikes.deserialize(reader)
            result = EffectSpecServerPacket(map_damage_type=map_damage_type, map_damage_type_data=map_damage_type_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"EffectSpecServerPacket(byte_size={repr(self._byte_size)}, map_damage_type={repr(self._map_damage_type)}, map_damage_type_data={repr(self._map_damage_type_data)})"

    MapDamageTypeData = Union['EffectSpecServerPacket.MapDamageTypeDataTpDrain', 'EffectSpecServerPacket.MapDamageTypeDataSpikes', None]
    """
    Data associated with different values of the `map_damage_type` field.
    """

    class MapDamageTypeDataTpDrain:
        """
        Data associated with map_damage_type value MapDamageType.TpDrain
        """
        _byte_size: int = 0
        _tp_damage: int
        _tp: int
        _max_tp: int

        def __init__(self, *, tp_damage: int, tp: int, max_tp: int):
            """
            Create a new instance of EffectSpecServerPacket.MapDamageTypeDataTpDrain.

            Args:
                tp_damage (int): (Value range is 0-64008.)
                tp (int): (Value range is 0-64008.)
                max_tp (int): (Value range is 0-64008.)
            """
            self._tp_damage = tp_damage
            self._tp = tp
            self._max_tp = max_tp

        @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 tp_damage(self) -> int:
            return self._tp_damage

        @property
        def tp(self) -> int:
            return self._tp

        @property
        def max_tp(self) -> int:
            return self._max_tp

        @staticmethod
        def serialize(writer: EoWriter, data: "EffectSpecServerPacket.MapDamageTypeDataTpDrain") -> None:
            """
            Serializes an instance of `EffectSpecServerPacket.MapDamageTypeDataTpDrain` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (EffectSpecServerPacket.MapDamageTypeDataTpDrain): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._tp_damage is None:
                    raise SerializationError("tp_damage must be provided.")
                writer.add_short(data._tp_damage)
                if data._tp is None:
                    raise SerializationError("tp must be provided.")
                writer.add_short(data._tp)
                if data._max_tp is None:
                    raise SerializationError("max_tp must be provided.")
                writer.add_short(data._max_tp)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "EffectSpecServerPacket.MapDamageTypeDataTpDrain":
            """
            Deserializes an instance of `EffectSpecServerPacket.MapDamageTypeDataTpDrain` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                EffectSpecServerPacket.MapDamageTypeDataTpDrain: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                tp_damage = reader.get_short()
                tp = reader.get_short()
                max_tp = reader.get_short()
                result = EffectSpecServerPacket.MapDamageTypeDataTpDrain(tp_damage=tp_damage, tp=tp, max_tp=max_tp)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"EffectSpecServerPacket.MapDamageTypeDataTpDrain(byte_size={repr(self._byte_size)}, tp_damage={repr(self._tp_damage)}, tp={repr(self._tp)}, max_tp={repr(self._max_tp)})"

    class MapDamageTypeDataSpikes:
        """
        Data associated with map_damage_type value MapDamageType.Spikes
        """
        _byte_size: int = 0
        _hp_damage: int
        _hp: int
        _max_hp: int

        def __init__(self, *, hp_damage: int, hp: int, max_hp: int):
            """
            Create a new instance of EffectSpecServerPacket.MapDamageTypeDataSpikes.

            Args:
                hp_damage (int): (Value range is 0-64008.)
                hp (int): (Value range is 0-64008.)
                max_hp (int): (Value range is 0-64008.)
            """
            self._hp_damage = hp_damage
            self._hp = hp
            self._max_hp = max_hp

        @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 hp_damage(self) -> int:
            return self._hp_damage

        @property
        def hp(self) -> int:
            return self._hp

        @property
        def max_hp(self) -> int:
            return self._max_hp

        @staticmethod
        def serialize(writer: EoWriter, data: "EffectSpecServerPacket.MapDamageTypeDataSpikes") -> None:
            """
            Serializes an instance of `EffectSpecServerPacket.MapDamageTypeDataSpikes` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (EffectSpecServerPacket.MapDamageTypeDataSpikes): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._hp_damage is None:
                    raise SerializationError("hp_damage must be provided.")
                writer.add_short(data._hp_damage)
                if data._hp is None:
                    raise SerializationError("hp must be provided.")
                writer.add_short(data._hp)
                if data._max_hp is None:
                    raise SerializationError("max_hp must be provided.")
                writer.add_short(data._max_hp)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "EffectSpecServerPacket.MapDamageTypeDataSpikes":
            """
            Deserializes an instance of `EffectSpecServerPacket.MapDamageTypeDataSpikes` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                EffectSpecServerPacket.MapDamageTypeDataSpikes: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                hp_damage = reader.get_short()
                hp = reader.get_short()
                max_hp = reader.get_short()
                result = EffectSpecServerPacket.MapDamageTypeDataSpikes(hp_damage=hp_damage, hp=hp, max_hp=max_hp)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"EffectSpecServerPacket.MapDamageTypeDataSpikes(byte_size={repr(self._byte_size)}, hp_damage={repr(self._hp_damage)}, hp={repr(self._hp)}, max_hp={repr(self._max_hp)})"

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.

map_damage_type: MapDamageType property

map_damage_type_data: EffectSpecServerPacket.MapDamageTypeData property

EffectSpecServerPacket.MapDamageTypeData: Data associated with the map_damage_type field.

MapDamageTypeData = Union['EffectSpecServerPacket.MapDamageTypeDataTpDrain', 'EffectSpecServerPacket.MapDamageTypeDataSpikes', None] class-attribute instance-attribute

Data associated with different values of the map_damage_type field.

MapDamageTypeDataTpDrain

Data associated with map_damage_type value MapDamageType.TpDrain

Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
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
class MapDamageTypeDataTpDrain:
    """
    Data associated with map_damage_type value MapDamageType.TpDrain
    """
    _byte_size: int = 0
    _tp_damage: int
    _tp: int
    _max_tp: int

    def __init__(self, *, tp_damage: int, tp: int, max_tp: int):
        """
        Create a new instance of EffectSpecServerPacket.MapDamageTypeDataTpDrain.

        Args:
            tp_damage (int): (Value range is 0-64008.)
            tp (int): (Value range is 0-64008.)
            max_tp (int): (Value range is 0-64008.)
        """
        self._tp_damage = tp_damage
        self._tp = tp
        self._max_tp = max_tp

    @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 tp_damage(self) -> int:
        return self._tp_damage

    @property
    def tp(self) -> int:
        return self._tp

    @property
    def max_tp(self) -> int:
        return self._max_tp

    @staticmethod
    def serialize(writer: EoWriter, data: "EffectSpecServerPacket.MapDamageTypeDataTpDrain") -> None:
        """
        Serializes an instance of `EffectSpecServerPacket.MapDamageTypeDataTpDrain` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (EffectSpecServerPacket.MapDamageTypeDataTpDrain): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._tp_damage is None:
                raise SerializationError("tp_damage must be provided.")
            writer.add_short(data._tp_damage)
            if data._tp is None:
                raise SerializationError("tp must be provided.")
            writer.add_short(data._tp)
            if data._max_tp is None:
                raise SerializationError("max_tp must be provided.")
            writer.add_short(data._max_tp)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "EffectSpecServerPacket.MapDamageTypeDataTpDrain":
        """
        Deserializes an instance of `EffectSpecServerPacket.MapDamageTypeDataTpDrain` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            EffectSpecServerPacket.MapDamageTypeDataTpDrain: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            tp_damage = reader.get_short()
            tp = reader.get_short()
            max_tp = reader.get_short()
            result = EffectSpecServerPacket.MapDamageTypeDataTpDrain(tp_damage=tp_damage, tp=tp, max_tp=max_tp)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"EffectSpecServerPacket.MapDamageTypeDataTpDrain(byte_size={repr(self._byte_size)}, tp_damage={repr(self._tp_damage)}, tp={repr(self._tp)}, max_tp={repr(self._max_tp)})"

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.

tp_damage: int property

tp: int property

max_tp: int property

__init__(*, tp_damage, tp, max_tp)

Create a new instance of EffectSpecServerPacket.MapDamageTypeDataTpDrain.

Parameters:

Name Type Description Default
tp_damage int

(Value range is 0-64008.)

required
tp int

(Value range is 0-64008.)

required
max_tp int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
152
153
154
155
156
157
158
159
160
161
162
163
def __init__(self, *, tp_damage: int, tp: int, max_tp: int):
    """
    Create a new instance of EffectSpecServerPacket.MapDamageTypeDataTpDrain.

    Args:
        tp_damage (int): (Value range is 0-64008.)
        tp (int): (Value range is 0-64008.)
        max_tp (int): (Value range is 0-64008.)
    """
    self._tp_damage = tp_damage
    self._tp = tp
    self._max_tp = max_tp

serialize(writer, data) staticmethod

Serializes an instance of EffectSpecServerPacket.MapDamageTypeDataTpDrain to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data MapDamageTypeDataTpDrain

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
@staticmethod
def serialize(writer: EoWriter, data: "EffectSpecServerPacket.MapDamageTypeDataTpDrain") -> None:
    """
    Serializes an instance of `EffectSpecServerPacket.MapDamageTypeDataTpDrain` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (EffectSpecServerPacket.MapDamageTypeDataTpDrain): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._tp_damage is None:
            raise SerializationError("tp_damage must be provided.")
        writer.add_short(data._tp_damage)
        if data._tp is None:
            raise SerializationError("tp must be provided.")
        writer.add_short(data._tp)
        if data._max_tp is None:
            raise SerializationError("max_tp must be provided.")
        writer.add_short(data._max_tp)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of EffectSpecServerPacket.MapDamageTypeDataTpDrain from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
MapDamageTypeDataTpDrain

EffectSpecServerPacket.MapDamageTypeDataTpDrain: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
@staticmethod
def deserialize(reader: EoReader) -> "EffectSpecServerPacket.MapDamageTypeDataTpDrain":
    """
    Deserializes an instance of `EffectSpecServerPacket.MapDamageTypeDataTpDrain` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        EffectSpecServerPacket.MapDamageTypeDataTpDrain: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        tp_damage = reader.get_short()
        tp = reader.get_short()
        max_tp = reader.get_short()
        result = EffectSpecServerPacket.MapDamageTypeDataTpDrain(tp_damage=tp_damage, tp=tp, max_tp=max_tp)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

MapDamageTypeDataSpikes

Data associated with map_damage_type value MapDamageType.Spikes

Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
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
class MapDamageTypeDataSpikes:
    """
    Data associated with map_damage_type value MapDamageType.Spikes
    """
    _byte_size: int = 0
    _hp_damage: int
    _hp: int
    _max_hp: int

    def __init__(self, *, hp_damage: int, hp: int, max_hp: int):
        """
        Create a new instance of EffectSpecServerPacket.MapDamageTypeDataSpikes.

        Args:
            hp_damage (int): (Value range is 0-64008.)
            hp (int): (Value range is 0-64008.)
            max_hp (int): (Value range is 0-64008.)
        """
        self._hp_damage = hp_damage
        self._hp = hp
        self._max_hp = max_hp

    @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 hp_damage(self) -> int:
        return self._hp_damage

    @property
    def hp(self) -> int:
        return self._hp

    @property
    def max_hp(self) -> int:
        return self._max_hp

    @staticmethod
    def serialize(writer: EoWriter, data: "EffectSpecServerPacket.MapDamageTypeDataSpikes") -> None:
        """
        Serializes an instance of `EffectSpecServerPacket.MapDamageTypeDataSpikes` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (EffectSpecServerPacket.MapDamageTypeDataSpikes): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._hp_damage is None:
                raise SerializationError("hp_damage must be provided.")
            writer.add_short(data._hp_damage)
            if data._hp is None:
                raise SerializationError("hp must be provided.")
            writer.add_short(data._hp)
            if data._max_hp is None:
                raise SerializationError("max_hp must be provided.")
            writer.add_short(data._max_hp)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "EffectSpecServerPacket.MapDamageTypeDataSpikes":
        """
        Deserializes an instance of `EffectSpecServerPacket.MapDamageTypeDataSpikes` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            EffectSpecServerPacket.MapDamageTypeDataSpikes: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            hp_damage = reader.get_short()
            hp = reader.get_short()
            max_hp = reader.get_short()
            result = EffectSpecServerPacket.MapDamageTypeDataSpikes(hp_damage=hp_damage, hp=hp, max_hp=max_hp)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"EffectSpecServerPacket.MapDamageTypeDataSpikes(byte_size={repr(self._byte_size)}, hp_damage={repr(self._hp_damage)}, hp={repr(self._hp)}, max_hp={repr(self._max_hp)})"

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.

hp_damage: int property

hp: int property

max_hp: int property

__init__(*, hp_damage, hp, max_hp)

Create a new instance of EffectSpecServerPacket.MapDamageTypeDataSpikes.

Parameters:

Name Type Description Default
hp_damage int

(Value range is 0-64008.)

required
hp int

(Value range is 0-64008.)

required
max_hp int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
245
246
247
248
249
250
251
252
253
254
255
256
def __init__(self, *, hp_damage: int, hp: int, max_hp: int):
    """
    Create a new instance of EffectSpecServerPacket.MapDamageTypeDataSpikes.

    Args:
        hp_damage (int): (Value range is 0-64008.)
        hp (int): (Value range is 0-64008.)
        max_hp (int): (Value range is 0-64008.)
    """
    self._hp_damage = hp_damage
    self._hp = hp
    self._max_hp = max_hp

serialize(writer, data) staticmethod

Serializes an instance of EffectSpecServerPacket.MapDamageTypeDataSpikes to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data MapDamageTypeDataSpikes

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
@staticmethod
def serialize(writer: EoWriter, data: "EffectSpecServerPacket.MapDamageTypeDataSpikes") -> None:
    """
    Serializes an instance of `EffectSpecServerPacket.MapDamageTypeDataSpikes` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (EffectSpecServerPacket.MapDamageTypeDataSpikes): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._hp_damage is None:
            raise SerializationError("hp_damage must be provided.")
        writer.add_short(data._hp_damage)
        if data._hp is None:
            raise SerializationError("hp must be provided.")
        writer.add_short(data._hp)
        if data._max_hp is None:
            raise SerializationError("max_hp must be provided.")
        writer.add_short(data._max_hp)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of EffectSpecServerPacket.MapDamageTypeDataSpikes from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
MapDamageTypeDataSpikes

EffectSpecServerPacket.MapDamageTypeDataSpikes: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
@staticmethod
def deserialize(reader: EoReader) -> "EffectSpecServerPacket.MapDamageTypeDataSpikes":
    """
    Deserializes an instance of `EffectSpecServerPacket.MapDamageTypeDataSpikes` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        EffectSpecServerPacket.MapDamageTypeDataSpikes: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        hp_damage = reader.get_short()
        hp = reader.get_short()
        max_hp = reader.get_short()
        result = EffectSpecServerPacket.MapDamageTypeDataSpikes(hp_damage=hp_damage, hp=hp, max_hp=max_hp)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

__init__(*, map_damage_type, map_damage_type_data=None)

Create a new instance of EffectSpecServerPacket.

Parameters:

Name Type Description Default
map_damage_type MapDamageType
required
map_damage_type_data MapDamageTypeData

Data associated with the map_damage_type field.

None
Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
23
24
25
26
27
28
29
30
31
32
def __init__(self, *, map_damage_type: MapDamageType, map_damage_type_data: 'EffectSpecServerPacket.MapDamageTypeData' = None):
    """
    Create a new instance of EffectSpecServerPacket.

    Args:
        map_damage_type (MapDamageType): 
        map_damage_type_data (EffectSpecServerPacket.MapDamageTypeData): Data associated with the `map_damage_type` field.
    """
    self._map_damage_type = map_damage_type
    self._map_damage_type_data = map_damage_type_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/effect_spec_server_packet.py
55
56
57
58
59
60
61
62
63
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Effect

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/effect_spec_server_packet.py
65
66
67
68
69
70
71
72
73
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Spec

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/effect_spec_server_packet.py
75
76
77
78
79
80
81
82
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.
    """
    EffectSpecServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of EffectSpecServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data EffectSpecServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
@staticmethod
def serialize(writer: EoWriter, data: "EffectSpecServerPacket") -> None:
    """
    Serializes an instance of `EffectSpecServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (EffectSpecServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._map_damage_type is None:
            raise SerializationError("map_damage_type must be provided.")
        writer.add_char(int(data._map_damage_type))
        if data._map_damage_type == MapDamageType.TpDrain:
            if not isinstance(data._map_damage_type_data, EffectSpecServerPacket.MapDamageTypeDataTpDrain):
                raise SerializationError("Expected map_damage_type_data to be type EffectSpecServerPacket.MapDamageTypeDataTpDrain for map_damage_type " + MapDamageType(data._map_damage_type).name + ".")
            EffectSpecServerPacket.MapDamageTypeDataTpDrain.serialize(writer, data._map_damage_type_data)
        elif data._map_damage_type == MapDamageType.Spikes:
            if not isinstance(data._map_damage_type_data, EffectSpecServerPacket.MapDamageTypeDataSpikes):
                raise SerializationError("Expected map_damage_type_data to be type EffectSpecServerPacket.MapDamageTypeDataSpikes for map_damage_type " + MapDamageType(data._map_damage_type).name + ".")
            EffectSpecServerPacket.MapDamageTypeDataSpikes.serialize(writer, data._map_damage_type_data)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of EffectSpecServerPacket 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
EffectSpecServerPacket EffectSpecServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/effect_spec_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "EffectSpecServerPacket":
    """
    Deserializes an instance of `EffectSpecServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        EffectSpecServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        map_damage_type = MapDamageType(reader.get_char())
        map_damage_type_data: EffectSpecServerPacket.MapDamageTypeData = None
        if map_damage_type == MapDamageType.TpDrain:
            map_damage_type_data = EffectSpecServerPacket.MapDamageTypeDataTpDrain.deserialize(reader)
        elif map_damage_type == MapDamageType.Spikes:
            map_damage_type_data = EffectSpecServerPacket.MapDamageTypeDataSpikes.deserialize(reader)
        result = EffectSpecServerPacket(map_damage_type=map_damage_type, map_damage_type_data=map_damage_type_data)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

EffectReportServerPacket

Bases: Packet

Map spike timer

Source code in src/eolib/protocol/_generated/net/server/effect_report_server_packet.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
class EffectReportServerPacket(Packet):
    """
    Map spike timer
    """
    _byte_size: int = 0

    def __init__(self):
        """
        Create a new instance of EffectReportServerPacket.
        """

    @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 family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Effect

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Report

    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.
        """
        EffectReportServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "EffectReportServerPacket") -> None:
        """
        Serializes an instance of `EffectReportServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (EffectReportServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.add_string("S")
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "EffectReportServerPacket":
        """
        Deserializes an instance of `EffectReportServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            EffectReportServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            result = EffectReportServerPacket()
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"EffectReportServerPacket(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 EffectReportServerPacket.

Source code in src/eolib/protocol/_generated/net/server/effect_report_server_packet.py
18
19
20
21
def __init__(self):
    """
    Create a new instance of EffectReportServerPacket.
    """

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/effect_report_server_packet.py
33
34
35
36
37
38
39
40
41
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Effect

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/effect_report_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Report

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/effect_report_server_packet.py
53
54
55
56
57
58
59
60
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.
    """
    EffectReportServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of EffectReportServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data EffectReportServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/effect_report_server_packet.py
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@staticmethod
def serialize(writer: EoWriter, data: "EffectReportServerPacket") -> None:
    """
    Serializes an instance of `EffectReportServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (EffectReportServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.add_string("S")
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of EffectReportServerPacket 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
EffectReportServerPacket EffectReportServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/effect_report_server_packet.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@staticmethod
def deserialize(reader: EoReader) -> "EffectReportServerPacket":
    """
    Deserializes an instance of `EffectReportServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        EffectReportServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        result = EffectReportServerPacket()
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PlayerEffect

An effect playing on a player

Source code in src/eolib/protocol/_generated/net/server/player_effect.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
class PlayerEffect:
    """
    An effect playing on a player
    """
    _byte_size: int = 0
    _player_id: int
    _effect_id: int

    def __init__(self, *, player_id: int, effect_id: int):
        """
        Create a new instance of PlayerEffect.

        Args:
            player_id (int): (Value range is 0-64008.)
            effect_id (int): (Value range is 0-16194276.)
        """
        self._player_id = player_id
        self._effect_id = effect_id

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def effect_id(self) -> int:
        return self._effect_id

    @staticmethod
    def serialize(writer: EoWriter, data: "PlayerEffect") -> None:
        """
        Serializes an instance of `PlayerEffect` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (PlayerEffect): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._effect_id is None:
                raise SerializationError("effect_id must be provided.")
            writer.add_three(data._effect_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "PlayerEffect":
        """
        Deserializes an instance of `PlayerEffect` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            PlayerEffect: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            effect_id = reader.get_three()
            result = PlayerEffect(player_id=player_id, effect_id=effect_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"PlayerEffect(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, effect_id={repr(self._effect_id)})"

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.

player_id: int property

effect_id: int property

__init__(*, player_id, effect_id)

Create a new instance of PlayerEffect.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
effect_id int

(Value range is 0-16194276.)

required
Source code in src/eolib/protocol/_generated/net/server/player_effect.py
18
19
20
21
22
23
24
25
26
27
def __init__(self, *, player_id: int, effect_id: int):
    """
    Create a new instance of PlayerEffect.

    Args:
        player_id (int): (Value range is 0-64008.)
        effect_id (int): (Value range is 0-16194276.)
    """
    self._player_id = player_id
    self._effect_id = effect_id

serialize(writer, data) staticmethod

Serializes an instance of PlayerEffect to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data PlayerEffect

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/player_effect.py
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@staticmethod
def serialize(writer: EoWriter, data: "PlayerEffect") -> None:
    """
    Serializes an instance of `PlayerEffect` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (PlayerEffect): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._effect_id is None:
            raise SerializationError("effect_id must be provided.")
        writer.add_three(data._effect_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of PlayerEffect 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
PlayerEffect PlayerEffect

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/player_effect.py
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def deserialize(reader: EoReader) -> "PlayerEffect":
    """
    Deserializes an instance of `PlayerEffect` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        PlayerEffect: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        effect_id = reader.get_three()
        result = PlayerEffect(player_id=player_id, effect_id=effect_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

EffectPlayerServerPacket

Bases: Packet

Effects playing on nearby players

Source code in src/eolib/protocol/_generated/net/server/effect_player_server_packet.py
 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
class EffectPlayerServerPacket(Packet):
    """
    Effects playing on nearby players
    """
    _byte_size: int = 0
    _effects: tuple[PlayerEffect, ...]

    def __init__(self, *, effects: Iterable[PlayerEffect]):
        """
        Create a new instance of EffectPlayerServerPacket.

        Args:
            effects (Iterable[PlayerEffect]): 
        """
        self._effects = tuple(effects)

    @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 effects(self) -> tuple[PlayerEffect, ...]:
        return self._effects

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Effect

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Player

    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.
        """
        EffectPlayerServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "EffectPlayerServerPacket") -> None:
        """
        Serializes an instance of `EffectPlayerServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (EffectPlayerServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._effects is None:
                raise SerializationError("effects must be provided.")
            for i in range(len(data._effects)):
                PlayerEffect.serialize(writer, data._effects[i])
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "EffectPlayerServerPacket":
        """
        Deserializes an instance of `EffectPlayerServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            EffectPlayerServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            effects_length = int(reader.remaining / 5)
            effects = []
            for i in range(effects_length):
                effects.append(PlayerEffect.deserialize(reader))
            result = EffectPlayerServerPacket(effects=effects)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"EffectPlayerServerPacket(byte_size={repr(self._byte_size)}, effects={repr(self._effects)})"

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.

effects: tuple[PlayerEffect, ...] property

__init__(*, effects)

Create a new instance of EffectPlayerServerPacket.

Parameters:

Name Type Description Default
effects Iterable[PlayerEffect]
required
Source code in src/eolib/protocol/_generated/net/server/effect_player_server_packet.py
23
24
25
26
27
28
29
30
def __init__(self, *, effects: Iterable[PlayerEffect]):
    """
    Create a new instance of EffectPlayerServerPacket.

    Args:
        effects (Iterable[PlayerEffect]): 
    """
    self._effects = tuple(effects)

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/effect_player_server_packet.py
46
47
48
49
50
51
52
53
54
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Effect

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/effect_player_server_packet.py
56
57
58
59
60
61
62
63
64
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Player

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/effect_player_server_packet.py
66
67
68
69
70
71
72
73
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.
    """
    EffectPlayerServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of EffectPlayerServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data EffectPlayerServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/effect_player_server_packet.py
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
@staticmethod
def serialize(writer: EoWriter, data: "EffectPlayerServerPacket") -> None:
    """
    Serializes an instance of `EffectPlayerServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (EffectPlayerServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._effects is None:
            raise SerializationError("effects must be provided.")
        for i in range(len(data._effects)):
            PlayerEffect.serialize(writer, data._effects[i])
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of EffectPlayerServerPacket 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
EffectPlayerServerPacket 'EffectPlayerServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/effect_player_server_packet.py
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
@staticmethod
def deserialize(reader: EoReader) -> "EffectPlayerServerPacket":
    """
    Deserializes an instance of `EffectPlayerServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        EffectPlayerServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        effects_length = int(reader.remaining / 5)
        effects = []
        for i in range(effects_length):
            effects.append(PlayerEffect.deserialize(reader))
        result = EffectPlayerServerPacket(effects=effects)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

TileEffect

An effect playing on a tile

Source code in src/eolib/protocol/_generated/net/server/tile_effect.py
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
class TileEffect:
    """
    An effect playing on a tile
    """
    _byte_size: int = 0
    _coords: Coords
    _effect_id: int

    def __init__(self, *, coords: Coords, effect_id: int):
        """
        Create a new instance of TileEffect.

        Args:
            coords (Coords): 
            effect_id (int): (Value range is 0-64008.)
        """
        self._coords = coords
        self._effect_id = effect_id

    @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 coords(self) -> Coords:
        return self._coords

    @property
    def effect_id(self) -> int:
        return self._effect_id

    @staticmethod
    def serialize(writer: EoWriter, data: "TileEffect") -> None:
        """
        Serializes an instance of `TileEffect` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (TileEffect): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._coords is None:
                raise SerializationError("coords must be provided.")
            Coords.serialize(writer, data._coords)
            if data._effect_id is None:
                raise SerializationError("effect_id must be provided.")
            writer.add_short(data._effect_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "TileEffect":
        """
        Deserializes an instance of `TileEffect` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            TileEffect: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            coords = Coords.deserialize(reader)
            effect_id = reader.get_short()
            result = TileEffect(coords=coords, effect_id=effect_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"TileEffect(byte_size={repr(self._byte_size)}, coords={repr(self._coords)}, effect_id={repr(self._effect_id)})"

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.

coords: Coords property

effect_id: int property

__init__(*, coords, effect_id)

Create a new instance of TileEffect.

Parameters:

Name Type Description Default
coords Coords
required
effect_id int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/tile_effect.py
19
20
21
22
23
24
25
26
27
28
def __init__(self, *, coords: Coords, effect_id: int):
    """
    Create a new instance of TileEffect.

    Args:
        coords (Coords): 
        effect_id (int): (Value range is 0-64008.)
    """
    self._coords = coords
    self._effect_id = effect_id

serialize(writer, data) staticmethod

Serializes an instance of TileEffect to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data TileEffect

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/tile_effect.py
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
@staticmethod
def serialize(writer: EoWriter, data: "TileEffect") -> None:
    """
    Serializes an instance of `TileEffect` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (TileEffect): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._coords is None:
            raise SerializationError("coords must be provided.")
        Coords.serialize(writer, data._coords)
        if data._effect_id is None:
            raise SerializationError("effect_id must be provided.")
        writer.add_short(data._effect_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of TileEffect 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
TileEffect TileEffect

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/tile_effect.py
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@staticmethod
def deserialize(reader: EoReader) -> "TileEffect":
    """
    Deserializes an instance of `TileEffect` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        TileEffect: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        coords = Coords.deserialize(reader)
        effect_id = reader.get_short()
        result = TileEffect(coords=coords, effect_id=effect_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

EffectAgreeServerPacket

Bases: Packet

Effects playing on nearby tiles

Source code in src/eolib/protocol/_generated/net/server/effect_agree_server_packet.py
 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
class EffectAgreeServerPacket(Packet):
    """
    Effects playing on nearby tiles
    """
    _byte_size: int = 0
    _effects: tuple[TileEffect, ...]

    def __init__(self, *, effects: Iterable[TileEffect]):
        """
        Create a new instance of EffectAgreeServerPacket.

        Args:
            effects (Iterable[TileEffect]): 
        """
        self._effects = tuple(effects)

    @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 effects(self) -> tuple[TileEffect, ...]:
        return self._effects

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Effect

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Agree

    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.
        """
        EffectAgreeServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "EffectAgreeServerPacket") -> None:
        """
        Serializes an instance of `EffectAgreeServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (EffectAgreeServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._effects is None:
                raise SerializationError("effects must be provided.")
            for i in range(len(data._effects)):
                TileEffect.serialize(writer, data._effects[i])
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "EffectAgreeServerPacket":
        """
        Deserializes an instance of `EffectAgreeServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            EffectAgreeServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            effects_length = int(reader.remaining / 4)
            effects = []
            for i in range(effects_length):
                effects.append(TileEffect.deserialize(reader))
            result = EffectAgreeServerPacket(effects=effects)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"EffectAgreeServerPacket(byte_size={repr(self._byte_size)}, effects={repr(self._effects)})"

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.

effects: tuple[TileEffect, ...] property

__init__(*, effects)

Create a new instance of EffectAgreeServerPacket.

Parameters:

Name Type Description Default
effects Iterable[TileEffect]
required
Source code in src/eolib/protocol/_generated/net/server/effect_agree_server_packet.py
23
24
25
26
27
28
29
30
def __init__(self, *, effects: Iterable[TileEffect]):
    """
    Create a new instance of EffectAgreeServerPacket.

    Args:
        effects (Iterable[TileEffect]): 
    """
    self._effects = tuple(effects)

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/effect_agree_server_packet.py
46
47
48
49
50
51
52
53
54
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Effect

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/effect_agree_server_packet.py
56
57
58
59
60
61
62
63
64
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Agree

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/effect_agree_server_packet.py
66
67
68
69
70
71
72
73
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.
    """
    EffectAgreeServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of EffectAgreeServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data EffectAgreeServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/effect_agree_server_packet.py
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
@staticmethod
def serialize(writer: EoWriter, data: "EffectAgreeServerPacket") -> None:
    """
    Serializes an instance of `EffectAgreeServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (EffectAgreeServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._effects is None:
            raise SerializationError("effects must be provided.")
        for i in range(len(data._effects)):
            TileEffect.serialize(writer, data._effects[i])
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of EffectAgreeServerPacket 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
EffectAgreeServerPacket 'EffectAgreeServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/effect_agree_server_packet.py
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
@staticmethod
def deserialize(reader: EoReader) -> "EffectAgreeServerPacket":
    """
    Deserializes an instance of `EffectAgreeServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        EffectAgreeServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        effects_length = int(reader.remaining / 4)
        effects = []
        for i in range(effects_length):
            effects.append(TileEffect.deserialize(reader))
        result = EffectAgreeServerPacket(effects=effects)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

EffectAdminServerPacket

Bases: Packet

Nearby character taking spike damage

Source code in src/eolib/protocol/_generated/net/server/effect_admin_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
class EffectAdminServerPacket(Packet):
    """
    Nearby character taking spike damage
    """
    _byte_size: int = 0
    _player_id: int
    _hp_percentage: int
    _died: bool
    _damage: int

    def __init__(self, *, player_id: int, hp_percentage: int, died: bool, damage: int):
        """
        Create a new instance of EffectAdminServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            hp_percentage (int): (Value range is 0-252.)
            died (bool): 
            damage (int): (Value range is 0-16194276.)
        """
        self._player_id = player_id
        self._hp_percentage = hp_percentage
        self._died = died
        self._damage = damage

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def hp_percentage(self) -> int:
        return self._hp_percentage

    @property
    def died(self) -> bool:
        return self._died

    @property
    def damage(self) -> int:
        return self._damage

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Effect

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Admin

    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.
        """
        EffectAdminServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "EffectAdminServerPacket") -> None:
        """
        Serializes an instance of `EffectAdminServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (EffectAdminServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._hp_percentage is None:
                raise SerializationError("hp_percentage must be provided.")
            writer.add_char(data._hp_percentage)
            if data._died is None:
                raise SerializationError("died must be provided.")
            writer.add_char(1 if data._died else 0)
            if data._damage is None:
                raise SerializationError("damage must be provided.")
            writer.add_three(data._damage)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "EffectAdminServerPacket":
        """
        Deserializes an instance of `EffectAdminServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            EffectAdminServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            hp_percentage = reader.get_char()
            died = reader.get_char() != 0
            damage = reader.get_three()
            result = EffectAdminServerPacket(player_id=player_id, hp_percentage=hp_percentage, died=died, damage=damage)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"EffectAdminServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, hp_percentage={repr(self._hp_percentage)}, died={repr(self._died)}, damage={repr(self._damage)})"

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.

player_id: int property

hp_percentage: int property

died: bool property

damage: int property

__init__(*, player_id, hp_percentage, died, damage)

Create a new instance of EffectAdminServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
hp_percentage int

(Value range is 0-252.)

required
died bool
required
damage int

(Value range is 0-16194276.)

required
Source code in src/eolib/protocol/_generated/net/server/effect_admin_server_packet.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
def __init__(self, *, player_id: int, hp_percentage: int, died: bool, damage: int):
    """
    Create a new instance of EffectAdminServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        hp_percentage (int): (Value range is 0-252.)
        died (bool): 
        damage (int): (Value range is 0-16194276.)
    """
    self._player_id = player_id
    self._hp_percentage = hp_percentage
    self._died = died
    self._damage = damage

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/effect_admin_server_packet.py
64
65
66
67
68
69
70
71
72
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Effect

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/effect_admin_server_packet.py
74
75
76
77
78
79
80
81
82
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Admin

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/effect_admin_server_packet.py
84
85
86
87
88
89
90
91
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.
    """
    EffectAdminServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of EffectAdminServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data EffectAdminServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/effect_admin_server_packet.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "EffectAdminServerPacket") -> None:
    """
    Serializes an instance of `EffectAdminServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (EffectAdminServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._hp_percentage is None:
            raise SerializationError("hp_percentage must be provided.")
        writer.add_char(data._hp_percentage)
        if data._died is None:
            raise SerializationError("died must be provided.")
        writer.add_char(1 if data._died else 0)
        if data._damage is None:
            raise SerializationError("damage must be provided.")
        writer.add_three(data._damage)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of EffectAdminServerPacket 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
EffectAdminServerPacket EffectAdminServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/effect_admin_server_packet.py
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
@staticmethod
def deserialize(reader: EoReader) -> "EffectAdminServerPacket":
    """
    Deserializes an instance of `EffectAdminServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        EffectAdminServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        hp_percentage = reader.get_char()
        died = reader.get_char() != 0
        damage = reader.get_three()
        result = EffectAdminServerPacket(player_id=player_id, hp_percentage=hp_percentage, died=died, damage=damage)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

DoorOpenServerPacket

Bases: Packet

Nearby door opening

Source code in src/eolib/protocol/_generated/net/server/door_open_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
class DoorOpenServerPacket(Packet):
    """
    Nearby door opening
    """
    _byte_size: int = 0
    _coords: Coords

    def __init__(self, *, coords: Coords):
        """
        Create a new instance of DoorOpenServerPacket.

        Args:
            coords (Coords): The official server erroneously encodes the Y coordinate as a short. The official client reads each coordinate as a char.
        """
        self._coords = coords

    @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 coords(self) -> Coords:
        """
        The official server erroneously encodes the Y coordinate as a short.
        The official client reads each coordinate as a char.
        """
        return self._coords

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Door

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Open

    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.
        """
        DoorOpenServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "DoorOpenServerPacket") -> None:
        """
        Serializes an instance of `DoorOpenServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (DoorOpenServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._coords is None:
                raise SerializationError("coords must be provided.")
            Coords.serialize(writer, data._coords)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "DoorOpenServerPacket":
        """
        Deserializes an instance of `DoorOpenServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            DoorOpenServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            coords = Coords.deserialize(reader)
            result = DoorOpenServerPacket(coords=coords)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"DoorOpenServerPacket(byte_size={repr(self._byte_size)}, coords={repr(self._coords)})"

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.

coords: Coords property

The official server erroneously encodes the Y coordinate as a short. The official client reads each coordinate as a char.

__init__(*, coords)

Create a new instance of DoorOpenServerPacket.

Parameters:

Name Type Description Default
coords Coords

The official server erroneously encodes the Y coordinate as a short. The official client reads each coordinate as a char.

required
Source code in src/eolib/protocol/_generated/net/server/door_open_server_packet.py
21
22
23
24
25
26
27
28
def __init__(self, *, coords: Coords):
    """
    Create a new instance of DoorOpenServerPacket.

    Args:
        coords (Coords): The official server erroneously encodes the Y coordinate as a short. The official client reads each coordinate as a char.
    """
    self._coords = coords

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/door_open_server_packet.py
48
49
50
51
52
53
54
55
56
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Door

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/door_open_server_packet.py
58
59
60
61
62
63
64
65
66
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Open

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/door_open_server_packet.py
68
69
70
71
72
73
74
75
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.
    """
    DoorOpenServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of DoorOpenServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data DoorOpenServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/door_open_server_packet.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
@staticmethod
def serialize(writer: EoWriter, data: "DoorOpenServerPacket") -> None:
    """
    Serializes an instance of `DoorOpenServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (DoorOpenServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._coords is None:
            raise SerializationError("coords must be provided.")
        Coords.serialize(writer, data._coords)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of DoorOpenServerPacket 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
DoorOpenServerPacket DoorOpenServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/door_open_server_packet.py
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
@staticmethod
def deserialize(reader: EoReader) -> "DoorOpenServerPacket":
    """
    Deserializes an instance of `DoorOpenServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        DoorOpenServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        coords = Coords.deserialize(reader)
        result = DoorOpenServerPacket(coords=coords)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

DoorCloseServerPacket

Bases: Packet

Reply to trying to open a locked door

Source code in src/eolib/protocol/_generated/net/server/door_close_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class DoorCloseServerPacket(Packet):
    """
    Reply to trying to open a locked door
    """
    _byte_size: int = 0
    _key: int

    def __init__(self, *, key: int):
        """
        Create a new instance of DoorCloseServerPacket.

        Args:
            key (int): (Value range is 0-252.)
        """
        self._key = key

    @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 key(self) -> int:
        return self._key

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Door

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Close

    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.
        """
        DoorCloseServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "DoorCloseServerPacket") -> None:
        """
        Serializes an instance of `DoorCloseServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (DoorCloseServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._key is None:
                raise SerializationError("key must be provided.")
            writer.add_char(data._key)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "DoorCloseServerPacket":
        """
        Deserializes an instance of `DoorCloseServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            DoorCloseServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            key = reader.get_char()
            result = DoorCloseServerPacket(key=key)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"DoorCloseServerPacket(byte_size={repr(self._byte_size)}, key={repr(self._key)})"

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.

key: int property

__init__(*, key)

Create a new instance of DoorCloseServerPacket.

Parameters:

Name Type Description Default
key int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/door_close_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, key: int):
    """
    Create a new instance of DoorCloseServerPacket.

    Args:
        key (int): (Value range is 0-252.)
    """
    self._key = key

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/door_close_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Door

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/door_close_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Close

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/door_close_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    DoorCloseServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of DoorCloseServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data DoorCloseServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/door_close_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "DoorCloseServerPacket") -> None:
    """
    Serializes an instance of `DoorCloseServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (DoorCloseServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._key is None:
            raise SerializationError("key must be provided.")
        writer.add_char(data._key)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of DoorCloseServerPacket 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
DoorCloseServerPacket DoorCloseServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/door_close_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "DoorCloseServerPacket":
    """
    Deserializes an instance of `DoorCloseServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        DoorCloseServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        key = reader.get_char()
        result = DoorCloseServerPacket(key=key)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

DialogQuestEntry

An entry in the quest switcher

Source code in src/eolib/protocol/_generated/net/server/dialog_quest_entry.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
class DialogQuestEntry:
    """
    An entry in the quest switcher
    """
    _byte_size: int = 0
    _quest_id: int
    _quest_name: str

    def __init__(self, *, quest_id: int, quest_name: str):
        """
        Create a new instance of DialogQuestEntry.

        Args:
            quest_id (int): (Value range is 0-64008.)
            quest_name (str): 
        """
        self._quest_id = quest_id
        self._quest_name = quest_name

    @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 quest_id(self) -> int:
        return self._quest_id

    @property
    def quest_name(self) -> str:
        return self._quest_name

    @staticmethod
    def serialize(writer: EoWriter, data: "DialogQuestEntry") -> None:
        """
        Serializes an instance of `DialogQuestEntry` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (DialogQuestEntry): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._quest_id is None:
                raise SerializationError("quest_id must be provided.")
            writer.add_short(data._quest_id)
            if data._quest_name is None:
                raise SerializationError("quest_name must be provided.")
            writer.add_string(data._quest_name)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "DialogQuestEntry":
        """
        Deserializes an instance of `DialogQuestEntry` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            DialogQuestEntry: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            quest_id = reader.get_short()
            quest_name = reader.get_string()
            result = DialogQuestEntry(quest_id=quest_id, quest_name=quest_name)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"DialogQuestEntry(byte_size={repr(self._byte_size)}, quest_id={repr(self._quest_id)}, quest_name={repr(self._quest_name)})"

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.

quest_id: int property

quest_name: str property

__init__(*, quest_id, quest_name)

Create a new instance of DialogQuestEntry.

Parameters:

Name Type Description Default
quest_id int

(Value range is 0-64008.)

required
quest_name str
required
Source code in src/eolib/protocol/_generated/net/server/dialog_quest_entry.py
18
19
20
21
22
23
24
25
26
27
def __init__(self, *, quest_id: int, quest_name: str):
    """
    Create a new instance of DialogQuestEntry.

    Args:
        quest_id (int): (Value range is 0-64008.)
        quest_name (str): 
    """
    self._quest_id = quest_id
    self._quest_name = quest_name

serialize(writer, data) staticmethod

Serializes an instance of DialogQuestEntry to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data DialogQuestEntry

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/dialog_quest_entry.py
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@staticmethod
def serialize(writer: EoWriter, data: "DialogQuestEntry") -> None:
    """
    Serializes an instance of `DialogQuestEntry` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (DialogQuestEntry): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._quest_id is None:
            raise SerializationError("quest_id must be provided.")
        writer.add_short(data._quest_id)
        if data._quest_name is None:
            raise SerializationError("quest_name must be provided.")
        writer.add_string(data._quest_name)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of DialogQuestEntry 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
DialogQuestEntry DialogQuestEntry

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/dialog_quest_entry.py
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def deserialize(reader: EoReader) -> "DialogQuestEntry":
    """
    Deserializes an instance of `DialogQuestEntry` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        DialogQuestEntry: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        quest_id = reader.get_short()
        quest_name = reader.get_string()
        result = DialogQuestEntry(quest_id=quest_id, quest_name=quest_name)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

DialogEntry

An entry in a quest dialog

Source code in src/eolib/protocol/_generated/net/server/dialog_entry.py
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
class DialogEntry:
    """
    An entry in a quest dialog
    """
    _byte_size: int = 0
    _entry_type: DialogEntryType
    _entry_type_data: 'DialogEntry.EntryTypeData'
    _line: str

    def __init__(self, *, entry_type: DialogEntryType, entry_type_data: 'DialogEntry.EntryTypeData' = None, line: str):
        """
        Create a new instance of DialogEntry.

        Args:
            entry_type (DialogEntryType): 
            entry_type_data (DialogEntry.EntryTypeData): Data associated with the `entry_type` field.
            line (str): 
        """
        self._entry_type = entry_type
        self._entry_type_data = entry_type_data
        self._line = line

    @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 entry_type(self) -> DialogEntryType:
        return self._entry_type

    @property
    def entry_type_data(self) -> 'DialogEntry.EntryTypeData':
        """
        DialogEntry.EntryTypeData: Data associated with the `entry_type` field.
        """
        return self._entry_type_data

    @property
    def line(self) -> str:
        return self._line

    @staticmethod
    def serialize(writer: EoWriter, data: "DialogEntry") -> None:
        """
        Serializes an instance of `DialogEntry` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (DialogEntry): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._entry_type is None:
                raise SerializationError("entry_type must be provided.")
            writer.add_short(int(data._entry_type))
            if data._entry_type == DialogEntryType.Link:
                if not isinstance(data._entry_type_data, DialogEntry.EntryTypeDataLink):
                    raise SerializationError("Expected entry_type_data to be type DialogEntry.EntryTypeDataLink for entry_type " + DialogEntryType(data._entry_type).name + ".")
                DialogEntry.EntryTypeDataLink.serialize(writer, data._entry_type_data)
            if data._line is None:
                raise SerializationError("line must be provided.")
            writer.add_string(data._line)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "DialogEntry":
        """
        Deserializes an instance of `DialogEntry` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            DialogEntry: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            entry_type = DialogEntryType(reader.get_short())
            entry_type_data: DialogEntry.EntryTypeData = None
            if entry_type == DialogEntryType.Link:
                entry_type_data = DialogEntry.EntryTypeDataLink.deserialize(reader)
            line = reader.get_string()
            result = DialogEntry(entry_type=entry_type, entry_type_data=entry_type_data, line=line)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"DialogEntry(byte_size={repr(self._byte_size)}, entry_type={repr(self._entry_type)}, entry_type_data={repr(self._entry_type_data)}, line={repr(self._line)})"

    EntryTypeData = Union['DialogEntry.EntryTypeDataLink', None]
    """
    Data associated with different values of the `entry_type` field.
    """

    class EntryTypeDataLink:
        """
        Data associated with entry_type value DialogEntryType.Link
        """
        _byte_size: int = 0
        _link_id: int

        def __init__(self, *, link_id: int):
            """
            Create a new instance of DialogEntry.EntryTypeDataLink.

            Args:
                link_id (int): (Value range is 0-64008.)
            """
            self._link_id = link_id

        @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 link_id(self) -> int:
            return self._link_id

        @staticmethod
        def serialize(writer: EoWriter, data: "DialogEntry.EntryTypeDataLink") -> None:
            """
            Serializes an instance of `DialogEntry.EntryTypeDataLink` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (DialogEntry.EntryTypeDataLink): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._link_id is None:
                    raise SerializationError("link_id must be provided.")
                writer.add_short(data._link_id)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "DialogEntry.EntryTypeDataLink":
            """
            Deserializes an instance of `DialogEntry.EntryTypeDataLink` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                DialogEntry.EntryTypeDataLink: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                link_id = reader.get_short()
                result = DialogEntry.EntryTypeDataLink(link_id=link_id)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"DialogEntry.EntryTypeDataLink(byte_size={repr(self._byte_size)}, link_id={repr(self._link_id)})"

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.

entry_type: DialogEntryType property

entry_type_data: DialogEntry.EntryTypeData property

DialogEntry.EntryTypeData: Data associated with the entry_type field.

line: str property

EntryTypeData = Union['DialogEntry.EntryTypeDataLink', None] class-attribute instance-attribute

Data associated with different values of the entry_type field.

Data associated with entry_type value DialogEntryType.Link

Source code in src/eolib/protocol/_generated/net/server/dialog_entry.py
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
class EntryTypeDataLink:
    """
    Data associated with entry_type value DialogEntryType.Link
    """
    _byte_size: int = 0
    _link_id: int

    def __init__(self, *, link_id: int):
        """
        Create a new instance of DialogEntry.EntryTypeDataLink.

        Args:
            link_id (int): (Value range is 0-64008.)
        """
        self._link_id = link_id

    @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 link_id(self) -> int:
        return self._link_id

    @staticmethod
    def serialize(writer: EoWriter, data: "DialogEntry.EntryTypeDataLink") -> None:
        """
        Serializes an instance of `DialogEntry.EntryTypeDataLink` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (DialogEntry.EntryTypeDataLink): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._link_id is None:
                raise SerializationError("link_id must be provided.")
            writer.add_short(data._link_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "DialogEntry.EntryTypeDataLink":
        """
        Deserializes an instance of `DialogEntry.EntryTypeDataLink` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            DialogEntry.EntryTypeDataLink: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            link_id = reader.get_short()
            result = DialogEntry.EntryTypeDataLink(link_id=link_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"DialogEntry.EntryTypeDataLink(byte_size={repr(self._byte_size)}, link_id={repr(self._link_id)})"

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__(*, link_id)

Create a new instance of DialogEntry.EntryTypeDataLink.

Parameters:

Name Type Description Default
link_id int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/dialog_entry.py
123
124
125
126
127
128
129
130
def __init__(self, *, link_id: int):
    """
    Create a new instance of DialogEntry.EntryTypeDataLink.

    Args:
        link_id (int): (Value range is 0-64008.)
    """
    self._link_id = link_id

serialize(writer, data) staticmethod

Serializes an instance of DialogEntry.EntryTypeDataLink to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data EntryTypeDataLink

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/dialog_entry.py
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
@staticmethod
def serialize(writer: EoWriter, data: "DialogEntry.EntryTypeDataLink") -> None:
    """
    Serializes an instance of `DialogEntry.EntryTypeDataLink` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (DialogEntry.EntryTypeDataLink): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._link_id is None:
            raise SerializationError("link_id must be provided.")
        writer.add_short(data._link_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of DialogEntry.EntryTypeDataLink from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
EntryTypeDataLink

DialogEntry.EntryTypeDataLink: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/dialog_entry.py
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
@staticmethod
def deserialize(reader: EoReader) -> "DialogEntry.EntryTypeDataLink":
    """
    Deserializes an instance of `DialogEntry.EntryTypeDataLink` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        DialogEntry.EntryTypeDataLink: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        link_id = reader.get_short()
        result = DialogEntry.EntryTypeDataLink(link_id=link_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

__init__(*, entry_type, entry_type_data=None, line)

Create a new instance of DialogEntry.

Parameters:

Name Type Description Default
entry_type DialogEntryType
required
entry_type_data EntryTypeData

Data associated with the entry_type field.

None
line str
required
Source code in src/eolib/protocol/_generated/net/server/dialog_entry.py
21
22
23
24
25
26
27
28
29
30
31
32
def __init__(self, *, entry_type: DialogEntryType, entry_type_data: 'DialogEntry.EntryTypeData' = None, line: str):
    """
    Create a new instance of DialogEntry.

    Args:
        entry_type (DialogEntryType): 
        entry_type_data (DialogEntry.EntryTypeData): Data associated with the `entry_type` field.
        line (str): 
    """
    self._entry_type = entry_type
    self._entry_type_data = entry_type_data
    self._line = line

serialize(writer, data) staticmethod

Serializes an instance of DialogEntry to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data DialogEntry

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/dialog_entry.py
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
@staticmethod
def serialize(writer: EoWriter, data: "DialogEntry") -> None:
    """
    Serializes an instance of `DialogEntry` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (DialogEntry): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._entry_type is None:
            raise SerializationError("entry_type must be provided.")
        writer.add_short(int(data._entry_type))
        if data._entry_type == DialogEntryType.Link:
            if not isinstance(data._entry_type_data, DialogEntry.EntryTypeDataLink):
                raise SerializationError("Expected entry_type_data to be type DialogEntry.EntryTypeDataLink for entry_type " + DialogEntryType(data._entry_type).name + ".")
            DialogEntry.EntryTypeDataLink.serialize(writer, data._entry_type_data)
        if data._line is None:
            raise SerializationError("line must be provided.")
        writer.add_string(data._line)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of DialogEntry 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
DialogEntry DialogEntry

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/dialog_entry.py
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
@staticmethod
def deserialize(reader: EoReader) -> "DialogEntry":
    """
    Deserializes an instance of `DialogEntry` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        DialogEntry: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        entry_type = DialogEntryType(reader.get_short())
        entry_type_data: DialogEntry.EntryTypeData = None
        if entry_type == DialogEntryType.Link:
            entry_type_data = DialogEntry.EntryTypeDataLink.deserialize(reader)
        line = reader.get_string()
        result = DialogEntry(entry_type=entry_type, entry_type_data=entry_type_data, line=line)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

DialogEntryType

Bases: IntEnum

The type of an entry in a quest dialog

Source code in src/eolib/protocol/_generated/net/server/dialog_entry_type.py
 9
10
11
12
13
14
class DialogEntryType(IntEnum, metaclass=ProtocolEnumMeta):
    """
    The type of an entry in a quest dialog
    """
    Text = 1
    Link = 2

Text = 1 class-attribute instance-attribute

ConnectionPlayerServerPacket

Bases: Packet

Ping request

Source code in src/eolib/protocol/_generated/net/server/connection_player_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
class ConnectionPlayerServerPacket(Packet):
    """
    Ping request
    """
    _byte_size: int = 0
    _seq1: int
    _seq2: int

    def __init__(self, *, seq1: int, seq2: int):
        """
        Create a new instance of ConnectionPlayerServerPacket.

        Args:
            seq1 (int): (Value range is 0-64008.)
            seq2 (int): (Value range is 0-252.)
        """
        self._seq1 = seq1
        self._seq2 = seq2

    @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 seq1(self) -> int:
        return self._seq1

    @property
    def seq2(self) -> int:
        return self._seq2

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Connection

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Player

    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.
        """
        ConnectionPlayerServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ConnectionPlayerServerPacket") -> None:
        """
        Serializes an instance of `ConnectionPlayerServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ConnectionPlayerServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._seq1 is None:
                raise SerializationError("seq1 must be provided.")
            writer.add_short(data._seq1)
            if data._seq2 is None:
                raise SerializationError("seq2 must be provided.")
            writer.add_char(data._seq2)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ConnectionPlayerServerPacket":
        """
        Deserializes an instance of `ConnectionPlayerServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ConnectionPlayerServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            seq1 = reader.get_short()
            seq2 = reader.get_char()
            result = ConnectionPlayerServerPacket(seq1=seq1, seq2=seq2)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ConnectionPlayerServerPacket(byte_size={repr(self._byte_size)}, seq1={repr(self._seq1)}, seq2={repr(self._seq2)})"

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.

seq1: int property

seq2: int property

__init__(*, seq1, seq2)

Create a new instance of ConnectionPlayerServerPacket.

Parameters:

Name Type Description Default
seq1 int

(Value range is 0-64008.)

required
seq2 int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/connection_player_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, seq1: int, seq2: int):
    """
    Create a new instance of ConnectionPlayerServerPacket.

    Args:
        seq1 (int): (Value range is 0-64008.)
        seq2 (int): (Value range is 0-252.)
    """
    self._seq1 = seq1
    self._seq2 = seq2

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/connection_player_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Connection

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/connection_player_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Player

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/connection_player_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    ConnectionPlayerServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ConnectionPlayerServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ConnectionPlayerServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/connection_player_server_packet.py
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@staticmethod
def serialize(writer: EoWriter, data: "ConnectionPlayerServerPacket") -> None:
    """
    Serializes an instance of `ConnectionPlayerServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ConnectionPlayerServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._seq1 is None:
            raise SerializationError("seq1 must be provided.")
        writer.add_short(data._seq1)
        if data._seq2 is None:
            raise SerializationError("seq2 must be provided.")
        writer.add_char(data._seq2)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ConnectionPlayerServerPacket 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
ConnectionPlayerServerPacket ConnectionPlayerServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/connection_player_server_packet.py
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@staticmethod
def deserialize(reader: EoReader) -> "ConnectionPlayerServerPacket":
    """
    Deserializes an instance of `ConnectionPlayerServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ConnectionPlayerServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        seq1 = reader.get_short()
        seq2 = reader.get_char()
        result = ConnectionPlayerServerPacket(seq1=seq1, seq2=seq2)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

CitizenRequestServerPacket

Bases: Packet

Reply to requesting sleeping at an inn

Source code in src/eolib/protocol/_generated/net/server/citizen_request_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class CitizenRequestServerPacket(Packet):
    """
    Reply to requesting sleeping at an inn
    """
    _byte_size: int = 0
    _cost: int

    def __init__(self, *, cost: int):
        """
        Create a new instance of CitizenRequestServerPacket.

        Args:
            cost (int): (Value range is 0-4097152080.)
        """
        self._cost = cost

    @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 cost(self) -> int:
        return self._cost

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Citizen

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Request

    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.
        """
        CitizenRequestServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "CitizenRequestServerPacket") -> None:
        """
        Serializes an instance of `CitizenRequestServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CitizenRequestServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._cost is None:
                raise SerializationError("cost must be provided.")
            writer.add_int(data._cost)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CitizenRequestServerPacket":
        """
        Deserializes an instance of `CitizenRequestServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CitizenRequestServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            cost = reader.get_int()
            result = CitizenRequestServerPacket(cost=cost)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CitizenRequestServerPacket(byte_size={repr(self._byte_size)}, cost={repr(self._cost)})"

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.

cost: int property

__init__(*, cost)

Create a new instance of CitizenRequestServerPacket.

Parameters:

Name Type Description Default
cost int

(Value range is 0-4097152080.)

required
Source code in src/eolib/protocol/_generated/net/server/citizen_request_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, cost: int):
    """
    Create a new instance of CitizenRequestServerPacket.

    Args:
        cost (int): (Value range is 0-4097152080.)
    """
    self._cost = cost

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/citizen_request_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Citizen

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/citizen_request_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Request

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/citizen_request_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    CitizenRequestServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of CitizenRequestServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CitizenRequestServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/citizen_request_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "CitizenRequestServerPacket") -> None:
    """
    Serializes an instance of `CitizenRequestServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CitizenRequestServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._cost is None:
            raise SerializationError("cost must be provided.")
        writer.add_int(data._cost)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CitizenRequestServerPacket 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
CitizenRequestServerPacket CitizenRequestServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/citizen_request_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "CitizenRequestServerPacket":
    """
    Deserializes an instance of `CitizenRequestServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CitizenRequestServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        cost = reader.get_int()
        result = CitizenRequestServerPacket(cost=cost)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

CitizenReplyServerPacket

Bases: Packet

Response to subscribing to a town

Source code in src/eolib/protocol/_generated/net/server/citizen_reply_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class CitizenReplyServerPacket(Packet):
    """
    Response to subscribing to a town
    """
    _byte_size: int = 0
    _questions_wrong: int

    def __init__(self, *, questions_wrong: int):
        """
        Create a new instance of CitizenReplyServerPacket.

        Args:
            questions_wrong (int): (Value range is 0-252.)
        """
        self._questions_wrong = questions_wrong

    @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 questions_wrong(self) -> int:
        return self._questions_wrong

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Citizen

    @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.
        """
        CitizenReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "CitizenReplyServerPacket") -> None:
        """
        Serializes an instance of `CitizenReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CitizenReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._questions_wrong is None:
                raise SerializationError("questions_wrong must be provided.")
            writer.add_char(data._questions_wrong)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CitizenReplyServerPacket":
        """
        Deserializes an instance of `CitizenReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CitizenReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            questions_wrong = reader.get_char()
            result = CitizenReplyServerPacket(questions_wrong=questions_wrong)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CitizenReplyServerPacket(byte_size={repr(self._byte_size)}, questions_wrong={repr(self._questions_wrong)})"

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.

questions_wrong: int property

__init__(*, questions_wrong)

Create a new instance of CitizenReplyServerPacket.

Parameters:

Name Type Description Default
questions_wrong int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/citizen_reply_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, questions_wrong: int):
    """
    Create a new instance of CitizenReplyServerPacket.

    Args:
        questions_wrong (int): (Value range is 0-252.)
    """
    self._questions_wrong = questions_wrong

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/citizen_reply_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Citizen

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/citizen_reply_server_packet.py
53
54
55
56
57
58
59
60
61
@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/citizen_reply_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    CitizenReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of CitizenReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CitizenReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/citizen_reply_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "CitizenReplyServerPacket") -> None:
    """
    Serializes an instance of `CitizenReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CitizenReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._questions_wrong is None:
            raise SerializationError("questions_wrong must be provided.")
        writer.add_char(data._questions_wrong)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CitizenReplyServerPacket 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
CitizenReplyServerPacket CitizenReplyServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/citizen_reply_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "CitizenReplyServerPacket":
    """
    Deserializes an instance of `CitizenReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CitizenReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        questions_wrong = reader.get_char()
        result = CitizenReplyServerPacket(questions_wrong=questions_wrong)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

InnUnsubscribeReply

Bases: IntEnum

Reply code sent with CITIZEN_REMOVE packet. Indicates the result of trying to give up citizenship to a town.

Source code in src/eolib/protocol/_generated/net/server/inn_unsubscribe_reply.py
 9
10
11
12
13
14
15
class InnUnsubscribeReply(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Reply code sent with CITIZEN_REMOVE packet.
    Indicates the result of trying to give up citizenship to a town.
    """
    NotCitizen = 0
    Unsubscribed = 1

NotCitizen = 0 class-attribute instance-attribute

Unsubscribed = 1 class-attribute instance-attribute

CitizenRemoveServerPacket

Bases: Packet

Response to giving up citizenship of a town

Source code in src/eolib/protocol/_generated/net/server/citizen_remove_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
class CitizenRemoveServerPacket(Packet):
    """
    Response to giving up citizenship of a town
    """
    _byte_size: int = 0
    _reply_code: InnUnsubscribeReply

    def __init__(self, *, reply_code: InnUnsubscribeReply):
        """
        Create a new instance of CitizenRemoveServerPacket.

        Args:
            reply_code (InnUnsubscribeReply): 
        """
        self._reply_code = reply_code

    @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) -> InnUnsubscribeReply:
        return self._reply_code

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Citizen

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Remove

    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.
        """
        CitizenRemoveServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "CitizenRemoveServerPacket") -> None:
        """
        Serializes an instance of `CitizenRemoveServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CitizenRemoveServerPacket): 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_char(int(data._reply_code))
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CitizenRemoveServerPacket":
        """
        Deserializes an instance of `CitizenRemoveServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CitizenRemoveServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reply_code = InnUnsubscribeReply(reader.get_char())
            result = CitizenRemoveServerPacket(reply_code=reply_code)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CitizenRemoveServerPacket(byte_size={repr(self._byte_size)}, reply_code={repr(self._reply_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.

reply_code: InnUnsubscribeReply property

__init__(*, reply_code)

Create a new instance of CitizenRemoveServerPacket.

Parameters:

Name Type Description Default
reply_code InnUnsubscribeReply
required
Source code in src/eolib/protocol/_generated/net/server/citizen_remove_server_packet.py
21
22
23
24
25
26
27
28
def __init__(self, *, reply_code: InnUnsubscribeReply):
    """
    Create a new instance of CitizenRemoveServerPacket.

    Args:
        reply_code (InnUnsubscribeReply): 
    """
    self._reply_code = reply_code

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/citizen_remove_server_packet.py
44
45
46
47
48
49
50
51
52
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Citizen

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/citizen_remove_server_packet.py
54
55
56
57
58
59
60
61
62
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Remove

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/citizen_remove_server_packet.py
64
65
66
67
68
69
70
71
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.
    """
    CitizenRemoveServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of CitizenRemoveServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CitizenRemoveServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/citizen_remove_server_packet.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@staticmethod
def serialize(writer: EoWriter, data: "CitizenRemoveServerPacket") -> None:
    """
    Serializes an instance of `CitizenRemoveServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CitizenRemoveServerPacket): 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_char(int(data._reply_code))
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CitizenRemoveServerPacket 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
CitizenRemoveServerPacket CitizenRemoveServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/citizen_remove_server_packet.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@staticmethod
def deserialize(reader: EoReader) -> "CitizenRemoveServerPacket":
    """
    Deserializes an instance of `CitizenRemoveServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CitizenRemoveServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reply_code = InnUnsubscribeReply(reader.get_char())
        result = CitizenRemoveServerPacket(reply_code=reply_code)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

CitizenOpenServerPacket

Bases: Packet

Response from talking to a citizenship NPC

Source code in src/eolib/protocol/_generated/net/server/citizen_open_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
class CitizenOpenServerPacket(Packet):
    """
    Response from talking to a citizenship NPC
    """
    _byte_size: int = 0
    _behavior_id: int
    _current_home_id: int
    _session_id: int
    _questions: tuple[str, ...]

    def __init__(self, *, behavior_id: int, current_home_id: int, session_id: int, questions: Iterable[str]):
        """
        Create a new instance of CitizenOpenServerPacket.

        Args:
            behavior_id (int): (Value range is 0-16194276.)
            current_home_id (int): (Value range is 0-252.)
            session_id (int): (Value range is 0-64008.)
            questions (Iterable[str]): (Length must be `3`.)
        """
        self._behavior_id = behavior_id
        self._current_home_id = current_home_id
        self._session_id = session_id
        self._questions = tuple(questions)

    @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 behavior_id(self) -> int:
        return self._behavior_id

    @property
    def current_home_id(self) -> int:
        return self._current_home_id

    @property
    def session_id(self) -> int:
        return self._session_id

    @property
    def questions(self) -> tuple[str, ...]:
        return self._questions

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Citizen

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Open

    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.
        """
        CitizenOpenServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "CitizenOpenServerPacket") -> None:
        """
        Serializes an instance of `CitizenOpenServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CitizenOpenServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._behavior_id is None:
                raise SerializationError("behavior_id must be provided.")
            writer.add_three(data._behavior_id)
            if data._current_home_id is None:
                raise SerializationError("current_home_id must be provided.")
            writer.add_char(data._current_home_id)
            if data._session_id is None:
                raise SerializationError("session_id must be provided.")
            writer.add_short(data._session_id)
            writer.add_byte(0xFF)
            if data._questions is None:
                raise SerializationError("questions must be provided.")
            if len(data._questions) != 3:
                raise SerializationError(f"Expected length of questions to be exactly 3, got {len(data._questions)}.")
            for i in range(3):
                if i > 0:
                    writer.add_byte(0xFF)
                writer.add_string(data._questions[i])
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CitizenOpenServerPacket":
        """
        Deserializes an instance of `CitizenOpenServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CitizenOpenServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            behavior_id = reader.get_three()
            current_home_id = reader.get_char()
            session_id = reader.get_short()
            reader.next_chunk()
            questions = []
            for i in range(3):
                questions.append(reader.get_string())
                if i + 1 < 3:
                    reader.next_chunk()
            reader.chunked_reading_mode = False
            result = CitizenOpenServerPacket(behavior_id=behavior_id, current_home_id=current_home_id, session_id=session_id, questions=questions)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CitizenOpenServerPacket(byte_size={repr(self._byte_size)}, behavior_id={repr(self._behavior_id)}, current_home_id={repr(self._current_home_id)}, session_id={repr(self._session_id)}, questions={repr(self._questions)})"

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.

behavior_id: int property

current_home_id: int property

session_id: int property

questions: tuple[str, ...] property

__init__(*, behavior_id, current_home_id, session_id, questions)

Create a new instance of CitizenOpenServerPacket.

Parameters:

Name Type Description Default
behavior_id int

(Value range is 0-16194276.)

required
current_home_id int

(Value range is 0-252.)

required
session_id int

(Value range is 0-64008.)

required
questions Iterable[str]

(Length must be 3.)

required
Source code in src/eolib/protocol/_generated/net/server/citizen_open_server_packet.py
25
26
27
28
29
30
31
32
33
34
35
36
37
38
def __init__(self, *, behavior_id: int, current_home_id: int, session_id: int, questions: Iterable[str]):
    """
    Create a new instance of CitizenOpenServerPacket.

    Args:
        behavior_id (int): (Value range is 0-16194276.)
        current_home_id (int): (Value range is 0-252.)
        session_id (int): (Value range is 0-64008.)
        questions (Iterable[str]): (Length must be `3`.)
    """
    self._behavior_id = behavior_id
    self._current_home_id = current_home_id
    self._session_id = session_id
    self._questions = tuple(questions)

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/citizen_open_server_packet.py
66
67
68
69
70
71
72
73
74
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Citizen

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/citizen_open_server_packet.py
76
77
78
79
80
81
82
83
84
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Open

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/citizen_open_server_packet.py
86
87
88
89
90
91
92
93
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.
    """
    CitizenOpenServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of CitizenOpenServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CitizenOpenServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/citizen_open_server_packet.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "CitizenOpenServerPacket") -> None:
    """
    Serializes an instance of `CitizenOpenServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CitizenOpenServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._behavior_id is None:
            raise SerializationError("behavior_id must be provided.")
        writer.add_three(data._behavior_id)
        if data._current_home_id is None:
            raise SerializationError("current_home_id must be provided.")
        writer.add_char(data._current_home_id)
        if data._session_id is None:
            raise SerializationError("session_id must be provided.")
        writer.add_short(data._session_id)
        writer.add_byte(0xFF)
        if data._questions is None:
            raise SerializationError("questions must be provided.")
        if len(data._questions) != 3:
            raise SerializationError(f"Expected length of questions to be exactly 3, got {len(data._questions)}.")
        for i in range(3):
            if i > 0:
                writer.add_byte(0xFF)
            writer.add_string(data._questions[i])
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CitizenOpenServerPacket 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
CitizenOpenServerPacket 'CitizenOpenServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/citizen_open_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "CitizenOpenServerPacket":
    """
    Deserializes an instance of `CitizenOpenServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CitizenOpenServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        behavior_id = reader.get_three()
        current_home_id = reader.get_char()
        session_id = reader.get_short()
        reader.next_chunk()
        questions = []
        for i in range(3):
            questions.append(reader.get_string())
            if i + 1 < 3:
                reader.next_chunk()
        reader.chunked_reading_mode = False
        result = CitizenOpenServerPacket(behavior_id=behavior_id, current_home_id=current_home_id, session_id=session_id, questions=questions)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

CitizenAcceptServerPacket

Bases: Packet

Sleeping at an inn

Source code in src/eolib/protocol/_generated/net/server/citizen_accept_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class CitizenAcceptServerPacket(Packet):
    """
    Sleeping at an inn
    """
    _byte_size: int = 0
    _gold_amount: int

    def __init__(self, *, gold_amount: int):
        """
        Create a new instance of CitizenAcceptServerPacket.

        Args:
            gold_amount (int): (Value range is 0-4097152080.)
        """
        self._gold_amount = gold_amount

    @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 gold_amount(self) -> int:
        return self._gold_amount

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Citizen

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Accept

    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.
        """
        CitizenAcceptServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "CitizenAcceptServerPacket") -> None:
        """
        Serializes an instance of `CitizenAcceptServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CitizenAcceptServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._gold_amount is None:
                raise SerializationError("gold_amount must be provided.")
            writer.add_int(data._gold_amount)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CitizenAcceptServerPacket":
        """
        Deserializes an instance of `CitizenAcceptServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CitizenAcceptServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            gold_amount = reader.get_int()
            result = CitizenAcceptServerPacket(gold_amount=gold_amount)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CitizenAcceptServerPacket(byte_size={repr(self._byte_size)}, gold_amount={repr(self._gold_amount)})"

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.

gold_amount: int property

__init__(*, gold_amount)

Create a new instance of CitizenAcceptServerPacket.

Parameters:

Name Type Description Default
gold_amount int

(Value range is 0-4097152080.)

required
Source code in src/eolib/protocol/_generated/net/server/citizen_accept_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, gold_amount: int):
    """
    Create a new instance of CitizenAcceptServerPacket.

    Args:
        gold_amount (int): (Value range is 0-4097152080.)
    """
    self._gold_amount = gold_amount

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/citizen_accept_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Citizen

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/citizen_accept_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Accept

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/citizen_accept_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    CitizenAcceptServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of CitizenAcceptServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CitizenAcceptServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/citizen_accept_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "CitizenAcceptServerPacket") -> None:
    """
    Serializes an instance of `CitizenAcceptServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CitizenAcceptServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._gold_amount is None:
            raise SerializationError("gold_amount must be provided.")
        writer.add_int(data._gold_amount)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CitizenAcceptServerPacket 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
CitizenAcceptServerPacket CitizenAcceptServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/citizen_accept_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "CitizenAcceptServerPacket":
    """
    Deserializes an instance of `CitizenAcceptServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CitizenAcceptServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        gold_amount = reader.get_int()
        result = CitizenAcceptServerPacket(gold_amount=gold_amount)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ChestSpecServerPacket

Bases: Packet

Reply to trying to add an item to a full chest

Source code in src/eolib/protocol/_generated/net/server/chest_spec_server_packet.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
class ChestSpecServerPacket(Packet):
    """
    Reply to trying to add an item to a full chest
    """
    _byte_size: int = 0

    def __init__(self):
        """
        Create a new instance of ChestSpecServerPacket.
        """

    @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 family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Chest

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Spec

    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.
        """
        ChestSpecServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ChestSpecServerPacket") -> None:
        """
        Serializes an instance of `ChestSpecServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ChestSpecServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.add_byte(0)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ChestSpecServerPacket":
        """
        Deserializes an instance of `ChestSpecServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ChestSpecServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_byte()
            result = ChestSpecServerPacket()
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ChestSpecServerPacket(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 ChestSpecServerPacket.

Source code in src/eolib/protocol/_generated/net/server/chest_spec_server_packet.py
18
19
20
21
def __init__(self):
    """
    Create a new instance of ChestSpecServerPacket.
    """

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/chest_spec_server_packet.py
33
34
35
36
37
38
39
40
41
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Chest

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/chest_spec_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Spec

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/chest_spec_server_packet.py
53
54
55
56
57
58
59
60
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.
    """
    ChestSpecServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ChestSpecServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ChestSpecServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/chest_spec_server_packet.py
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@staticmethod
def serialize(writer: EoWriter, data: "ChestSpecServerPacket") -> None:
    """
    Serializes an instance of `ChestSpecServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ChestSpecServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.add_byte(0)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ChestSpecServerPacket 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
ChestSpecServerPacket ChestSpecServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/chest_spec_server_packet.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@staticmethod
def deserialize(reader: EoReader) -> "ChestSpecServerPacket":
    """
    Deserializes an instance of `ChestSpecServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ChestSpecServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_byte()
        result = ChestSpecServerPacket()
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ChestReplyServerPacket

Bases: Packet

Reply to placing an item in to a chest

Source code in src/eolib/protocol/_generated/net/server/chest_reply_server_packet.py
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
class ChestReplyServerPacket(Packet):
    """
    Reply to placing an item in to a chest
    """
    _byte_size: int = 0
    _added_item_id: int
    _remaining_amount: int
    _weight: Weight
    _items: tuple[ThreeItem, ...]

    def __init__(self, *, added_item_id: int, remaining_amount: int, weight: Weight, items: Iterable[ThreeItem]):
        """
        Create a new instance of ChestReplyServerPacket.

        Args:
            added_item_id (int): (Value range is 0-64008.)
            remaining_amount (int): (Value range is 0-4097152080.)
            weight (Weight): 
            items (Iterable[ThreeItem]): 
        """
        self._added_item_id = added_item_id
        self._remaining_amount = remaining_amount
        self._weight = weight
        self._items = tuple(items)

    @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 added_item_id(self) -> int:
        return self._added_item_id

    @property
    def remaining_amount(self) -> int:
        return self._remaining_amount

    @property
    def weight(self) -> Weight:
        return self._weight

    @property
    def items(self) -> tuple[ThreeItem, ...]:
        return self._items

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Chest

    @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.
        """
        ChestReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ChestReplyServerPacket") -> None:
        """
        Serializes an instance of `ChestReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ChestReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._added_item_id is None:
                raise SerializationError("added_item_id must be provided.")
            writer.add_short(data._added_item_id)
            if data._remaining_amount is None:
                raise SerializationError("remaining_amount must be provided.")
            writer.add_int(data._remaining_amount)
            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)):
                ThreeItem.serialize(writer, data._items[i])
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ChestReplyServerPacket":
        """
        Deserializes an instance of `ChestReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ChestReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            added_item_id = reader.get_short()
            remaining_amount = reader.get_int()
            weight = Weight.deserialize(reader)
            items_length = int(reader.remaining / 5)
            items = []
            for i in range(items_length):
                items.append(ThreeItem.deserialize(reader))
            result = ChestReplyServerPacket(added_item_id=added_item_id, remaining_amount=remaining_amount, weight=weight, items=items)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ChestReplyServerPacket(byte_size={repr(self._byte_size)}, added_item_id={repr(self._added_item_id)}, remaining_amount={repr(self._remaining_amount)}, weight={repr(self._weight)}, items={repr(self._items)})"

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.

added_item_id: int property

remaining_amount: int property

weight: Weight property

items: tuple[ThreeItem, ...] property

__init__(*, added_item_id, remaining_amount, weight, items)

Create a new instance of ChestReplyServerPacket.

Parameters:

Name Type Description Default
added_item_id int

(Value range is 0-64008.)

required
remaining_amount int

(Value range is 0-4097152080.)

required
weight Weight
required
items Iterable[ThreeItem]
required
Source code in src/eolib/protocol/_generated/net/server/chest_reply_server_packet.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
def __init__(self, *, added_item_id: int, remaining_amount: int, weight: Weight, items: Iterable[ThreeItem]):
    """
    Create a new instance of ChestReplyServerPacket.

    Args:
        added_item_id (int): (Value range is 0-64008.)
        remaining_amount (int): (Value range is 0-4097152080.)
        weight (Weight): 
        items (Iterable[ThreeItem]): 
    """
    self._added_item_id = added_item_id
    self._remaining_amount = remaining_amount
    self._weight = weight
    self._items = tuple(items)

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/chest_reply_server_packet.py
68
69
70
71
72
73
74
75
76
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Chest

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/chest_reply_server_packet.py
78
79
80
81
82
83
84
85
86
@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/chest_reply_server_packet.py
88
89
90
91
92
93
94
95
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.
    """
    ChestReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ChestReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ChestReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/chest_reply_server_packet.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "ChestReplyServerPacket") -> None:
    """
    Serializes an instance of `ChestReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ChestReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._added_item_id is None:
            raise SerializationError("added_item_id must be provided.")
        writer.add_short(data._added_item_id)
        if data._remaining_amount is None:
            raise SerializationError("remaining_amount must be provided.")
        writer.add_int(data._remaining_amount)
        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)):
            ThreeItem.serialize(writer, data._items[i])
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ChestReplyServerPacket 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
ChestReplyServerPacket 'ChestReplyServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/chest_reply_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "ChestReplyServerPacket":
    """
    Deserializes an instance of `ChestReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ChestReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        added_item_id = reader.get_short()
        remaining_amount = reader.get_int()
        weight = Weight.deserialize(reader)
        items_length = int(reader.remaining / 5)
        items = []
        for i in range(items_length):
            items.append(ThreeItem.deserialize(reader))
        result = ChestReplyServerPacket(added_item_id=added_item_id, remaining_amount=remaining_amount, weight=weight, items=items)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ChestOpenServerPacket

Bases: Packet

Reply to opening a chest

Source code in src/eolib/protocol/_generated/net/server/chest_open_server_packet.py
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
class ChestOpenServerPacket(Packet):
    """
    Reply to opening a chest
    """
    _byte_size: int = 0
    _coords: Coords
    _items: tuple[ThreeItem, ...]

    def __init__(self, *, coords: Coords, items: Iterable[ThreeItem]):
        """
        Create a new instance of ChestOpenServerPacket.

        Args:
            coords (Coords): 
            items (Iterable[ThreeItem]): 
        """
        self._coords = coords
        self._items = tuple(items)

    @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 coords(self) -> Coords:
        return self._coords

    @property
    def items(self) -> tuple[ThreeItem, ...]:
        return self._items

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Chest

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Open

    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.
        """
        ChestOpenServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ChestOpenServerPacket") -> None:
        """
        Serializes an instance of `ChestOpenServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ChestOpenServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._coords is None:
                raise SerializationError("coords must be provided.")
            Coords.serialize(writer, data._coords)
            if data._items is None:
                raise SerializationError("items must be provided.")
            for i in range(len(data._items)):
                ThreeItem.serialize(writer, data._items[i])
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ChestOpenServerPacket":
        """
        Deserializes an instance of `ChestOpenServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ChestOpenServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            coords = Coords.deserialize(reader)
            items_length = int(reader.remaining / 5)
            items = []
            for i in range(items_length):
                items.append(ThreeItem.deserialize(reader))
            result = ChestOpenServerPacket(coords=coords, items=items)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ChestOpenServerPacket(byte_size={repr(self._byte_size)}, coords={repr(self._coords)}, items={repr(self._items)})"

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.

coords: Coords property

items: tuple[ThreeItem, ...] property

__init__(*, coords, items)

Create a new instance of ChestOpenServerPacket.

Parameters:

Name Type Description Default
coords Coords
required
items Iterable[ThreeItem]
required
Source code in src/eolib/protocol/_generated/net/server/chest_open_server_packet.py
25
26
27
28
29
30
31
32
33
34
def __init__(self, *, coords: Coords, items: Iterable[ThreeItem]):
    """
    Create a new instance of ChestOpenServerPacket.

    Args:
        coords (Coords): 
        items (Iterable[ThreeItem]): 
    """
    self._coords = coords
    self._items = tuple(items)

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/chest_open_server_packet.py
54
55
56
57
58
59
60
61
62
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Chest

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/chest_open_server_packet.py
64
65
66
67
68
69
70
71
72
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Open

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/chest_open_server_packet.py
74
75
76
77
78
79
80
81
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.
    """
    ChestOpenServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ChestOpenServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ChestOpenServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/chest_open_server_packet.py
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
@staticmethod
def serialize(writer: EoWriter, data: "ChestOpenServerPacket") -> None:
    """
    Serializes an instance of `ChestOpenServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ChestOpenServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._coords is None:
            raise SerializationError("coords must be provided.")
        Coords.serialize(writer, data._coords)
        if data._items is None:
            raise SerializationError("items must be provided.")
        for i in range(len(data._items)):
            ThreeItem.serialize(writer, data._items[i])
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ChestOpenServerPacket 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
ChestOpenServerPacket 'ChestOpenServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/chest_open_server_packet.py
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
@staticmethod
def deserialize(reader: EoReader) -> "ChestOpenServerPacket":
    """
    Deserializes an instance of `ChestOpenServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ChestOpenServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        coords = Coords.deserialize(reader)
        items_length = int(reader.remaining / 5)
        items = []
        for i in range(items_length):
            items.append(ThreeItem.deserialize(reader))
        result = ChestOpenServerPacket(coords=coords, items=items)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ChestGetServerPacket

Bases: Packet

Reply to removing an item from a chest

Source code in src/eolib/protocol/_generated/net/server/chest_get_server_packet.py
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
class ChestGetServerPacket(Packet):
    """
    Reply to removing an item from a chest
    """
    _byte_size: int = 0
    _taken_item: ThreeItem
    _weight: Weight
    _items: tuple[ThreeItem, ...]

    def __init__(self, *, taken_item: ThreeItem, weight: Weight, items: Iterable[ThreeItem]):
        """
        Create a new instance of ChestGetServerPacket.

        Args:
            taken_item (ThreeItem): 
            weight (Weight): 
            items (Iterable[ThreeItem]): 
        """
        self._taken_item = taken_item
        self._weight = weight
        self._items = tuple(items)

    @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 taken_item(self) -> ThreeItem:
        return self._taken_item

    @property
    def weight(self) -> Weight:
        return self._weight

    @property
    def items(self) -> tuple[ThreeItem, ...]:
        return self._items

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Chest

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Get

    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.
        """
        ChestGetServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ChestGetServerPacket") -> None:
        """
        Serializes an instance of `ChestGetServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ChestGetServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._taken_item is None:
                raise SerializationError("taken_item must be provided.")
            ThreeItem.serialize(writer, data._taken_item)
            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)):
                ThreeItem.serialize(writer, data._items[i])
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ChestGetServerPacket":
        """
        Deserializes an instance of `ChestGetServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ChestGetServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            taken_item = ThreeItem.deserialize(reader)
            weight = Weight.deserialize(reader)
            items_length = int(reader.remaining / 5)
            items = []
            for i in range(items_length):
                items.append(ThreeItem.deserialize(reader))
            result = ChestGetServerPacket(taken_item=taken_item, weight=weight, items=items)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ChestGetServerPacket(byte_size={repr(self._byte_size)}, taken_item={repr(self._taken_item)}, weight={repr(self._weight)}, items={repr(self._items)})"

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.

taken_item: ThreeItem property

weight: Weight property

items: tuple[ThreeItem, ...] property

__init__(*, taken_item, weight, items)

Create a new instance of ChestGetServerPacket.

Parameters:

Name Type Description Default
taken_item ThreeItem
required
weight Weight
required
items Iterable[ThreeItem]
required
Source code in src/eolib/protocol/_generated/net/server/chest_get_server_packet.py
26
27
28
29
30
31
32
33
34
35
36
37
def __init__(self, *, taken_item: ThreeItem, weight: Weight, items: Iterable[ThreeItem]):
    """
    Create a new instance of ChestGetServerPacket.

    Args:
        taken_item (ThreeItem): 
        weight (Weight): 
        items (Iterable[ThreeItem]): 
    """
    self._taken_item = taken_item
    self._weight = weight
    self._items = tuple(items)

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/chest_get_server_packet.py
61
62
63
64
65
66
67
68
69
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Chest

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/chest_get_server_packet.py
71
72
73
74
75
76
77
78
79
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Get

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/chest_get_server_packet.py
81
82
83
84
85
86
87
88
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.
    """
    ChestGetServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ChestGetServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ChestGetServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/chest_get_server_packet.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
@staticmethod
def serialize(writer: EoWriter, data: "ChestGetServerPacket") -> None:
    """
    Serializes an instance of `ChestGetServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ChestGetServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._taken_item is None:
            raise SerializationError("taken_item must be provided.")
        ThreeItem.serialize(writer, data._taken_item)
        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)):
            ThreeItem.serialize(writer, data._items[i])
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ChestGetServerPacket 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
ChestGetServerPacket 'ChestGetServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/chest_get_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "ChestGetServerPacket":
    """
    Deserializes an instance of `ChestGetServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ChestGetServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        taken_item = ThreeItem.deserialize(reader)
        weight = Weight.deserialize(reader)
        items_length = int(reader.remaining / 5)
        items = []
        for i in range(items_length):
            items.append(ThreeItem.deserialize(reader))
        result = ChestGetServerPacket(taken_item=taken_item, weight=weight, items=items)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ChestCloseServerPacket

Bases: Packet

Reply to trying to interact with a locked or "broken" chest. The official client assumes a broken chest if the packet is under 2 bytes in length.

Source code in src/eolib/protocol/_generated/net/server/chest_close_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class ChestCloseServerPacket(Packet):
    """
    Reply to trying to interact with a locked or "broken" chest.
    The official client assumes a broken chest if the packet is under 2 bytes in length.
    """
    _byte_size: int = 0
    _key: Optional[int]

    def __init__(self, *, key: Optional[int] = None):
        """
        Create a new instance of ChestCloseServerPacket.

        Args:
            key (Optional[int]): Sent if the player is trying to interact with a locked chest (Value range is 0-64008.)
        """
        self._key = key

    @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 key(self) -> Optional[int]:
        """
        Sent if the player is trying to interact with a locked chest
        """
        return self._key

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Chest

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Close

    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.
        """
        ChestCloseServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ChestCloseServerPacket") -> None:
        """
        Serializes an instance of `ChestCloseServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ChestCloseServerPacket): The data to serialize.
        """
        old_writer_length: int = len(writer)
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            reached_missing_optional = data._key is None
            if not reached_missing_optional:
                writer.add_short(cast(int, data._key))
            if len(writer) == old_writer_length:
                writer.add_string("N")
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ChestCloseServerPacket":
        """
        Deserializes an instance of `ChestCloseServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ChestCloseServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            key: Optional[int] = None
            if reader.remaining > 0:
                key = reader.get_short()
            if reader.position == reader_start_position:
                reader.get_string()
            result = ChestCloseServerPacket(key=key)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ChestCloseServerPacket(byte_size={repr(self._byte_size)}, key={repr(self._key)})"

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.

key: Optional[int] property

Sent if the player is trying to interact with a locked chest

__init__(*, key=None)

Create a new instance of ChestCloseServerPacket.

Parameters:

Name Type Description Default
key Optional[int]

Sent if the player is trying to interact with a locked chest (Value range is 0-64008.)

None
Source code in src/eolib/protocol/_generated/net/server/chest_close_server_packet.py
22
23
24
25
26
27
28
29
def __init__(self, *, key: Optional[int] = None):
    """
    Create a new instance of ChestCloseServerPacket.

    Args:
        key (Optional[int]): Sent if the player is trying to interact with a locked chest (Value range is 0-64008.)
    """
    self._key = key

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/chest_close_server_packet.py
48
49
50
51
52
53
54
55
56
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Chest

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/chest_close_server_packet.py
58
59
60
61
62
63
64
65
66
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Close

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/chest_close_server_packet.py
68
69
70
71
72
73
74
75
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.
    """
    ChestCloseServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ChestCloseServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ChestCloseServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/chest_close_server_packet.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
@staticmethod
def serialize(writer: EoWriter, data: "ChestCloseServerPacket") -> None:
    """
    Serializes an instance of `ChestCloseServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ChestCloseServerPacket): The data to serialize.
    """
    old_writer_length: int = len(writer)
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        reached_missing_optional = data._key is None
        if not reached_missing_optional:
            writer.add_short(cast(int, data._key))
        if len(writer) == old_writer_length:
            writer.add_string("N")
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ChestCloseServerPacket 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
ChestCloseServerPacket ChestCloseServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/chest_close_server_packet.py
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@staticmethod
def deserialize(reader: EoReader) -> "ChestCloseServerPacket":
    """
    Deserializes an instance of `ChestCloseServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ChestCloseServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        key: Optional[int] = None
        if reader.remaining > 0:
            key = reader.get_short()
        if reader.position == reader_start_position:
            reader.get_string()
        result = ChestCloseServerPacket(key=key)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ChestAgreeServerPacket

Bases: Packet

Chest contents updating

Source code in src/eolib/protocol/_generated/net/server/chest_agree_server_packet.py
 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
class ChestAgreeServerPacket(Packet):
    """
    Chest contents updating
    """
    _byte_size: int = 0
    _items: tuple[ThreeItem, ...]

    def __init__(self, *, items: Iterable[ThreeItem]):
        """
        Create a new instance of ChestAgreeServerPacket.

        Args:
            items (Iterable[ThreeItem]): 
        """
        self._items = tuple(items)

    @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 items(self) -> tuple[ThreeItem, ...]:
        return self._items

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Chest

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Agree

    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.
        """
        ChestAgreeServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ChestAgreeServerPacket") -> None:
        """
        Serializes an instance of `ChestAgreeServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ChestAgreeServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._items is None:
                raise SerializationError("items must be provided.")
            for i in range(len(data._items)):
                ThreeItem.serialize(writer, data._items[i])
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ChestAgreeServerPacket":
        """
        Deserializes an instance of `ChestAgreeServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ChestAgreeServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            items_length = int(reader.remaining / 5)
            items = []
            for i in range(items_length):
                items.append(ThreeItem.deserialize(reader))
            result = ChestAgreeServerPacket(items=items)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ChestAgreeServerPacket(byte_size={repr(self._byte_size)}, items={repr(self._items)})"

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.

items: tuple[ThreeItem, ...] property

__init__(*, items)

Create a new instance of ChestAgreeServerPacket.

Parameters:

Name Type Description Default
items Iterable[ThreeItem]
required
Source code in src/eolib/protocol/_generated/net/server/chest_agree_server_packet.py
23
24
25
26
27
28
29
30
def __init__(self, *, items: Iterable[ThreeItem]):
    """
    Create a new instance of ChestAgreeServerPacket.

    Args:
        items (Iterable[ThreeItem]): 
    """
    self._items = tuple(items)

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/chest_agree_server_packet.py
46
47
48
49
50
51
52
53
54
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Chest

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/chest_agree_server_packet.py
56
57
58
59
60
61
62
63
64
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Agree

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/chest_agree_server_packet.py
66
67
68
69
70
71
72
73
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.
    """
    ChestAgreeServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ChestAgreeServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ChestAgreeServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/chest_agree_server_packet.py
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
@staticmethod
def serialize(writer: EoWriter, data: "ChestAgreeServerPacket") -> None:
    """
    Serializes an instance of `ChestAgreeServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ChestAgreeServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._items is None:
            raise SerializationError("items must be provided.")
        for i in range(len(data._items)):
            ThreeItem.serialize(writer, data._items[i])
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ChestAgreeServerPacket 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
ChestAgreeServerPacket 'ChestAgreeServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/chest_agree_server_packet.py
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
@staticmethod
def deserialize(reader: EoReader) -> "ChestAgreeServerPacket":
    """
    Deserializes an instance of `ChestAgreeServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ChestAgreeServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        items_length = int(reader.remaining / 5)
        items = []
        for i in range(items_length):
            items.append(ThreeItem.deserialize(reader))
        result = ChestAgreeServerPacket(items=items)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

CharacterStatsWelcome

Character stats data. Sent upon selecting a character and entering the game.

Source code in src/eolib/protocol/_generated/net/server/character_stats_welcome.py
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
class CharacterStatsWelcome:
    """
    Character stats data.
    Sent upon selecting a character and entering the game.
    """
    _byte_size: int = 0
    _hp: int
    _max_hp: int
    _tp: int
    _max_tp: int
    _max_sp: int
    _stat_points: int
    _skill_points: int
    _karma: int
    _secondary: CharacterSecondaryStats
    _base: CharacterBaseStatsWelcome

    def __init__(self, *, hp: int, max_hp: int, tp: int, max_tp: int, max_sp: int, stat_points: int, skill_points: int, karma: int, secondary: CharacterSecondaryStats, base: CharacterBaseStatsWelcome):
        """
        Create a new instance of CharacterStatsWelcome.

        Args:
            hp (int): (Value range is 0-64008.)
            max_hp (int): (Value range is 0-64008.)
            tp (int): (Value range is 0-64008.)
            max_tp (int): (Value range is 0-64008.)
            max_sp (int): (Value range is 0-64008.)
            stat_points (int): (Value range is 0-64008.)
            skill_points (int): (Value range is 0-64008.)
            karma (int): (Value range is 0-64008.)
            secondary (CharacterSecondaryStats): 
            base (CharacterBaseStatsWelcome): 
        """
        self._hp = hp
        self._max_hp = max_hp
        self._tp = tp
        self._max_tp = max_tp
        self._max_sp = max_sp
        self._stat_points = stat_points
        self._skill_points = skill_points
        self._karma = karma
        self._secondary = secondary
        self._base = base

    @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 hp(self) -> int:
        return self._hp

    @property
    def max_hp(self) -> int:
        return self._max_hp

    @property
    def tp(self) -> int:
        return self._tp

    @property
    def max_tp(self) -> int:
        return self._max_tp

    @property
    def max_sp(self) -> int:
        return self._max_sp

    @property
    def stat_points(self) -> int:
        return self._stat_points

    @property
    def skill_points(self) -> int:
        return self._skill_points

    @property
    def karma(self) -> int:
        return self._karma

    @property
    def secondary(self) -> CharacterSecondaryStats:
        return self._secondary

    @property
    def base(self) -> CharacterBaseStatsWelcome:
        return self._base

    @staticmethod
    def serialize(writer: EoWriter, data: "CharacterStatsWelcome") -> None:
        """
        Serializes an instance of `CharacterStatsWelcome` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterStatsWelcome): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._hp is None:
                raise SerializationError("hp must be provided.")
            writer.add_short(data._hp)
            if data._max_hp is None:
                raise SerializationError("max_hp must be provided.")
            writer.add_short(data._max_hp)
            if data._tp is None:
                raise SerializationError("tp must be provided.")
            writer.add_short(data._tp)
            if data._max_tp is None:
                raise SerializationError("max_tp must be provided.")
            writer.add_short(data._max_tp)
            if data._max_sp is None:
                raise SerializationError("max_sp must be provided.")
            writer.add_short(data._max_sp)
            if data._stat_points is None:
                raise SerializationError("stat_points must be provided.")
            writer.add_short(data._stat_points)
            if data._skill_points is None:
                raise SerializationError("skill_points must be provided.")
            writer.add_short(data._skill_points)
            if data._karma is None:
                raise SerializationError("karma must be provided.")
            writer.add_short(data._karma)
            if data._secondary is None:
                raise SerializationError("secondary must be provided.")
            CharacterSecondaryStats.serialize(writer, data._secondary)
            if data._base is None:
                raise SerializationError("base must be provided.")
            CharacterBaseStatsWelcome.serialize(writer, data._base)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CharacterStatsWelcome":
        """
        Deserializes an instance of `CharacterStatsWelcome` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterStatsWelcome: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            hp = reader.get_short()
            max_hp = reader.get_short()
            tp = reader.get_short()
            max_tp = reader.get_short()
            max_sp = reader.get_short()
            stat_points = reader.get_short()
            skill_points = reader.get_short()
            karma = reader.get_short()
            secondary = CharacterSecondaryStats.deserialize(reader)
            base = CharacterBaseStatsWelcome.deserialize(reader)
            result = CharacterStatsWelcome(hp=hp, max_hp=max_hp, tp=tp, max_tp=max_tp, max_sp=max_sp, stat_points=stat_points, skill_points=skill_points, karma=karma, secondary=secondary, base=base)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterStatsWelcome(byte_size={repr(self._byte_size)}, hp={repr(self._hp)}, max_hp={repr(self._max_hp)}, tp={repr(self._tp)}, max_tp={repr(self._max_tp)}, max_sp={repr(self._max_sp)}, stat_points={repr(self._stat_points)}, skill_points={repr(self._skill_points)}, karma={repr(self._karma)}, secondary={repr(self._secondary)}, base={repr(self._base)})"

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.

hp: int property

max_hp: int property

tp: int property

max_tp: int property

max_sp: int property

stat_points: int property

skill_points: int property

karma: int property

secondary: CharacterSecondaryStats property

base: CharacterBaseStatsWelcome property

__init__(*, hp, max_hp, tp, max_tp, max_sp, stat_points, skill_points, karma, secondary, base)

Create a new instance of CharacterStatsWelcome.

Parameters:

Name Type Description Default
hp int

(Value range is 0-64008.)

required
max_hp int

(Value range is 0-64008.)

required
tp int

(Value range is 0-64008.)

required
max_tp int

(Value range is 0-64008.)

required
max_sp int

(Value range is 0-64008.)

required
stat_points int

(Value range is 0-64008.)

required
skill_points int

(Value range is 0-64008.)

required
karma int

(Value range is 0-64008.)

required
secondary CharacterSecondaryStats
required
base CharacterBaseStatsWelcome
required
Source code in src/eolib/protocol/_generated/net/server/character_stats_welcome.py
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
def __init__(self, *, hp: int, max_hp: int, tp: int, max_tp: int, max_sp: int, stat_points: int, skill_points: int, karma: int, secondary: CharacterSecondaryStats, base: CharacterBaseStatsWelcome):
    """
    Create a new instance of CharacterStatsWelcome.

    Args:
        hp (int): (Value range is 0-64008.)
        max_hp (int): (Value range is 0-64008.)
        tp (int): (Value range is 0-64008.)
        max_tp (int): (Value range is 0-64008.)
        max_sp (int): (Value range is 0-64008.)
        stat_points (int): (Value range is 0-64008.)
        skill_points (int): (Value range is 0-64008.)
        karma (int): (Value range is 0-64008.)
        secondary (CharacterSecondaryStats): 
        base (CharacterBaseStatsWelcome): 
    """
    self._hp = hp
    self._max_hp = max_hp
    self._tp = tp
    self._max_tp = max_tp
    self._max_sp = max_sp
    self._stat_points = stat_points
    self._skill_points = skill_points
    self._karma = karma
    self._secondary = secondary
    self._base = base

serialize(writer, data) staticmethod

Serializes an instance of CharacterStatsWelcome to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CharacterStatsWelcome

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_stats_welcome.py
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
@staticmethod
def serialize(writer: EoWriter, data: "CharacterStatsWelcome") -> None:
    """
    Serializes an instance of `CharacterStatsWelcome` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterStatsWelcome): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._hp is None:
            raise SerializationError("hp must be provided.")
        writer.add_short(data._hp)
        if data._max_hp is None:
            raise SerializationError("max_hp must be provided.")
        writer.add_short(data._max_hp)
        if data._tp is None:
            raise SerializationError("tp must be provided.")
        writer.add_short(data._tp)
        if data._max_tp is None:
            raise SerializationError("max_tp must be provided.")
        writer.add_short(data._max_tp)
        if data._max_sp is None:
            raise SerializationError("max_sp must be provided.")
        writer.add_short(data._max_sp)
        if data._stat_points is None:
            raise SerializationError("stat_points must be provided.")
        writer.add_short(data._stat_points)
        if data._skill_points is None:
            raise SerializationError("skill_points must be provided.")
        writer.add_short(data._skill_points)
        if data._karma is None:
            raise SerializationError("karma must be provided.")
        writer.add_short(data._karma)
        if data._secondary is None:
            raise SerializationError("secondary must be provided.")
        CharacterSecondaryStats.serialize(writer, data._secondary)
        if data._base is None:
            raise SerializationError("base must be provided.")
        CharacterBaseStatsWelcome.serialize(writer, data._base)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CharacterStatsWelcome 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
CharacterStatsWelcome CharacterStatsWelcome

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_stats_welcome.py
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
@staticmethod
def deserialize(reader: EoReader) -> "CharacterStatsWelcome":
    """
    Deserializes an instance of `CharacterStatsWelcome` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterStatsWelcome: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        hp = reader.get_short()
        max_hp = reader.get_short()
        tp = reader.get_short()
        max_tp = reader.get_short()
        max_sp = reader.get_short()
        stat_points = reader.get_short()
        skill_points = reader.get_short()
        karma = reader.get_short()
        secondary = CharacterSecondaryStats.deserialize(reader)
        base = CharacterBaseStatsWelcome.deserialize(reader)
        result = CharacterStatsWelcome(hp=hp, max_hp=max_hp, tp=tp, max_tp=max_tp, max_sp=max_sp, stat_points=stat_points, skill_points=skill_points, karma=karma, secondary=secondary, base=base)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

CharacterStatsUpdate

Character stats data. Sent when stats are updated.

Source code in src/eolib/protocol/_generated/net/server/character_stats_update.py
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
class CharacterStatsUpdate:
    """
    Character stats data.
    Sent when stats are updated.
    """
    _byte_size: int = 0
    _base_stats: CharacterBaseStats
    _max_hp: int
    _max_tp: int
    _max_sp: int
    _max_weight: int
    _secondary_stats: CharacterSecondaryStats

    def __init__(self, *, base_stats: CharacterBaseStats, max_hp: int, max_tp: int, max_sp: int, max_weight: int, secondary_stats: CharacterSecondaryStats):
        """
        Create a new instance of CharacterStatsUpdate.

        Args:
            base_stats (CharacterBaseStats): 
            max_hp (int): (Value range is 0-64008.)
            max_tp (int): (Value range is 0-64008.)
            max_sp (int): (Value range is 0-64008.)
            max_weight (int): (Value range is 0-64008.)
            secondary_stats (CharacterSecondaryStats): 
        """
        self._base_stats = base_stats
        self._max_hp = max_hp
        self._max_tp = max_tp
        self._max_sp = max_sp
        self._max_weight = max_weight
        self._secondary_stats = secondary_stats

    @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 base_stats(self) -> CharacterBaseStats:
        return self._base_stats

    @property
    def max_hp(self) -> int:
        return self._max_hp

    @property
    def max_tp(self) -> int:
        return self._max_tp

    @property
    def max_sp(self) -> int:
        return self._max_sp

    @property
    def max_weight(self) -> int:
        return self._max_weight

    @property
    def secondary_stats(self) -> CharacterSecondaryStats:
        return self._secondary_stats

    @staticmethod
    def serialize(writer: EoWriter, data: "CharacterStatsUpdate") -> None:
        """
        Serializes an instance of `CharacterStatsUpdate` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterStatsUpdate): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._base_stats is None:
                raise SerializationError("base_stats must be provided.")
            CharacterBaseStats.serialize(writer, data._base_stats)
            if data._max_hp is None:
                raise SerializationError("max_hp must be provided.")
            writer.add_short(data._max_hp)
            if data._max_tp is None:
                raise SerializationError("max_tp must be provided.")
            writer.add_short(data._max_tp)
            if data._max_sp is None:
                raise SerializationError("max_sp must be provided.")
            writer.add_short(data._max_sp)
            if data._max_weight is None:
                raise SerializationError("max_weight must be provided.")
            writer.add_short(data._max_weight)
            if data._secondary_stats is None:
                raise SerializationError("secondary_stats must be provided.")
            CharacterSecondaryStats.serialize(writer, data._secondary_stats)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CharacterStatsUpdate":
        """
        Deserializes an instance of `CharacterStatsUpdate` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterStatsUpdate: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            base_stats = CharacterBaseStats.deserialize(reader)
            max_hp = reader.get_short()
            max_tp = reader.get_short()
            max_sp = reader.get_short()
            max_weight = reader.get_short()
            secondary_stats = CharacterSecondaryStats.deserialize(reader)
            result = CharacterStatsUpdate(base_stats=base_stats, max_hp=max_hp, max_tp=max_tp, max_sp=max_sp, max_weight=max_weight, secondary_stats=secondary_stats)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterStatsUpdate(byte_size={repr(self._byte_size)}, base_stats={repr(self._base_stats)}, max_hp={repr(self._max_hp)}, max_tp={repr(self._max_tp)}, max_sp={repr(self._max_sp)}, max_weight={repr(self._max_weight)}, secondary_stats={repr(self._secondary_stats)})"

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.

base_stats: CharacterBaseStats property

max_hp: int property

max_tp: int property

max_sp: int property

max_weight: int property

secondary_stats: CharacterSecondaryStats property

__init__(*, base_stats, max_hp, max_tp, max_sp, max_weight, secondary_stats)

Create a new instance of CharacterStatsUpdate.

Parameters:

Name Type Description Default
base_stats CharacterBaseStats
required
max_hp int

(Value range is 0-64008.)

required
max_tp int

(Value range is 0-64008.)

required
max_sp int

(Value range is 0-64008.)

required
max_weight int

(Value range is 0-64008.)

required
secondary_stats CharacterSecondaryStats
required
Source code in src/eolib/protocol/_generated/net/server/character_stats_update.py
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
def __init__(self, *, base_stats: CharacterBaseStats, max_hp: int, max_tp: int, max_sp: int, max_weight: int, secondary_stats: CharacterSecondaryStats):
    """
    Create a new instance of CharacterStatsUpdate.

    Args:
        base_stats (CharacterBaseStats): 
        max_hp (int): (Value range is 0-64008.)
        max_tp (int): (Value range is 0-64008.)
        max_sp (int): (Value range is 0-64008.)
        max_weight (int): (Value range is 0-64008.)
        secondary_stats (CharacterSecondaryStats): 
    """
    self._base_stats = base_stats
    self._max_hp = max_hp
    self._max_tp = max_tp
    self._max_sp = max_sp
    self._max_weight = max_weight
    self._secondary_stats = secondary_stats

serialize(writer, data) staticmethod

Serializes an instance of CharacterStatsUpdate to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CharacterStatsUpdate

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_stats_update.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "CharacterStatsUpdate") -> None:
    """
    Serializes an instance of `CharacterStatsUpdate` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterStatsUpdate): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._base_stats is None:
            raise SerializationError("base_stats must be provided.")
        CharacterBaseStats.serialize(writer, data._base_stats)
        if data._max_hp is None:
            raise SerializationError("max_hp must be provided.")
        writer.add_short(data._max_hp)
        if data._max_tp is None:
            raise SerializationError("max_tp must be provided.")
        writer.add_short(data._max_tp)
        if data._max_sp is None:
            raise SerializationError("max_sp must be provided.")
        writer.add_short(data._max_sp)
        if data._max_weight is None:
            raise SerializationError("max_weight must be provided.")
        writer.add_short(data._max_weight)
        if data._secondary_stats is None:
            raise SerializationError("secondary_stats must be provided.")
        CharacterSecondaryStats.serialize(writer, data._secondary_stats)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CharacterStatsUpdate 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
CharacterStatsUpdate CharacterStatsUpdate

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_stats_update.py
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
@staticmethod
def deserialize(reader: EoReader) -> "CharacterStatsUpdate":
    """
    Deserializes an instance of `CharacterStatsUpdate` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterStatsUpdate: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        base_stats = CharacterBaseStats.deserialize(reader)
        max_hp = reader.get_short()
        max_tp = reader.get_short()
        max_sp = reader.get_short()
        max_weight = reader.get_short()
        secondary_stats = CharacterSecondaryStats.deserialize(reader)
        result = CharacterStatsUpdate(base_stats=base_stats, max_hp=max_hp, max_tp=max_tp, max_sp=max_sp, max_weight=max_weight, secondary_stats=secondary_stats)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

CharacterStatsReset

Character stats data. Sent when resetting stats and skills at a skill master NPC.

Source code in src/eolib/protocol/_generated/net/server/character_stats_reset.py
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
class CharacterStatsReset:
    """
    Character stats data.
    Sent when resetting stats and skills at a skill master NPC.
    """
    _byte_size: int = 0
    _stat_points: int
    _skill_points: int
    _hp: int
    _max_hp: int
    _tp: int
    _max_tp: int
    _max_sp: int
    _base: CharacterBaseStats
    _secondary: CharacterSecondaryStats

    def __init__(self, *, stat_points: int, skill_points: int, hp: int, max_hp: int, tp: int, max_tp: int, max_sp: int, base: CharacterBaseStats, secondary: CharacterSecondaryStats):
        """
        Create a new instance of CharacterStatsReset.

        Args:
            stat_points (int): (Value range is 0-64008.)
            skill_points (int): (Value range is 0-64008.)
            hp (int): (Value range is 0-64008.)
            max_hp (int): (Value range is 0-64008.)
            tp (int): (Value range is 0-64008.)
            max_tp (int): (Value range is 0-64008.)
            max_sp (int): (Value range is 0-64008.)
            base (CharacterBaseStats): 
            secondary (CharacterSecondaryStats): 
        """
        self._stat_points = stat_points
        self._skill_points = skill_points
        self._hp = hp
        self._max_hp = max_hp
        self._tp = tp
        self._max_tp = max_tp
        self._max_sp = max_sp
        self._base = base
        self._secondary = secondary

    @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 stat_points(self) -> int:
        return self._stat_points

    @property
    def skill_points(self) -> int:
        return self._skill_points

    @property
    def hp(self) -> int:
        return self._hp

    @property
    def max_hp(self) -> int:
        return self._max_hp

    @property
    def tp(self) -> int:
        return self._tp

    @property
    def max_tp(self) -> int:
        return self._max_tp

    @property
    def max_sp(self) -> int:
        return self._max_sp

    @property
    def base(self) -> CharacterBaseStats:
        return self._base

    @property
    def secondary(self) -> CharacterSecondaryStats:
        return self._secondary

    @staticmethod
    def serialize(writer: EoWriter, data: "CharacterStatsReset") -> None:
        """
        Serializes an instance of `CharacterStatsReset` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterStatsReset): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._stat_points is None:
                raise SerializationError("stat_points must be provided.")
            writer.add_short(data._stat_points)
            if data._skill_points is None:
                raise SerializationError("skill_points must be provided.")
            writer.add_short(data._skill_points)
            if data._hp is None:
                raise SerializationError("hp must be provided.")
            writer.add_short(data._hp)
            if data._max_hp is None:
                raise SerializationError("max_hp must be provided.")
            writer.add_short(data._max_hp)
            if data._tp is None:
                raise SerializationError("tp must be provided.")
            writer.add_short(data._tp)
            if data._max_tp is None:
                raise SerializationError("max_tp must be provided.")
            writer.add_short(data._max_tp)
            if data._max_sp is None:
                raise SerializationError("max_sp must be provided.")
            writer.add_short(data._max_sp)
            if data._base is None:
                raise SerializationError("base must be provided.")
            CharacterBaseStats.serialize(writer, data._base)
            if data._secondary is None:
                raise SerializationError("secondary must be provided.")
            CharacterSecondaryStats.serialize(writer, data._secondary)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CharacterStatsReset":
        """
        Deserializes an instance of `CharacterStatsReset` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterStatsReset: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            stat_points = reader.get_short()
            skill_points = reader.get_short()
            hp = reader.get_short()
            max_hp = reader.get_short()
            tp = reader.get_short()
            max_tp = reader.get_short()
            max_sp = reader.get_short()
            base = CharacterBaseStats.deserialize(reader)
            secondary = CharacterSecondaryStats.deserialize(reader)
            result = CharacterStatsReset(stat_points=stat_points, skill_points=skill_points, hp=hp, max_hp=max_hp, tp=tp, max_tp=max_tp, max_sp=max_sp, base=base, secondary=secondary)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterStatsReset(byte_size={repr(self._byte_size)}, stat_points={repr(self._stat_points)}, skill_points={repr(self._skill_points)}, hp={repr(self._hp)}, max_hp={repr(self._max_hp)}, tp={repr(self._tp)}, max_tp={repr(self._max_tp)}, max_sp={repr(self._max_sp)}, base={repr(self._base)}, secondary={repr(self._secondary)})"

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.

stat_points: int property

skill_points: int property

hp: int property

max_hp: int property

tp: int property

max_tp: int property

max_sp: int property

base: CharacterBaseStats property

secondary: CharacterSecondaryStats property

__init__(*, stat_points, skill_points, hp, max_hp, tp, max_tp, max_sp, base, secondary)

Create a new instance of CharacterStatsReset.

Parameters:

Name Type Description Default
stat_points int

(Value range is 0-64008.)

required
skill_points int

(Value range is 0-64008.)

required
hp int

(Value range is 0-64008.)

required
max_hp int

(Value range is 0-64008.)

required
tp int

(Value range is 0-64008.)

required
max_tp int

(Value range is 0-64008.)

required
max_sp int

(Value range is 0-64008.)

required
base CharacterBaseStats
required
secondary CharacterSecondaryStats
required
Source code in src/eolib/protocol/_generated/net/server/character_stats_reset.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
def __init__(self, *, stat_points: int, skill_points: int, hp: int, max_hp: int, tp: int, max_tp: int, max_sp: int, base: CharacterBaseStats, secondary: CharacterSecondaryStats):
    """
    Create a new instance of CharacterStatsReset.

    Args:
        stat_points (int): (Value range is 0-64008.)
        skill_points (int): (Value range is 0-64008.)
        hp (int): (Value range is 0-64008.)
        max_hp (int): (Value range is 0-64008.)
        tp (int): (Value range is 0-64008.)
        max_tp (int): (Value range is 0-64008.)
        max_sp (int): (Value range is 0-64008.)
        base (CharacterBaseStats): 
        secondary (CharacterSecondaryStats): 
    """
    self._stat_points = stat_points
    self._skill_points = skill_points
    self._hp = hp
    self._max_hp = max_hp
    self._tp = tp
    self._max_tp = max_tp
    self._max_sp = max_sp
    self._base = base
    self._secondary = secondary

serialize(writer, data) staticmethod

Serializes an instance of CharacterStatsReset to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CharacterStatsReset

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_stats_reset.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "CharacterStatsReset") -> None:
    """
    Serializes an instance of `CharacterStatsReset` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterStatsReset): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._stat_points is None:
            raise SerializationError("stat_points must be provided.")
        writer.add_short(data._stat_points)
        if data._skill_points is None:
            raise SerializationError("skill_points must be provided.")
        writer.add_short(data._skill_points)
        if data._hp is None:
            raise SerializationError("hp must be provided.")
        writer.add_short(data._hp)
        if data._max_hp is None:
            raise SerializationError("max_hp must be provided.")
        writer.add_short(data._max_hp)
        if data._tp is None:
            raise SerializationError("tp must be provided.")
        writer.add_short(data._tp)
        if data._max_tp is None:
            raise SerializationError("max_tp must be provided.")
        writer.add_short(data._max_tp)
        if data._max_sp is None:
            raise SerializationError("max_sp must be provided.")
        writer.add_short(data._max_sp)
        if data._base is None:
            raise SerializationError("base must be provided.")
        CharacterBaseStats.serialize(writer, data._base)
        if data._secondary is None:
            raise SerializationError("secondary must be provided.")
        CharacterSecondaryStats.serialize(writer, data._secondary)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CharacterStatsReset 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
CharacterStatsReset CharacterStatsReset

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_stats_reset.py
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
@staticmethod
def deserialize(reader: EoReader) -> "CharacterStatsReset":
    """
    Deserializes an instance of `CharacterStatsReset` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterStatsReset: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        stat_points = reader.get_short()
        skill_points = reader.get_short()
        hp = reader.get_short()
        max_hp = reader.get_short()
        tp = reader.get_short()
        max_tp = reader.get_short()
        max_sp = reader.get_short()
        base = CharacterBaseStats.deserialize(reader)
        secondary = CharacterSecondaryStats.deserialize(reader)
        result = CharacterStatsReset(stat_points=stat_points, skill_points=skill_points, hp=hp, max_hp=max_hp, tp=tp, max_tp=max_tp, max_sp=max_sp, base=base, secondary=secondary)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

CharacterStatsEquipmentChange

Character stats data. Sent when an item is equipped or unequipped.

Source code in src/eolib/protocol/_generated/net/server/character_stats_equipment_change.py
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
class CharacterStatsEquipmentChange:
    """
    Character stats data.
    Sent when an item is equipped or unequipped.
    """
    _byte_size: int = 0
    _max_hp: int
    _max_tp: int
    _base_stats: CharacterBaseStats
    _secondary_stats: CharacterSecondaryStats

    def __init__(self, *, max_hp: int, max_tp: int, base_stats: CharacterBaseStats, secondary_stats: CharacterSecondaryStats):
        """
        Create a new instance of CharacterStatsEquipmentChange.

        Args:
            max_hp (int): (Value range is 0-64008.)
            max_tp (int): (Value range is 0-64008.)
            base_stats (CharacterBaseStats): 
            secondary_stats (CharacterSecondaryStats): 
        """
        self._max_hp = max_hp
        self._max_tp = max_tp
        self._base_stats = base_stats
        self._secondary_stats = secondary_stats

    @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 max_hp(self) -> int:
        return self._max_hp

    @property
    def max_tp(self) -> int:
        return self._max_tp

    @property
    def base_stats(self) -> CharacterBaseStats:
        return self._base_stats

    @property
    def secondary_stats(self) -> CharacterSecondaryStats:
        return self._secondary_stats

    @staticmethod
    def serialize(writer: EoWriter, data: "CharacterStatsEquipmentChange") -> None:
        """
        Serializes an instance of `CharacterStatsEquipmentChange` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterStatsEquipmentChange): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._max_hp is None:
                raise SerializationError("max_hp must be provided.")
            writer.add_short(data._max_hp)
            if data._max_tp is None:
                raise SerializationError("max_tp must be provided.")
            writer.add_short(data._max_tp)
            if data._base_stats is None:
                raise SerializationError("base_stats must be provided.")
            CharacterBaseStats.serialize(writer, data._base_stats)
            if data._secondary_stats is None:
                raise SerializationError("secondary_stats must be provided.")
            CharacterSecondaryStats.serialize(writer, data._secondary_stats)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CharacterStatsEquipmentChange":
        """
        Deserializes an instance of `CharacterStatsEquipmentChange` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterStatsEquipmentChange: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            max_hp = reader.get_short()
            max_tp = reader.get_short()
            base_stats = CharacterBaseStats.deserialize(reader)
            secondary_stats = CharacterSecondaryStats.deserialize(reader)
            result = CharacterStatsEquipmentChange(max_hp=max_hp, max_tp=max_tp, base_stats=base_stats, secondary_stats=secondary_stats)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterStatsEquipmentChange(byte_size={repr(self._byte_size)}, max_hp={repr(self._max_hp)}, max_tp={repr(self._max_tp)}, base_stats={repr(self._base_stats)}, secondary_stats={repr(self._secondary_stats)})"

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.

max_hp: int property

max_tp: int property

base_stats: CharacterBaseStats property

secondary_stats: CharacterSecondaryStats property

__init__(*, max_hp, max_tp, base_stats, secondary_stats)

Create a new instance of CharacterStatsEquipmentChange.

Parameters:

Name Type Description Default
max_hp int

(Value range is 0-64008.)

required
max_tp int

(Value range is 0-64008.)

required
base_stats CharacterBaseStats
required
secondary_stats CharacterSecondaryStats
required
Source code in src/eolib/protocol/_generated/net/server/character_stats_equipment_change.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
def __init__(self, *, max_hp: int, max_tp: int, base_stats: CharacterBaseStats, secondary_stats: CharacterSecondaryStats):
    """
    Create a new instance of CharacterStatsEquipmentChange.

    Args:
        max_hp (int): (Value range is 0-64008.)
        max_tp (int): (Value range is 0-64008.)
        base_stats (CharacterBaseStats): 
        secondary_stats (CharacterSecondaryStats): 
    """
    self._max_hp = max_hp
    self._max_tp = max_tp
    self._base_stats = base_stats
    self._secondary_stats = secondary_stats

serialize(writer, data) staticmethod

Serializes an instance of CharacterStatsEquipmentChange to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CharacterStatsEquipmentChange

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_stats_equipment_change.py
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
@staticmethod
def serialize(writer: EoWriter, data: "CharacterStatsEquipmentChange") -> None:
    """
    Serializes an instance of `CharacterStatsEquipmentChange` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterStatsEquipmentChange): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._max_hp is None:
            raise SerializationError("max_hp must be provided.")
        writer.add_short(data._max_hp)
        if data._max_tp is None:
            raise SerializationError("max_tp must be provided.")
        writer.add_short(data._max_tp)
        if data._base_stats is None:
            raise SerializationError("base_stats must be provided.")
        CharacterBaseStats.serialize(writer, data._base_stats)
        if data._secondary_stats is None:
            raise SerializationError("secondary_stats must be provided.")
        CharacterSecondaryStats.serialize(writer, data._secondary_stats)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CharacterStatsEquipmentChange 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
CharacterStatsEquipmentChange CharacterStatsEquipmentChange

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_stats_equipment_change.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
@staticmethod
def deserialize(reader: EoReader) -> "CharacterStatsEquipmentChange":
    """
    Deserializes an instance of `CharacterStatsEquipmentChange` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterStatsEquipmentChange: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        max_hp = reader.get_short()
        max_tp = reader.get_short()
        base_stats = CharacterBaseStats.deserialize(reader)
        secondary_stats = CharacterSecondaryStats.deserialize(reader)
        result = CharacterStatsEquipmentChange(max_hp=max_hp, max_tp=max_tp, base_stats=base_stats, secondary_stats=secondary_stats)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

EquipmentCharacterSelect

Player equipment data. Sent with a character in the character selection list. Note that these values are graphic IDs.

Source code in src/eolib/protocol/_generated/net/server/equipment_character_select.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
class EquipmentCharacterSelect:
    """
    Player equipment data.
    Sent with a character in the character selection list.
    Note that these values are graphic IDs.
    """
    _byte_size: int = 0
    _boots: int
    _armor: int
    _hat: int
    _shield: int
    _weapon: int

    def __init__(self, *, boots: int, armor: int, hat: int, shield: int, weapon: int):
        """
        Create a new instance of EquipmentCharacterSelect.

        Args:
            boots (int): (Value range is 0-64008.)
            armor (int): (Value range is 0-64008.)
            hat (int): (Value range is 0-64008.)
            shield (int): (Value range is 0-64008.)
            weapon (int): (Value range is 0-64008.)
        """
        self._boots = boots
        self._armor = armor
        self._hat = hat
        self._shield = shield
        self._weapon = weapon

    @property
    def byte_size(self) -> int:
        """
        Returns the size of the data that this was deserialized from.

        Returns:
            int: The size of the data that this was deserialized from.
        """
        return self._byte_size

    @property
    def boots(self) -> int:
        return self._boots

    @property
    def armor(self) -> int:
        return self._armor

    @property
    def hat(self) -> int:
        return self._hat

    @property
    def shield(self) -> int:
        return self._shield

    @property
    def weapon(self) -> int:
        return self._weapon

    @staticmethod
    def serialize(writer: EoWriter, data: "EquipmentCharacterSelect") -> None:
        """
        Serializes an instance of `EquipmentCharacterSelect` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (EquipmentCharacterSelect): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._boots is None:
                raise SerializationError("boots must be provided.")
            writer.add_short(data._boots)
            if data._armor is None:
                raise SerializationError("armor must be provided.")
            writer.add_short(data._armor)
            if data._hat is None:
                raise SerializationError("hat must be provided.")
            writer.add_short(data._hat)
            if data._shield is None:
                raise SerializationError("shield must be provided.")
            writer.add_short(data._shield)
            if data._weapon is None:
                raise SerializationError("weapon must be provided.")
            writer.add_short(data._weapon)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "EquipmentCharacterSelect":
        """
        Deserializes an instance of `EquipmentCharacterSelect` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            EquipmentCharacterSelect: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            boots = reader.get_short()
            armor = reader.get_short()
            hat = reader.get_short()
            shield = reader.get_short()
            weapon = reader.get_short()
            result = EquipmentCharacterSelect(boots=boots, armor=armor, hat=hat, shield=shield, weapon=weapon)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"EquipmentCharacterSelect(byte_size={repr(self._byte_size)}, boots={repr(self._boots)}, armor={repr(self._armor)}, hat={repr(self._hat)}, shield={repr(self._shield)}, weapon={repr(self._weapon)})"

byte_size: int property

Returns the size of the data that this was deserialized from.

Returns:

Name Type Description
int int

The size of the data that this was deserialized from.

boots: int property

armor: int property

hat: int property

shield: int property

weapon: int property

__init__(*, boots, armor, hat, shield, weapon)

Create a new instance of EquipmentCharacterSelect.

Parameters:

Name Type Description Default
boots int

(Value range is 0-64008.)

required
armor int

(Value range is 0-64008.)

required
hat int

(Value range is 0-64008.)

required
shield int

(Value range is 0-64008.)

required
weapon int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/equipment_character_select.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
def __init__(self, *, boots: int, armor: int, hat: int, shield: int, weapon: int):
    """
    Create a new instance of EquipmentCharacterSelect.

    Args:
        boots (int): (Value range is 0-64008.)
        armor (int): (Value range is 0-64008.)
        hat (int): (Value range is 0-64008.)
        shield (int): (Value range is 0-64008.)
        weapon (int): (Value range is 0-64008.)
    """
    self._boots = boots
    self._armor = armor
    self._hat = hat
    self._shield = shield
    self._weapon = weapon

serialize(writer, data) staticmethod

Serializes an instance of EquipmentCharacterSelect to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data EquipmentCharacterSelect

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/equipment_character_select.py
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
@staticmethod
def serialize(writer: EoWriter, data: "EquipmentCharacterSelect") -> None:
    """
    Serializes an instance of `EquipmentCharacterSelect` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (EquipmentCharacterSelect): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._boots is None:
            raise SerializationError("boots must be provided.")
        writer.add_short(data._boots)
        if data._armor is None:
            raise SerializationError("armor must be provided.")
        writer.add_short(data._armor)
        if data._hat is None:
            raise SerializationError("hat must be provided.")
        writer.add_short(data._hat)
        if data._shield is None:
            raise SerializationError("shield must be provided.")
        writer.add_short(data._shield)
        if data._weapon is None:
            raise SerializationError("weapon must be provided.")
        writer.add_short(data._weapon)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of EquipmentCharacterSelect 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
EquipmentCharacterSelect EquipmentCharacterSelect

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/equipment_character_select.py
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
@staticmethod
def deserialize(reader: EoReader) -> "EquipmentCharacterSelect":
    """
    Deserializes an instance of `EquipmentCharacterSelect` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        EquipmentCharacterSelect: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        boots = reader.get_short()
        armor = reader.get_short()
        hat = reader.get_short()
        shield = reader.get_short()
        weapon = reader.get_short()
        result = EquipmentCharacterSelect(boots=boots, armor=armor, hat=hat, shield=shield, weapon=weapon)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

CharacterSecondaryStatsInfoLookup

The 5 secondary character stats. Sent with character info lookups.

Source code in src/eolib/protocol/_generated/net/server/character_secondary_stats_info_lookup.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
class CharacterSecondaryStatsInfoLookup:
    """
    The 5 secondary character stats.
    Sent with character info lookups.
    """
    _byte_size: int = 0
    _max_damage: int
    _min_damage: int
    _accuracy: int
    _evade: int
    _armor: int

    def __init__(self, *, max_damage: int, min_damage: int, accuracy: int, evade: int, armor: int):
        """
        Create a new instance of CharacterSecondaryStatsInfoLookup.

        Args:
            max_damage (int): (Value range is 0-64008.)
            min_damage (int): (Value range is 0-64008.)
            accuracy (int): (Value range is 0-64008.)
            evade (int): (Value range is 0-64008.)
            armor (int): (Value range is 0-64008.)
        """
        self._max_damage = max_damage
        self._min_damage = min_damage
        self._accuracy = accuracy
        self._evade = evade
        self._armor = armor

    @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 max_damage(self) -> int:
        return self._max_damage

    @property
    def min_damage(self) -> int:
        return self._min_damage

    @property
    def accuracy(self) -> int:
        return self._accuracy

    @property
    def evade(self) -> int:
        return self._evade

    @property
    def armor(self) -> int:
        return self._armor

    @staticmethod
    def serialize(writer: EoWriter, data: "CharacterSecondaryStatsInfoLookup") -> None:
        """
        Serializes an instance of `CharacterSecondaryStatsInfoLookup` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterSecondaryStatsInfoLookup): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._max_damage is None:
                raise SerializationError("max_damage must be provided.")
            writer.add_short(data._max_damage)
            if data._min_damage is None:
                raise SerializationError("min_damage must be provided.")
            writer.add_short(data._min_damage)
            if data._accuracy is None:
                raise SerializationError("accuracy must be provided.")
            writer.add_short(data._accuracy)
            if data._evade is None:
                raise SerializationError("evade must be provided.")
            writer.add_short(data._evade)
            if data._armor is None:
                raise SerializationError("armor must be provided.")
            writer.add_short(data._armor)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CharacterSecondaryStatsInfoLookup":
        """
        Deserializes an instance of `CharacterSecondaryStatsInfoLookup` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterSecondaryStatsInfoLookup: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            max_damage = reader.get_short()
            min_damage = reader.get_short()
            accuracy = reader.get_short()
            evade = reader.get_short()
            armor = reader.get_short()
            result = CharacterSecondaryStatsInfoLookup(max_damage=max_damage, min_damage=min_damage, accuracy=accuracy, evade=evade, armor=armor)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterSecondaryStatsInfoLookup(byte_size={repr(self._byte_size)}, max_damage={repr(self._max_damage)}, min_damage={repr(self._min_damage)}, accuracy={repr(self._accuracy)}, evade={repr(self._evade)}, armor={repr(self._armor)})"

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.

max_damage: int property

min_damage: int property

accuracy: int property

evade: int property

armor: int property

__init__(*, max_damage, min_damage, accuracy, evade, armor)

Create a new instance of CharacterSecondaryStatsInfoLookup.

Parameters:

Name Type Description Default
max_damage int

(Value range is 0-64008.)

required
min_damage int

(Value range is 0-64008.)

required
accuracy int

(Value range is 0-64008.)

required
evade int

(Value range is 0-64008.)

required
armor int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/character_secondary_stats_info_lookup.py
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
def __init__(self, *, max_damage: int, min_damage: int, accuracy: int, evade: int, armor: int):
    """
    Create a new instance of CharacterSecondaryStatsInfoLookup.

    Args:
        max_damage (int): (Value range is 0-64008.)
        min_damage (int): (Value range is 0-64008.)
        accuracy (int): (Value range is 0-64008.)
        evade (int): (Value range is 0-64008.)
        armor (int): (Value range is 0-64008.)
    """
    self._max_damage = max_damage
    self._min_damage = min_damage
    self._accuracy = accuracy
    self._evade = evade
    self._armor = armor

serialize(writer, data) staticmethod

Serializes an instance of CharacterSecondaryStatsInfoLookup to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CharacterSecondaryStatsInfoLookup

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_secondary_stats_info_lookup.py
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
@staticmethod
def serialize(writer: EoWriter, data: "CharacterSecondaryStatsInfoLookup") -> None:
    """
    Serializes an instance of `CharacterSecondaryStatsInfoLookup` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterSecondaryStatsInfoLookup): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._max_damage is None:
            raise SerializationError("max_damage must be provided.")
        writer.add_short(data._max_damage)
        if data._min_damage is None:
            raise SerializationError("min_damage must be provided.")
        writer.add_short(data._min_damage)
        if data._accuracy is None:
            raise SerializationError("accuracy must be provided.")
        writer.add_short(data._accuracy)
        if data._evade is None:
            raise SerializationError("evade must be provided.")
        writer.add_short(data._evade)
        if data._armor is None:
            raise SerializationError("armor must be provided.")
        writer.add_short(data._armor)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CharacterSecondaryStatsInfoLookup 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
CharacterSecondaryStatsInfoLookup CharacterSecondaryStatsInfoLookup

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_secondary_stats_info_lookup.py
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
@staticmethod
def deserialize(reader: EoReader) -> "CharacterSecondaryStatsInfoLookup":
    """
    Deserializes an instance of `CharacterSecondaryStatsInfoLookup` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterSecondaryStatsInfoLookup: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        max_damage = reader.get_short()
        min_damage = reader.get_short()
        accuracy = reader.get_short()
        evade = reader.get_short()
        armor = reader.get_short()
        result = CharacterSecondaryStatsInfoLookup(max_damage=max_damage, min_damage=min_damage, accuracy=accuracy, evade=evade, armor=armor)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

CharacterSecondaryStats

The 5 secondary character stats

Source code in src/eolib/protocol/_generated/net/server/character_secondary_stats.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class CharacterSecondaryStats:
    """
    The 5 secondary character stats
    """
    _byte_size: int = 0
    _min_damage: int
    _max_damage: int
    _accuracy: int
    _evade: int
    _armor: int

    def __init__(self, *, min_damage: int, max_damage: int, accuracy: int, evade: int, armor: int):
        """
        Create a new instance of CharacterSecondaryStats.

        Args:
            min_damage (int): (Value range is 0-64008.)
            max_damage (int): (Value range is 0-64008.)
            accuracy (int): (Value range is 0-64008.)
            evade (int): (Value range is 0-64008.)
            armor (int): (Value range is 0-64008.)
        """
        self._min_damage = min_damage
        self._max_damage = max_damage
        self._accuracy = accuracy
        self._evade = evade
        self._armor = armor

    @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 min_damage(self) -> int:
        return self._min_damage

    @property
    def max_damage(self) -> int:
        return self._max_damage

    @property
    def accuracy(self) -> int:
        return self._accuracy

    @property
    def evade(self) -> int:
        return self._evade

    @property
    def armor(self) -> int:
        return self._armor

    @staticmethod
    def serialize(writer: EoWriter, data: "CharacterSecondaryStats") -> None:
        """
        Serializes an instance of `CharacterSecondaryStats` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterSecondaryStats): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._min_damage is None:
                raise SerializationError("min_damage must be provided.")
            writer.add_short(data._min_damage)
            if data._max_damage is None:
                raise SerializationError("max_damage must be provided.")
            writer.add_short(data._max_damage)
            if data._accuracy is None:
                raise SerializationError("accuracy must be provided.")
            writer.add_short(data._accuracy)
            if data._evade is None:
                raise SerializationError("evade must be provided.")
            writer.add_short(data._evade)
            if data._armor is None:
                raise SerializationError("armor must be provided.")
            writer.add_short(data._armor)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CharacterSecondaryStats":
        """
        Deserializes an instance of `CharacterSecondaryStats` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterSecondaryStats: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            min_damage = reader.get_short()
            max_damage = reader.get_short()
            accuracy = reader.get_short()
            evade = reader.get_short()
            armor = reader.get_short()
            result = CharacterSecondaryStats(min_damage=min_damage, max_damage=max_damage, accuracy=accuracy, evade=evade, armor=armor)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterSecondaryStats(byte_size={repr(self._byte_size)}, min_damage={repr(self._min_damage)}, max_damage={repr(self._max_damage)}, accuracy={repr(self._accuracy)}, evade={repr(self._evade)}, armor={repr(self._armor)})"

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.

min_damage: int property

max_damage: int property

accuracy: int property

evade: int property

armor: int property

__init__(*, min_damage, max_damage, accuracy, evade, armor)

Create a new instance of CharacterSecondaryStats.

Parameters:

Name Type Description Default
min_damage int

(Value range is 0-64008.)

required
max_damage int

(Value range is 0-64008.)

required
accuracy int

(Value range is 0-64008.)

required
evade int

(Value range is 0-64008.)

required
armor int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/character_secondary_stats.py
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
def __init__(self, *, min_damage: int, max_damage: int, accuracy: int, evade: int, armor: int):
    """
    Create a new instance of CharacterSecondaryStats.

    Args:
        min_damage (int): (Value range is 0-64008.)
        max_damage (int): (Value range is 0-64008.)
        accuracy (int): (Value range is 0-64008.)
        evade (int): (Value range is 0-64008.)
        armor (int): (Value range is 0-64008.)
    """
    self._min_damage = min_damage
    self._max_damage = max_damage
    self._accuracy = accuracy
    self._evade = evade
    self._armor = armor

serialize(writer, data) staticmethod

Serializes an instance of CharacterSecondaryStats to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CharacterSecondaryStats

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_secondary_stats.py
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
@staticmethod
def serialize(writer: EoWriter, data: "CharacterSecondaryStats") -> None:
    """
    Serializes an instance of `CharacterSecondaryStats` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterSecondaryStats): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._min_damage is None:
            raise SerializationError("min_damage must be provided.")
        writer.add_short(data._min_damage)
        if data._max_damage is None:
            raise SerializationError("max_damage must be provided.")
        writer.add_short(data._max_damage)
        if data._accuracy is None:
            raise SerializationError("accuracy must be provided.")
        writer.add_short(data._accuracy)
        if data._evade is None:
            raise SerializationError("evade must be provided.")
        writer.add_short(data._evade)
        if data._armor is None:
            raise SerializationError("armor must be provided.")
        writer.add_short(data._armor)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CharacterSecondaryStats 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
CharacterSecondaryStats CharacterSecondaryStats

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_secondary_stats.py
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@staticmethod
def deserialize(reader: EoReader) -> "CharacterSecondaryStats":
    """
    Deserializes an instance of `CharacterSecondaryStats` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterSecondaryStats: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        min_damage = reader.get_short()
        max_damage = reader.get_short()
        accuracy = reader.get_short()
        evade = reader.get_short()
        armor = reader.get_short()
        result = CharacterSecondaryStats(min_damage=min_damage, max_damage=max_damage, accuracy=accuracy, evade=evade, armor=armor)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

CharacterSelectionListEntry

Character selection screen character

Source code in src/eolib/protocol/_generated/net/server/character_selection_list_entry.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
class CharacterSelectionListEntry:
    """
    Character selection screen character
    """
    _byte_size: int = 0
    _name: str
    _id: int
    _level: int
    _gender: Gender
    _hair_style: int
    _hair_color: int
    _skin: int
    _admin: AdminLevel
    _equipment: EquipmentCharacterSelect

    def __init__(self, *, name: str, id: int, level: int, gender: Gender, hair_style: int, hair_color: int, skin: int, admin: AdminLevel, equipment: EquipmentCharacterSelect):
        """
        Create a new instance of CharacterSelectionListEntry.

        Args:
            name (str): 
            id (int): (Value range is 0-4097152080.)
            level (int): (Value range is 0-252.)
            gender (Gender): 
            hair_style (int): (Value range is 0-252.)
            hair_color (int): (Value range is 0-252.)
            skin (int): (Value range is 0-252.)
            admin (AdminLevel): 
            equipment (EquipmentCharacterSelect): 
        """
        self._name = name
        self._id = id
        self._level = level
        self._gender = gender
        self._hair_style = hair_style
        self._hair_color = hair_color
        self._skin = skin
        self._admin = admin
        self._equipment = equipment

    @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 name(self) -> str:
        return self._name

    @property
    def id(self) -> int:
        return self._id

    @property
    def level(self) -> int:
        return self._level

    @property
    def gender(self) -> Gender:
        return self._gender

    @property
    def hair_style(self) -> int:
        return self._hair_style

    @property
    def hair_color(self) -> int:
        return self._hair_color

    @property
    def skin(self) -> int:
        return self._skin

    @property
    def admin(self) -> AdminLevel:
        return self._admin

    @property
    def equipment(self) -> EquipmentCharacterSelect:
        return self._equipment

    @staticmethod
    def serialize(writer: EoWriter, data: "CharacterSelectionListEntry") -> None:
        """
        Serializes an instance of `CharacterSelectionListEntry` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterSelectionListEntry): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._name is None:
                raise SerializationError("name must be provided.")
            writer.add_string(data._name)
            writer.add_byte(0xFF)
            if data._id is None:
                raise SerializationError("id must be provided.")
            writer.add_int(data._id)
            if data._level is None:
                raise SerializationError("level must be provided.")
            writer.add_char(data._level)
            if data._gender is None:
                raise SerializationError("gender must be provided.")
            writer.add_char(int(data._gender))
            if data._hair_style is None:
                raise SerializationError("hair_style must be provided.")
            writer.add_char(data._hair_style)
            if data._hair_color is None:
                raise SerializationError("hair_color must be provided.")
            writer.add_char(data._hair_color)
            if data._skin is None:
                raise SerializationError("skin must be provided.")
            writer.add_char(data._skin)
            if data._admin is None:
                raise SerializationError("admin must be provided.")
            writer.add_char(int(data._admin))
            if data._equipment is None:
                raise SerializationError("equipment must be provided.")
            EquipmentCharacterSelect.serialize(writer, data._equipment)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CharacterSelectionListEntry":
        """
        Deserializes an instance of `CharacterSelectionListEntry` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterSelectionListEntry: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            name = reader.get_string()
            reader.next_chunk()
            id = reader.get_int()
            level = reader.get_char()
            gender = Gender(reader.get_char())
            hair_style = reader.get_char()
            hair_color = reader.get_char()
            skin = reader.get_char()
            admin = AdminLevel(reader.get_char())
            equipment = EquipmentCharacterSelect.deserialize(reader)
            reader.chunked_reading_mode = False
            result = CharacterSelectionListEntry(name=name, id=id, level=level, gender=gender, hair_style=hair_style, hair_color=hair_color, skin=skin, admin=admin, equipment=equipment)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterSelectionListEntry(byte_size={repr(self._byte_size)}, name={repr(self._name)}, id={repr(self._id)}, level={repr(self._level)}, gender={repr(self._gender)}, hair_style={repr(self._hair_style)}, hair_color={repr(self._hair_color)}, skin={repr(self._skin)}, admin={repr(self._admin)}, equipment={repr(self._equipment)})"

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.

name: str property

id: int property

level: int property

gender: Gender property

hair_style: int property

hair_color: int property

skin: int property

admin: AdminLevel property

equipment: EquipmentCharacterSelect property

__init__(*, name, id, level, gender, hair_style, hair_color, skin, admin, equipment)

Create a new instance of CharacterSelectionListEntry.

Parameters:

Name Type Description Default
name str
required
id int

(Value range is 0-4097152080.)

required
level int

(Value range is 0-252.)

required
gender Gender
required
hair_style int

(Value range is 0-252.)

required
hair_color int

(Value range is 0-252.)

required
skin int

(Value range is 0-252.)

required
admin AdminLevel
required
equipment EquipmentCharacterSelect
required
Source code in src/eolib/protocol/_generated/net/server/character_selection_list_entry.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
def __init__(self, *, name: str, id: int, level: int, gender: Gender, hair_style: int, hair_color: int, skin: int, admin: AdminLevel, equipment: EquipmentCharacterSelect):
    """
    Create a new instance of CharacterSelectionListEntry.

    Args:
        name (str): 
        id (int): (Value range is 0-4097152080.)
        level (int): (Value range is 0-252.)
        gender (Gender): 
        hair_style (int): (Value range is 0-252.)
        hair_color (int): (Value range is 0-252.)
        skin (int): (Value range is 0-252.)
        admin (AdminLevel): 
        equipment (EquipmentCharacterSelect): 
    """
    self._name = name
    self._id = id
    self._level = level
    self._gender = gender
    self._hair_style = hair_style
    self._hair_color = hair_color
    self._skin = skin
    self._admin = admin
    self._equipment = equipment

serialize(writer, data) staticmethod

Serializes an instance of CharacterSelectionListEntry to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CharacterSelectionListEntry

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_selection_list_entry.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "CharacterSelectionListEntry") -> None:
    """
    Serializes an instance of `CharacterSelectionListEntry` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterSelectionListEntry): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._name is None:
            raise SerializationError("name must be provided.")
        writer.add_string(data._name)
        writer.add_byte(0xFF)
        if data._id is None:
            raise SerializationError("id must be provided.")
        writer.add_int(data._id)
        if data._level is None:
            raise SerializationError("level must be provided.")
        writer.add_char(data._level)
        if data._gender is None:
            raise SerializationError("gender must be provided.")
        writer.add_char(int(data._gender))
        if data._hair_style is None:
            raise SerializationError("hair_style must be provided.")
        writer.add_char(data._hair_style)
        if data._hair_color is None:
            raise SerializationError("hair_color must be provided.")
        writer.add_char(data._hair_color)
        if data._skin is None:
            raise SerializationError("skin must be provided.")
        writer.add_char(data._skin)
        if data._admin is None:
            raise SerializationError("admin must be provided.")
        writer.add_char(int(data._admin))
        if data._equipment is None:
            raise SerializationError("equipment must be provided.")
        EquipmentCharacterSelect.serialize(writer, data._equipment)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CharacterSelectionListEntry 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
CharacterSelectionListEntry CharacterSelectionListEntry

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_selection_list_entry.py
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
@staticmethod
def deserialize(reader: EoReader) -> "CharacterSelectionListEntry":
    """
    Deserializes an instance of `CharacterSelectionListEntry` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterSelectionListEntry: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        name = reader.get_string()
        reader.next_chunk()
        id = reader.get_int()
        level = reader.get_char()
        gender = Gender(reader.get_char())
        hair_style = reader.get_char()
        hair_color = reader.get_char()
        skin = reader.get_char()
        admin = AdminLevel(reader.get_char())
        equipment = EquipmentCharacterSelect.deserialize(reader)
        reader.chunked_reading_mode = False
        result = CharacterSelectionListEntry(name=name, id=id, level=level, gender=gender, hair_style=hair_style, hair_color=hair_color, skin=skin, admin=admin, equipment=equipment)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

CharacterReplyServerPacket

Bases: Packet

Reply to client Character-family packets

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
 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
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
class CharacterReplyServerPacket(Packet):
    """
    Reply to client Character-family packets
    """
    _byte_size: int = 0
    _reply_code: CharacterReply
    _reply_code_data: 'CharacterReplyServerPacket.ReplyCodeData'

    def __init__(self, *, reply_code: CharacterReply, reply_code_data: 'CharacterReplyServerPacket.ReplyCodeData' = None):
        """
        Create a new instance of CharacterReplyServerPacket.

        Args:
            reply_code (CharacterReply): Sometimes a CharacterReply code, sometimes a session ID for character creation
            reply_code_data (CharacterReplyServerPacket.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) -> CharacterReply:
        """
        Sometimes a CharacterReply code, sometimes a session ID for character creation
        """
        return self._reply_code

    @property
    def reply_code_data(self) -> 'CharacterReplyServerPacket.ReplyCodeData':
        """
        CharacterReplyServerPacket.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.Character

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Reply

    def write(self, writer):
        """
        Serializes and writes this packet to the provided EoWriter.

        Args:
            writer (EoWriter): the writer that this packet will be written to.
        """
        CharacterReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "CharacterReplyServerPacket") -> None:
        """
        Serializes an instance of `CharacterReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._reply_code is None:
                raise SerializationError("reply_code must be provided.")
            writer.add_short(int(data._reply_code))
            if data._reply_code == 0:
                if data._reply_code_data is not None:
                    raise SerializationError("Expected reply_code_data to be None for reply_code " + CharacterReply(data._reply_code).name + ".")
            elif data._reply_code == CharacterReply.Exists:
                if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataExists):
                    raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataExists for reply_code " + CharacterReply(data._reply_code).name + ".")
                CharacterReplyServerPacket.ReplyCodeDataExists.serialize(writer, data._reply_code_data)
            elif data._reply_code == CharacterReply.Full:
                if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataFull):
                    raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataFull for reply_code " + CharacterReply(data._reply_code).name + ".")
                CharacterReplyServerPacket.ReplyCodeDataFull.serialize(writer, data._reply_code_data)
            elif data._reply_code == CharacterReply.Full3:
                if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataFull3):
                    raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataFull3 for reply_code " + CharacterReply(data._reply_code).name + ".")
                CharacterReplyServerPacket.ReplyCodeDataFull3.serialize(writer, data._reply_code_data)
            elif data._reply_code == CharacterReply.NotApproved:
                if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataNotApproved):
                    raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataNotApproved for reply_code " + CharacterReply(data._reply_code).name + ".")
                CharacterReplyServerPacket.ReplyCodeDataNotApproved.serialize(writer, data._reply_code_data)
            elif data._reply_code == CharacterReply.Ok:
                if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataOk):
                    raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataOk for reply_code " + CharacterReply(data._reply_code).name + ".")
                CharacterReplyServerPacket.ReplyCodeDataOk.serialize(writer, data._reply_code_data)
            elif data._reply_code == CharacterReply.Deleted:
                if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataDeleted):
                    raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataDeleted for reply_code " + CharacterReply(data._reply_code).name + ".")
                CharacterReplyServerPacket.ReplyCodeDataDeleted.serialize(writer, data._reply_code_data)
            elif data._reply_code == 7:
                if data._reply_code_data is not None:
                    raise SerializationError("Expected reply_code_data to be None for reply_code " + CharacterReply(data._reply_code).name + ".")
            elif data._reply_code == 8:
                if data._reply_code_data is not None:
                    raise SerializationError("Expected reply_code_data to be None for reply_code " + CharacterReply(data._reply_code).name + ".")
            elif data._reply_code == 9:
                if data._reply_code_data is not None:
                    raise SerializationError("Expected reply_code_data to be None for reply_code " + CharacterReply(data._reply_code).name + ".")
            else:
                if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataDefault):
                    raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataDefault for reply_code " + CharacterReply(data._reply_code).name + ".")
                CharacterReplyServerPacket.ReplyCodeDataDefault.serialize(writer, data._reply_code_data)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CharacterReplyServerPacket":
        """
        Deserializes an instance of `CharacterReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            reply_code = CharacterReply(reader.get_short())
            reply_code_data: CharacterReplyServerPacket.ReplyCodeData = None
            if reply_code == 0:
                reply_code_data = None
            elif reply_code == CharacterReply.Exists:
                reply_code_data = CharacterReplyServerPacket.ReplyCodeDataExists.deserialize(reader)
            elif reply_code == CharacterReply.Full:
                reply_code_data = CharacterReplyServerPacket.ReplyCodeDataFull.deserialize(reader)
            elif reply_code == CharacterReply.Full3:
                reply_code_data = CharacterReplyServerPacket.ReplyCodeDataFull3.deserialize(reader)
            elif reply_code == CharacterReply.NotApproved:
                reply_code_data = CharacterReplyServerPacket.ReplyCodeDataNotApproved.deserialize(reader)
            elif reply_code == CharacterReply.Ok:
                reply_code_data = CharacterReplyServerPacket.ReplyCodeDataOk.deserialize(reader)
            elif reply_code == CharacterReply.Deleted:
                reply_code_data = CharacterReplyServerPacket.ReplyCodeDataDeleted.deserialize(reader)
            elif reply_code == 7:
                reply_code_data = None
            elif reply_code == 8:
                reply_code_data = None
            elif reply_code == 9:
                reply_code_data = None
            else:
                reply_code_data = CharacterReplyServerPacket.ReplyCodeDataDefault.deserialize(reader)
            reader.chunked_reading_mode = False
            result = CharacterReplyServerPacket(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"CharacterReplyServerPacket(byte_size={repr(self._byte_size)}, reply_code={repr(self._reply_code)}, reply_code_data={repr(self._reply_code_data)})"

    ReplyCodeData = Union['CharacterReplyServerPacket.ReplyCodeDataExists', 'CharacterReplyServerPacket.ReplyCodeDataFull', 'CharacterReplyServerPacket.ReplyCodeDataFull3', 'CharacterReplyServerPacket.ReplyCodeDataNotApproved', 'CharacterReplyServerPacket.ReplyCodeDataOk', 'CharacterReplyServerPacket.ReplyCodeDataDeleted', 'CharacterReplyServerPacket.ReplyCodeDataDefault', None]
    """
    Data associated with different values of the `reply_code` field.
    """

    class ReplyCodeDataExists:
        """
        Data associated with reply_code value CharacterReply.Exists
        """
        _byte_size: int = 0

        def __init__(self):
            """
            Create a new instance of CharacterReplyServerPacket.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: "CharacterReplyServerPacket.ReplyCodeDataExists") -> None:
            """
            Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataExists` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (CharacterReplyServerPacket.ReplyCodeDataExists): The data to serialize.
            """
            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) -> "CharacterReplyServerPacket.ReplyCodeDataExists":
            """
            Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataExists` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                CharacterReplyServerPacket.ReplyCodeDataExists: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.get_string()
                result = CharacterReplyServerPacket.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"CharacterReplyServerPacket.ReplyCodeDataExists(byte_size={repr(self._byte_size)})"

    class ReplyCodeDataFull:
        """
        Data associated with reply_code value CharacterReply.Full
        """
        _byte_size: int = 0

        def __init__(self):
            """
            Create a new instance of CharacterReplyServerPacket.ReplyCodeDataFull.
            """

        @property
        def byte_size(self) -> int:
            """
            Returns the size of the data that this was deserialized from.

            Returns:
                int: The size of the data that this was deserialized from.
            """
            return self._byte_size


        @staticmethod
        def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataFull") -> None:
            """
            Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataFull` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (CharacterReplyServerPacket.ReplyCodeDataFull): The data to serialize.
            """
            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) -> "CharacterReplyServerPacket.ReplyCodeDataFull":
            """
            Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataFull` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                CharacterReplyServerPacket.ReplyCodeDataFull: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.get_string()
                result = CharacterReplyServerPacket.ReplyCodeDataFull()
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"CharacterReplyServerPacket.ReplyCodeDataFull(byte_size={repr(self._byte_size)})"

    class ReplyCodeDataFull3:
        """
        Data associated with reply_code value CharacterReply.Full3
        """
        _byte_size: int = 0

        def __init__(self):
            """
            Create a new instance of CharacterReplyServerPacket.ReplyCodeDataFull3.
            """

        @property
        def byte_size(self) -> int:
            """
            Returns the size of the data that this was deserialized from.

            Returns:
                int: The size of the data that this was deserialized from.
            """
            return self._byte_size


        @staticmethod
        def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataFull3") -> None:
            """
            Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataFull3` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (CharacterReplyServerPacket.ReplyCodeDataFull3): The data to serialize.
            """
            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) -> "CharacterReplyServerPacket.ReplyCodeDataFull3":
            """
            Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataFull3` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                CharacterReplyServerPacket.ReplyCodeDataFull3: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.get_string()
                result = CharacterReplyServerPacket.ReplyCodeDataFull3()
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"CharacterReplyServerPacket.ReplyCodeDataFull3(byte_size={repr(self._byte_size)})"

    class ReplyCodeDataNotApproved:
        """
        Data associated with reply_code value CharacterReply.NotApproved
        """
        _byte_size: int = 0

        def __init__(self):
            """
            Create a new instance of CharacterReplyServerPacket.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: "CharacterReplyServerPacket.ReplyCodeDataNotApproved") -> None:
            """
            Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataNotApproved` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (CharacterReplyServerPacket.ReplyCodeDataNotApproved): The data to serialize.
            """
            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) -> "CharacterReplyServerPacket.ReplyCodeDataNotApproved":
            """
            Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataNotApproved` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                CharacterReplyServerPacket.ReplyCodeDataNotApproved: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.get_string()
                result = CharacterReplyServerPacket.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"CharacterReplyServerPacket.ReplyCodeDataNotApproved(byte_size={repr(self._byte_size)})"

    class ReplyCodeDataOk:
        """
        Data associated with reply_code value CharacterReply.Ok
        """
        _byte_size: int = 0
        _characters_count: int
        _characters: tuple[CharacterSelectionListEntry, ...]

        def __init__(self, *, characters: Iterable[CharacterSelectionListEntry]):
            """
            Create a new instance of CharacterReplyServerPacket.ReplyCodeDataOk.

            Args:
                characters (Iterable[CharacterSelectionListEntry]): (Length must be 252 or less.)
            """
            self._characters = tuple(characters)
            self._characters_count = len(self._characters)

        @property
        def byte_size(self) -> int:
            """
            Returns the size of the data that this was deserialized from.

            Returns:
                int: The size of the data that this was deserialized from.
            """
            return self._byte_size

        @property
        def characters(self) -> tuple[CharacterSelectionListEntry, ...]:
            return self._characters

        @staticmethod
        def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataOk") -> None:
            """
            Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataOk` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (CharacterReplyServerPacket.ReplyCodeDataOk): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._characters_count is None:
                    raise SerializationError("characters_count must be provided.")
                writer.add_char(data._characters_count)
                writer.add_char(0)
                writer.add_byte(0xFF)
                if data._characters is None:
                    raise SerializationError("characters must be provided.")
                if len(data._characters) > 252:
                    raise SerializationError(f"Expected length of characters to be 252 or less, got {len(data._characters)}.")
                for i in range(data._characters_count):
                    CharacterSelectionListEntry.serialize(writer, data._characters[i])
                    writer.add_byte(0xFF)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "CharacterReplyServerPacket.ReplyCodeDataOk":
            """
            Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataOk` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                CharacterReplyServerPacket.ReplyCodeDataOk: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                characters_count = reader.get_char()
                reader.get_char()
                reader.next_chunk()
                characters = []
                for i in range(characters_count):
                    characters.append(CharacterSelectionListEntry.deserialize(reader))
                    reader.next_chunk()
                result = CharacterReplyServerPacket.ReplyCodeDataOk(characters=characters)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"CharacterReplyServerPacket.ReplyCodeDataOk(byte_size={repr(self._byte_size)}, characters={repr(self._characters)})"

    class ReplyCodeDataDeleted:
        """
        Data associated with reply_code value CharacterReply.Deleted
        """
        _byte_size: int = 0
        _characters_count: int
        _characters: tuple[CharacterSelectionListEntry, ...]

        def __init__(self, *, characters: Iterable[CharacterSelectionListEntry]):
            """
            Create a new instance of CharacterReplyServerPacket.ReplyCodeDataDeleted.

            Args:
                characters (Iterable[CharacterSelectionListEntry]): (Length must be 252 or less.)
            """
            self._characters = tuple(characters)
            self._characters_count = len(self._characters)

        @property
        def byte_size(self) -> int:
            """
            Returns the size of the data that this was deserialized from.

            Returns:
                int: The size of the data that this was deserialized from.
            """
            return self._byte_size

        @property
        def characters(self) -> tuple[CharacterSelectionListEntry, ...]:
            return self._characters

        @staticmethod
        def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataDeleted") -> None:
            """
            Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataDeleted` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (CharacterReplyServerPacket.ReplyCodeDataDeleted): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._characters_count is None:
                    raise SerializationError("characters_count must be provided.")
                writer.add_char(data._characters_count)
                writer.add_byte(0xFF)
                if data._characters is None:
                    raise SerializationError("characters must be provided.")
                if len(data._characters) > 252:
                    raise SerializationError(f"Expected length of characters to be 252 or less, got {len(data._characters)}.")
                for i in range(data._characters_count):
                    CharacterSelectionListEntry.serialize(writer, data._characters[i])
                    writer.add_byte(0xFF)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "CharacterReplyServerPacket.ReplyCodeDataDeleted":
            """
            Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataDeleted` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                CharacterReplyServerPacket.ReplyCodeDataDeleted: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                characters_count = reader.get_char()
                reader.next_chunk()
                characters = []
                for i in range(characters_count):
                    characters.append(CharacterSelectionListEntry.deserialize(reader))
                    reader.next_chunk()
                result = CharacterReplyServerPacket.ReplyCodeDataDeleted(characters=characters)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"CharacterReplyServerPacket.ReplyCodeDataDeleted(byte_size={repr(self._byte_size)}, characters={repr(self._characters)})"

    class ReplyCodeDataDefault:
        """
        Default data associated with reply_code

        In this case (reply_code &gt; 9), reply_code is a session ID for character creation
        """
        _byte_size: int = 0

        def __init__(self):
            """
            Create a new instance of CharacterReplyServerPacket.ReplyCodeDataDefault.
            """

        @property
        def byte_size(self) -> int:
            """
            Returns the size of the data that this was deserialized from.

            Returns:
                int: The size of the data that this was deserialized from.
            """
            return self._byte_size


        @staticmethod
        def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataDefault") -> None:
            """
            Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataDefault` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (CharacterReplyServerPacket.ReplyCodeDataDefault): The data to serialize.
            """
            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) -> "CharacterReplyServerPacket.ReplyCodeDataDefault":
            """
            Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataDefault` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                CharacterReplyServerPacket.ReplyCodeDataDefault: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.get_string()
                result = CharacterReplyServerPacket.ReplyCodeDataDefault()
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"CharacterReplyServerPacket.ReplyCodeDataDefault(byte_size={repr(self._byte_size)})"

byte_size: int property

Returns the size of the data that this was deserialized from.

Returns:

Name Type Description
int int

The size of the data that this was deserialized from.

reply_code: CharacterReply property

Sometimes a CharacterReply code, sometimes a session ID for character creation

reply_code_data: 'CharacterReplyServerPacket.ReplyCodeData' property

CharacterReplyServerPacket.ReplyCodeData: Data associated with the reply_code field.

ReplyCodeData = Union['CharacterReplyServerPacket.ReplyCodeDataExists', 'CharacterReplyServerPacket.ReplyCodeDataFull', 'CharacterReplyServerPacket.ReplyCodeDataFull3', 'CharacterReplyServerPacket.ReplyCodeDataNotApproved', 'CharacterReplyServerPacket.ReplyCodeDataOk', 'CharacterReplyServerPacket.ReplyCodeDataDeleted', 'CharacterReplyServerPacket.ReplyCodeDataDefault', None] class-attribute instance-attribute

Data associated with different values of the reply_code field.

ReplyCodeDataExists

Data associated with reply_code value CharacterReply.Exists

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
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
class ReplyCodeDataExists:
    """
    Data associated with reply_code value CharacterReply.Exists
    """
    _byte_size: int = 0

    def __init__(self):
        """
        Create a new instance of CharacterReplyServerPacket.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: "CharacterReplyServerPacket.ReplyCodeDataExists") -> None:
        """
        Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataExists` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterReplyServerPacket.ReplyCodeDataExists): The data to serialize.
        """
        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) -> "CharacterReplyServerPacket.ReplyCodeDataExists":
        """
        Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataExists` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterReplyServerPacket.ReplyCodeDataExists: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            result = CharacterReplyServerPacket.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"CharacterReplyServerPacket.ReplyCodeDataExists(byte_size={repr(self._byte_size)})"

byte_size: int property

Returns the size of the data that this was deserialized from.

Returns:

Name Type Description
int int

The size of the data that this was deserialized from.

__init__()

Create a new instance of CharacterReplyServerPacket.ReplyCodeDataExists.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
209
210
211
212
def __init__(self):
    """
    Create a new instance of CharacterReplyServerPacket.ReplyCodeDataExists.
    """

serialize(writer, data) staticmethod

Serializes an instance of CharacterReplyServerPacket.ReplyCodeDataExists to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataExists

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
225
226
227
228
229
230
231
232
233
234
235
236
237
238
@staticmethod
def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataExists") -> None:
    """
    Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataExists` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterReplyServerPacket.ReplyCodeDataExists): The data to serialize.
    """
    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 CharacterReplyServerPacket.ReplyCodeDataExists from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'CharacterReplyServerPacket.ReplyCodeDataExists'

CharacterReplyServerPacket.ReplyCodeDataExists: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
@staticmethod
def deserialize(reader: EoReader) -> "CharacterReplyServerPacket.ReplyCodeDataExists":
    """
    Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataExists` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterReplyServerPacket.ReplyCodeDataExists: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        result = CharacterReplyServerPacket.ReplyCodeDataExists()
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataFull

Data associated with reply_code value CharacterReply.Full

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
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
class ReplyCodeDataFull:
    """
    Data associated with reply_code value CharacterReply.Full
    """
    _byte_size: int = 0

    def __init__(self):
        """
        Create a new instance of CharacterReplyServerPacket.ReplyCodeDataFull.
        """

    @property
    def byte_size(self) -> int:
        """
        Returns the size of the data that this was deserialized from.

        Returns:
            int: The size of the data that this was deserialized from.
        """
        return self._byte_size


    @staticmethod
    def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataFull") -> None:
        """
        Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataFull` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterReplyServerPacket.ReplyCodeDataFull): The data to serialize.
        """
        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) -> "CharacterReplyServerPacket.ReplyCodeDataFull":
        """
        Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataFull` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterReplyServerPacket.ReplyCodeDataFull: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            result = CharacterReplyServerPacket.ReplyCodeDataFull()
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterReplyServerPacket.ReplyCodeDataFull(byte_size={repr(self._byte_size)})"

byte_size: int property

Returns the size of the data that this was deserialized from.

Returns:

Name Type Description
int int

The size of the data that this was deserialized from.

__init__()

Create a new instance of CharacterReplyServerPacket.ReplyCodeDataFull.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
270
271
272
273
def __init__(self):
    """
    Create a new instance of CharacterReplyServerPacket.ReplyCodeDataFull.
    """

serialize(writer, data) staticmethod

Serializes an instance of CharacterReplyServerPacket.ReplyCodeDataFull to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataFull

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
286
287
288
289
290
291
292
293
294
295
296
297
298
299
@staticmethod
def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataFull") -> None:
    """
    Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataFull` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterReplyServerPacket.ReplyCodeDataFull): The data to serialize.
    """
    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 CharacterReplyServerPacket.ReplyCodeDataFull from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'CharacterReplyServerPacket.ReplyCodeDataFull'

CharacterReplyServerPacket.ReplyCodeDataFull: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
@staticmethod
def deserialize(reader: EoReader) -> "CharacterReplyServerPacket.ReplyCodeDataFull":
    """
    Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataFull` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterReplyServerPacket.ReplyCodeDataFull: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        result = CharacterReplyServerPacket.ReplyCodeDataFull()
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataFull3

Data associated with reply_code value CharacterReply.Full3

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
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
class ReplyCodeDataFull3:
    """
    Data associated with reply_code value CharacterReply.Full3
    """
    _byte_size: int = 0

    def __init__(self):
        """
        Create a new instance of CharacterReplyServerPacket.ReplyCodeDataFull3.
        """

    @property
    def byte_size(self) -> int:
        """
        Returns the size of the data that this was deserialized from.

        Returns:
            int: The size of the data that this was deserialized from.
        """
        return self._byte_size


    @staticmethod
    def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataFull3") -> None:
        """
        Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataFull3` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterReplyServerPacket.ReplyCodeDataFull3): The data to serialize.
        """
        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) -> "CharacterReplyServerPacket.ReplyCodeDataFull3":
        """
        Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataFull3` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterReplyServerPacket.ReplyCodeDataFull3: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            result = CharacterReplyServerPacket.ReplyCodeDataFull3()
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterReplyServerPacket.ReplyCodeDataFull3(byte_size={repr(self._byte_size)})"

byte_size: int property

Returns the size of the data that this was deserialized from.

Returns:

Name Type Description
int int

The size of the data that this was deserialized from.

__init__()

Create a new instance of CharacterReplyServerPacket.ReplyCodeDataFull3.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
331
332
333
334
def __init__(self):
    """
    Create a new instance of CharacterReplyServerPacket.ReplyCodeDataFull3.
    """

serialize(writer, data) staticmethod

Serializes an instance of CharacterReplyServerPacket.ReplyCodeDataFull3 to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataFull3

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
347
348
349
350
351
352
353
354
355
356
357
358
359
360
@staticmethod
def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataFull3") -> None:
    """
    Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataFull3` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterReplyServerPacket.ReplyCodeDataFull3): The data to serialize.
    """
    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 CharacterReplyServerPacket.ReplyCodeDataFull3 from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'CharacterReplyServerPacket.ReplyCodeDataFull3'

CharacterReplyServerPacket.ReplyCodeDataFull3: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
@staticmethod
def deserialize(reader: EoReader) -> "CharacterReplyServerPacket.ReplyCodeDataFull3":
    """
    Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataFull3` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterReplyServerPacket.ReplyCodeDataFull3: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        result = CharacterReplyServerPacket.ReplyCodeDataFull3()
        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 CharacterReply.NotApproved

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
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
class ReplyCodeDataNotApproved:
    """
    Data associated with reply_code value CharacterReply.NotApproved
    """
    _byte_size: int = 0

    def __init__(self):
        """
        Create a new instance of CharacterReplyServerPacket.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: "CharacterReplyServerPacket.ReplyCodeDataNotApproved") -> None:
        """
        Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataNotApproved` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterReplyServerPacket.ReplyCodeDataNotApproved): The data to serialize.
        """
        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) -> "CharacterReplyServerPacket.ReplyCodeDataNotApproved":
        """
        Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataNotApproved` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterReplyServerPacket.ReplyCodeDataNotApproved: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            result = CharacterReplyServerPacket.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"CharacterReplyServerPacket.ReplyCodeDataNotApproved(byte_size={repr(self._byte_size)})"

byte_size: int property

Returns the size of the data that this was deserialized from.

Returns:

Name Type Description
int int

The size of the data that this was deserialized from.

__init__()

Create a new instance of CharacterReplyServerPacket.ReplyCodeDataNotApproved.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
392
393
394
395
def __init__(self):
    """
    Create a new instance of CharacterReplyServerPacket.ReplyCodeDataNotApproved.
    """

serialize(writer, data) staticmethod

Serializes an instance of CharacterReplyServerPacket.ReplyCodeDataNotApproved to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataNotApproved

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
408
409
410
411
412
413
414
415
416
417
418
419
420
421
@staticmethod
def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataNotApproved") -> None:
    """
    Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataNotApproved` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterReplyServerPacket.ReplyCodeDataNotApproved): The data to serialize.
    """
    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 CharacterReplyServerPacket.ReplyCodeDataNotApproved from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'CharacterReplyServerPacket.ReplyCodeDataNotApproved'

CharacterReplyServerPacket.ReplyCodeDataNotApproved: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
@staticmethod
def deserialize(reader: EoReader) -> "CharacterReplyServerPacket.ReplyCodeDataNotApproved":
    """
    Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataNotApproved` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterReplyServerPacket.ReplyCodeDataNotApproved: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        result = CharacterReplyServerPacket.ReplyCodeDataNotApproved()
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataOk

Data associated with reply_code value CharacterReply.Ok

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
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
class ReplyCodeDataOk:
    """
    Data associated with reply_code value CharacterReply.Ok
    """
    _byte_size: int = 0
    _characters_count: int
    _characters: tuple[CharacterSelectionListEntry, ...]

    def __init__(self, *, characters: Iterable[CharacterSelectionListEntry]):
        """
        Create a new instance of CharacterReplyServerPacket.ReplyCodeDataOk.

        Args:
            characters (Iterable[CharacterSelectionListEntry]): (Length must be 252 or less.)
        """
        self._characters = tuple(characters)
        self._characters_count = len(self._characters)

    @property
    def byte_size(self) -> int:
        """
        Returns the size of the data that this was deserialized from.

        Returns:
            int: The size of the data that this was deserialized from.
        """
        return self._byte_size

    @property
    def characters(self) -> tuple[CharacterSelectionListEntry, ...]:
        return self._characters

    @staticmethod
    def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataOk") -> None:
        """
        Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataOk` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterReplyServerPacket.ReplyCodeDataOk): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._characters_count is None:
                raise SerializationError("characters_count must be provided.")
            writer.add_char(data._characters_count)
            writer.add_char(0)
            writer.add_byte(0xFF)
            if data._characters is None:
                raise SerializationError("characters must be provided.")
            if len(data._characters) > 252:
                raise SerializationError(f"Expected length of characters to be 252 or less, got {len(data._characters)}.")
            for i in range(data._characters_count):
                CharacterSelectionListEntry.serialize(writer, data._characters[i])
                writer.add_byte(0xFF)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CharacterReplyServerPacket.ReplyCodeDataOk":
        """
        Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataOk` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterReplyServerPacket.ReplyCodeDataOk: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            characters_count = reader.get_char()
            reader.get_char()
            reader.next_chunk()
            characters = []
            for i in range(characters_count):
                characters.append(CharacterSelectionListEntry.deserialize(reader))
                reader.next_chunk()
            result = CharacterReplyServerPacket.ReplyCodeDataOk(characters=characters)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterReplyServerPacket.ReplyCodeDataOk(byte_size={repr(self._byte_size)}, characters={repr(self._characters)})"

byte_size: int property

Returns the size of the data that this was deserialized from.

Returns:

Name Type Description
int int

The size of the data that this was deserialized from.

characters: tuple[CharacterSelectionListEntry, ...] property

__init__(*, characters)

Create a new instance of CharacterReplyServerPacket.ReplyCodeDataOk.

Parameters:

Name Type Description Default
characters Iterable[CharacterSelectionListEntry]

(Length must be 252 or less.)

required
Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
455
456
457
458
459
460
461
462
463
def __init__(self, *, characters: Iterable[CharacterSelectionListEntry]):
    """
    Create a new instance of CharacterReplyServerPacket.ReplyCodeDataOk.

    Args:
        characters (Iterable[CharacterSelectionListEntry]): (Length must be 252 or less.)
    """
    self._characters = tuple(characters)
    self._characters_count = len(self._characters)

serialize(writer, data) staticmethod

Serializes an instance of CharacterReplyServerPacket.ReplyCodeDataOk to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataOk

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
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
@staticmethod
def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataOk") -> None:
    """
    Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataOk` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterReplyServerPacket.ReplyCodeDataOk): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._characters_count is None:
            raise SerializationError("characters_count must be provided.")
        writer.add_char(data._characters_count)
        writer.add_char(0)
        writer.add_byte(0xFF)
        if data._characters is None:
            raise SerializationError("characters must be provided.")
        if len(data._characters) > 252:
            raise SerializationError(f"Expected length of characters to be 252 or less, got {len(data._characters)}.")
        for i in range(data._characters_count):
            CharacterSelectionListEntry.serialize(writer, data._characters[i])
            writer.add_byte(0xFF)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CharacterReplyServerPacket.ReplyCodeDataOk from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'CharacterReplyServerPacket.ReplyCodeDataOk'

CharacterReplyServerPacket.ReplyCodeDataOk: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "CharacterReplyServerPacket.ReplyCodeDataOk":
    """
    Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataOk` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterReplyServerPacket.ReplyCodeDataOk: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        characters_count = reader.get_char()
        reader.get_char()
        reader.next_chunk()
        characters = []
        for i in range(characters_count):
            characters.append(CharacterSelectionListEntry.deserialize(reader))
            reader.next_chunk()
        result = CharacterReplyServerPacket.ReplyCodeDataOk(characters=characters)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataDeleted

Data associated with reply_code value CharacterReply.Deleted

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
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
class ReplyCodeDataDeleted:
    """
    Data associated with reply_code value CharacterReply.Deleted
    """
    _byte_size: int = 0
    _characters_count: int
    _characters: tuple[CharacterSelectionListEntry, ...]

    def __init__(self, *, characters: Iterable[CharacterSelectionListEntry]):
        """
        Create a new instance of CharacterReplyServerPacket.ReplyCodeDataDeleted.

        Args:
            characters (Iterable[CharacterSelectionListEntry]): (Length must be 252 or less.)
        """
        self._characters = tuple(characters)
        self._characters_count = len(self._characters)

    @property
    def byte_size(self) -> int:
        """
        Returns the size of the data that this was deserialized from.

        Returns:
            int: The size of the data that this was deserialized from.
        """
        return self._byte_size

    @property
    def characters(self) -> tuple[CharacterSelectionListEntry, ...]:
        return self._characters

    @staticmethod
    def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataDeleted") -> None:
        """
        Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataDeleted` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterReplyServerPacket.ReplyCodeDataDeleted): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._characters_count is None:
                raise SerializationError("characters_count must be provided.")
            writer.add_char(data._characters_count)
            writer.add_byte(0xFF)
            if data._characters is None:
                raise SerializationError("characters must be provided.")
            if len(data._characters) > 252:
                raise SerializationError(f"Expected length of characters to be 252 or less, got {len(data._characters)}.")
            for i in range(data._characters_count):
                CharacterSelectionListEntry.serialize(writer, data._characters[i])
                writer.add_byte(0xFF)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CharacterReplyServerPacket.ReplyCodeDataDeleted":
        """
        Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataDeleted` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterReplyServerPacket.ReplyCodeDataDeleted: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            characters_count = reader.get_char()
            reader.next_chunk()
            characters = []
            for i in range(characters_count):
                characters.append(CharacterSelectionListEntry.deserialize(reader))
                reader.next_chunk()
            result = CharacterReplyServerPacket.ReplyCodeDataDeleted(characters=characters)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterReplyServerPacket.ReplyCodeDataDeleted(byte_size={repr(self._byte_size)}, characters={repr(self._characters)})"

byte_size: int property

Returns the size of the data that this was deserialized from.

Returns:

Name Type Description
int int

The size of the data that this was deserialized from.

characters: tuple[CharacterSelectionListEntry, ...] property

__init__(*, characters)

Create a new instance of CharacterReplyServerPacket.ReplyCodeDataDeleted.

Parameters:

Name Type Description Default
characters Iterable[CharacterSelectionListEntry]

(Length must be 252 or less.)

required
Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
543
544
545
546
547
548
549
550
551
def __init__(self, *, characters: Iterable[CharacterSelectionListEntry]):
    """
    Create a new instance of CharacterReplyServerPacket.ReplyCodeDataDeleted.

    Args:
        characters (Iterable[CharacterSelectionListEntry]): (Length must be 252 or less.)
    """
    self._characters = tuple(characters)
    self._characters_count = len(self._characters)

serialize(writer, data) staticmethod

Serializes an instance of CharacterReplyServerPacket.ReplyCodeDataDeleted to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataDeleted

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
@staticmethod
def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataDeleted") -> None:
    """
    Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataDeleted` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterReplyServerPacket.ReplyCodeDataDeleted): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._characters_count is None:
            raise SerializationError("characters_count must be provided.")
        writer.add_char(data._characters_count)
        writer.add_byte(0xFF)
        if data._characters is None:
            raise SerializationError("characters must be provided.")
        if len(data._characters) > 252:
            raise SerializationError(f"Expected length of characters to be 252 or less, got {len(data._characters)}.")
        for i in range(data._characters_count):
            CharacterSelectionListEntry.serialize(writer, data._characters[i])
            writer.add_byte(0xFF)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CharacterReplyServerPacket.ReplyCodeDataDeleted from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'CharacterReplyServerPacket.ReplyCodeDataDeleted'

CharacterReplyServerPacket.ReplyCodeDataDeleted: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "CharacterReplyServerPacket.ReplyCodeDataDeleted":
    """
    Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataDeleted` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterReplyServerPacket.ReplyCodeDataDeleted: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        characters_count = reader.get_char()
        reader.next_chunk()
        characters = []
        for i in range(characters_count):
            characters.append(CharacterSelectionListEntry.deserialize(reader))
            reader.next_chunk()
        result = CharacterReplyServerPacket.ReplyCodeDataDeleted(characters=characters)
        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 character creation

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
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
class ReplyCodeDataDefault:
    """
    Default data associated with reply_code

    In this case (reply_code &gt; 9), reply_code is a session ID for character creation
    """
    _byte_size: int = 0

    def __init__(self):
        """
        Create a new instance of CharacterReplyServerPacket.ReplyCodeDataDefault.
        """

    @property
    def byte_size(self) -> int:
        """
        Returns the size of the data that this was deserialized from.

        Returns:
            int: The size of the data that this was deserialized from.
        """
        return self._byte_size


    @staticmethod
    def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataDefault") -> None:
        """
        Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataDefault` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterReplyServerPacket.ReplyCodeDataDefault): The data to serialize.
        """
        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) -> "CharacterReplyServerPacket.ReplyCodeDataDefault":
        """
        Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataDefault` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterReplyServerPacket.ReplyCodeDataDefault: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            result = CharacterReplyServerPacket.ReplyCodeDataDefault()
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterReplyServerPacket.ReplyCodeDataDefault(byte_size={repr(self._byte_size)})"

byte_size: int property

Returns the size of the data that this was deserialized from.

Returns:

Name Type Description
int int

The size of the data that this was deserialized from.

__init__()

Create a new instance of CharacterReplyServerPacket.ReplyCodeDataDefault.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
629
630
631
632
def __init__(self):
    """
    Create a new instance of CharacterReplyServerPacket.ReplyCodeDataDefault.
    """

serialize(writer, data) staticmethod

Serializes an instance of CharacterReplyServerPacket.ReplyCodeDataDefault to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ReplyCodeDataDefault

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
645
646
647
648
649
650
651
652
653
654
655
656
657
658
@staticmethod
def serialize(writer: EoWriter, data: "CharacterReplyServerPacket.ReplyCodeDataDefault") -> None:
    """
    Serializes an instance of `CharacterReplyServerPacket.ReplyCodeDataDefault` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterReplyServerPacket.ReplyCodeDataDefault): The data to serialize.
    """
    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 CharacterReplyServerPacket.ReplyCodeDataDefault from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
'CharacterReplyServerPacket.ReplyCodeDataDefault'

CharacterReplyServerPacket.ReplyCodeDataDefault: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
@staticmethod
def deserialize(reader: EoReader) -> "CharacterReplyServerPacket.ReplyCodeDataDefault":
    """
    Deserializes an instance of `CharacterReplyServerPacket.ReplyCodeDataDefault` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterReplyServerPacket.ReplyCodeDataDefault: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        result = CharacterReplyServerPacket.ReplyCodeDataDefault()
        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 CharacterReplyServerPacket.

Parameters:

Name Type Description Default
reply_code CharacterReply

Sometimes a CharacterReply code, sometimes a session ID for character creation

required
reply_code_data ReplyCodeData

Data associated with the reply_code field.

None
Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
26
27
28
29
30
31
32
33
34
35
def __init__(self, *, reply_code: CharacterReply, reply_code_data: 'CharacterReplyServerPacket.ReplyCodeData' = None):
    """
    Create a new instance of CharacterReplyServerPacket.

    Args:
        reply_code (CharacterReply): Sometimes a CharacterReply code, sometimes a session ID for character creation
        reply_code_data (CharacterReplyServerPacket.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/character_reply_server_packet.py
61
62
63
64
65
66
67
68
69
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Character

action() staticmethod

Returns the packet action associated with this packet.

Returns:

Name Type Description
PacketAction PacketAction

The packet action associated with this packet.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
71
72
73
74
75
76
77
78
79
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Reply

write(writer)

Serializes and writes this packet to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

the writer that this packet will be written to.

required
Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
81
82
83
84
85
86
87
88
def write(self, writer):
    """
    Serializes and writes this packet to the provided EoWriter.

    Args:
        writer (EoWriter): the writer that this packet will be written to.
    """
    CharacterReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of CharacterReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CharacterReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "CharacterReplyServerPacket") -> None:
    """
    Serializes an instance of `CharacterReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._reply_code is None:
            raise SerializationError("reply_code must be provided.")
        writer.add_short(int(data._reply_code))
        if data._reply_code == 0:
            if data._reply_code_data is not None:
                raise SerializationError("Expected reply_code_data to be None for reply_code " + CharacterReply(data._reply_code).name + ".")
        elif data._reply_code == CharacterReply.Exists:
            if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataExists):
                raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataExists for reply_code " + CharacterReply(data._reply_code).name + ".")
            CharacterReplyServerPacket.ReplyCodeDataExists.serialize(writer, data._reply_code_data)
        elif data._reply_code == CharacterReply.Full:
            if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataFull):
                raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataFull for reply_code " + CharacterReply(data._reply_code).name + ".")
            CharacterReplyServerPacket.ReplyCodeDataFull.serialize(writer, data._reply_code_data)
        elif data._reply_code == CharacterReply.Full3:
            if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataFull3):
                raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataFull3 for reply_code " + CharacterReply(data._reply_code).name + ".")
            CharacterReplyServerPacket.ReplyCodeDataFull3.serialize(writer, data._reply_code_data)
        elif data._reply_code == CharacterReply.NotApproved:
            if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataNotApproved):
                raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataNotApproved for reply_code " + CharacterReply(data._reply_code).name + ".")
            CharacterReplyServerPacket.ReplyCodeDataNotApproved.serialize(writer, data._reply_code_data)
        elif data._reply_code == CharacterReply.Ok:
            if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataOk):
                raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataOk for reply_code " + CharacterReply(data._reply_code).name + ".")
            CharacterReplyServerPacket.ReplyCodeDataOk.serialize(writer, data._reply_code_data)
        elif data._reply_code == CharacterReply.Deleted:
            if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataDeleted):
                raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataDeleted for reply_code " + CharacterReply(data._reply_code).name + ".")
            CharacterReplyServerPacket.ReplyCodeDataDeleted.serialize(writer, data._reply_code_data)
        elif data._reply_code == 7:
            if data._reply_code_data is not None:
                raise SerializationError("Expected reply_code_data to be None for reply_code " + CharacterReply(data._reply_code).name + ".")
        elif data._reply_code == 8:
            if data._reply_code_data is not None:
                raise SerializationError("Expected reply_code_data to be None for reply_code " + CharacterReply(data._reply_code).name + ".")
        elif data._reply_code == 9:
            if data._reply_code_data is not None:
                raise SerializationError("Expected reply_code_data to be None for reply_code " + CharacterReply(data._reply_code).name + ".")
        else:
            if not isinstance(data._reply_code_data, CharacterReplyServerPacket.ReplyCodeDataDefault):
                raise SerializationError("Expected reply_code_data to be type CharacterReplyServerPacket.ReplyCodeDataDefault for reply_code " + CharacterReply(data._reply_code).name + ".")
            CharacterReplyServerPacket.ReplyCodeDataDefault.serialize(writer, data._reply_code_data)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CharacterReplyServerPacket from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Name Type Description
CharacterReplyServerPacket 'CharacterReplyServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_reply_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "CharacterReplyServerPacket":
    """
    Deserializes an instance of `CharacterReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        reply_code = CharacterReply(reader.get_short())
        reply_code_data: CharacterReplyServerPacket.ReplyCodeData = None
        if reply_code == 0:
            reply_code_data = None
        elif reply_code == CharacterReply.Exists:
            reply_code_data = CharacterReplyServerPacket.ReplyCodeDataExists.deserialize(reader)
        elif reply_code == CharacterReply.Full:
            reply_code_data = CharacterReplyServerPacket.ReplyCodeDataFull.deserialize(reader)
        elif reply_code == CharacterReply.Full3:
            reply_code_data = CharacterReplyServerPacket.ReplyCodeDataFull3.deserialize(reader)
        elif reply_code == CharacterReply.NotApproved:
            reply_code_data = CharacterReplyServerPacket.ReplyCodeDataNotApproved.deserialize(reader)
        elif reply_code == CharacterReply.Ok:
            reply_code_data = CharacterReplyServerPacket.ReplyCodeDataOk.deserialize(reader)
        elif reply_code == CharacterReply.Deleted:
            reply_code_data = CharacterReplyServerPacket.ReplyCodeDataDeleted.deserialize(reader)
        elif reply_code == 7:
            reply_code_data = None
        elif reply_code == 8:
            reply_code_data = None
        elif reply_code == 9:
            reply_code_data = None
        else:
            reply_code_data = CharacterReplyServerPacket.ReplyCodeDataDefault.deserialize(reader)
        reader.chunked_reading_mode = False
        result = CharacterReplyServerPacket(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

CharacterReply

Bases: IntEnum

Reply code sent with CHARACTER_REPLY packet

Source code in src/eolib/protocol/_generated/net/server/character_reply.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class CharacterReply(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Reply code sent with CHARACTER_REPLY packet
    """
    Exists = 1
    Full = 2
    """
    Only sent in reply to Character_Create packets.
    Displays the same message as CharacterReply.Full3 in the official client.
    """
    Full3 = 3
    """
    Only sent in reply to Character_Request packets.
    Displays the same message as CharacterReply.Full in the official client.
    """
    NotApproved = 4
    Ok = 5
    Deleted = 6

Exists = 1 class-attribute instance-attribute

Full = 2 class-attribute instance-attribute

Only sent in reply to Character_Create packets. Displays the same message as CharacterReply.Full3 in the official client.

Full3 = 3 class-attribute instance-attribute

Only sent in reply to Character_Request packets. Displays the same message as CharacterReply.Full in the official client.

NotApproved = 4 class-attribute instance-attribute

Ok = 5 class-attribute instance-attribute

Deleted = 6 class-attribute instance-attribute

CharacterPlayerServerPacket

Bases: Packet

Reply to client request to delete a character from the account (Character_Take)

Source code in src/eolib/protocol/_generated/net/server/character_player_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
class CharacterPlayerServerPacket(Packet):
    """
    Reply to client request to delete a character from the account (Character_Take)
    """
    _byte_size: int = 0
    _session_id: int
    _character_id: int

    def __init__(self, *, session_id: int, character_id: int):
        """
        Create a new instance of CharacterPlayerServerPacket.

        Args:
            session_id (int): (Value range is 0-64008.)
            character_id (int): (Value range is 0-4097152080.)
        """
        self._session_id = session_id
        self._character_id = character_id

    @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:
        return self._session_id

    @property
    def character_id(self) -> int:
        return self._character_id

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Character

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Player

    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.
        """
        CharacterPlayerServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "CharacterPlayerServerPacket") -> None:
        """
        Serializes an instance of `CharacterPlayerServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterPlayerServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            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)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CharacterPlayerServerPacket":
        """
        Deserializes an instance of `CharacterPlayerServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterPlayerServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            session_id = reader.get_short()
            character_id = reader.get_int()
            result = CharacterPlayerServerPacket(session_id=session_id, character_id=character_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterPlayerServerPacket(byte_size={repr(self._byte_size)}, session_id={repr(self._session_id)}, character_id={repr(self._character_id)})"

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

character_id: int property

__init__(*, session_id, character_id)

Create a new instance of CharacterPlayerServerPacket.

Parameters:

Name Type Description Default
session_id int

(Value range is 0-64008.)

required
character_id int

(Value range is 0-4097152080.)

required
Source code in src/eolib/protocol/_generated/net/server/character_player_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, session_id: int, character_id: int):
    """
    Create a new instance of CharacterPlayerServerPacket.

    Args:
        session_id (int): (Value range is 0-64008.)
        character_id (int): (Value range is 0-4097152080.)
    """
    self._session_id = session_id
    self._character_id = character_id

family() staticmethod

Returns the packet family associated with this packet.

Returns:

Name Type Description
PacketFamily PacketFamily

The packet family associated with this packet.

Source code in src/eolib/protocol/_generated/net/server/character_player_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Character

action() staticmethod

Returns the packet action associated with this packet.

Returns:

Name Type Description
PacketAction PacketAction

The packet action associated with this packet.

Source code in src/eolib/protocol/_generated/net/server/character_player_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Player

write(writer)

Serializes and writes this packet to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

the writer that this packet will be written to.

required
Source code in src/eolib/protocol/_generated/net/server/character_player_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    CharacterPlayerServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of CharacterPlayerServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CharacterPlayerServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_player_server_packet.py
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@staticmethod
def serialize(writer: EoWriter, data: "CharacterPlayerServerPacket") -> None:
    """
    Serializes an instance of `CharacterPlayerServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterPlayerServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        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)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CharacterPlayerServerPacket 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
CharacterPlayerServerPacket CharacterPlayerServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_player_server_packet.py
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@staticmethod
def deserialize(reader: EoReader) -> "CharacterPlayerServerPacket":
    """
    Deserializes an instance of `CharacterPlayerServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterPlayerServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        session_id = reader.get_short()
        character_id = reader.get_int()
        result = CharacterPlayerServerPacket(session_id=session_id, character_id=character_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

SitState

Bases: IntEnum

Indicates how a player is sitting (or not sitting)

Source code in src/eolib/protocol/_generated/net/server/sit_state.py
 9
10
11
12
13
14
15
class SitState(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Indicates how a player is sitting (or not sitting)
    """
    Stand = 0
    Chair = 1
    Floor = 2

Stand = 0 class-attribute instance-attribute

Chair = 1 class-attribute instance-attribute

Floor = 2 class-attribute instance-attribute

CharacterMapInfo

Information about a nearby character. The official client skips these if they're under 42 bytes in length.

Source code in src/eolib/protocol/_generated/net/server/character_map_info.py
 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
class CharacterMapInfo:
    """
    Information about a nearby character.
    The official client skips these if they're under 42 bytes in length.
    """
    _byte_size: int = 0
    _name: str
    _player_id: int
    _map_id: int
    _coords: BigCoords
    _direction: Direction
    _class_id: int
    _guild_tag: str
    _level: int
    _gender: Gender
    _hair_style: int
    _hair_color: int
    _skin: int
    _max_hp: int
    _hp: int
    _max_tp: int
    _tp: int
    _equipment: EquipmentMapInfo
    _sit_state: SitState
    _invisible: bool
    _warp_effect: Optional[WarpEffect]

    def __init__(self, *, name: str, player_id: int, map_id: int, coords: BigCoords, direction: Direction, class_id: int, guild_tag: str, level: int, gender: Gender, hair_style: int, hair_color: int, skin: int, max_hp: int, hp: int, max_tp: int, tp: int, equipment: EquipmentMapInfo, sit_state: SitState, invisible: bool, warp_effect: Optional[WarpEffect] = None):
        """
        Create a new instance of CharacterMapInfo.

        Args:
            name (str): 
            player_id (int): (Value range is 0-64008.)
            map_id (int): (Value range is 0-64008.)
            coords (BigCoords): 
            direction (Direction): 
            class_id (int): (Value range is 0-252.)
            guild_tag (str): (Length must be `3`.)
            level (int): (Value range is 0-252.)
            gender (Gender): 
            hair_style (int): (Value range is 0-252.)
            hair_color (int): (Value range is 0-252.)
            skin (int): (Value range is 0-252.)
            max_hp (int): (Value range is 0-64008.)
            hp (int): (Value range is 0-64008.)
            max_tp (int): (Value range is 0-64008.)
            tp (int): (Value range is 0-64008.)
            equipment (EquipmentMapInfo): 
            sit_state (SitState): 
            invisible (bool): 
            warp_effect (Optional[WarpEffect]): 
        """
        self._name = name
        self._player_id = player_id
        self._map_id = map_id
        self._coords = coords
        self._direction = direction
        self._class_id = class_id
        self._guild_tag = guild_tag
        self._level = level
        self._gender = gender
        self._hair_style = hair_style
        self._hair_color = hair_color
        self._skin = skin
        self._max_hp = max_hp
        self._hp = hp
        self._max_tp = max_tp
        self._tp = tp
        self._equipment = equipment
        self._sit_state = sit_state
        self._invisible = invisible
        self._warp_effect = warp_effect

    @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 name(self) -> str:
        return self._name

    @property
    def player_id(self) -> int:
        return self._player_id

    @property
    def map_id(self) -> int:
        return self._map_id

    @property
    def coords(self) -> BigCoords:
        return self._coords

    @property
    def direction(self) -> Direction:
        return self._direction

    @property
    def class_id(self) -> int:
        return self._class_id

    @property
    def guild_tag(self) -> str:
        return self._guild_tag

    @property
    def level(self) -> int:
        return self._level

    @property
    def gender(self) -> Gender:
        return self._gender

    @property
    def hair_style(self) -> int:
        return self._hair_style

    @property
    def hair_color(self) -> int:
        return self._hair_color

    @property
    def skin(self) -> int:
        return self._skin

    @property
    def max_hp(self) -> int:
        return self._max_hp

    @property
    def hp(self) -> int:
        return self._hp

    @property
    def max_tp(self) -> int:
        return self._max_tp

    @property
    def tp(self) -> int:
        return self._tp

    @property
    def equipment(self) -> EquipmentMapInfo:
        return self._equipment

    @property
    def sit_state(self) -> SitState:
        return self._sit_state

    @property
    def invisible(self) -> bool:
        return self._invisible

    @property
    def warp_effect(self) -> Optional[WarpEffect]:
        return self._warp_effect

    @staticmethod
    def serialize(writer: EoWriter, data: "CharacterMapInfo") -> None:
        """
        Serializes an instance of `CharacterMapInfo` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterMapInfo): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._name is None:
                raise SerializationError("name must be provided.")
            writer.add_string(data._name)
            writer.add_byte(0xFF)
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._map_id is None:
                raise SerializationError("map_id must be provided.")
            writer.add_short(data._map_id)
            if data._coords is None:
                raise SerializationError("coords must be provided.")
            BigCoords.serialize(writer, data._coords)
            if data._direction is None:
                raise SerializationError("direction must be provided.")
            writer.add_char(int(data._direction))
            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._level is None:
                raise SerializationError("level must be provided.")
            writer.add_char(data._level)
            if data._gender is None:
                raise SerializationError("gender must be provided.")
            writer.add_char(int(data._gender))
            if data._hair_style is None:
                raise SerializationError("hair_style must be provided.")
            writer.add_char(data._hair_style)
            if data._hair_color is None:
                raise SerializationError("hair_color must be provided.")
            writer.add_char(data._hair_color)
            if data._skin is None:
                raise SerializationError("skin must be provided.")
            writer.add_char(data._skin)
            if data._max_hp is None:
                raise SerializationError("max_hp must be provided.")
            writer.add_short(data._max_hp)
            if data._hp is None:
                raise SerializationError("hp must be provided.")
            writer.add_short(data._hp)
            if data._max_tp is None:
                raise SerializationError("max_tp must be provided.")
            writer.add_short(data._max_tp)
            if data._tp is None:
                raise SerializationError("tp must be provided.")
            writer.add_short(data._tp)
            if data._equipment is None:
                raise SerializationError("equipment must be provided.")
            EquipmentMapInfo.serialize(writer, data._equipment)
            if data._sit_state is None:
                raise SerializationError("sit_state must be provided.")
            writer.add_char(int(data._sit_state))
            if data._invisible is None:
                raise SerializationError("invisible must be provided.")
            writer.add_char(1 if data._invisible else 0)
            reached_missing_optional = data._warp_effect is None
            if not reached_missing_optional:
                writer.add_char(int(cast(WarpEffect, data._warp_effect)))
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CharacterMapInfo":
        """
        Deserializes an instance of `CharacterMapInfo` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterMapInfo: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            name = reader.get_string()
            reader.next_chunk()
            player_id = reader.get_short()
            map_id = reader.get_short()
            coords = BigCoords.deserialize(reader)
            direction = Direction(reader.get_char())
            class_id = reader.get_char()
            guild_tag = reader.get_fixed_string(3, False)
            level = reader.get_char()
            gender = Gender(reader.get_char())
            hair_style = reader.get_char()
            hair_color = reader.get_char()
            skin = reader.get_char()
            max_hp = reader.get_short()
            hp = reader.get_short()
            max_tp = reader.get_short()
            tp = reader.get_short()
            equipment = EquipmentMapInfo.deserialize(reader)
            sit_state = SitState(reader.get_char())
            invisible = reader.get_char() != 0
            warp_effect: Optional[WarpEffect] = None
            if reader.remaining > 0:
                warp_effect = WarpEffect(reader.get_char())
            reader.chunked_reading_mode = False
            result = CharacterMapInfo(name=name, player_id=player_id, map_id=map_id, coords=coords, direction=direction, class_id=class_id, guild_tag=guild_tag, level=level, gender=gender, hair_style=hair_style, hair_color=hair_color, skin=skin, max_hp=max_hp, hp=hp, max_tp=max_tp, tp=tp, equipment=equipment, sit_state=sit_state, invisible=invisible, warp_effect=warp_effect)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterMapInfo(byte_size={repr(self._byte_size)}, name={repr(self._name)}, player_id={repr(self._player_id)}, map_id={repr(self._map_id)}, coords={repr(self._coords)}, direction={repr(self._direction)}, class_id={repr(self._class_id)}, guild_tag={repr(self._guild_tag)}, level={repr(self._level)}, gender={repr(self._gender)}, hair_style={repr(self._hair_style)}, hair_color={repr(self._hair_color)}, skin={repr(self._skin)}, max_hp={repr(self._max_hp)}, hp={repr(self._hp)}, max_tp={repr(self._max_tp)}, tp={repr(self._tp)}, equipment={repr(self._equipment)}, sit_state={repr(self._sit_state)}, invisible={repr(self._invisible)}, warp_effect={repr(self._warp_effect)})"

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.

name: str property

player_id: int property

map_id: int property

coords: BigCoords property

direction: Direction property

class_id: int property

guild_tag: str property

level: int property

gender: Gender property

hair_style: int property

hair_color: int property

skin: int property

max_hp: int property

hp: int property

max_tp: int property

tp: int property

equipment: EquipmentMapInfo property

sit_state: SitState property

invisible: bool property

warp_effect: Optional[WarpEffect] property

__init__(*, name, player_id, map_id, coords, direction, class_id, guild_tag, level, gender, hair_style, hair_color, skin, max_hp, hp, max_tp, tp, equipment, sit_state, invisible, warp_effect=None)

Create a new instance of CharacterMapInfo.

Parameters:

Name Type Description Default
name str
required
player_id int

(Value range is 0-64008.)

required
map_id int

(Value range is 0-64008.)

required
coords BigCoords
required
direction Direction
required
class_id int

(Value range is 0-252.)

required
guild_tag str

(Length must be 3.)

required
level int

(Value range is 0-252.)

required
gender Gender
required
hair_style int

(Value range is 0-252.)

required
hair_color int

(Value range is 0-252.)

required
skin int

(Value range is 0-252.)

required
max_hp int

(Value range is 0-64008.)

required
hp int

(Value range is 0-64008.)

required
max_tp int

(Value range is 0-64008.)

required
tp int

(Value range is 0-64008.)

required
equipment EquipmentMapInfo
required
sit_state SitState
required
invisible bool
required
warp_effect Optional[WarpEffect]
None
Source code in src/eolib/protocol/_generated/net/server/character_map_info.py
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
def __init__(self, *, name: str, player_id: int, map_id: int, coords: BigCoords, direction: Direction, class_id: int, guild_tag: str, level: int, gender: Gender, hair_style: int, hair_color: int, skin: int, max_hp: int, hp: int, max_tp: int, tp: int, equipment: EquipmentMapInfo, sit_state: SitState, invisible: bool, warp_effect: Optional[WarpEffect] = None):
    """
    Create a new instance of CharacterMapInfo.

    Args:
        name (str): 
        player_id (int): (Value range is 0-64008.)
        map_id (int): (Value range is 0-64008.)
        coords (BigCoords): 
        direction (Direction): 
        class_id (int): (Value range is 0-252.)
        guild_tag (str): (Length must be `3`.)
        level (int): (Value range is 0-252.)
        gender (Gender): 
        hair_style (int): (Value range is 0-252.)
        hair_color (int): (Value range is 0-252.)
        skin (int): (Value range is 0-252.)
        max_hp (int): (Value range is 0-64008.)
        hp (int): (Value range is 0-64008.)
        max_tp (int): (Value range is 0-64008.)
        tp (int): (Value range is 0-64008.)
        equipment (EquipmentMapInfo): 
        sit_state (SitState): 
        invisible (bool): 
        warp_effect (Optional[WarpEffect]): 
    """
    self._name = name
    self._player_id = player_id
    self._map_id = map_id
    self._coords = coords
    self._direction = direction
    self._class_id = class_id
    self._guild_tag = guild_tag
    self._level = level
    self._gender = gender
    self._hair_style = hair_style
    self._hair_color = hair_color
    self._skin = skin
    self._max_hp = max_hp
    self._hp = hp
    self._max_tp = max_tp
    self._tp = tp
    self._equipment = equipment
    self._sit_state = sit_state
    self._invisible = invisible
    self._warp_effect = warp_effect

serialize(writer, data) staticmethod

Serializes an instance of CharacterMapInfo to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CharacterMapInfo

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_map_info.py
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
@staticmethod
def serialize(writer: EoWriter, data: "CharacterMapInfo") -> None:
    """
    Serializes an instance of `CharacterMapInfo` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterMapInfo): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._name is None:
            raise SerializationError("name must be provided.")
        writer.add_string(data._name)
        writer.add_byte(0xFF)
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._map_id is None:
            raise SerializationError("map_id must be provided.")
        writer.add_short(data._map_id)
        if data._coords is None:
            raise SerializationError("coords must be provided.")
        BigCoords.serialize(writer, data._coords)
        if data._direction is None:
            raise SerializationError("direction must be provided.")
        writer.add_char(int(data._direction))
        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._level is None:
            raise SerializationError("level must be provided.")
        writer.add_char(data._level)
        if data._gender is None:
            raise SerializationError("gender must be provided.")
        writer.add_char(int(data._gender))
        if data._hair_style is None:
            raise SerializationError("hair_style must be provided.")
        writer.add_char(data._hair_style)
        if data._hair_color is None:
            raise SerializationError("hair_color must be provided.")
        writer.add_char(data._hair_color)
        if data._skin is None:
            raise SerializationError("skin must be provided.")
        writer.add_char(data._skin)
        if data._max_hp is None:
            raise SerializationError("max_hp must be provided.")
        writer.add_short(data._max_hp)
        if data._hp is None:
            raise SerializationError("hp must be provided.")
        writer.add_short(data._hp)
        if data._max_tp is None:
            raise SerializationError("max_tp must be provided.")
        writer.add_short(data._max_tp)
        if data._tp is None:
            raise SerializationError("tp must be provided.")
        writer.add_short(data._tp)
        if data._equipment is None:
            raise SerializationError("equipment must be provided.")
        EquipmentMapInfo.serialize(writer, data._equipment)
        if data._sit_state is None:
            raise SerializationError("sit_state must be provided.")
        writer.add_char(int(data._sit_state))
        if data._invisible is None:
            raise SerializationError("invisible must be provided.")
        writer.add_char(1 if data._invisible else 0)
        reached_missing_optional = data._warp_effect is None
        if not reached_missing_optional:
            writer.add_char(int(cast(WarpEffect, data._warp_effect)))
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CharacterMapInfo 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
CharacterMapInfo CharacterMapInfo

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_map_info.py
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
@staticmethod
def deserialize(reader: EoReader) -> "CharacterMapInfo":
    """
    Deserializes an instance of `CharacterMapInfo` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterMapInfo: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        name = reader.get_string()
        reader.next_chunk()
        player_id = reader.get_short()
        map_id = reader.get_short()
        coords = BigCoords.deserialize(reader)
        direction = Direction(reader.get_char())
        class_id = reader.get_char()
        guild_tag = reader.get_fixed_string(3, False)
        level = reader.get_char()
        gender = Gender(reader.get_char())
        hair_style = reader.get_char()
        hair_color = reader.get_char()
        skin = reader.get_char()
        max_hp = reader.get_short()
        hp = reader.get_short()
        max_tp = reader.get_short()
        tp = reader.get_short()
        equipment = EquipmentMapInfo.deserialize(reader)
        sit_state = SitState(reader.get_char())
        invisible = reader.get_char() != 0
        warp_effect: Optional[WarpEffect] = None
        if reader.remaining > 0:
            warp_effect = WarpEffect(reader.get_char())
        reader.chunked_reading_mode = False
        result = CharacterMapInfo(name=name, player_id=player_id, map_id=map_id, coords=coords, direction=direction, class_id=class_id, guild_tag=guild_tag, level=level, gender=gender, hair_style=hair_style, hair_color=hair_color, skin=skin, max_hp=max_hp, hp=hp, max_tp=max_tp, tp=tp, equipment=equipment, sit_state=sit_state, invisible=invisible, warp_effect=warp_effect)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

EquipmentMapInfo

Player equipment data. Sent with map information about a nearby character. Note that these values are graphic IDs.

Source code in src/eolib/protocol/_generated/net/server/equipment_map_info.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
class EquipmentMapInfo:
    """
    Player equipment data.
    Sent with map information about a nearby character.
    Note that these values are graphic IDs.
    """
    _byte_size: int = 0
    _boots: int
    _armor: int
    _hat: int
    _shield: int
    _weapon: int

    def __init__(self, *, boots: int, armor: int, hat: int, shield: int, weapon: int):
        """
        Create a new instance of EquipmentMapInfo.

        Args:
            boots (int): (Value range is 0-64008.)
            armor (int): (Value range is 0-64008.)
            hat (int): (Value range is 0-64008.)
            shield (int): (Value range is 0-64008.)
            weapon (int): (Value range is 0-64008.)
        """
        self._boots = boots
        self._armor = armor
        self._hat = hat
        self._shield = shield
        self._weapon = weapon

    @property
    def byte_size(self) -> int:
        """
        Returns the size of the data that this was deserialized from.

        Returns:
            int: The size of the data that this was deserialized from.
        """
        return self._byte_size

    @property
    def boots(self) -> int:
        return self._boots

    @property
    def armor(self) -> int:
        return self._armor

    @property
    def hat(self) -> int:
        return self._hat

    @property
    def shield(self) -> int:
        return self._shield

    @property
    def weapon(self) -> int:
        return self._weapon

    @staticmethod
    def serialize(writer: EoWriter, data: "EquipmentMapInfo") -> None:
        """
        Serializes an instance of `EquipmentMapInfo` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (EquipmentMapInfo): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._boots is None:
                raise SerializationError("boots must be provided.")
            writer.add_short(data._boots)
            writer.add_short(0)
            writer.add_short(0)
            writer.add_short(0)
            if data._armor is None:
                raise SerializationError("armor must be provided.")
            writer.add_short(data._armor)
            writer.add_short(0)
            if data._hat is None:
                raise SerializationError("hat must be provided.")
            writer.add_short(data._hat)
            if data._shield is None:
                raise SerializationError("shield must be provided.")
            writer.add_short(data._shield)
            if data._weapon is None:
                raise SerializationError("weapon must be provided.")
            writer.add_short(data._weapon)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "EquipmentMapInfo":
        """
        Deserializes an instance of `EquipmentMapInfo` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            EquipmentMapInfo: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            boots = reader.get_short()
            reader.get_short()
            reader.get_short()
            reader.get_short()
            armor = reader.get_short()
            reader.get_short()
            hat = reader.get_short()
            shield = reader.get_short()
            weapon = reader.get_short()
            result = EquipmentMapInfo(boots=boots, armor=armor, hat=hat, shield=shield, weapon=weapon)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"EquipmentMapInfo(byte_size={repr(self._byte_size)}, boots={repr(self._boots)}, armor={repr(self._armor)}, hat={repr(self._hat)}, shield={repr(self._shield)}, weapon={repr(self._weapon)})"

byte_size: int property

Returns the size of the data that this was deserialized from.

Returns:

Name Type Description
int int

The size of the data that this was deserialized from.

boots: int property

armor: int property

hat: int property

shield: int property

weapon: int property

__init__(*, boots, armor, hat, shield, weapon)

Create a new instance of EquipmentMapInfo.

Parameters:

Name Type Description Default
boots int

(Value range is 0-64008.)

required
armor int

(Value range is 0-64008.)

required
hat int

(Value range is 0-64008.)

required
shield int

(Value range is 0-64008.)

required
weapon int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/equipment_map_info.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
def __init__(self, *, boots: int, armor: int, hat: int, shield: int, weapon: int):
    """
    Create a new instance of EquipmentMapInfo.

    Args:
        boots (int): (Value range is 0-64008.)
        armor (int): (Value range is 0-64008.)
        hat (int): (Value range is 0-64008.)
        shield (int): (Value range is 0-64008.)
        weapon (int): (Value range is 0-64008.)
    """
    self._boots = boots
    self._armor = armor
    self._hat = hat
    self._shield = shield
    self._weapon = weapon

serialize(writer, data) staticmethod

Serializes an instance of EquipmentMapInfo to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data EquipmentMapInfo

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/equipment_map_info.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "EquipmentMapInfo") -> None:
    """
    Serializes an instance of `EquipmentMapInfo` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (EquipmentMapInfo): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._boots is None:
            raise SerializationError("boots must be provided.")
        writer.add_short(data._boots)
        writer.add_short(0)
        writer.add_short(0)
        writer.add_short(0)
        if data._armor is None:
            raise SerializationError("armor must be provided.")
        writer.add_short(data._armor)
        writer.add_short(0)
        if data._hat is None:
            raise SerializationError("hat must be provided.")
        writer.add_short(data._hat)
        if data._shield is None:
            raise SerializationError("shield must be provided.")
        writer.add_short(data._shield)
        if data._weapon is None:
            raise SerializationError("weapon must be provided.")
        writer.add_short(data._weapon)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of EquipmentMapInfo 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
EquipmentMapInfo EquipmentMapInfo

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/equipment_map_info.py
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
@staticmethod
def deserialize(reader: EoReader) -> "EquipmentMapInfo":
    """
    Deserializes an instance of `EquipmentMapInfo` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        EquipmentMapInfo: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        boots = reader.get_short()
        reader.get_short()
        reader.get_short()
        reader.get_short()
        armor = reader.get_short()
        reader.get_short()
        hat = reader.get_short()
        shield = reader.get_short()
        weapon = reader.get_short()
        result = EquipmentMapInfo(boots=boots, armor=armor, hat=hat, shield=shield, weapon=weapon)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

CharacterElementalStats

The 6 elemental character stats

Source code in src/eolib/protocol/_generated/net/server/character_elemental_stats.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
class CharacterElementalStats:
    """
    The 6 elemental character stats
    """
    _byte_size: int = 0
    _light: int
    _dark: int
    _fire: int
    _water: int
    _earth: int
    _wind: int

    def __init__(self, *, light: int, dark: int, fire: int, water: int, earth: int, wind: int):
        """
        Create a new instance of CharacterElementalStats.

        Args:
            light (int): (Value range is 0-64008.)
            dark (int): (Value range is 0-64008.)
            fire (int): (Value range is 0-64008.)
            water (int): (Value range is 0-64008.)
            earth (int): (Value range is 0-64008.)
            wind (int): (Value range is 0-64008.)
        """
        self._light = light
        self._dark = dark
        self._fire = fire
        self._water = water
        self._earth = earth
        self._wind = wind

    @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 light(self) -> int:
        return self._light

    @property
    def dark(self) -> int:
        return self._dark

    @property
    def fire(self) -> int:
        return self._fire

    @property
    def water(self) -> int:
        return self._water

    @property
    def earth(self) -> int:
        return self._earth

    @property
    def wind(self) -> int:
        return self._wind

    @staticmethod
    def serialize(writer: EoWriter, data: "CharacterElementalStats") -> None:
        """
        Serializes an instance of `CharacterElementalStats` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterElementalStats): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._light is None:
                raise SerializationError("light must be provided.")
            writer.add_short(data._light)
            if data._dark is None:
                raise SerializationError("dark must be provided.")
            writer.add_short(data._dark)
            if data._fire is None:
                raise SerializationError("fire must be provided.")
            writer.add_short(data._fire)
            if data._water is None:
                raise SerializationError("water must be provided.")
            writer.add_short(data._water)
            if data._earth is None:
                raise SerializationError("earth must be provided.")
            writer.add_short(data._earth)
            if data._wind is None:
                raise SerializationError("wind must be provided.")
            writer.add_short(data._wind)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CharacterElementalStats":
        """
        Deserializes an instance of `CharacterElementalStats` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterElementalStats: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            light = reader.get_short()
            dark = reader.get_short()
            fire = reader.get_short()
            water = reader.get_short()
            earth = reader.get_short()
            wind = reader.get_short()
            result = CharacterElementalStats(light=light, dark=dark, fire=fire, water=water, earth=earth, wind=wind)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterElementalStats(byte_size={repr(self._byte_size)}, light={repr(self._light)}, dark={repr(self._dark)}, fire={repr(self._fire)}, water={repr(self._water)}, earth={repr(self._earth)}, wind={repr(self._wind)})"

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.

light: int property

dark: int property

fire: int property

water: int property

earth: int property

wind: int property

__init__(*, light, dark, fire, water, earth, wind)

Create a new instance of CharacterElementalStats.

Parameters:

Name Type Description Default
light int

(Value range is 0-64008.)

required
dark int

(Value range is 0-64008.)

required
fire int

(Value range is 0-64008.)

required
water int

(Value range is 0-64008.)

required
earth int

(Value range is 0-64008.)

required
wind int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/character_elemental_stats.py
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
def __init__(self, *, light: int, dark: int, fire: int, water: int, earth: int, wind: int):
    """
    Create a new instance of CharacterElementalStats.

    Args:
        light (int): (Value range is 0-64008.)
        dark (int): (Value range is 0-64008.)
        fire (int): (Value range is 0-64008.)
        water (int): (Value range is 0-64008.)
        earth (int): (Value range is 0-64008.)
        wind (int): (Value range is 0-64008.)
    """
    self._light = light
    self._dark = dark
    self._fire = fire
    self._water = water
    self._earth = earth
    self._wind = wind

serialize(writer, data) staticmethod

Serializes an instance of CharacterElementalStats to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CharacterElementalStats

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_elemental_stats.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "CharacterElementalStats") -> None:
    """
    Serializes an instance of `CharacterElementalStats` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterElementalStats): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._light is None:
            raise SerializationError("light must be provided.")
        writer.add_short(data._light)
        if data._dark is None:
            raise SerializationError("dark must be provided.")
        writer.add_short(data._dark)
        if data._fire is None:
            raise SerializationError("fire must be provided.")
        writer.add_short(data._fire)
        if data._water is None:
            raise SerializationError("water must be provided.")
        writer.add_short(data._water)
        if data._earth is None:
            raise SerializationError("earth must be provided.")
        writer.add_short(data._earth)
        if data._wind is None:
            raise SerializationError("wind must be provided.")
        writer.add_short(data._wind)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CharacterElementalStats 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
CharacterElementalStats CharacterElementalStats

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_elemental_stats.py
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
@staticmethod
def deserialize(reader: EoReader) -> "CharacterElementalStats":
    """
    Deserializes an instance of `CharacterElementalStats` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterElementalStats: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        light = reader.get_short()
        dark = reader.get_short()
        fire = reader.get_short()
        water = reader.get_short()
        earth = reader.get_short()
        wind = reader.get_short()
        result = CharacterElementalStats(light=light, dark=dark, fire=fire, water=water, earth=earth, wind=wind)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

AdminLevel

Bases: IntEnum

The admin level of a player

Source code in src/eolib/protocol/_generated/admin_level.py
 9
10
11
12
13
14
15
16
17
18
class AdminLevel(IntEnum, metaclass=ProtocolEnumMeta):
    """
    The admin level of a player
    """
    Player = 0
    Spy = 1
    LightGuide = 2
    Guardian = 3
    GameMaster = 4
    HighGameMaster = 5

Player = 0 class-attribute instance-attribute

Spy = 1 class-attribute instance-attribute

LightGuide = 2 class-attribute instance-attribute

Guardian = 3 class-attribute instance-attribute

GameMaster = 4 class-attribute instance-attribute

HighGameMaster = 5 class-attribute instance-attribute

Gender

Bases: IntEnum

The gender of a player

Source code in src/eolib/protocol/_generated/gender.py
 9
10
11
12
13
14
class Gender(IntEnum, metaclass=ProtocolEnumMeta):
    """
    The gender of a player
    """
    Female = 0
    Male = 1

Female = 0 class-attribute instance-attribute

Male = 1 class-attribute instance-attribute

CharacterBaseStatsWelcome

The 6 base character stats. Sent upon selecting a character and entering the game.

Source code in src/eolib/protocol/_generated/net/server/character_base_stats_welcome.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
class CharacterBaseStatsWelcome:
    """
    The 6 base character stats.
    Sent upon selecting a character and entering the game.
    """
    _byte_size: int = 0
    _str: int
    _wis: int
    _intl: int
    _agi: int
    _con: int
    _cha: int

    def __init__(self, *, str: int, wis: int, intl: int, agi: int, con: int, cha: int):
        """
        Create a new instance of CharacterBaseStatsWelcome.

        Args:
            str (int): (Value range is 0-64008.)
            wis (int): (Value range is 0-64008.)
            intl (int): (Value range is 0-64008.)
            agi (int): (Value range is 0-64008.)
            con (int): (Value range is 0-64008.)
            cha (int): (Value range is 0-64008.)
        """
        self._str = str
        self._wis = wis
        self._intl = intl
        self._agi = agi
        self._con = con
        self._cha = cha

    @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 str(self) -> int:
        return self._str

    @property
    def wis(self) -> int:
        return self._wis

    @property
    def intl(self) -> int:
        return self._intl

    @property
    def agi(self) -> int:
        return self._agi

    @property
    def con(self) -> int:
        return self._con

    @property
    def cha(self) -> int:
        return self._cha

    @staticmethod
    def serialize(writer: EoWriter, data: "CharacterBaseStatsWelcome") -> None:
        """
        Serializes an instance of `CharacterBaseStatsWelcome` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterBaseStatsWelcome): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._str is None:
                raise SerializationError("str must be provided.")
            writer.add_short(data._str)
            if data._wis is None:
                raise SerializationError("wis must be provided.")
            writer.add_short(data._wis)
            if data._intl is None:
                raise SerializationError("intl must be provided.")
            writer.add_short(data._intl)
            if data._agi is None:
                raise SerializationError("agi must be provided.")
            writer.add_short(data._agi)
            if data._con is None:
                raise SerializationError("con must be provided.")
            writer.add_short(data._con)
            if data._cha is None:
                raise SerializationError("cha must be provided.")
            writer.add_short(data._cha)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CharacterBaseStatsWelcome":
        """
        Deserializes an instance of `CharacterBaseStatsWelcome` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterBaseStatsWelcome: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            str = reader.get_short()
            wis = reader.get_short()
            intl = reader.get_short()
            agi = reader.get_short()
            con = reader.get_short()
            cha = reader.get_short()
            result = CharacterBaseStatsWelcome(str=str, wis=wis, intl=intl, agi=agi, con=con, cha=cha)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterBaseStatsWelcome(byte_size={repr(self._byte_size)}, str={repr(self._str)}, wis={repr(self._wis)}, intl={repr(self._intl)}, agi={repr(self._agi)}, con={repr(self._con)}, cha={repr(self._cha)})"

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.

str: int property

wis: int property

intl: int property

agi: int property

con: int property

cha: int property

__init__(*, str, wis, intl, agi, con, cha)

Create a new instance of CharacterBaseStatsWelcome.

Parameters:

Name Type Description Default
str int

(Value range is 0-64008.)

required
wis int

(Value range is 0-64008.)

required
intl int

(Value range is 0-64008.)

required
agi int

(Value range is 0-64008.)

required
con int

(Value range is 0-64008.)

required
cha int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/character_base_stats_welcome.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
def __init__(self, *, str: int, wis: int, intl: int, agi: int, con: int, cha: int):
    """
    Create a new instance of CharacterBaseStatsWelcome.

    Args:
        str (int): (Value range is 0-64008.)
        wis (int): (Value range is 0-64008.)
        intl (int): (Value range is 0-64008.)
        agi (int): (Value range is 0-64008.)
        con (int): (Value range is 0-64008.)
        cha (int): (Value range is 0-64008.)
    """
    self._str = str
    self._wis = wis
    self._intl = intl
    self._agi = agi
    self._con = con
    self._cha = cha

serialize(writer, data) staticmethod

Serializes an instance of CharacterBaseStatsWelcome to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CharacterBaseStatsWelcome

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_base_stats_welcome.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "CharacterBaseStatsWelcome") -> None:
    """
    Serializes an instance of `CharacterBaseStatsWelcome` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterBaseStatsWelcome): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._str is None:
            raise SerializationError("str must be provided.")
        writer.add_short(data._str)
        if data._wis is None:
            raise SerializationError("wis must be provided.")
        writer.add_short(data._wis)
        if data._intl is None:
            raise SerializationError("intl must be provided.")
        writer.add_short(data._intl)
        if data._agi is None:
            raise SerializationError("agi must be provided.")
        writer.add_short(data._agi)
        if data._con is None:
            raise SerializationError("con must be provided.")
        writer.add_short(data._con)
        if data._cha is None:
            raise SerializationError("cha must be provided.")
        writer.add_short(data._cha)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CharacterBaseStatsWelcome 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
CharacterBaseStatsWelcome CharacterBaseStatsWelcome

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_base_stats_welcome.py
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
@staticmethod
def deserialize(reader: EoReader) -> "CharacterBaseStatsWelcome":
    """
    Deserializes an instance of `CharacterBaseStatsWelcome` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterBaseStatsWelcome: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        str = reader.get_short()
        wis = reader.get_short()
        intl = reader.get_short()
        agi = reader.get_short()
        con = reader.get_short()
        cha = reader.get_short()
        result = CharacterBaseStatsWelcome(str=str, wis=wis, intl=intl, agi=agi, con=con, cha=cha)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

CharacterBaseStats

The 6 base character stats

Source code in src/eolib/protocol/_generated/net/server/character_base_stats.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
class CharacterBaseStats:
    """
    The 6 base character stats
    """
    _byte_size: int = 0
    _str: int
    _intl: int
    _wis: int
    _agi: int
    _con: int
    _cha: int

    def __init__(self, *, str: int, intl: int, wis: int, agi: int, con: int, cha: int):
        """
        Create a new instance of CharacterBaseStats.

        Args:
            str (int): (Value range is 0-64008.)
            intl (int): (Value range is 0-64008.)
            wis (int): (Value range is 0-64008.)
            agi (int): (Value range is 0-64008.)
            con (int): (Value range is 0-64008.)
            cha (int): (Value range is 0-64008.)
        """
        self._str = str
        self._intl = intl
        self._wis = wis
        self._agi = agi
        self._con = con
        self._cha = cha

    @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 str(self) -> int:
        return self._str

    @property
    def intl(self) -> int:
        return self._intl

    @property
    def wis(self) -> int:
        return self._wis

    @property
    def agi(self) -> int:
        return self._agi

    @property
    def con(self) -> int:
        return self._con

    @property
    def cha(self) -> int:
        return self._cha

    @staticmethod
    def serialize(writer: EoWriter, data: "CharacterBaseStats") -> None:
        """
        Serializes an instance of `CharacterBaseStats` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterBaseStats): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._str is None:
                raise SerializationError("str must be provided.")
            writer.add_short(data._str)
            if data._intl is None:
                raise SerializationError("intl must be provided.")
            writer.add_short(data._intl)
            if data._wis is None:
                raise SerializationError("wis must be provided.")
            writer.add_short(data._wis)
            if data._agi is None:
                raise SerializationError("agi must be provided.")
            writer.add_short(data._agi)
            if data._con is None:
                raise SerializationError("con must be provided.")
            writer.add_short(data._con)
            if data._cha is None:
                raise SerializationError("cha must be provided.")
            writer.add_short(data._cha)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CharacterBaseStats":
        """
        Deserializes an instance of `CharacterBaseStats` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterBaseStats: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            str = reader.get_short()
            intl = reader.get_short()
            wis = reader.get_short()
            agi = reader.get_short()
            con = reader.get_short()
            cha = reader.get_short()
            result = CharacterBaseStats(str=str, intl=intl, wis=wis, agi=agi, con=con, cha=cha)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterBaseStats(byte_size={repr(self._byte_size)}, str={repr(self._str)}, intl={repr(self._intl)}, wis={repr(self._wis)}, agi={repr(self._agi)}, con={repr(self._con)}, cha={repr(self._cha)})"

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.

str: int property

intl: int property

wis: int property

agi: int property

con: int property

cha: int property

__init__(*, str, intl, wis, agi, con, cha)

Create a new instance of CharacterBaseStats.

Parameters:

Name Type Description Default
str int

(Value range is 0-64008.)

required
intl int

(Value range is 0-64008.)

required
wis int

(Value range is 0-64008.)

required
agi int

(Value range is 0-64008.)

required
con int

(Value range is 0-64008.)

required
cha int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/character_base_stats.py
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
def __init__(self, *, str: int, intl: int, wis: int, agi: int, con: int, cha: int):
    """
    Create a new instance of CharacterBaseStats.

    Args:
        str (int): (Value range is 0-64008.)
        intl (int): (Value range is 0-64008.)
        wis (int): (Value range is 0-64008.)
        agi (int): (Value range is 0-64008.)
        con (int): (Value range is 0-64008.)
        cha (int): (Value range is 0-64008.)
    """
    self._str = str
    self._intl = intl
    self._wis = wis
    self._agi = agi
    self._con = con
    self._cha = cha

serialize(writer, data) staticmethod

Serializes an instance of CharacterBaseStats to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CharacterBaseStats

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_base_stats.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "CharacterBaseStats") -> None:
    """
    Serializes an instance of `CharacterBaseStats` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterBaseStats): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._str is None:
            raise SerializationError("str must be provided.")
        writer.add_short(data._str)
        if data._intl is None:
            raise SerializationError("intl must be provided.")
        writer.add_short(data._intl)
        if data._wis is None:
            raise SerializationError("wis must be provided.")
        writer.add_short(data._wis)
        if data._agi is None:
            raise SerializationError("agi must be provided.")
        writer.add_short(data._agi)
        if data._con is None:
            raise SerializationError("con must be provided.")
        writer.add_short(data._con)
        if data._cha is None:
            raise SerializationError("cha must be provided.")
        writer.add_short(data._cha)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CharacterBaseStats 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
CharacterBaseStats CharacterBaseStats

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_base_stats.py
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
@staticmethod
def deserialize(reader: EoReader) -> "CharacterBaseStats":
    """
    Deserializes an instance of `CharacterBaseStats` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterBaseStats: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        str = reader.get_short()
        intl = reader.get_short()
        wis = reader.get_short()
        agi = reader.get_short()
        con = reader.get_short()
        cha = reader.get_short()
        result = CharacterBaseStats(str=str, intl=intl, wis=wis, agi=agi, con=con, cha=cha)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ChairReplyServerPacket

Bases: Packet

Your character sitting on a chair

Source code in src/eolib/protocol/_generated/net/server/chair_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
class ChairReplyServerPacket(Packet):
    """
    Your character sitting on a chair
    """
    _byte_size: int = 0
    _player_id: int
    _coords: Coords
    _direction: Direction

    def __init__(self, *, player_id: int, coords: Coords, direction: Direction):
        """
        Create a new instance of ChairReplyServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            coords (Coords): 
            direction (Direction): 
        """
        self._player_id = player_id
        self._coords = coords
        self._direction = direction

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def coords(self) -> Coords:
        return self._coords

    @property
    def direction(self) -> Direction:
        return self._direction

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Chair

    @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.
        """
        ChairReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ChairReplyServerPacket") -> None:
        """
        Serializes an instance of `ChairReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ChairReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._coords is None:
                raise SerializationError("coords must be provided.")
            Coords.serialize(writer, data._coords)
            if data._direction is None:
                raise SerializationError("direction must be provided.")
            writer.add_char(int(data._direction))
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ChairReplyServerPacket":
        """
        Deserializes an instance of `ChairReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ChairReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            coords = Coords.deserialize(reader)
            direction = Direction(reader.get_char())
            result = ChairReplyServerPacket(player_id=player_id, coords=coords, direction=direction)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ChairReplyServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, coords={repr(self._coords)}, direction={repr(self._direction)})"

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.

player_id: int property

coords: Coords property

direction: Direction property

__init__(*, player_id, coords, direction)

Create a new instance of ChairReplyServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
coords Coords
required
direction Direction
required
Source code in src/eolib/protocol/_generated/net/server/chair_reply_server_packet.py
24
25
26
27
28
29
30
31
32
33
34
35
def __init__(self, *, player_id: int, coords: Coords, direction: Direction):
    """
    Create a new instance of ChairReplyServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        coords (Coords): 
        direction (Direction): 
    """
    self._player_id = player_id
    self._coords = coords
    self._direction = direction

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/chair_reply_server_packet.py
59
60
61
62
63
64
65
66
67
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Chair

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/chair_reply_server_packet.py
69
70
71
72
73
74
75
76
77
@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/chair_reply_server_packet.py
79
80
81
82
83
84
85
86
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.
    """
    ChairReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ChairReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ChairReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/chair_reply_server_packet.py
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@staticmethod
def serialize(writer: EoWriter, data: "ChairReplyServerPacket") -> None:
    """
    Serializes an instance of `ChairReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ChairReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._coords is None:
            raise SerializationError("coords must be provided.")
        Coords.serialize(writer, data._coords)
        if data._direction is None:
            raise SerializationError("direction must be provided.")
        writer.add_char(int(data._direction))
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ChairReplyServerPacket 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
ChairReplyServerPacket ChairReplyServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/chair_reply_server_packet.py
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
@staticmethod
def deserialize(reader: EoReader) -> "ChairReplyServerPacket":
    """
    Deserializes an instance of `ChairReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ChairReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        coords = Coords.deserialize(reader)
        direction = Direction(reader.get_char())
        result = ChairReplyServerPacket(player_id=player_id, coords=coords, direction=direction)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ChairRemoveServerPacket

Bases: Packet

Nearby player standing up from a chair

Source code in src/eolib/protocol/_generated/net/server/chair_remove_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class ChairRemoveServerPacket(Packet):
    """
    Nearby player standing up from a chair
    """
    _byte_size: int = 0
    _player_id: int
    _coords: Coords

    def __init__(self, *, player_id: int, coords: Coords):
        """
        Create a new instance of ChairRemoveServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            coords (Coords): 
        """
        self._player_id = player_id
        self._coords = coords

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def coords(self) -> Coords:
        return self._coords

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Chair

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Remove

    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.
        """
        ChairRemoveServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ChairRemoveServerPacket") -> None:
        """
        Serializes an instance of `ChairRemoveServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ChairRemoveServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._coords is None:
                raise SerializationError("coords must be provided.")
            Coords.serialize(writer, data._coords)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ChairRemoveServerPacket":
        """
        Deserializes an instance of `ChairRemoveServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ChairRemoveServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            coords = Coords.deserialize(reader)
            result = ChairRemoveServerPacket(player_id=player_id, coords=coords)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ChairRemoveServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, coords={repr(self._coords)})"

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.

player_id: int property

coords: Coords property

__init__(*, player_id, coords)

Create a new instance of ChairRemoveServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
coords Coords
required
Source code in src/eolib/protocol/_generated/net/server/chair_remove_server_packet.py
22
23
24
25
26
27
28
29
30
31
def __init__(self, *, player_id: int, coords: Coords):
    """
    Create a new instance of ChairRemoveServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        coords (Coords): 
    """
    self._player_id = player_id
    self._coords = coords

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/chair_remove_server_packet.py
51
52
53
54
55
56
57
58
59
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Chair

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/chair_remove_server_packet.py
61
62
63
64
65
66
67
68
69
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Remove

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/chair_remove_server_packet.py
71
72
73
74
75
76
77
78
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.
    """
    ChairRemoveServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ChairRemoveServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ChairRemoveServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/chair_remove_server_packet.py
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@staticmethod
def serialize(writer: EoWriter, data: "ChairRemoveServerPacket") -> None:
    """
    Serializes an instance of `ChairRemoveServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ChairRemoveServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._coords is None:
            raise SerializationError("coords must be provided.")
        Coords.serialize(writer, data._coords)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ChairRemoveServerPacket 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
ChairRemoveServerPacket ChairRemoveServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/chair_remove_server_packet.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@staticmethod
def deserialize(reader: EoReader) -> "ChairRemoveServerPacket":
    """
    Deserializes an instance of `ChairRemoveServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ChairRemoveServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        coords = Coords.deserialize(reader)
        result = ChairRemoveServerPacket(player_id=player_id, coords=coords)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ChairPlayerServerPacket

Bases: Packet

Nearby player sitting on a chair

Source code in src/eolib/protocol/_generated/net/server/chair_player_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
class ChairPlayerServerPacket(Packet):
    """
    Nearby player sitting on a chair
    """
    _byte_size: int = 0
    _player_id: int
    _coords: Coords
    _direction: Direction

    def __init__(self, *, player_id: int, coords: Coords, direction: Direction):
        """
        Create a new instance of ChairPlayerServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            coords (Coords): 
            direction (Direction): 
        """
        self._player_id = player_id
        self._coords = coords
        self._direction = direction

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def coords(self) -> Coords:
        return self._coords

    @property
    def direction(self) -> Direction:
        return self._direction

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Chair

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Player

    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.
        """
        ChairPlayerServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ChairPlayerServerPacket") -> None:
        """
        Serializes an instance of `ChairPlayerServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ChairPlayerServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._coords is None:
                raise SerializationError("coords must be provided.")
            Coords.serialize(writer, data._coords)
            if data._direction is None:
                raise SerializationError("direction must be provided.")
            writer.add_char(int(data._direction))
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ChairPlayerServerPacket":
        """
        Deserializes an instance of `ChairPlayerServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ChairPlayerServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            coords = Coords.deserialize(reader)
            direction = Direction(reader.get_char())
            result = ChairPlayerServerPacket(player_id=player_id, coords=coords, direction=direction)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ChairPlayerServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, coords={repr(self._coords)}, direction={repr(self._direction)})"

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.

player_id: int property

coords: Coords property

direction: Direction property

__init__(*, player_id, coords, direction)

Create a new instance of ChairPlayerServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
coords Coords
required
direction Direction
required
Source code in src/eolib/protocol/_generated/net/server/chair_player_server_packet.py
24
25
26
27
28
29
30
31
32
33
34
35
def __init__(self, *, player_id: int, coords: Coords, direction: Direction):
    """
    Create a new instance of ChairPlayerServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        coords (Coords): 
        direction (Direction): 
    """
    self._player_id = player_id
    self._coords = coords
    self._direction = direction

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/chair_player_server_packet.py
59
60
61
62
63
64
65
66
67
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Chair

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/chair_player_server_packet.py
69
70
71
72
73
74
75
76
77
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Player

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/chair_player_server_packet.py
79
80
81
82
83
84
85
86
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.
    """
    ChairPlayerServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ChairPlayerServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ChairPlayerServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/chair_player_server_packet.py
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@staticmethod
def serialize(writer: EoWriter, data: "ChairPlayerServerPacket") -> None:
    """
    Serializes an instance of `ChairPlayerServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ChairPlayerServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._coords is None:
            raise SerializationError("coords must be provided.")
        Coords.serialize(writer, data._coords)
        if data._direction is None:
            raise SerializationError("direction must be provided.")
        writer.add_char(int(data._direction))
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ChairPlayerServerPacket 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
ChairPlayerServerPacket ChairPlayerServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/chair_player_server_packet.py
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
@staticmethod
def deserialize(reader: EoReader) -> "ChairPlayerServerPacket":
    """
    Deserializes an instance of `ChairPlayerServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ChairPlayerServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        coords = Coords.deserialize(reader)
        direction = Direction(reader.get_char())
        result = ChairPlayerServerPacket(player_id=player_id, coords=coords, direction=direction)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

Coords

Map coordinates

Source code in src/eolib/protocol/_generated/coords.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
class Coords:
    """
    Map coordinates
    """
    _byte_size: int = 0
    _x: int
    _y: int

    def __init__(self, *, x: int, y: int):
        """
        Create a new instance of Coords.

        Args:
            x (int): (Value range is 0-252.)
            y (int): (Value range is 0-252.)
        """
        self._x = x
        self._y = y

    @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 x(self) -> int:
        return self._x

    @property
    def y(self) -> int:
        return self._y

    @staticmethod
    def serialize(writer: EoWriter, data: "Coords") -> None:
        """
        Serializes an instance of `Coords` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (Coords): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._x is None:
                raise SerializationError("x must be provided.")
            writer.add_char(data._x)
            if data._y is None:
                raise SerializationError("y must be provided.")
            writer.add_char(data._y)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "Coords":
        """
        Deserializes an instance of `Coords` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            Coords: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            x = reader.get_char()
            y = reader.get_char()
            result = Coords(x=x, y=y)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"Coords(byte_size={repr(self._byte_size)}, x={repr(self._x)}, y={repr(self._y)})"

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.

x: int property

y: int property

__init__(*, x, y)

Create a new instance of Coords.

Parameters:

Name Type Description Default
x int

(Value range is 0-252.)

required
y int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/coords.py
18
19
20
21
22
23
24
25
26
27
def __init__(self, *, x: int, y: int):
    """
    Create a new instance of Coords.

    Args:
        x (int): (Value range is 0-252.)
        y (int): (Value range is 0-252.)
    """
    self._x = x
    self._y = y

serialize(writer, data) staticmethod

Serializes an instance of Coords to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data Coords

The data to serialize.

required
Source code in src/eolib/protocol/_generated/coords.py
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@staticmethod
def serialize(writer: EoWriter, data: "Coords") -> None:
    """
    Serializes an instance of `Coords` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (Coords): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._x is None:
            raise SerializationError("x must be provided.")
        writer.add_char(data._x)
        if data._y is None:
            raise SerializationError("y must be provided.")
        writer.add_char(data._y)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of Coords 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
Coords Coords

The data to serialize.

Source code in src/eolib/protocol/_generated/coords.py
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def deserialize(reader: EoReader) -> "Coords":
    """
    Deserializes an instance of `Coords` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        Coords: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        x = reader.get_char()
        y = reader.get_char()
        result = Coords(x=x, y=y)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ChairCloseServerPacket

Bases: Packet

Your character standing up from a chair

Source code in src/eolib/protocol/_generated/net/server/chair_close_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class ChairCloseServerPacket(Packet):
    """
    Your character standing up from a chair
    """
    _byte_size: int = 0
    _player_id: int
    _coords: Coords

    def __init__(self, *, player_id: int, coords: Coords):
        """
        Create a new instance of ChairCloseServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            coords (Coords): 
        """
        self._player_id = player_id
        self._coords = coords

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def coords(self) -> Coords:
        return self._coords

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Chair

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Close

    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.
        """
        ChairCloseServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ChairCloseServerPacket") -> None:
        """
        Serializes an instance of `ChairCloseServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ChairCloseServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._coords is None:
                raise SerializationError("coords must be provided.")
            Coords.serialize(writer, data._coords)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ChairCloseServerPacket":
        """
        Deserializes an instance of `ChairCloseServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ChairCloseServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            coords = Coords.deserialize(reader)
            result = ChairCloseServerPacket(player_id=player_id, coords=coords)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ChairCloseServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, coords={repr(self._coords)})"

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.

player_id: int property

coords: Coords property

__init__(*, player_id, coords)

Create a new instance of ChairCloseServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
coords Coords
required
Source code in src/eolib/protocol/_generated/net/server/chair_close_server_packet.py
22
23
24
25
26
27
28
29
30
31
def __init__(self, *, player_id: int, coords: Coords):
    """
    Create a new instance of ChairCloseServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        coords (Coords): 
    """
    self._player_id = player_id
    self._coords = coords

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/chair_close_server_packet.py
51
52
53
54
55
56
57
58
59
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Chair

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/chair_close_server_packet.py
61
62
63
64
65
66
67
68
69
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Close

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/chair_close_server_packet.py
71
72
73
74
75
76
77
78
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.
    """
    ChairCloseServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ChairCloseServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ChairCloseServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/chair_close_server_packet.py
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@staticmethod
def serialize(writer: EoWriter, data: "ChairCloseServerPacket") -> None:
    """
    Serializes an instance of `ChairCloseServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ChairCloseServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._coords is None:
            raise SerializationError("coords must be provided.")
        Coords.serialize(writer, data._coords)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ChairCloseServerPacket 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
ChairCloseServerPacket ChairCloseServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/chair_close_server_packet.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@staticmethod
def deserialize(reader: EoReader) -> "ChairCloseServerPacket":
    """
    Deserializes an instance of `ChairCloseServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ChairCloseServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        coords = Coords.deserialize(reader)
        result = ChairCloseServerPacket(player_id=player_id, coords=coords)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

CastSpecServerPacket

Bases: Packet

Nearby NPC killed by player spell

Source code in src/eolib/protocol/_generated/net/server/cast_spec_server_packet.py
 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
class CastSpecServerPacket(Packet):
    """
    Nearby NPC killed by player spell
    """
    _byte_size: int = 0
    _spell_id: int
    _npc_killed_data: NpcKilledData
    _caster_tp: Optional[int]
    _experience: Optional[int]

    def __init__(self, *, spell_id: int, npc_killed_data: NpcKilledData, caster_tp: Optional[int] = None, experience: Optional[int] = None):
        """
        Create a new instance of CastSpecServerPacket.

        Args:
            spell_id (int): (Value range is 0-64008.)
            npc_killed_data (NpcKilledData): 
            caster_tp (Optional[int]): This field should be sent to the killer, but not nearby players (Value range is 0-64008.)
            experience (Optional[int]): This field should be sent to the killer, but not nearby players (Value range is 0-4097152080.)
        """
        self._spell_id = spell_id
        self._npc_killed_data = npc_killed_data
        self._caster_tp = caster_tp
        self._experience = experience

    @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 spell_id(self) -> int:
        return self._spell_id

    @property
    def npc_killed_data(self) -> NpcKilledData:
        return self._npc_killed_data

    @property
    def caster_tp(self) -> Optional[int]:
        """
        This field should be sent to the killer, but not nearby players
        """
        return self._caster_tp

    @property
    def experience(self) -> Optional[int]:
        """
        This field should be sent to the killer, but not nearby players
        """
        return self._experience

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Cast

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Spec

    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.
        """
        CastSpecServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "CastSpecServerPacket") -> None:
        """
        Serializes an instance of `CastSpecServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CastSpecServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._spell_id is None:
                raise SerializationError("spell_id must be provided.")
            writer.add_short(data._spell_id)
            if data._npc_killed_data is None:
                raise SerializationError("npc_killed_data must be provided.")
            NpcKilledData.serialize(writer, data._npc_killed_data)
            reached_missing_optional = data._caster_tp is None
            if not reached_missing_optional:
                writer.add_short(cast(int, data._caster_tp))
            reached_missing_optional = reached_missing_optional or data._experience is None
            if not reached_missing_optional:
                writer.add_int(cast(int, data._experience))
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CastSpecServerPacket":
        """
        Deserializes an instance of `CastSpecServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CastSpecServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            spell_id = reader.get_short()
            npc_killed_data = NpcKilledData.deserialize(reader)
            caster_tp: Optional[int] = None
            if reader.remaining > 0:
                caster_tp = reader.get_short()
            experience: Optional[int] = None
            if reader.remaining > 0:
                experience = reader.get_int()
            result = CastSpecServerPacket(spell_id=spell_id, npc_killed_data=npc_killed_data, caster_tp=caster_tp, experience=experience)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CastSpecServerPacket(byte_size={repr(self._byte_size)}, spell_id={repr(self._spell_id)}, npc_killed_data={repr(self._npc_killed_data)}, caster_tp={repr(self._caster_tp)}, experience={repr(self._experience)})"

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.

spell_id: int property

npc_killed_data: NpcKilledData property

caster_tp: Optional[int] property

This field should be sent to the killer, but not nearby players

experience: Optional[int] property

This field should be sent to the killer, but not nearby players

__init__(*, spell_id, npc_killed_data, caster_tp=None, experience=None)

Create a new instance of CastSpecServerPacket.

Parameters:

Name Type Description Default
spell_id int

(Value range is 0-64008.)

required
npc_killed_data NpcKilledData
required
caster_tp Optional[int]

This field should be sent to the killer, but not nearby players (Value range is 0-64008.)

None
experience Optional[int]

This field should be sent to the killer, but not nearby players (Value range is 0-4097152080.)

None
Source code in src/eolib/protocol/_generated/net/server/cast_spec_server_packet.py
26
27
28
29
30
31
32
33
34
35
36
37
38
39
def __init__(self, *, spell_id: int, npc_killed_data: NpcKilledData, caster_tp: Optional[int] = None, experience: Optional[int] = None):
    """
    Create a new instance of CastSpecServerPacket.

    Args:
        spell_id (int): (Value range is 0-64008.)
        npc_killed_data (NpcKilledData): 
        caster_tp (Optional[int]): This field should be sent to the killer, but not nearby players (Value range is 0-64008.)
        experience (Optional[int]): This field should be sent to the killer, but not nearby players (Value range is 0-4097152080.)
    """
    self._spell_id = spell_id
    self._npc_killed_data = npc_killed_data
    self._caster_tp = caster_tp
    self._experience = experience

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/cast_spec_server_packet.py
73
74
75
76
77
78
79
80
81
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Cast

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/cast_spec_server_packet.py
83
84
85
86
87
88
89
90
91
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Spec

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/cast_spec_server_packet.py
 93
 94
 95
 96
 97
 98
 99
100
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.
    """
    CastSpecServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of CastSpecServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CastSpecServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/cast_spec_server_packet.py
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
@staticmethod
def serialize(writer: EoWriter, data: "CastSpecServerPacket") -> None:
    """
    Serializes an instance of `CastSpecServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CastSpecServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._spell_id is None:
            raise SerializationError("spell_id must be provided.")
        writer.add_short(data._spell_id)
        if data._npc_killed_data is None:
            raise SerializationError("npc_killed_data must be provided.")
        NpcKilledData.serialize(writer, data._npc_killed_data)
        reached_missing_optional = data._caster_tp is None
        if not reached_missing_optional:
            writer.add_short(cast(int, data._caster_tp))
        reached_missing_optional = reached_missing_optional or data._experience is None
        if not reached_missing_optional:
            writer.add_int(cast(int, data._experience))
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CastSpecServerPacket 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
CastSpecServerPacket CastSpecServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/cast_spec_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "CastSpecServerPacket":
    """
    Deserializes an instance of `CastSpecServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CastSpecServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        spell_id = reader.get_short()
        npc_killed_data = NpcKilledData.deserialize(reader)
        caster_tp: Optional[int] = None
        if reader.remaining > 0:
            caster_tp = reader.get_short()
        experience: Optional[int] = None
        if reader.remaining > 0:
            experience = reader.get_int()
        result = CastSpecServerPacket(spell_id=spell_id, npc_killed_data=npc_killed_data, caster_tp=caster_tp, experience=experience)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

NpcKillStealProtectionState

Bases: IntEnum

Flag to indicate whether you are able to attack an NPC

Source code in src/eolib/protocol/_generated/net/server/npc_kill_steal_protection_state.py
 9
10
11
12
13
14
class NpcKillStealProtectionState(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Flag to indicate whether you are able to attack an NPC
    """
    Unprotected = 1
    Protected = 2

Unprotected = 1 class-attribute instance-attribute

Protected = 2 class-attribute instance-attribute

CastReplyServerPacket

Bases: Packet

Nearby NPC hit by a spell from a player

Source code in src/eolib/protocol/_generated/net/server/cast_reply_server_packet.py
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
class CastReplyServerPacket(Packet):
    """
    Nearby NPC hit by a spell from a player
    """
    _byte_size: int = 0
    _spell_id: int
    _caster_id: int
    _caster_direction: Direction
    _npc_index: int
    _damage: int
    _hp_percentage: int
    _caster_tp: Optional[int]
    _kill_steal_protection: Optional[NpcKillStealProtectionState]

    def __init__(self, *, spell_id: int, caster_id: int, caster_direction: Direction, npc_index: int, damage: int, hp_percentage: int, caster_tp: Optional[int] = None, kill_steal_protection: Optional[NpcKillStealProtectionState] = None):
        """
        Create a new instance of CastReplyServerPacket.

        Args:
            spell_id (int): (Value range is 0-64008.)
            caster_id (int): (Value range is 0-64008.)
            caster_direction (Direction): 
            npc_index (int): (Value range is 0-64008.)
            damage (int): (Value range is 0-16194276.)
            hp_percentage (int): (Value range is 0-64008.)
            caster_tp (Optional[int]): This field should be sent to the attacker, but not nearby players (Value range is 0-64008.)
            kill_steal_protection (Optional[NpcKillStealProtectionState]): This field should be sent to the attacker, but not nearby players
        """
        self._spell_id = spell_id
        self._caster_id = caster_id
        self._caster_direction = caster_direction
        self._npc_index = npc_index
        self._damage = damage
        self._hp_percentage = hp_percentage
        self._caster_tp = caster_tp
        self._kill_steal_protection = kill_steal_protection

    @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 spell_id(self) -> int:
        return self._spell_id

    @property
    def caster_id(self) -> int:
        return self._caster_id

    @property
    def caster_direction(self) -> Direction:
        return self._caster_direction

    @property
    def npc_index(self) -> int:
        return self._npc_index

    @property
    def damage(self) -> int:
        return self._damage

    @property
    def hp_percentage(self) -> int:
        return self._hp_percentage

    @property
    def caster_tp(self) -> Optional[int]:
        """
        This field should be sent to the attacker, but not nearby players
        """
        return self._caster_tp

    @property
    def kill_steal_protection(self) -> Optional[NpcKillStealProtectionState]:
        """
        This field should be sent to the attacker, but not nearby players
        """
        return self._kill_steal_protection

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Cast

    @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.
        """
        CastReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "CastReplyServerPacket") -> None:
        """
        Serializes an instance of `CastReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CastReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._spell_id is None:
                raise SerializationError("spell_id must be provided.")
            writer.add_short(data._spell_id)
            if data._caster_id is None:
                raise SerializationError("caster_id must be provided.")
            writer.add_short(data._caster_id)
            if data._caster_direction is None:
                raise SerializationError("caster_direction must be provided.")
            writer.add_char(int(data._caster_direction))
            if data._npc_index is None:
                raise SerializationError("npc_index must be provided.")
            writer.add_short(data._npc_index)
            if data._damage is None:
                raise SerializationError("damage must be provided.")
            writer.add_three(data._damage)
            if data._hp_percentage is None:
                raise SerializationError("hp_percentage must be provided.")
            writer.add_short(data._hp_percentage)
            reached_missing_optional = data._caster_tp is None
            if not reached_missing_optional:
                writer.add_short(cast(int, data._caster_tp))
            reached_missing_optional = reached_missing_optional or data._kill_steal_protection is None
            if not reached_missing_optional:
                writer.add_char(int(cast(NpcKillStealProtectionState, data._kill_steal_protection)))
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CastReplyServerPacket":
        """
        Deserializes an instance of `CastReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CastReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            spell_id = reader.get_short()
            caster_id = reader.get_short()
            caster_direction = Direction(reader.get_char())
            npc_index = reader.get_short()
            damage = reader.get_three()
            hp_percentage = reader.get_short()
            caster_tp: Optional[int] = None
            if reader.remaining > 0:
                caster_tp = reader.get_short()
            kill_steal_protection: Optional[NpcKillStealProtectionState] = None
            if reader.remaining > 0:
                kill_steal_protection = NpcKillStealProtectionState(reader.get_char())
            result = CastReplyServerPacket(spell_id=spell_id, caster_id=caster_id, caster_direction=caster_direction, npc_index=npc_index, damage=damage, hp_percentage=hp_percentage, caster_tp=caster_tp, kill_steal_protection=kill_steal_protection)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CastReplyServerPacket(byte_size={repr(self._byte_size)}, spell_id={repr(self._spell_id)}, caster_id={repr(self._caster_id)}, caster_direction={repr(self._caster_direction)}, npc_index={repr(self._npc_index)}, damage={repr(self._damage)}, hp_percentage={repr(self._hp_percentage)}, caster_tp={repr(self._caster_tp)}, kill_steal_protection={repr(self._kill_steal_protection)})"

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.

spell_id: int property

caster_id: int property

caster_direction: Direction property

npc_index: int property

damage: int property

hp_percentage: int property

caster_tp: Optional[int] property

This field should be sent to the attacker, but not nearby players

kill_steal_protection: Optional[NpcKillStealProtectionState] property

This field should be sent to the attacker, but not nearby players

__init__(*, spell_id, caster_id, caster_direction, npc_index, damage, hp_percentage, caster_tp=None, kill_steal_protection=None)

Create a new instance of CastReplyServerPacket.

Parameters:

Name Type Description Default
spell_id int

(Value range is 0-64008.)

required
caster_id int

(Value range is 0-64008.)

required
caster_direction Direction
required
npc_index int

(Value range is 0-64008.)

required
damage int

(Value range is 0-16194276.)

required
hp_percentage int

(Value range is 0-64008.)

required
caster_tp Optional[int]

This field should be sent to the attacker, but not nearby players (Value range is 0-64008.)

None
kill_steal_protection Optional[NpcKillStealProtectionState]

This field should be sent to the attacker, but not nearby players

None
Source code in src/eolib/protocol/_generated/net/server/cast_reply_server_packet.py
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
def __init__(self, *, spell_id: int, caster_id: int, caster_direction: Direction, npc_index: int, damage: int, hp_percentage: int, caster_tp: Optional[int] = None, kill_steal_protection: Optional[NpcKillStealProtectionState] = None):
    """
    Create a new instance of CastReplyServerPacket.

    Args:
        spell_id (int): (Value range is 0-64008.)
        caster_id (int): (Value range is 0-64008.)
        caster_direction (Direction): 
        npc_index (int): (Value range is 0-64008.)
        damage (int): (Value range is 0-16194276.)
        hp_percentage (int): (Value range is 0-64008.)
        caster_tp (Optional[int]): This field should be sent to the attacker, but not nearby players (Value range is 0-64008.)
        kill_steal_protection (Optional[NpcKillStealProtectionState]): This field should be sent to the attacker, but not nearby players
    """
    self._spell_id = spell_id
    self._caster_id = caster_id
    self._caster_direction = caster_direction
    self._npc_index = npc_index
    self._damage = damage
    self._hp_percentage = hp_percentage
    self._caster_tp = caster_tp
    self._kill_steal_protection = kill_steal_protection

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/cast_reply_server_packet.py
102
103
104
105
106
107
108
109
110
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Cast

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/cast_reply_server_packet.py
112
113
114
115
116
117
118
119
120
@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/cast_reply_server_packet.py
122
123
124
125
126
127
128
129
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.
    """
    CastReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of CastReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CastReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/cast_reply_server_packet.py
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
@staticmethod
def serialize(writer: EoWriter, data: "CastReplyServerPacket") -> None:
    """
    Serializes an instance of `CastReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CastReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._spell_id is None:
            raise SerializationError("spell_id must be provided.")
        writer.add_short(data._spell_id)
        if data._caster_id is None:
            raise SerializationError("caster_id must be provided.")
        writer.add_short(data._caster_id)
        if data._caster_direction is None:
            raise SerializationError("caster_direction must be provided.")
        writer.add_char(int(data._caster_direction))
        if data._npc_index is None:
            raise SerializationError("npc_index must be provided.")
        writer.add_short(data._npc_index)
        if data._damage is None:
            raise SerializationError("damage must be provided.")
        writer.add_three(data._damage)
        if data._hp_percentage is None:
            raise SerializationError("hp_percentage must be provided.")
        writer.add_short(data._hp_percentage)
        reached_missing_optional = data._caster_tp is None
        if not reached_missing_optional:
            writer.add_short(cast(int, data._caster_tp))
        reached_missing_optional = reached_missing_optional or data._kill_steal_protection is None
        if not reached_missing_optional:
            writer.add_char(int(cast(NpcKillStealProtectionState, data._kill_steal_protection)))
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CastReplyServerPacket 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
CastReplyServerPacket CastReplyServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/cast_reply_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "CastReplyServerPacket":
    """
    Deserializes an instance of `CastReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CastReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        spell_id = reader.get_short()
        caster_id = reader.get_short()
        caster_direction = Direction(reader.get_char())
        npc_index = reader.get_short()
        damage = reader.get_three()
        hp_percentage = reader.get_short()
        caster_tp: Optional[int] = None
        if reader.remaining > 0:
            caster_tp = reader.get_short()
        kill_steal_protection: Optional[NpcKillStealProtectionState] = None
        if reader.remaining > 0:
            kill_steal_protection = NpcKillStealProtectionState(reader.get_char())
        result = CastReplyServerPacket(spell_id=spell_id, caster_id=caster_id, caster_direction=caster_direction, npc_index=npc_index, damage=damage, hp_percentage=hp_percentage, caster_tp=caster_tp, kill_steal_protection=kill_steal_protection)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

NpcKilledData

Information about an NPC that has been killed

Source code in src/eolib/protocol/_generated/net/server/npc_killed_data.py
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
class NpcKilledData:
    """
    Information about an NPC that has been killed
    """
    _byte_size: int = 0
    _killer_id: int
    _killer_direction: Direction
    _npc_index: int
    _drop_index: int
    _drop_id: int
    _drop_coords: Coords
    _drop_amount: int
    _damage: int

    def __init__(self, *, killer_id: int, killer_direction: Direction, npc_index: int, drop_index: int, drop_id: int, drop_coords: Coords, drop_amount: int, damage: int):
        """
        Create a new instance of NpcKilledData.

        Args:
            killer_id (int): (Value range is 0-64008.)
            killer_direction (Direction): 
            npc_index (int): (Value range is 0-64008.)
            drop_index (int): (Value range is 0-64008.)
            drop_id (int): (Value range is 0-64008.)
            drop_coords (Coords): 
            drop_amount (int): (Value range is 0-4097152080.)
            damage (int): (Value range is 0-16194276.)
        """
        self._killer_id = killer_id
        self._killer_direction = killer_direction
        self._npc_index = npc_index
        self._drop_index = drop_index
        self._drop_id = drop_id
        self._drop_coords = drop_coords
        self._drop_amount = drop_amount
        self._damage = damage

    @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 killer_id(self) -> int:
        return self._killer_id

    @property
    def killer_direction(self) -> Direction:
        return self._killer_direction

    @property
    def npc_index(self) -> int:
        return self._npc_index

    @property
    def drop_index(self) -> int:
        return self._drop_index

    @property
    def drop_id(self) -> int:
        return self._drop_id

    @property
    def drop_coords(self) -> Coords:
        return self._drop_coords

    @property
    def drop_amount(self) -> int:
        return self._drop_amount

    @property
    def damage(self) -> int:
        return self._damage

    @staticmethod
    def serialize(writer: EoWriter, data: "NpcKilledData") -> None:
        """
        Serializes an instance of `NpcKilledData` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (NpcKilledData): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._killer_id is None:
                raise SerializationError("killer_id must be provided.")
            writer.add_short(data._killer_id)
            if data._killer_direction is None:
                raise SerializationError("killer_direction must be provided.")
            writer.add_char(int(data._killer_direction))
            if data._npc_index is None:
                raise SerializationError("npc_index must be provided.")
            writer.add_short(data._npc_index)
            if data._drop_index is None:
                raise SerializationError("drop_index must be provided.")
            writer.add_short(data._drop_index)
            if data._drop_id is None:
                raise SerializationError("drop_id must be provided.")
            writer.add_short(data._drop_id)
            if data._drop_coords is None:
                raise SerializationError("drop_coords must be provided.")
            Coords.serialize(writer, data._drop_coords)
            if data._drop_amount is None:
                raise SerializationError("drop_amount must be provided.")
            writer.add_int(data._drop_amount)
            if data._damage is None:
                raise SerializationError("damage must be provided.")
            writer.add_three(data._damage)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "NpcKilledData":
        """
        Deserializes an instance of `NpcKilledData` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            NpcKilledData: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            killer_id = reader.get_short()
            killer_direction = Direction(reader.get_char())
            npc_index = reader.get_short()
            drop_index = reader.get_short()
            drop_id = reader.get_short()
            drop_coords = Coords.deserialize(reader)
            drop_amount = reader.get_int()
            damage = reader.get_three()
            result = NpcKilledData(killer_id=killer_id, killer_direction=killer_direction, npc_index=npc_index, drop_index=drop_index, drop_id=drop_id, drop_coords=drop_coords, drop_amount=drop_amount, damage=damage)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"NpcKilledData(byte_size={repr(self._byte_size)}, killer_id={repr(self._killer_id)}, killer_direction={repr(self._killer_direction)}, npc_index={repr(self._npc_index)}, drop_index={repr(self._drop_index)}, drop_id={repr(self._drop_id)}, drop_coords={repr(self._drop_coords)}, drop_amount={repr(self._drop_amount)}, damage={repr(self._damage)})"

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.

killer_id: int property

killer_direction: Direction property

npc_index: int property

drop_index: int property

drop_id: int property

drop_coords: Coords property

drop_amount: int property

damage: int property

__init__(*, killer_id, killer_direction, npc_index, drop_index, drop_id, drop_coords, drop_amount, damage)

Create a new instance of NpcKilledData.

Parameters:

Name Type Description Default
killer_id int

(Value range is 0-64008.)

required
killer_direction Direction
required
npc_index int

(Value range is 0-64008.)

required
drop_index int

(Value range is 0-64008.)

required
drop_id int

(Value range is 0-64008.)

required
drop_coords Coords
required
drop_amount int

(Value range is 0-4097152080.)

required
damage int

(Value range is 0-16194276.)

required
Source code in src/eolib/protocol/_generated/net/server/npc_killed_data.py
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
def __init__(self, *, killer_id: int, killer_direction: Direction, npc_index: int, drop_index: int, drop_id: int, drop_coords: Coords, drop_amount: int, damage: int):
    """
    Create a new instance of NpcKilledData.

    Args:
        killer_id (int): (Value range is 0-64008.)
        killer_direction (Direction): 
        npc_index (int): (Value range is 0-64008.)
        drop_index (int): (Value range is 0-64008.)
        drop_id (int): (Value range is 0-64008.)
        drop_coords (Coords): 
        drop_amount (int): (Value range is 0-4097152080.)
        damage (int): (Value range is 0-16194276.)
    """
    self._killer_id = killer_id
    self._killer_direction = killer_direction
    self._npc_index = npc_index
    self._drop_index = drop_index
    self._drop_id = drop_id
    self._drop_coords = drop_coords
    self._drop_amount = drop_amount
    self._damage = damage

serialize(writer, data) staticmethod

Serializes an instance of NpcKilledData to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data NpcKilledData

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/npc_killed_data.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "NpcKilledData") -> None:
    """
    Serializes an instance of `NpcKilledData` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (NpcKilledData): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._killer_id is None:
            raise SerializationError("killer_id must be provided.")
        writer.add_short(data._killer_id)
        if data._killer_direction is None:
            raise SerializationError("killer_direction must be provided.")
        writer.add_char(int(data._killer_direction))
        if data._npc_index is None:
            raise SerializationError("npc_index must be provided.")
        writer.add_short(data._npc_index)
        if data._drop_index is None:
            raise SerializationError("drop_index must be provided.")
        writer.add_short(data._drop_index)
        if data._drop_id is None:
            raise SerializationError("drop_id must be provided.")
        writer.add_short(data._drop_id)
        if data._drop_coords is None:
            raise SerializationError("drop_coords must be provided.")
        Coords.serialize(writer, data._drop_coords)
        if data._drop_amount is None:
            raise SerializationError("drop_amount must be provided.")
        writer.add_int(data._drop_amount)
        if data._damage is None:
            raise SerializationError("damage must be provided.")
        writer.add_three(data._damage)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of NpcKilledData 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
NpcKilledData NpcKilledData

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/npc_killed_data.py
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
@staticmethod
def deserialize(reader: EoReader) -> "NpcKilledData":
    """
    Deserializes an instance of `NpcKilledData` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        NpcKilledData: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        killer_id = reader.get_short()
        killer_direction = Direction(reader.get_char())
        npc_index = reader.get_short()
        drop_index = reader.get_short()
        drop_id = reader.get_short()
        drop_coords = Coords.deserialize(reader)
        drop_amount = reader.get_int()
        damage = reader.get_three()
        result = NpcKilledData(killer_id=killer_id, killer_direction=killer_direction, npc_index=npc_index, drop_index=drop_index, drop_id=drop_id, drop_coords=drop_coords, drop_amount=drop_amount, damage=damage)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

LevelUpStats

Level and stat updates

Source code in src/eolib/protocol/_generated/net/server/level_up_stats.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
class LevelUpStats:
    """
    Level and stat updates
    """
    _byte_size: int = 0
    _level: int
    _stat_points: int
    _skill_points: int
    _max_hp: int
    _max_tp: int
    _max_sp: int

    def __init__(self, *, level: int, stat_points: int, skill_points: int, max_hp: int, max_tp: int, max_sp: int):
        """
        Create a new instance of LevelUpStats.

        Args:
            level (int): (Value range is 0-252.)
            stat_points (int): (Value range is 0-64008.)
            skill_points (int): (Value range is 0-64008.)
            max_hp (int): (Value range is 0-64008.)
            max_tp (int): (Value range is 0-64008.)
            max_sp (int): (Value range is 0-64008.)
        """
        self._level = level
        self._stat_points = stat_points
        self._skill_points = skill_points
        self._max_hp = max_hp
        self._max_tp = max_tp
        self._max_sp = max_sp

    @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 level(self) -> int:
        return self._level

    @property
    def stat_points(self) -> int:
        return self._stat_points

    @property
    def skill_points(self) -> int:
        return self._skill_points

    @property
    def max_hp(self) -> int:
        return self._max_hp

    @property
    def max_tp(self) -> int:
        return self._max_tp

    @property
    def max_sp(self) -> int:
        return self._max_sp

    @staticmethod
    def serialize(writer: EoWriter, data: "LevelUpStats") -> None:
        """
        Serializes an instance of `LevelUpStats` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (LevelUpStats): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._level is None:
                raise SerializationError("level must be provided.")
            writer.add_char(data._level)
            if data._stat_points is None:
                raise SerializationError("stat_points must be provided.")
            writer.add_short(data._stat_points)
            if data._skill_points is None:
                raise SerializationError("skill_points must be provided.")
            writer.add_short(data._skill_points)
            if data._max_hp is None:
                raise SerializationError("max_hp must be provided.")
            writer.add_short(data._max_hp)
            if data._max_tp is None:
                raise SerializationError("max_tp must be provided.")
            writer.add_short(data._max_tp)
            if data._max_sp is None:
                raise SerializationError("max_sp must be provided.")
            writer.add_short(data._max_sp)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "LevelUpStats":
        """
        Deserializes an instance of `LevelUpStats` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            LevelUpStats: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            level = reader.get_char()
            stat_points = reader.get_short()
            skill_points = reader.get_short()
            max_hp = reader.get_short()
            max_tp = reader.get_short()
            max_sp = reader.get_short()
            result = LevelUpStats(level=level, stat_points=stat_points, skill_points=skill_points, max_hp=max_hp, max_tp=max_tp, max_sp=max_sp)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"LevelUpStats(byte_size={repr(self._byte_size)}, level={repr(self._level)}, stat_points={repr(self._stat_points)}, skill_points={repr(self._skill_points)}, max_hp={repr(self._max_hp)}, max_tp={repr(self._max_tp)}, max_sp={repr(self._max_sp)})"

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.

level: int property

stat_points: int property

skill_points: int property

max_hp: int property

max_tp: int property

max_sp: int property

__init__(*, level, stat_points, skill_points, max_hp, max_tp, max_sp)

Create a new instance of LevelUpStats.

Parameters:

Name Type Description Default
level int

(Value range is 0-252.)

required
stat_points int

(Value range is 0-64008.)

required
skill_points int

(Value range is 0-64008.)

required
max_hp int

(Value range is 0-64008.)

required
max_tp int

(Value range is 0-64008.)

required
max_sp int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/level_up_stats.py
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
def __init__(self, *, level: int, stat_points: int, skill_points: int, max_hp: int, max_tp: int, max_sp: int):
    """
    Create a new instance of LevelUpStats.

    Args:
        level (int): (Value range is 0-252.)
        stat_points (int): (Value range is 0-64008.)
        skill_points (int): (Value range is 0-64008.)
        max_hp (int): (Value range is 0-64008.)
        max_tp (int): (Value range is 0-64008.)
        max_sp (int): (Value range is 0-64008.)
    """
    self._level = level
    self._stat_points = stat_points
    self._skill_points = skill_points
    self._max_hp = max_hp
    self._max_tp = max_tp
    self._max_sp = max_sp

serialize(writer, data) staticmethod

Serializes an instance of LevelUpStats to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data LevelUpStats

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/level_up_stats.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "LevelUpStats") -> None:
    """
    Serializes an instance of `LevelUpStats` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (LevelUpStats): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._level is None:
            raise SerializationError("level must be provided.")
        writer.add_char(data._level)
        if data._stat_points is None:
            raise SerializationError("stat_points must be provided.")
        writer.add_short(data._stat_points)
        if data._skill_points is None:
            raise SerializationError("skill_points must be provided.")
        writer.add_short(data._skill_points)
        if data._max_hp is None:
            raise SerializationError("max_hp must be provided.")
        writer.add_short(data._max_hp)
        if data._max_tp is None:
            raise SerializationError("max_tp must be provided.")
        writer.add_short(data._max_tp)
        if data._max_sp is None:
            raise SerializationError("max_sp must be provided.")
        writer.add_short(data._max_sp)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of LevelUpStats 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
LevelUpStats LevelUpStats

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/level_up_stats.py
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
@staticmethod
def deserialize(reader: EoReader) -> "LevelUpStats":
    """
    Deserializes an instance of `LevelUpStats` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        LevelUpStats: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        level = reader.get_char()
        stat_points = reader.get_short()
        skill_points = reader.get_short()
        max_hp = reader.get_short()
        max_tp = reader.get_short()
        max_sp = reader.get_short()
        result = LevelUpStats(level=level, stat_points=stat_points, skill_points=skill_points, max_hp=max_hp, max_tp=max_tp, max_sp=max_sp)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

CastAcceptServerPacket

Bases: Packet

Nearby NPC killed by player spell and killer leveled up

Source code in src/eolib/protocol/_generated/net/server/cast_accept_server_packet.py
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
class CastAcceptServerPacket(Packet):
    """
    Nearby NPC killed by player spell and killer leveled up
    """
    _byte_size: int = 0
    _spell_id: int
    _npc_killed_data: NpcKilledData
    _caster_tp: Optional[int]
    _experience: Optional[int]
    _level_up: Optional[LevelUpStats]

    def __init__(self, *, spell_id: int, npc_killed_data: NpcKilledData, caster_tp: Optional[int] = None, experience: Optional[int] = None, level_up: Optional[LevelUpStats] = None):
        """
        Create a new instance of CastAcceptServerPacket.

        Args:
            spell_id (int): (Value range is 0-64008.)
            npc_killed_data (NpcKilledData): 
            caster_tp (Optional[int]): This field should be sent to the killer, but not nearby players (Value range is 0-64008.)
            experience (Optional[int]): This field should be sent to the killer, but not nearby players (Value range is 0-4097152080.)
            level_up (Optional[LevelUpStats]): This field should be sent to the killer if they leveled up, but not nearby players
        """
        self._spell_id = spell_id
        self._npc_killed_data = npc_killed_data
        self._caster_tp = caster_tp
        self._experience = experience
        self._level_up = level_up

    @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 spell_id(self) -> int:
        return self._spell_id

    @property
    def npc_killed_data(self) -> NpcKilledData:
        return self._npc_killed_data

    @property
    def caster_tp(self) -> Optional[int]:
        """
        This field should be sent to the killer, but not nearby players
        """
        return self._caster_tp

    @property
    def experience(self) -> Optional[int]:
        """
        This field should be sent to the killer, but not nearby players
        """
        return self._experience

    @property
    def level_up(self) -> Optional[LevelUpStats]:
        """
        This field should be sent to the killer if they leveled up, but not nearby players
        """
        return self._level_up

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Cast

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Accept

    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.
        """
        CastAcceptServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "CastAcceptServerPacket") -> None:
        """
        Serializes an instance of `CastAcceptServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CastAcceptServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._spell_id is None:
                raise SerializationError("spell_id must be provided.")
            writer.add_short(data._spell_id)
            if data._npc_killed_data is None:
                raise SerializationError("npc_killed_data must be provided.")
            NpcKilledData.serialize(writer, data._npc_killed_data)
            reached_missing_optional = data._caster_tp is None
            if not reached_missing_optional:
                writer.add_short(cast(int, data._caster_tp))
            reached_missing_optional = reached_missing_optional or data._experience is None
            if not reached_missing_optional:
                writer.add_int(cast(int, data._experience))
            reached_missing_optional = reached_missing_optional or data._level_up is None
            if not reached_missing_optional:
                LevelUpStats.serialize(writer, cast(LevelUpStats, data._level_up))
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CastAcceptServerPacket":
        """
        Deserializes an instance of `CastAcceptServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CastAcceptServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            spell_id = reader.get_short()
            npc_killed_data = NpcKilledData.deserialize(reader)
            caster_tp: Optional[int] = None
            if reader.remaining > 0:
                caster_tp = reader.get_short()
            experience: Optional[int] = None
            if reader.remaining > 0:
                experience = reader.get_int()
            level_up: Optional[LevelUpStats] = None
            if reader.remaining > 0:
                level_up = LevelUpStats.deserialize(reader)
            result = CastAcceptServerPacket(spell_id=spell_id, npc_killed_data=npc_killed_data, caster_tp=caster_tp, experience=experience, level_up=level_up)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CastAcceptServerPacket(byte_size={repr(self._byte_size)}, spell_id={repr(self._spell_id)}, npc_killed_data={repr(self._npc_killed_data)}, caster_tp={repr(self._caster_tp)}, experience={repr(self._experience)}, level_up={repr(self._level_up)})"

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.

spell_id: int property

npc_killed_data: NpcKilledData property

caster_tp: Optional[int] property

This field should be sent to the killer, but not nearby players

experience: Optional[int] property

This field should be sent to the killer, but not nearby players

level_up: Optional[LevelUpStats] property

This field should be sent to the killer if they leveled up, but not nearby players

__init__(*, spell_id, npc_killed_data, caster_tp=None, experience=None, level_up=None)

Create a new instance of CastAcceptServerPacket.

Parameters:

Name Type Description Default
spell_id int

(Value range is 0-64008.)

required
npc_killed_data NpcKilledData
required
caster_tp Optional[int]

This field should be sent to the killer, but not nearby players (Value range is 0-64008.)

None
experience Optional[int]

This field should be sent to the killer, but not nearby players (Value range is 0-4097152080.)

None
level_up Optional[LevelUpStats]

This field should be sent to the killer if they leveled up, but not nearby players

None
Source code in src/eolib/protocol/_generated/net/server/cast_accept_server_packet.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
def __init__(self, *, spell_id: int, npc_killed_data: NpcKilledData, caster_tp: Optional[int] = None, experience: Optional[int] = None, level_up: Optional[LevelUpStats] = None):
    """
    Create a new instance of CastAcceptServerPacket.

    Args:
        spell_id (int): (Value range is 0-64008.)
        npc_killed_data (NpcKilledData): 
        caster_tp (Optional[int]): This field should be sent to the killer, but not nearby players (Value range is 0-64008.)
        experience (Optional[int]): This field should be sent to the killer, but not nearby players (Value range is 0-4097152080.)
        level_up (Optional[LevelUpStats]): This field should be sent to the killer if they leveled up, but not nearby players
    """
    self._spell_id = spell_id
    self._npc_killed_data = npc_killed_data
    self._caster_tp = caster_tp
    self._experience = experience
    self._level_up = level_up

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/cast_accept_server_packet.py
84
85
86
87
88
89
90
91
92
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Cast

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/cast_accept_server_packet.py
 94
 95
 96
 97
 98
 99
100
101
102
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Accept

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/cast_accept_server_packet.py
104
105
106
107
108
109
110
111
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.
    """
    CastAcceptServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of CastAcceptServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CastAcceptServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/cast_accept_server_packet.py
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
@staticmethod
def serialize(writer: EoWriter, data: "CastAcceptServerPacket") -> None:
    """
    Serializes an instance of `CastAcceptServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CastAcceptServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._spell_id is None:
            raise SerializationError("spell_id must be provided.")
        writer.add_short(data._spell_id)
        if data._npc_killed_data is None:
            raise SerializationError("npc_killed_data must be provided.")
        NpcKilledData.serialize(writer, data._npc_killed_data)
        reached_missing_optional = data._caster_tp is None
        if not reached_missing_optional:
            writer.add_short(cast(int, data._caster_tp))
        reached_missing_optional = reached_missing_optional or data._experience is None
        if not reached_missing_optional:
            writer.add_int(cast(int, data._experience))
        reached_missing_optional = reached_missing_optional or data._level_up is None
        if not reached_missing_optional:
            LevelUpStats.serialize(writer, cast(LevelUpStats, data._level_up))
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CastAcceptServerPacket 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
CastAcceptServerPacket CastAcceptServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/cast_accept_server_packet.py
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
@staticmethod
def deserialize(reader: EoReader) -> "CastAcceptServerPacket":
    """
    Deserializes an instance of `CastAcceptServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CastAcceptServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        spell_id = reader.get_short()
        npc_killed_data = NpcKilledData.deserialize(reader)
        caster_tp: Optional[int] = None
        if reader.remaining > 0:
            caster_tp = reader.get_short()
        experience: Optional[int] = None
        if reader.remaining > 0:
            experience = reader.get_int()
        level_up: Optional[LevelUpStats] = None
        if reader.remaining > 0:
            level_up = LevelUpStats.deserialize(reader)
        result = CastAcceptServerPacket(spell_id=spell_id, npc_killed_data=npc_killed_data, caster_tp=caster_tp, experience=experience, level_up=level_up)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

CharacterIcon

Bases: IntEnum

Icon displayed in paperdolls, books, and the online list

Source code in src/eolib/protocol/_generated/net/server/character_icon.py
 9
10
11
12
13
14
15
16
17
18
class CharacterIcon(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Icon displayed in paperdolls, books, and the online list
    """
    Player = 1
    Gm = 4
    Hgm = 5
    Party = 6
    GmParty = 9
    HgmParty = 10

Player = 1 class-attribute instance-attribute

Gm = 4 class-attribute instance-attribute

Hgm = 5 class-attribute instance-attribute

Party = 6 class-attribute instance-attribute

GmParty = 9 class-attribute instance-attribute

HgmParty = 10 class-attribute instance-attribute

CharacterDetails

Information displayed on the paperdoll and book

Source code in src/eolib/protocol/_generated/net/server/character_details.py
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
class CharacterDetails:
    """
    Information displayed on the paperdoll and book
    """
    _byte_size: int = 0
    _name: str
    _home: str
    _partner: str
    _title: str
    _guild: str
    _guild_rank: str
    _player_id: int
    _class_id: int
    _gender: Gender
    _admin: AdminLevel

    def __init__(self, *, name: str, home: str, partner: str, title: str, guild: str, guild_rank: str, player_id: int, class_id: int, gender: Gender, admin: AdminLevel):
        """
        Create a new instance of CharacterDetails.

        Args:
            name (str): 
            home (str): 
            partner (str): 
            title (str): 
            guild (str): 
            guild_rank (str): 
            player_id (int): (Value range is 0-64008.)
            class_id (int): (Value range is 0-252.)
            gender (Gender): 
            admin (AdminLevel): 
        """
        self._name = name
        self._home = home
        self._partner = partner
        self._title = title
        self._guild = guild
        self._guild_rank = guild_rank
        self._player_id = player_id
        self._class_id = class_id
        self._gender = gender
        self._admin = admin

    @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 name(self) -> str:
        return self._name

    @property
    def home(self) -> str:
        return self._home

    @property
    def partner(self) -> str:
        return self._partner

    @property
    def title(self) -> str:
        return self._title

    @property
    def guild(self) -> str:
        return self._guild

    @property
    def guild_rank(self) -> str:
        return self._guild_rank

    @property
    def player_id(self) -> int:
        return self._player_id

    @property
    def class_id(self) -> int:
        return self._class_id

    @property
    def gender(self) -> Gender:
        return self._gender

    @property
    def admin(self) -> AdminLevel:
        return self._admin

    @staticmethod
    def serialize(writer: EoWriter, data: "CharacterDetails") -> None:
        """
        Serializes an instance of `CharacterDetails` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterDetails): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._name is None:
                raise SerializationError("name must be provided.")
            writer.add_string(data._name)
            writer.add_byte(0xFF)
            if data._home is None:
                raise SerializationError("home must be provided.")
            writer.add_string(data._home)
            writer.add_byte(0xFF)
            if data._partner is None:
                raise SerializationError("partner must be provided.")
            writer.add_string(data._partner)
            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 is None:
                raise SerializationError("guild must be provided.")
            writer.add_string(data._guild)
            writer.add_byte(0xFF)
            if data._guild_rank is None:
                raise SerializationError("guild_rank must be provided.")
            writer.add_string(data._guild_rank)
            writer.add_byte(0xFF)
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._class_id is None:
                raise SerializationError("class_id must be provided.")
            writer.add_char(data._class_id)
            if data._gender is None:
                raise SerializationError("gender must be provided.")
            writer.add_char(int(data._gender))
            if data._admin is None:
                raise SerializationError("admin must be provided.")
            writer.add_char(int(data._admin))
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CharacterDetails":
        """
        Deserializes an instance of `CharacterDetails` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterDetails: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            name = reader.get_string()
            reader.next_chunk()
            home = reader.get_string()
            reader.next_chunk()
            partner = reader.get_string()
            reader.next_chunk()
            title = reader.get_string()
            reader.next_chunk()
            guild = reader.get_string()
            reader.next_chunk()
            guild_rank = reader.get_string()
            reader.next_chunk()
            player_id = reader.get_short()
            class_id = reader.get_char()
            gender = Gender(reader.get_char())
            admin = AdminLevel(reader.get_char())
            reader.chunked_reading_mode = False
            result = CharacterDetails(name=name, home=home, partner=partner, title=title, guild=guild, guild_rank=guild_rank, player_id=player_id, class_id=class_id, gender=gender, admin=admin)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterDetails(byte_size={repr(self._byte_size)}, name={repr(self._name)}, home={repr(self._home)}, partner={repr(self._partner)}, title={repr(self._title)}, guild={repr(self._guild)}, guild_rank={repr(self._guild_rank)}, player_id={repr(self._player_id)}, class_id={repr(self._class_id)}, gender={repr(self._gender)}, admin={repr(self._admin)})"

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.

name: str property

home: str property

partner: str property

title: str property

guild: str property

guild_rank: str property

player_id: int property

class_id: int property

gender: Gender property

admin: AdminLevel property

__init__(*, name, home, partner, title, guild, guild_rank, player_id, class_id, gender, admin)

Create a new instance of CharacterDetails.

Parameters:

Name Type Description Default
name str
required
home str
required
partner str
required
title str
required
guild str
required
guild_rank str
required
player_id int

(Value range is 0-64008.)

required
class_id int

(Value range is 0-252.)

required
gender Gender
required
admin AdminLevel
required
Source code in src/eolib/protocol/_generated/net/server/character_details.py
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
def __init__(self, *, name: str, home: str, partner: str, title: str, guild: str, guild_rank: str, player_id: int, class_id: int, gender: Gender, admin: AdminLevel):
    """
    Create a new instance of CharacterDetails.

    Args:
        name (str): 
        home (str): 
        partner (str): 
        title (str): 
        guild (str): 
        guild_rank (str): 
        player_id (int): (Value range is 0-64008.)
        class_id (int): (Value range is 0-252.)
        gender (Gender): 
        admin (AdminLevel): 
    """
    self._name = name
    self._home = home
    self._partner = partner
    self._title = title
    self._guild = guild
    self._guild_rank = guild_rank
    self._player_id = player_id
    self._class_id = class_id
    self._gender = gender
    self._admin = admin

serialize(writer, data) staticmethod

Serializes an instance of CharacterDetails to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CharacterDetails

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_details.py
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
@staticmethod
def serialize(writer: EoWriter, data: "CharacterDetails") -> None:
    """
    Serializes an instance of `CharacterDetails` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterDetails): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._name is None:
            raise SerializationError("name must be provided.")
        writer.add_string(data._name)
        writer.add_byte(0xFF)
        if data._home is None:
            raise SerializationError("home must be provided.")
        writer.add_string(data._home)
        writer.add_byte(0xFF)
        if data._partner is None:
            raise SerializationError("partner must be provided.")
        writer.add_string(data._partner)
        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 is None:
            raise SerializationError("guild must be provided.")
        writer.add_string(data._guild)
        writer.add_byte(0xFF)
        if data._guild_rank is None:
            raise SerializationError("guild_rank must be provided.")
        writer.add_string(data._guild_rank)
        writer.add_byte(0xFF)
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._class_id is None:
            raise SerializationError("class_id must be provided.")
        writer.add_char(data._class_id)
        if data._gender is None:
            raise SerializationError("gender must be provided.")
        writer.add_char(int(data._gender))
        if data._admin is None:
            raise SerializationError("admin must be provided.")
        writer.add_char(int(data._admin))
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CharacterDetails 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
CharacterDetails CharacterDetails

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_details.py
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
@staticmethod
def deserialize(reader: EoReader) -> "CharacterDetails":
    """
    Deserializes an instance of `CharacterDetails` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterDetails: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        name = reader.get_string()
        reader.next_chunk()
        home = reader.get_string()
        reader.next_chunk()
        partner = reader.get_string()
        reader.next_chunk()
        title = reader.get_string()
        reader.next_chunk()
        guild = reader.get_string()
        reader.next_chunk()
        guild_rank = reader.get_string()
        reader.next_chunk()
        player_id = reader.get_short()
        class_id = reader.get_char()
        gender = Gender(reader.get_char())
        admin = AdminLevel(reader.get_char())
        reader.chunked_reading_mode = False
        result = CharacterDetails(name=name, home=home, partner=partner, title=title, guild=guild, guild_rank=guild_rank, player_id=player_id, class_id=class_id, gender=gender, admin=admin)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

BookReplyServerPacket

Bases: Packet

Reply to requesting a book

Source code in src/eolib/protocol/_generated/net/server/book_reply_server_packet.py
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
class BookReplyServerPacket(Packet):
    """
    Reply to requesting a book
    """
    _byte_size: int = 0
    _details: CharacterDetails
    _icon: CharacterIcon
    _quest_names: tuple[str, ...]

    def __init__(self, *, details: CharacterDetails, icon: CharacterIcon, quest_names: Iterable[str]):
        """
        Create a new instance of BookReplyServerPacket.

        Args:
            details (CharacterDetails): 
            icon (CharacterIcon): 
            quest_names (Iterable[str]): 
        """
        self._details = details
        self._icon = icon
        self._quest_names = tuple(quest_names)

    @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 details(self) -> CharacterDetails:
        return self._details

    @property
    def icon(self) -> CharacterIcon:
        return self._icon

    @property
    def quest_names(self) -> tuple[str, ...]:
        return self._quest_names

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Book

    @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.
        """
        BookReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "BookReplyServerPacket") -> None:
        """
        Serializes an instance of `BookReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (BookReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._details is None:
                raise SerializationError("details must be provided.")
            CharacterDetails.serialize(writer, data._details)
            if data._icon is None:
                raise SerializationError("icon must be provided.")
            writer.add_char(int(data._icon))
            writer.add_byte(0xFF)
            if data._quest_names is None:
                raise SerializationError("quest_names must be provided.")
            for i in range(len(data._quest_names)):
                writer.add_string(data._quest_names[i])
                writer.add_byte(0xFF)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "BookReplyServerPacket":
        """
        Deserializes an instance of `BookReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            BookReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            details = CharacterDetails.deserialize(reader)
            icon = CharacterIcon(reader.get_char())
            reader.next_chunk()
            quest_names = []
            while reader.remaining > 0:
                quest_names.append(reader.get_string())
                reader.next_chunk()
            reader.chunked_reading_mode = False
            result = BookReplyServerPacket(details=details, icon=icon, quest_names=quest_names)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"BookReplyServerPacket(byte_size={repr(self._byte_size)}, details={repr(self._details)}, icon={repr(self._icon)}, quest_names={repr(self._quest_names)})"

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.

details: CharacterDetails property

icon: CharacterIcon property

quest_names: tuple[str, ...] property

__init__(*, details, icon, quest_names)

Create a new instance of BookReplyServerPacket.

Parameters:

Name Type Description Default
details CharacterDetails
required
icon CharacterIcon
required
quest_names Iterable[str]
required
Source code in src/eolib/protocol/_generated/net/server/book_reply_server_packet.py
26
27
28
29
30
31
32
33
34
35
36
37
def __init__(self, *, details: CharacterDetails, icon: CharacterIcon, quest_names: Iterable[str]):
    """
    Create a new instance of BookReplyServerPacket.

    Args:
        details (CharacterDetails): 
        icon (CharacterIcon): 
        quest_names (Iterable[str]): 
    """
    self._details = details
    self._icon = icon
    self._quest_names = tuple(quest_names)

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/book_reply_server_packet.py
61
62
63
64
65
66
67
68
69
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Book

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/book_reply_server_packet.py
71
72
73
74
75
76
77
78
79
@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/book_reply_server_packet.py
81
82
83
84
85
86
87
88
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.
    """
    BookReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of BookReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data BookReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/book_reply_server_packet.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "BookReplyServerPacket") -> None:
    """
    Serializes an instance of `BookReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (BookReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._details is None:
            raise SerializationError("details must be provided.")
        CharacterDetails.serialize(writer, data._details)
        if data._icon is None:
            raise SerializationError("icon must be provided.")
        writer.add_char(int(data._icon))
        writer.add_byte(0xFF)
        if data._quest_names is None:
            raise SerializationError("quest_names must be provided.")
        for i in range(len(data._quest_names)):
            writer.add_string(data._quest_names[i])
            writer.add_byte(0xFF)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of BookReplyServerPacket 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
BookReplyServerPacket 'BookReplyServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/book_reply_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "BookReplyServerPacket":
    """
    Deserializes an instance of `BookReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        BookReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        details = CharacterDetails.deserialize(reader)
        icon = CharacterIcon(reader.get_char())
        reader.next_chunk()
        quest_names = []
        while reader.remaining > 0:
            quest_names.append(reader.get_string())
            reader.next_chunk()
        reader.chunked_reading_mode = False
        result = BookReplyServerPacket(details=details, icon=icon, quest_names=quest_names)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

BoardPlayerServerPacket

Bases: Packet

Reply to reading a post on a town board

Source code in src/eolib/protocol/_generated/net/server/board_player_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
class BoardPlayerServerPacket(Packet):
    """
    Reply to reading a post on a town board
    """
    _byte_size: int = 0
    _post_id: int
    _post_body: str

    def __init__(self, *, post_id: int, post_body: str):
        """
        Create a new instance of BoardPlayerServerPacket.

        Args:
            post_id (int): (Value range is 0-64008.)
            post_body (str): 
        """
        self._post_id = post_id
        self._post_body = post_body

    @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 post_id(self) -> int:
        return self._post_id

    @property
    def post_body(self) -> str:
        return self._post_body

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Board

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Player

    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.
        """
        BoardPlayerServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "BoardPlayerServerPacket") -> None:
        """
        Serializes an instance of `BoardPlayerServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (BoardPlayerServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._post_id is None:
                raise SerializationError("post_id must be provided.")
            writer.add_short(data._post_id)
            if data._post_body is None:
                raise SerializationError("post_body must be provided.")
            writer.add_string(data._post_body)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "BoardPlayerServerPacket":
        """
        Deserializes an instance of `BoardPlayerServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            BoardPlayerServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            post_id = reader.get_short()
            post_body = reader.get_string()
            reader.chunked_reading_mode = False
            result = BoardPlayerServerPacket(post_id=post_id, post_body=post_body)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"BoardPlayerServerPacket(byte_size={repr(self._byte_size)}, post_id={repr(self._post_id)}, post_body={repr(self._post_body)})"

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.

post_id: int property

post_body: str property

__init__(*, post_id, post_body)

Create a new instance of BoardPlayerServerPacket.

Parameters:

Name Type Description Default
post_id int

(Value range is 0-64008.)

required
post_body str
required
Source code in src/eolib/protocol/_generated/net/server/board_player_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, post_id: int, post_body: str):
    """
    Create a new instance of BoardPlayerServerPacket.

    Args:
        post_id (int): (Value range is 0-64008.)
        post_body (str): 
    """
    self._post_id = post_id
    self._post_body = post_body

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/board_player_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Board

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/board_player_server_packet.py
60
61
62
63
64
65
66
67
68
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Player

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/board_player_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    BoardPlayerServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of BoardPlayerServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data BoardPlayerServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/board_player_server_packet.py
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
@staticmethod
def serialize(writer: EoWriter, data: "BoardPlayerServerPacket") -> None:
    """
    Serializes an instance of `BoardPlayerServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (BoardPlayerServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._post_id is None:
            raise SerializationError("post_id must be provided.")
        writer.add_short(data._post_id)
        if data._post_body is None:
            raise SerializationError("post_body must be provided.")
        writer.add_string(data._post_body)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of BoardPlayerServerPacket 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
BoardPlayerServerPacket BoardPlayerServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/board_player_server_packet.py
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
@staticmethod
def deserialize(reader: EoReader) -> "BoardPlayerServerPacket":
    """
    Deserializes an instance of `BoardPlayerServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        BoardPlayerServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        post_id = reader.get_short()
        post_body = reader.get_string()
        reader.chunked_reading_mode = False
        result = BoardPlayerServerPacket(post_id=post_id, post_body=post_body)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

BoardPostListing

An entry in the list of town board posts

Source code in src/eolib/protocol/_generated/net/server/board_post_listing.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
class BoardPostListing:
    """
    An entry in the list of town board posts
    """
    _byte_size: int = 0
    _post_id: int
    _author: str
    _subject: str

    def __init__(self, *, post_id: int, author: str, subject: str):
        """
        Create a new instance of BoardPostListing.

        Args:
            post_id (int): (Value range is 0-64008.)
            author (str): 
            subject (str): 
        """
        self._post_id = post_id
        self._author = author
        self._subject = subject

    @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 post_id(self) -> int:
        return self._post_id

    @property
    def author(self) -> str:
        return self._author

    @property
    def subject(self) -> str:
        return self._subject

    @staticmethod
    def serialize(writer: EoWriter, data: "BoardPostListing") -> None:
        """
        Serializes an instance of `BoardPostListing` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (BoardPostListing): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._post_id is None:
                raise SerializationError("post_id must be provided.")
            writer.add_short(data._post_id)
            writer.add_byte(0xFF)
            if data._author is None:
                raise SerializationError("author must be provided.")
            writer.add_string(data._author)
            writer.add_byte(0xFF)
            if data._subject is None:
                raise SerializationError("subject must be provided.")
            writer.add_string(data._subject)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "BoardPostListing":
        """
        Deserializes an instance of `BoardPostListing` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            BoardPostListing: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            post_id = reader.get_short()
            reader.next_chunk()
            author = reader.get_string()
            reader.next_chunk()
            subject = reader.get_string()
            reader.chunked_reading_mode = False
            result = BoardPostListing(post_id=post_id, author=author, subject=subject)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"BoardPostListing(byte_size={repr(self._byte_size)}, post_id={repr(self._post_id)}, author={repr(self._author)}, subject={repr(self._subject)})"

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.

post_id: int property

author: str property

subject: str property

__init__(*, post_id, author, subject)

Create a new instance of BoardPostListing.

Parameters:

Name Type Description Default
post_id int

(Value range is 0-64008.)

required
author str
required
subject str
required
Source code in src/eolib/protocol/_generated/net/server/board_post_listing.py
19
20
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, post_id: int, author: str, subject: str):
    """
    Create a new instance of BoardPostListing.

    Args:
        post_id (int): (Value range is 0-64008.)
        author (str): 
        subject (str): 
    """
    self._post_id = post_id
    self._author = author
    self._subject = subject

serialize(writer, data) staticmethod

Serializes an instance of BoardPostListing to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data BoardPostListing

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/board_post_listing.py
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
@staticmethod
def serialize(writer: EoWriter, data: "BoardPostListing") -> None:
    """
    Serializes an instance of `BoardPostListing` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (BoardPostListing): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._post_id is None:
            raise SerializationError("post_id must be provided.")
        writer.add_short(data._post_id)
        writer.add_byte(0xFF)
        if data._author is None:
            raise SerializationError("author must be provided.")
        writer.add_string(data._author)
        writer.add_byte(0xFF)
        if data._subject is None:
            raise SerializationError("subject must be provided.")
        writer.add_string(data._subject)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of BoardPostListing 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
BoardPostListing BoardPostListing

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/board_post_listing.py
 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
@staticmethod
def deserialize(reader: EoReader) -> "BoardPostListing":
    """
    Deserializes an instance of `BoardPostListing` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        BoardPostListing: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        post_id = reader.get_short()
        reader.next_chunk()
        author = reader.get_string()
        reader.next_chunk()
        subject = reader.get_string()
        reader.chunked_reading_mode = False
        result = BoardPostListing(post_id=post_id, author=author, subject=subject)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

BoardOpenServerPacket

Bases: Packet

Reply to opening a town board

Source code in src/eolib/protocol/_generated/net/server/board_open_server_packet.py
 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
class BoardOpenServerPacket(Packet):
    """
    Reply to opening a town board
    """
    _byte_size: int = 0
    _board_id: int
    _posts_count: int
    _posts: tuple[BoardPostListing, ...]

    def __init__(self, *, board_id: int, posts: Iterable[BoardPostListing]):
        """
        Create a new instance of BoardOpenServerPacket.

        Args:
            board_id (int): (Value range is 0-252.)
            posts (Iterable[BoardPostListing]): (Length must be 252 or less.)
        """
        self._board_id = board_id
        self._posts = tuple(posts)
        self._posts_count = len(self._posts)

    @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 board_id(self) -> int:
        return self._board_id

    @property
    def posts(self) -> tuple[BoardPostListing, ...]:
        return self._posts

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Board

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Open

    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.
        """
        BoardOpenServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "BoardOpenServerPacket") -> None:
        """
        Serializes an instance of `BoardOpenServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (BoardOpenServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._board_id is None:
                raise SerializationError("board_id must be provided.")
            writer.add_char(data._board_id)
            if data._posts_count is None:
                raise SerializationError("posts_count must be provided.")
            writer.add_char(data._posts_count)
            if data._posts is None:
                raise SerializationError("posts must be provided.")
            if len(data._posts) > 252:
                raise SerializationError(f"Expected length of posts to be 252 or less, got {len(data._posts)}.")
            for i in range(data._posts_count):
                BoardPostListing.serialize(writer, data._posts[i])
                writer.add_byte(0xFF)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "BoardOpenServerPacket":
        """
        Deserializes an instance of `BoardOpenServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            BoardOpenServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            board_id = reader.get_char()
            posts_count = reader.get_char()
            posts = []
            for i in range(posts_count):
                posts.append(BoardPostListing.deserialize(reader))
                reader.next_chunk()
            reader.chunked_reading_mode = False
            result = BoardOpenServerPacket(board_id=board_id, posts=posts)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"BoardOpenServerPacket(byte_size={repr(self._byte_size)}, board_id={repr(self._board_id)}, posts={repr(self._posts)})"

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.

board_id: int property

posts: tuple[BoardPostListing, ...] property

__init__(*, board_id, posts)

Create a new instance of BoardOpenServerPacket.

Parameters:

Name Type Description Default
board_id int

(Value range is 0-252.)

required
posts Iterable[BoardPostListing]

(Length must be 252 or less.)

required
Source code in src/eolib/protocol/_generated/net/server/board_open_server_packet.py
25
26
27
28
29
30
31
32
33
34
35
def __init__(self, *, board_id: int, posts: Iterable[BoardPostListing]):
    """
    Create a new instance of BoardOpenServerPacket.

    Args:
        board_id (int): (Value range is 0-252.)
        posts (Iterable[BoardPostListing]): (Length must be 252 or less.)
    """
    self._board_id = board_id
    self._posts = tuple(posts)
    self._posts_count = len(self._posts)

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/board_open_server_packet.py
55
56
57
58
59
60
61
62
63
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Board

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/board_open_server_packet.py
65
66
67
68
69
70
71
72
73
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Open

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/board_open_server_packet.py
75
76
77
78
79
80
81
82
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.
    """
    BoardOpenServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of BoardOpenServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data BoardOpenServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/board_open_server_packet.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "BoardOpenServerPacket") -> None:
    """
    Serializes an instance of `BoardOpenServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (BoardOpenServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._board_id is None:
            raise SerializationError("board_id must be provided.")
        writer.add_char(data._board_id)
        if data._posts_count is None:
            raise SerializationError("posts_count must be provided.")
        writer.add_char(data._posts_count)
        if data._posts is None:
            raise SerializationError("posts must be provided.")
        if len(data._posts) > 252:
            raise SerializationError(f"Expected length of posts to be 252 or less, got {len(data._posts)}.")
        for i in range(data._posts_count):
            BoardPostListing.serialize(writer, data._posts[i])
            writer.add_byte(0xFF)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of BoardOpenServerPacket 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
BoardOpenServerPacket 'BoardOpenServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/board_open_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "BoardOpenServerPacket":
    """
    Deserializes an instance of `BoardOpenServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        BoardOpenServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        board_id = reader.get_char()
        posts_count = reader.get_char()
        posts = []
        for i in range(posts_count):
            posts.append(BoardPostListing.deserialize(reader))
            reader.next_chunk()
        reader.chunked_reading_mode = False
        result = BoardOpenServerPacket(board_id=board_id, posts=posts)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

BarberOpenServerPacket

Bases: Packet

Response from talking to a barber NPC

Source code in src/eolib/protocol/_generated/net/server/barber_open_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class BarberOpenServerPacket(Packet):
    """
    Response from talking to a barber NPC
    """
    _byte_size: int = 0
    _session_id: int

    def __init__(self, *, session_id: int):
        """
        Create a new instance of BarberOpenServerPacket.

        Args:
            session_id (int): (Value range is 0-4097152080.)
        """
        self._session_id = session_id

    @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:
        return self._session_id

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Barber

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Open

    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.
        """
        BarberOpenServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "BarberOpenServerPacket") -> None:
        """
        Serializes an instance of `BarberOpenServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (BarberOpenServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._session_id is None:
                raise SerializationError("session_id must be provided.")
            writer.add_int(data._session_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "BarberOpenServerPacket":
        """
        Deserializes an instance of `BarberOpenServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            BarberOpenServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            session_id = reader.get_int()
            result = BarberOpenServerPacket(session_id=session_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"BarberOpenServerPacket(byte_size={repr(self._byte_size)}, session_id={repr(self._session_id)})"

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

__init__(*, session_id)

Create a new instance of BarberOpenServerPacket.

Parameters:

Name Type Description Default
session_id int

(Value range is 0-4097152080.)

required
Source code in src/eolib/protocol/_generated/net/server/barber_open_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, session_id: int):
    """
    Create a new instance of BarberOpenServerPacket.

    Args:
        session_id (int): (Value range is 0-4097152080.)
    """
    self._session_id = session_id

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/barber_open_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Barber

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/barber_open_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Open

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/barber_open_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    BarberOpenServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of BarberOpenServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data BarberOpenServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/barber_open_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "BarberOpenServerPacket") -> None:
    """
    Serializes an instance of `BarberOpenServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (BarberOpenServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._session_id is None:
            raise SerializationError("session_id must be provided.")
        writer.add_int(data._session_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of BarberOpenServerPacket 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
BarberOpenServerPacket BarberOpenServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/barber_open_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "BarberOpenServerPacket":
    """
    Deserializes an instance of `BarberOpenServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        BarberOpenServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        session_id = reader.get_int()
        result = BarberOpenServerPacket(session_id=session_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

BarberAgreeServerPacket

Bases: Packet

Purchasing a new hair style

Source code in src/eolib/protocol/_generated/net/server/barber_agree_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class BarberAgreeServerPacket(Packet):
    """
    Purchasing a new hair style
    """
    _byte_size: int = 0
    _gold_amount: int
    _change: AvatarChange

    def __init__(self, *, gold_amount: int, change: AvatarChange):
        """
        Create a new instance of BarberAgreeServerPacket.

        Args:
            gold_amount (int): (Value range is 0-4097152080.)
            change (AvatarChange): 
        """
        self._gold_amount = gold_amount
        self._change = change

    @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 gold_amount(self) -> int:
        return self._gold_amount

    @property
    def change(self) -> AvatarChange:
        return self._change

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Barber

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Agree

    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.
        """
        BarberAgreeServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "BarberAgreeServerPacket") -> None:
        """
        Serializes an instance of `BarberAgreeServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (BarberAgreeServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._gold_amount is None:
                raise SerializationError("gold_amount must be provided.")
            writer.add_int(data._gold_amount)
            if data._change is None:
                raise SerializationError("change must be provided.")
            AvatarChange.serialize(writer, data._change)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "BarberAgreeServerPacket":
        """
        Deserializes an instance of `BarberAgreeServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            BarberAgreeServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            gold_amount = reader.get_int()
            change = AvatarChange.deserialize(reader)
            result = BarberAgreeServerPacket(gold_amount=gold_amount, change=change)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"BarberAgreeServerPacket(byte_size={repr(self._byte_size)}, gold_amount={repr(self._gold_amount)}, change={repr(self._change)})"

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.

gold_amount: int property

change: AvatarChange property

__init__(*, gold_amount, change)

Create a new instance of BarberAgreeServerPacket.

Parameters:

Name Type Description Default
gold_amount int

(Value range is 0-4097152080.)

required
change AvatarChange
required
Source code in src/eolib/protocol/_generated/net/server/barber_agree_server_packet.py
22
23
24
25
26
27
28
29
30
31
def __init__(self, *, gold_amount: int, change: AvatarChange):
    """
    Create a new instance of BarberAgreeServerPacket.

    Args:
        gold_amount (int): (Value range is 0-4097152080.)
        change (AvatarChange): 
    """
    self._gold_amount = gold_amount
    self._change = change

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/barber_agree_server_packet.py
51
52
53
54
55
56
57
58
59
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Barber

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/barber_agree_server_packet.py
61
62
63
64
65
66
67
68
69
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Agree

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/barber_agree_server_packet.py
71
72
73
74
75
76
77
78
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.
    """
    BarberAgreeServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of BarberAgreeServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data BarberAgreeServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/barber_agree_server_packet.py
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@staticmethod
def serialize(writer: EoWriter, data: "BarberAgreeServerPacket") -> None:
    """
    Serializes an instance of `BarberAgreeServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (BarberAgreeServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._gold_amount is None:
            raise SerializationError("gold_amount must be provided.")
        writer.add_int(data._gold_amount)
        if data._change is None:
            raise SerializationError("change must be provided.")
        AvatarChange.serialize(writer, data._change)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of BarberAgreeServerPacket 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
BarberAgreeServerPacket BarberAgreeServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/barber_agree_server_packet.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@staticmethod
def deserialize(reader: EoReader) -> "BarberAgreeServerPacket":
    """
    Deserializes an instance of `BarberAgreeServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        BarberAgreeServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        gold_amount = reader.get_int()
        change = AvatarChange.deserialize(reader)
        result = BarberAgreeServerPacket(gold_amount=gold_amount, change=change)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

BankReplyServerPacket

Bases: Packet

Update gold counts after deposit/withdraw

Source code in src/eolib/protocol/_generated/net/server/bank_reply_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
class BankReplyServerPacket(Packet):
    """
    Update gold counts after deposit/withdraw
    """
    _byte_size: int = 0
    _gold_inventory: int
    _gold_bank: int

    def __init__(self, *, gold_inventory: int, gold_bank: int):
        """
        Create a new instance of BankReplyServerPacket.

        Args:
            gold_inventory (int): (Value range is 0-4097152080.)
            gold_bank (int): (Value range is 0-4097152080.)
        """
        self._gold_inventory = gold_inventory
        self._gold_bank = gold_bank

    @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 gold_inventory(self) -> int:
        return self._gold_inventory

    @property
    def gold_bank(self) -> int:
        return self._gold_bank

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Bank

    @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.
        """
        BankReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "BankReplyServerPacket") -> None:
        """
        Serializes an instance of `BankReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (BankReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._gold_inventory is None:
                raise SerializationError("gold_inventory must be provided.")
            writer.add_int(data._gold_inventory)
            if data._gold_bank is None:
                raise SerializationError("gold_bank must be provided.")
            writer.add_int(data._gold_bank)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "BankReplyServerPacket":
        """
        Deserializes an instance of `BankReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            BankReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            gold_inventory = reader.get_int()
            gold_bank = reader.get_int()
            result = BankReplyServerPacket(gold_inventory=gold_inventory, gold_bank=gold_bank)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"BankReplyServerPacket(byte_size={repr(self._byte_size)}, gold_inventory={repr(self._gold_inventory)}, gold_bank={repr(self._gold_bank)})"

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.

gold_inventory: int property

gold_bank: int property

__init__(*, gold_inventory, gold_bank)

Create a new instance of BankReplyServerPacket.

Parameters:

Name Type Description Default
gold_inventory int

(Value range is 0-4097152080.)

required
gold_bank int

(Value range is 0-4097152080.)

required
Source code in src/eolib/protocol/_generated/net/server/bank_reply_server_packet.py
21
22
23
24
25
26
27
28
29
30
def __init__(self, *, gold_inventory: int, gold_bank: int):
    """
    Create a new instance of BankReplyServerPacket.

    Args:
        gold_inventory (int): (Value range is 0-4097152080.)
        gold_bank (int): (Value range is 0-4097152080.)
    """
    self._gold_inventory = gold_inventory
    self._gold_bank = gold_bank

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/bank_reply_server_packet.py
50
51
52
53
54
55
56
57
58
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Bank

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/bank_reply_server_packet.py
60
61
62
63
64
65
66
67
68
@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/bank_reply_server_packet.py
70
71
72
73
74
75
76
77
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.
    """
    BankReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of BankReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data BankReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/bank_reply_server_packet.py
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@staticmethod
def serialize(writer: EoWriter, data: "BankReplyServerPacket") -> None:
    """
    Serializes an instance of `BankReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (BankReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._gold_inventory is None:
            raise SerializationError("gold_inventory must be provided.")
        writer.add_int(data._gold_inventory)
        if data._gold_bank is None:
            raise SerializationError("gold_bank must be provided.")
        writer.add_int(data._gold_bank)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of BankReplyServerPacket 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
BankReplyServerPacket BankReplyServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/bank_reply_server_packet.py
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
@staticmethod
def deserialize(reader: EoReader) -> "BankReplyServerPacket":
    """
    Deserializes an instance of `BankReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        BankReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        gold_inventory = reader.get_int()
        gold_bank = reader.get_int()
        result = BankReplyServerPacket(gold_inventory=gold_inventory, gold_bank=gold_bank)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

BankOpenServerPacket

Bases: Packet

Open banker NPC interface

Source code in src/eolib/protocol/_generated/net/server/bank_open_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
class BankOpenServerPacket(Packet):
    """
    Open banker NPC interface
    """
    _byte_size: int = 0
    _gold_bank: int
    _session_id: int
    _locker_upgrades: int

    def __init__(self, *, gold_bank: int, session_id: int, locker_upgrades: int):
        """
        Create a new instance of BankOpenServerPacket.

        Args:
            gold_bank (int): (Value range is 0-4097152080.)
            session_id (int): (Value range is 0-16194276.)
            locker_upgrades (int): (Value range is 0-252.)
        """
        self._gold_bank = gold_bank
        self._session_id = session_id
        self._locker_upgrades = locker_upgrades

    @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 gold_bank(self) -> int:
        return self._gold_bank

    @property
    def session_id(self) -> int:
        return self._session_id

    @property
    def locker_upgrades(self) -> int:
        return self._locker_upgrades

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Bank

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Open

    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.
        """
        BankOpenServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "BankOpenServerPacket") -> None:
        """
        Serializes an instance of `BankOpenServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (BankOpenServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._gold_bank is None:
                raise SerializationError("gold_bank must be provided.")
            writer.add_int(data._gold_bank)
            if data._session_id is None:
                raise SerializationError("session_id must be provided.")
            writer.add_three(data._session_id)
            if data._locker_upgrades is None:
                raise SerializationError("locker_upgrades must be provided.")
            writer.add_char(data._locker_upgrades)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "BankOpenServerPacket":
        """
        Deserializes an instance of `BankOpenServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            BankOpenServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            gold_bank = reader.get_int()
            session_id = reader.get_three()
            locker_upgrades = reader.get_char()
            result = BankOpenServerPacket(gold_bank=gold_bank, session_id=session_id, locker_upgrades=locker_upgrades)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"BankOpenServerPacket(byte_size={repr(self._byte_size)}, gold_bank={repr(self._gold_bank)}, session_id={repr(self._session_id)}, locker_upgrades={repr(self._locker_upgrades)})"

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.

gold_bank: int property

session_id: int property

locker_upgrades: int property

__init__(*, gold_bank, session_id, locker_upgrades)

Create a new instance of BankOpenServerPacket.

Parameters:

Name Type Description Default
gold_bank int

(Value range is 0-4097152080.)

required
session_id int

(Value range is 0-16194276.)

required
locker_upgrades int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/bank_open_server_packet.py
22
23
24
25
26
27
28
29
30
31
32
33
def __init__(self, *, gold_bank: int, session_id: int, locker_upgrades: int):
    """
    Create a new instance of BankOpenServerPacket.

    Args:
        gold_bank (int): (Value range is 0-4097152080.)
        session_id (int): (Value range is 0-16194276.)
        locker_upgrades (int): (Value range is 0-252.)
    """
    self._gold_bank = gold_bank
    self._session_id = session_id
    self._locker_upgrades = locker_upgrades

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/bank_open_server_packet.py
57
58
59
60
61
62
63
64
65
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Bank

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/bank_open_server_packet.py
67
68
69
70
71
72
73
74
75
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Open

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/bank_open_server_packet.py
77
78
79
80
81
82
83
84
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.
    """
    BankOpenServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of BankOpenServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data BankOpenServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/bank_open_server_packet.py
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
@staticmethod
def serialize(writer: EoWriter, data: "BankOpenServerPacket") -> None:
    """
    Serializes an instance of `BankOpenServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (BankOpenServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._gold_bank is None:
            raise SerializationError("gold_bank must be provided.")
        writer.add_int(data._gold_bank)
        if data._session_id is None:
            raise SerializationError("session_id must be provided.")
        writer.add_three(data._session_id)
        if data._locker_upgrades is None:
            raise SerializationError("locker_upgrades must be provided.")
        writer.add_char(data._locker_upgrades)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of BankOpenServerPacket 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
BankOpenServerPacket BankOpenServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/bank_open_server_packet.py
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
@staticmethod
def deserialize(reader: EoReader) -> "BankOpenServerPacket":
    """
    Deserializes an instance of `BankOpenServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        BankOpenServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        gold_bank = reader.get_int()
        session_id = reader.get_three()
        locker_upgrades = reader.get_char()
        result = BankOpenServerPacket(gold_bank=gold_bank, session_id=session_id, locker_upgrades=locker_upgrades)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

AvatarReplyServerPacket

Bases: Packet

Nearby player hit by another player

Source code in src/eolib/protocol/_generated/net/server/avatar_reply_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
class AvatarReplyServerPacket(Packet):
    """
    Nearby player hit by another player
    """
    _byte_size: int = 0
    _player_id: int
    _victim_id: int
    _damage: int
    _direction: Direction
    _hp_percentage: int
    _dead: bool

    def __init__(self, *, player_id: int, victim_id: int, damage: int, direction: Direction, hp_percentage: int, dead: bool):
        """
        Create a new instance of AvatarReplyServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            victim_id (int): (Value range is 0-64008.)
            damage (int): (Value range is 0-16194276.)
            direction (Direction): 
            hp_percentage (int): (Value range is 0-252.)
            dead (bool): 
        """
        self._player_id = player_id
        self._victim_id = victim_id
        self._damage = damage
        self._direction = direction
        self._hp_percentage = hp_percentage
        self._dead = dead

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def victim_id(self) -> int:
        return self._victim_id

    @property
    def damage(self) -> int:
        return self._damage

    @property
    def direction(self) -> Direction:
        return self._direction

    @property
    def hp_percentage(self) -> int:
        return self._hp_percentage

    @property
    def dead(self) -> bool:
        return self._dead

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Avatar

    @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.
        """
        AvatarReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "AvatarReplyServerPacket") -> None:
        """
        Serializes an instance of `AvatarReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AvatarReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._victim_id is None:
                raise SerializationError("victim_id must be provided.")
            writer.add_short(data._victim_id)
            if data._damage is None:
                raise SerializationError("damage must be provided.")
            writer.add_three(data._damage)
            if data._direction is None:
                raise SerializationError("direction must be provided.")
            writer.add_char(int(data._direction))
            if data._hp_percentage is None:
                raise SerializationError("hp_percentage must be provided.")
            writer.add_char(data._hp_percentage)
            if data._dead is None:
                raise SerializationError("dead must be provided.")
            writer.add_char(1 if data._dead else 0)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "AvatarReplyServerPacket":
        """
        Deserializes an instance of `AvatarReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            AvatarReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            victim_id = reader.get_short()
            damage = reader.get_three()
            direction = Direction(reader.get_char())
            hp_percentage = reader.get_char()
            dead = reader.get_char() != 0
            result = AvatarReplyServerPacket(player_id=player_id, victim_id=victim_id, damage=damage, direction=direction, hp_percentage=hp_percentage, dead=dead)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"AvatarReplyServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, victim_id={repr(self._victim_id)}, damage={repr(self._damage)}, direction={repr(self._direction)}, hp_percentage={repr(self._hp_percentage)}, dead={repr(self._dead)})"

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.

player_id: int property

victim_id: int property

damage: int property

direction: Direction property

hp_percentage: int property

dead: bool property

__init__(*, player_id, victim_id, damage, direction, hp_percentage, dead)

Create a new instance of AvatarReplyServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
victim_id int

(Value range is 0-64008.)

required
damage int

(Value range is 0-16194276.)

required
direction Direction
required
hp_percentage int

(Value range is 0-252.)

required
dead bool
required
Source code in src/eolib/protocol/_generated/net/server/avatar_reply_server_packet.py
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
def __init__(self, *, player_id: int, victim_id: int, damage: int, direction: Direction, hp_percentage: int, dead: bool):
    """
    Create a new instance of AvatarReplyServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        victim_id (int): (Value range is 0-64008.)
        damage (int): (Value range is 0-16194276.)
        direction (Direction): 
        hp_percentage (int): (Value range is 0-252.)
        dead (bool): 
    """
    self._player_id = player_id
    self._victim_id = victim_id
    self._damage = damage
    self._direction = direction
    self._hp_percentage = hp_percentage
    self._dead = dead

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/avatar_reply_server_packet.py
79
80
81
82
83
84
85
86
87
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Avatar

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/avatar_reply_server_packet.py
89
90
91
92
93
94
95
96
97
@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/avatar_reply_server_packet.py
 99
100
101
102
103
104
105
106
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.
    """
    AvatarReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of AvatarReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data AvatarReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/avatar_reply_server_packet.py
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
@staticmethod
def serialize(writer: EoWriter, data: "AvatarReplyServerPacket") -> None:
    """
    Serializes an instance of `AvatarReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AvatarReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._victim_id is None:
            raise SerializationError("victim_id must be provided.")
        writer.add_short(data._victim_id)
        if data._damage is None:
            raise SerializationError("damage must be provided.")
        writer.add_three(data._damage)
        if data._direction is None:
            raise SerializationError("direction must be provided.")
        writer.add_char(int(data._direction))
        if data._hp_percentage is None:
            raise SerializationError("hp_percentage must be provided.")
        writer.add_char(data._hp_percentage)
        if data._dead is None:
            raise SerializationError("dead must be provided.")
        writer.add_char(1 if data._dead else 0)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AvatarReplyServerPacket 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
AvatarReplyServerPacket AvatarReplyServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/avatar_reply_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "AvatarReplyServerPacket":
    """
    Deserializes an instance of `AvatarReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        AvatarReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        victim_id = reader.get_short()
        damage = reader.get_three()
        direction = Direction(reader.get_char())
        hp_percentage = reader.get_char()
        dead = reader.get_char() != 0
        result = AvatarReplyServerPacket(player_id=player_id, victim_id=victim_id, damage=damage, direction=direction, hp_percentage=hp_percentage, dead=dead)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

WarpEffect

Bases: IntEnum

An effect that accompanies a player warp

Source code in src/eolib/protocol/_generated/net/server/warp_effect.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class WarpEffect(IntEnum, metaclass=ProtocolEnumMeta):
    """
    An effect that accompanies a player warp
    """
    None_ = 0
    """
    Does nothing
    """
    Scroll = 1
    """
    Plays the scroll sound effect
    """
    Admin = 2
    """
    Plays the admin warp sound effect and animation
    """

None_ = 0 class-attribute instance-attribute

Does nothing

Scroll = 1 class-attribute instance-attribute

Plays the scroll sound effect

Admin = 2 class-attribute instance-attribute

Plays the admin warp sound effect and animation

AvatarRemoveServerPacket

Bases: Packet

Nearby player has disappeared from view

Source code in src/eolib/protocol/_generated/net/server/avatar_remove_server_packet.py
 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
class AvatarRemoveServerPacket(Packet):
    """
    Nearby player has disappeared from view
    """
    _byte_size: int = 0
    _player_id: int
    _warp_effect: Optional[WarpEffect]

    def __init__(self, *, player_id: int, warp_effect: Optional[WarpEffect] = None):
        """
        Create a new instance of AvatarRemoveServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            warp_effect (Optional[WarpEffect]): 
        """
        self._player_id = player_id
        self._warp_effect = warp_effect

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def warp_effect(self) -> Optional[WarpEffect]:
        return self._warp_effect

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Avatar

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Remove

    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.
        """
        AvatarRemoveServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "AvatarRemoveServerPacket") -> None:
        """
        Serializes an instance of `AvatarRemoveServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AvatarRemoveServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            reached_missing_optional = data._warp_effect is None
            if not reached_missing_optional:
                writer.add_char(int(cast(WarpEffect, data._warp_effect)))
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "AvatarRemoveServerPacket":
        """
        Deserializes an instance of `AvatarRemoveServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            AvatarRemoveServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            warp_effect: Optional[WarpEffect] = None
            if reader.remaining > 0:
                warp_effect = WarpEffect(reader.get_char())
            result = AvatarRemoveServerPacket(player_id=player_id, warp_effect=warp_effect)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"AvatarRemoveServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, warp_effect={repr(self._warp_effect)})"

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.

player_id: int property

warp_effect: Optional[WarpEffect] property

__init__(*, player_id, warp_effect=None)

Create a new instance of AvatarRemoveServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
warp_effect Optional[WarpEffect]
None
Source code in src/eolib/protocol/_generated/net/server/avatar_remove_server_packet.py
24
25
26
27
28
29
30
31
32
33
def __init__(self, *, player_id: int, warp_effect: Optional[WarpEffect] = None):
    """
    Create a new instance of AvatarRemoveServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        warp_effect (Optional[WarpEffect]): 
    """
    self._player_id = player_id
    self._warp_effect = warp_effect

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/avatar_remove_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Avatar

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/avatar_remove_server_packet.py
63
64
65
66
67
68
69
70
71
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Remove

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/avatar_remove_server_packet.py
73
74
75
76
77
78
79
80
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.
    """
    AvatarRemoveServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of AvatarRemoveServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data AvatarRemoveServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/avatar_remove_server_packet.py
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
@staticmethod
def serialize(writer: EoWriter, data: "AvatarRemoveServerPacket") -> None:
    """
    Serializes an instance of `AvatarRemoveServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AvatarRemoveServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        reached_missing_optional = data._warp_effect is None
        if not reached_missing_optional:
            writer.add_char(int(cast(WarpEffect, data._warp_effect)))
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AvatarRemoveServerPacket 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
AvatarRemoveServerPacket AvatarRemoveServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/avatar_remove_server_packet.py
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
@staticmethod
def deserialize(reader: EoReader) -> "AvatarRemoveServerPacket":
    """
    Deserializes an instance of `AvatarRemoveServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        AvatarRemoveServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        warp_effect: Optional[WarpEffect] = None
        if reader.remaining > 0:
            warp_effect = WarpEffect(reader.get_char())
        result = AvatarRemoveServerPacket(player_id=player_id, warp_effect=warp_effect)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

EquipmentChange

Player equipment data. Sent when a player's visible equipment changes. Note that these values are graphic IDs.

Source code in src/eolib/protocol/_generated/net/server/equipment_change.py
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
class EquipmentChange:
    """
    Player equipment data.
    Sent when a player's visible equipment changes.
    Note that these values are graphic IDs.
    """
    _byte_size: int = 0
    _boots: int
    _armor: int
    _hat: int
    _weapon: int
    _shield: int

    def __init__(self, *, boots: int, armor: int, hat: int, weapon: int, shield: int):
        """
        Create a new instance of EquipmentChange.

        Args:
            boots (int): (Value range is 0-64008.)
            armor (int): (Value range is 0-64008.)
            hat (int): (Value range is 0-64008.)
            weapon (int): (Value range is 0-64008.)
            shield (int): (Value range is 0-64008.)
        """
        self._boots = boots
        self._armor = armor
        self._hat = hat
        self._weapon = weapon
        self._shield = shield

    @property
    def byte_size(self) -> int:
        """
        Returns the size of the data that this was deserialized from.

        Returns:
            int: The size of the data that this was deserialized from.
        """
        return self._byte_size

    @property
    def boots(self) -> int:
        return self._boots

    @property
    def armor(self) -> int:
        return self._armor

    @property
    def hat(self) -> int:
        return self._hat

    @property
    def weapon(self) -> int:
        return self._weapon

    @property
    def shield(self) -> int:
        return self._shield

    @staticmethod
    def serialize(writer: EoWriter, data: "EquipmentChange") -> None:
        """
        Serializes an instance of `EquipmentChange` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (EquipmentChange): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._boots is None:
                raise SerializationError("boots must be provided.")
            writer.add_short(data._boots)
            if data._armor is None:
                raise SerializationError("armor must be provided.")
            writer.add_short(data._armor)
            if data._hat is None:
                raise SerializationError("hat must be provided.")
            writer.add_short(data._hat)
            if data._weapon is None:
                raise SerializationError("weapon must be provided.")
            writer.add_short(data._weapon)
            if data._shield is None:
                raise SerializationError("shield must be provided.")
            writer.add_short(data._shield)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "EquipmentChange":
        """
        Deserializes an instance of `EquipmentChange` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            EquipmentChange: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            boots = reader.get_short()
            armor = reader.get_short()
            hat = reader.get_short()
            weapon = reader.get_short()
            shield = reader.get_short()
            result = EquipmentChange(boots=boots, armor=armor, hat=hat, weapon=weapon, shield=shield)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"EquipmentChange(byte_size={repr(self._byte_size)}, boots={repr(self._boots)}, armor={repr(self._armor)}, hat={repr(self._hat)}, weapon={repr(self._weapon)}, shield={repr(self._shield)})"

byte_size: int property

Returns the size of the data that this was deserialized from.

Returns:

Name Type Description
int int

The size of the data that this was deserialized from.

boots: int property

armor: int property

hat: int property

weapon: int property

shield: int property

__init__(*, boots, armor, hat, weapon, shield)

Create a new instance of EquipmentChange.

Parameters:

Name Type Description Default
boots int

(Value range is 0-64008.)

required
armor int

(Value range is 0-64008.)

required
hat int

(Value range is 0-64008.)

required
weapon int

(Value range is 0-64008.)

required
shield int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/equipment_change.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
def __init__(self, *, boots: int, armor: int, hat: int, weapon: int, shield: int):
    """
    Create a new instance of EquipmentChange.

    Args:
        boots (int): (Value range is 0-64008.)
        armor (int): (Value range is 0-64008.)
        hat (int): (Value range is 0-64008.)
        weapon (int): (Value range is 0-64008.)
        shield (int): (Value range is 0-64008.)
    """
    self._boots = boots
    self._armor = armor
    self._hat = hat
    self._weapon = weapon
    self._shield = shield

serialize(writer, data) staticmethod

Serializes an instance of EquipmentChange to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data EquipmentChange

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/equipment_change.py
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
@staticmethod
def serialize(writer: EoWriter, data: "EquipmentChange") -> None:
    """
    Serializes an instance of `EquipmentChange` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (EquipmentChange): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._boots is None:
            raise SerializationError("boots must be provided.")
        writer.add_short(data._boots)
        if data._armor is None:
            raise SerializationError("armor must be provided.")
        writer.add_short(data._armor)
        if data._hat is None:
            raise SerializationError("hat must be provided.")
        writer.add_short(data._hat)
        if data._weapon is None:
            raise SerializationError("weapon must be provided.")
        writer.add_short(data._weapon)
        if data._shield is None:
            raise SerializationError("shield must be provided.")
        writer.add_short(data._shield)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of EquipmentChange 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
EquipmentChange EquipmentChange

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/equipment_change.py
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
@staticmethod
def deserialize(reader: EoReader) -> "EquipmentChange":
    """
    Deserializes an instance of `EquipmentChange` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        EquipmentChange: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        boots = reader.get_short()
        armor = reader.get_short()
        hat = reader.get_short()
        weapon = reader.get_short()
        shield = reader.get_short()
        result = EquipmentChange(boots=boots, armor=armor, hat=hat, weapon=weapon, shield=shield)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

AvatarChangeType

Bases: IntEnum

How a player's appearance is changing

Source code in src/eolib/protocol/_generated/net/server/avatar_change_type.py
 9
10
11
12
13
14
15
class AvatarChangeType(IntEnum, metaclass=ProtocolEnumMeta):
    """
    How a player's appearance is changing
    """
    Equipment = 1
    Hair = 2
    HairColor = 3

Equipment = 1 class-attribute instance-attribute

Hair = 2 class-attribute instance-attribute

HairColor = 3 class-attribute instance-attribute

AvatarChange

Information about a nearby player's appearance changing

Source code in src/eolib/protocol/_generated/net/server/avatar_change.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
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
class AvatarChange:
    """
    Information about a nearby player's appearance changing
    """
    _byte_size: int = 0
    _player_id: int
    _change_type: AvatarChangeType
    _sound: bool
    _change_type_data: 'AvatarChange.ChangeTypeData'

    def __init__(self, *, player_id: int, change_type: AvatarChangeType, sound: bool, change_type_data: 'AvatarChange.ChangeTypeData' = None):
        """
        Create a new instance of AvatarChange.

        Args:
            player_id (int): (Value range is 0-64008.)
            change_type (AvatarChangeType): 
            sound (bool): 
            change_type_data (AvatarChange.ChangeTypeData): Data associated with the `change_type` field.
        """
        self._player_id = player_id
        self._change_type = change_type
        self._sound = sound
        self._change_type_data = change_type_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 player_id(self) -> int:
        return self._player_id

    @property
    def change_type(self) -> AvatarChangeType:
        return self._change_type

    @property
    def sound(self) -> bool:
        return self._sound

    @property
    def change_type_data(self) -> 'AvatarChange.ChangeTypeData':
        """
        AvatarChange.ChangeTypeData: Data associated with the `change_type` field.
        """
        return self._change_type_data

    @staticmethod
    def serialize(writer: EoWriter, data: "AvatarChange") -> None:
        """
        Serializes an instance of `AvatarChange` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AvatarChange): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._change_type is None:
                raise SerializationError("change_type must be provided.")
            writer.add_char(int(data._change_type))
            if data._sound is None:
                raise SerializationError("sound must be provided.")
            writer.add_char(1 if data._sound else 0)
            if data._change_type == AvatarChangeType.Equipment:
                if not isinstance(data._change_type_data, AvatarChange.ChangeTypeDataEquipment):
                    raise SerializationError("Expected change_type_data to be type AvatarChange.ChangeTypeDataEquipment for change_type " + AvatarChangeType(data._change_type).name + ".")
                AvatarChange.ChangeTypeDataEquipment.serialize(writer, data._change_type_data)
            elif data._change_type == AvatarChangeType.Hair:
                if not isinstance(data._change_type_data, AvatarChange.ChangeTypeDataHair):
                    raise SerializationError("Expected change_type_data to be type AvatarChange.ChangeTypeDataHair for change_type " + AvatarChangeType(data._change_type).name + ".")
                AvatarChange.ChangeTypeDataHair.serialize(writer, data._change_type_data)
            elif data._change_type == AvatarChangeType.HairColor:
                if not isinstance(data._change_type_data, AvatarChange.ChangeTypeDataHairColor):
                    raise SerializationError("Expected change_type_data to be type AvatarChange.ChangeTypeDataHairColor for change_type " + AvatarChangeType(data._change_type).name + ".")
                AvatarChange.ChangeTypeDataHairColor.serialize(writer, data._change_type_data)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "AvatarChange":
        """
        Deserializes an instance of `AvatarChange` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            AvatarChange: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            change_type = AvatarChangeType(reader.get_char())
            sound = reader.get_char() != 0
            change_type_data: AvatarChange.ChangeTypeData = None
            if change_type == AvatarChangeType.Equipment:
                change_type_data = AvatarChange.ChangeTypeDataEquipment.deserialize(reader)
            elif change_type == AvatarChangeType.Hair:
                change_type_data = AvatarChange.ChangeTypeDataHair.deserialize(reader)
            elif change_type == AvatarChangeType.HairColor:
                change_type_data = AvatarChange.ChangeTypeDataHairColor.deserialize(reader)
            result = AvatarChange(player_id=player_id, change_type=change_type, sound=sound, change_type_data=change_type_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"AvatarChange(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, change_type={repr(self._change_type)}, sound={repr(self._sound)}, change_type_data={repr(self._change_type_data)})"

    ChangeTypeData = Union['AvatarChange.ChangeTypeDataEquipment', 'AvatarChange.ChangeTypeDataHair', 'AvatarChange.ChangeTypeDataHairColor', None]
    """
    Data associated with different values of the `change_type` field.
    """

    class ChangeTypeDataEquipment:
        """
        Data associated with change_type value AvatarChangeType.Equipment
        """
        _byte_size: int = 0
        _equipment: EquipmentChange

        def __init__(self, *, equipment: EquipmentChange):
            """
            Create a new instance of AvatarChange.ChangeTypeDataEquipment.

            Args:
                equipment (EquipmentChange): 
            """
            self._equipment = equipment

        @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 equipment(self) -> EquipmentChange:
            return self._equipment

        @staticmethod
        def serialize(writer: EoWriter, data: "AvatarChange.ChangeTypeDataEquipment") -> None:
            """
            Serializes an instance of `AvatarChange.ChangeTypeDataEquipment` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (AvatarChange.ChangeTypeDataEquipment): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._equipment is None:
                    raise SerializationError("equipment must be provided.")
                EquipmentChange.serialize(writer, data._equipment)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "AvatarChange.ChangeTypeDataEquipment":
            """
            Deserializes an instance of `AvatarChange.ChangeTypeDataEquipment` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                AvatarChange.ChangeTypeDataEquipment: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                equipment = EquipmentChange.deserialize(reader)
                result = AvatarChange.ChangeTypeDataEquipment(equipment=equipment)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"AvatarChange.ChangeTypeDataEquipment(byte_size={repr(self._byte_size)}, equipment={repr(self._equipment)})"

    class ChangeTypeDataHair:
        """
        Data associated with change_type value AvatarChangeType.Hair
        """
        _byte_size: int = 0
        _hair_style: int
        _hair_color: int

        def __init__(self, *, hair_style: int, hair_color: int):
            """
            Create a new instance of AvatarChange.ChangeTypeDataHair.

            Args:
                hair_style (int): (Value range is 0-252.)
                hair_color (int): (Value range is 0-252.)
            """
            self._hair_style = hair_style
            self._hair_color = hair_color

        @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 hair_style(self) -> int:
            return self._hair_style

        @property
        def hair_color(self) -> int:
            return self._hair_color

        @staticmethod
        def serialize(writer: EoWriter, data: "AvatarChange.ChangeTypeDataHair") -> None:
            """
            Serializes an instance of `AvatarChange.ChangeTypeDataHair` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (AvatarChange.ChangeTypeDataHair): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._hair_style is None:
                    raise SerializationError("hair_style must be provided.")
                writer.add_char(data._hair_style)
                if data._hair_color is None:
                    raise SerializationError("hair_color must be provided.")
                writer.add_char(data._hair_color)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "AvatarChange.ChangeTypeDataHair":
            """
            Deserializes an instance of `AvatarChange.ChangeTypeDataHair` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                AvatarChange.ChangeTypeDataHair: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                hair_style = reader.get_char()
                hair_color = reader.get_char()
                result = AvatarChange.ChangeTypeDataHair(hair_style=hair_style, hair_color=hair_color)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"AvatarChange.ChangeTypeDataHair(byte_size={repr(self._byte_size)}, hair_style={repr(self._hair_style)}, hair_color={repr(self._hair_color)})"

    class ChangeTypeDataHairColor:
        """
        Data associated with change_type value AvatarChangeType.HairColor
        """
        _byte_size: int = 0
        _hair_color: int

        def __init__(self, *, hair_color: int):
            """
            Create a new instance of AvatarChange.ChangeTypeDataHairColor.

            Args:
                hair_color (int): (Value range is 0-252.)
            """
            self._hair_color = hair_color

        @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 hair_color(self) -> int:
            return self._hair_color

        @staticmethod
        def serialize(writer: EoWriter, data: "AvatarChange.ChangeTypeDataHairColor") -> None:
            """
            Serializes an instance of `AvatarChange.ChangeTypeDataHairColor` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (AvatarChange.ChangeTypeDataHairColor): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._hair_color is None:
                    raise SerializationError("hair_color must be provided.")
                writer.add_char(data._hair_color)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "AvatarChange.ChangeTypeDataHairColor":
            """
            Deserializes an instance of `AvatarChange.ChangeTypeDataHairColor` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                AvatarChange.ChangeTypeDataHairColor: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                hair_color = reader.get_char()
                result = AvatarChange.ChangeTypeDataHairColor(hair_color=hair_color)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"AvatarChange.ChangeTypeDataHairColor(byte_size={repr(self._byte_size)}, hair_color={repr(self._hair_color)})"

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.

player_id: int property

change_type: AvatarChangeType property

sound: bool property

change_type_data: AvatarChange.ChangeTypeData property

AvatarChange.ChangeTypeData: Data associated with the change_type field.

ChangeTypeData = Union['AvatarChange.ChangeTypeDataEquipment', 'AvatarChange.ChangeTypeDataHair', 'AvatarChange.ChangeTypeDataHairColor', None] class-attribute instance-attribute

Data associated with different values of the change_type field.

ChangeTypeDataEquipment

Data associated with change_type value AvatarChangeType.Equipment

Source code in src/eolib/protocol/_generated/net/server/avatar_change.py
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
class ChangeTypeDataEquipment:
    """
    Data associated with change_type value AvatarChangeType.Equipment
    """
    _byte_size: int = 0
    _equipment: EquipmentChange

    def __init__(self, *, equipment: EquipmentChange):
        """
        Create a new instance of AvatarChange.ChangeTypeDataEquipment.

        Args:
            equipment (EquipmentChange): 
        """
        self._equipment = equipment

    @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 equipment(self) -> EquipmentChange:
        return self._equipment

    @staticmethod
    def serialize(writer: EoWriter, data: "AvatarChange.ChangeTypeDataEquipment") -> None:
        """
        Serializes an instance of `AvatarChange.ChangeTypeDataEquipment` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AvatarChange.ChangeTypeDataEquipment): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._equipment is None:
                raise SerializationError("equipment must be provided.")
            EquipmentChange.serialize(writer, data._equipment)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "AvatarChange.ChangeTypeDataEquipment":
        """
        Deserializes an instance of `AvatarChange.ChangeTypeDataEquipment` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            AvatarChange.ChangeTypeDataEquipment: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            equipment = EquipmentChange.deserialize(reader)
            result = AvatarChange.ChangeTypeDataEquipment(equipment=equipment)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"AvatarChange.ChangeTypeDataEquipment(byte_size={repr(self._byte_size)}, equipment={repr(self._equipment)})"

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.

equipment: EquipmentChange property

__init__(*, equipment)

Create a new instance of AvatarChange.ChangeTypeDataEquipment.

Parameters:

Name Type Description Default
equipment EquipmentChange
required
Source code in src/eolib/protocol/_generated/net/server/avatar_change.py
147
148
149
150
151
152
153
154
def __init__(self, *, equipment: EquipmentChange):
    """
    Create a new instance of AvatarChange.ChangeTypeDataEquipment.

    Args:
        equipment (EquipmentChange): 
    """
    self._equipment = equipment

serialize(writer, data) staticmethod

Serializes an instance of AvatarChange.ChangeTypeDataEquipment to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ChangeTypeDataEquipment

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/avatar_change.py
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
@staticmethod
def serialize(writer: EoWriter, data: "AvatarChange.ChangeTypeDataEquipment") -> None:
    """
    Serializes an instance of `AvatarChange.ChangeTypeDataEquipment` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AvatarChange.ChangeTypeDataEquipment): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._equipment is None:
            raise SerializationError("equipment must be provided.")
        EquipmentChange.serialize(writer, data._equipment)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AvatarChange.ChangeTypeDataEquipment from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ChangeTypeDataEquipment

AvatarChange.ChangeTypeDataEquipment: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/avatar_change.py
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
@staticmethod
def deserialize(reader: EoReader) -> "AvatarChange.ChangeTypeDataEquipment":
    """
    Deserializes an instance of `AvatarChange.ChangeTypeDataEquipment` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        AvatarChange.ChangeTypeDataEquipment: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        equipment = EquipmentChange.deserialize(reader)
        result = AvatarChange.ChangeTypeDataEquipment(equipment=equipment)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ChangeTypeDataHair

Data associated with change_type value AvatarChangeType.Hair

Source code in src/eolib/protocol/_generated/net/server/avatar_change.py
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
class ChangeTypeDataHair:
    """
    Data associated with change_type value AvatarChangeType.Hair
    """
    _byte_size: int = 0
    _hair_style: int
    _hair_color: int

    def __init__(self, *, hair_style: int, hair_color: int):
        """
        Create a new instance of AvatarChange.ChangeTypeDataHair.

        Args:
            hair_style (int): (Value range is 0-252.)
            hair_color (int): (Value range is 0-252.)
        """
        self._hair_style = hair_style
        self._hair_color = hair_color

    @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 hair_style(self) -> int:
        return self._hair_style

    @property
    def hair_color(self) -> int:
        return self._hair_color

    @staticmethod
    def serialize(writer: EoWriter, data: "AvatarChange.ChangeTypeDataHair") -> None:
        """
        Serializes an instance of `AvatarChange.ChangeTypeDataHair` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AvatarChange.ChangeTypeDataHair): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._hair_style is None:
                raise SerializationError("hair_style must be provided.")
            writer.add_char(data._hair_style)
            if data._hair_color is None:
                raise SerializationError("hair_color must be provided.")
            writer.add_char(data._hair_color)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "AvatarChange.ChangeTypeDataHair":
        """
        Deserializes an instance of `AvatarChange.ChangeTypeDataHair` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            AvatarChange.ChangeTypeDataHair: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            hair_style = reader.get_char()
            hair_color = reader.get_char()
            result = AvatarChange.ChangeTypeDataHair(hair_style=hair_style, hair_color=hair_color)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"AvatarChange.ChangeTypeDataHair(byte_size={repr(self._byte_size)}, hair_style={repr(self._hair_style)}, hair_color={repr(self._hair_color)})"

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.

hair_style: int property

hair_color: int property

__init__(*, hair_style, hair_color)

Create a new instance of AvatarChange.ChangeTypeDataHair.

Parameters:

Name Type Description Default
hair_style int

(Value range is 0-252.)

required
hair_color int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/avatar_change.py
219
220
221
222
223
224
225
226
227
228
def __init__(self, *, hair_style: int, hair_color: int):
    """
    Create a new instance of AvatarChange.ChangeTypeDataHair.

    Args:
        hair_style (int): (Value range is 0-252.)
        hair_color (int): (Value range is 0-252.)
    """
    self._hair_style = hair_style
    self._hair_color = hair_color

serialize(writer, data) staticmethod

Serializes an instance of AvatarChange.ChangeTypeDataHair to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ChangeTypeDataHair

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/avatar_change.py
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
@staticmethod
def serialize(writer: EoWriter, data: "AvatarChange.ChangeTypeDataHair") -> None:
    """
    Serializes an instance of `AvatarChange.ChangeTypeDataHair` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AvatarChange.ChangeTypeDataHair): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._hair_style is None:
            raise SerializationError("hair_style must be provided.")
        writer.add_char(data._hair_style)
        if data._hair_color is None:
            raise SerializationError("hair_color must be provided.")
        writer.add_char(data._hair_color)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AvatarChange.ChangeTypeDataHair from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ChangeTypeDataHair

AvatarChange.ChangeTypeDataHair: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/avatar_change.py
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
@staticmethod
def deserialize(reader: EoReader) -> "AvatarChange.ChangeTypeDataHair":
    """
    Deserializes an instance of `AvatarChange.ChangeTypeDataHair` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        AvatarChange.ChangeTypeDataHair: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        hair_style = reader.get_char()
        hair_color = reader.get_char()
        result = AvatarChange.ChangeTypeDataHair(hair_style=hair_style, hair_color=hair_color)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ChangeTypeDataHairColor

Data associated with change_type value AvatarChangeType.HairColor

Source code in src/eolib/protocol/_generated/net/server/avatar_change.py
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
class ChangeTypeDataHairColor:
    """
    Data associated with change_type value AvatarChangeType.HairColor
    """
    _byte_size: int = 0
    _hair_color: int

    def __init__(self, *, hair_color: int):
        """
        Create a new instance of AvatarChange.ChangeTypeDataHairColor.

        Args:
            hair_color (int): (Value range is 0-252.)
        """
        self._hair_color = hair_color

    @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 hair_color(self) -> int:
        return self._hair_color

    @staticmethod
    def serialize(writer: EoWriter, data: "AvatarChange.ChangeTypeDataHairColor") -> None:
        """
        Serializes an instance of `AvatarChange.ChangeTypeDataHairColor` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AvatarChange.ChangeTypeDataHairColor): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._hair_color is None:
                raise SerializationError("hair_color must be provided.")
            writer.add_char(data._hair_color)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "AvatarChange.ChangeTypeDataHairColor":
        """
        Deserializes an instance of `AvatarChange.ChangeTypeDataHairColor` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            AvatarChange.ChangeTypeDataHairColor: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            hair_color = reader.get_char()
            result = AvatarChange.ChangeTypeDataHairColor(hair_color=hair_color)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"AvatarChange.ChangeTypeDataHairColor(byte_size={repr(self._byte_size)}, hair_color={repr(self._hair_color)})"

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.

hair_color: int property

__init__(*, hair_color)

Create a new instance of AvatarChange.ChangeTypeDataHairColor.

Parameters:

Name Type Description Default
hair_color int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/avatar_change.py
300
301
302
303
304
305
306
307
def __init__(self, *, hair_color: int):
    """
    Create a new instance of AvatarChange.ChangeTypeDataHairColor.

    Args:
        hair_color (int): (Value range is 0-252.)
    """
    self._hair_color = hair_color

serialize(writer, data) staticmethod

Serializes an instance of AvatarChange.ChangeTypeDataHairColor to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ChangeTypeDataHairColor

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/avatar_change.py
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
@staticmethod
def serialize(writer: EoWriter, data: "AvatarChange.ChangeTypeDataHairColor") -> None:
    """
    Serializes an instance of `AvatarChange.ChangeTypeDataHairColor` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AvatarChange.ChangeTypeDataHairColor): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._hair_color is None:
            raise SerializationError("hair_color must be provided.")
        writer.add_char(data._hair_color)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AvatarChange.ChangeTypeDataHairColor from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
ChangeTypeDataHairColor

AvatarChange.ChangeTypeDataHairColor: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/avatar_change.py
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
@staticmethod
def deserialize(reader: EoReader) -> "AvatarChange.ChangeTypeDataHairColor":
    """
    Deserializes an instance of `AvatarChange.ChangeTypeDataHairColor` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        AvatarChange.ChangeTypeDataHairColor: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        hair_color = reader.get_char()
        result = AvatarChange.ChangeTypeDataHairColor(hair_color=hair_color)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

__init__(*, player_id, change_type, sound, change_type_data=None)

Create a new instance of AvatarChange.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
change_type AvatarChangeType
required
sound bool
required
change_type_data ChangeTypeData

Data associated with the change_type field.

None
Source code in src/eolib/protocol/_generated/net/server/avatar_change.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
def __init__(self, *, player_id: int, change_type: AvatarChangeType, sound: bool, change_type_data: 'AvatarChange.ChangeTypeData' = None):
    """
    Create a new instance of AvatarChange.

    Args:
        player_id (int): (Value range is 0-64008.)
        change_type (AvatarChangeType): 
        sound (bool): 
        change_type_data (AvatarChange.ChangeTypeData): Data associated with the `change_type` field.
    """
    self._player_id = player_id
    self._change_type = change_type
    self._sound = sound
    self._change_type_data = change_type_data

serialize(writer, data) staticmethod

Serializes an instance of AvatarChange to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data AvatarChange

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/avatar_change.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "AvatarChange") -> None:
    """
    Serializes an instance of `AvatarChange` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AvatarChange): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._change_type is None:
            raise SerializationError("change_type must be provided.")
        writer.add_char(int(data._change_type))
        if data._sound is None:
            raise SerializationError("sound must be provided.")
        writer.add_char(1 if data._sound else 0)
        if data._change_type == AvatarChangeType.Equipment:
            if not isinstance(data._change_type_data, AvatarChange.ChangeTypeDataEquipment):
                raise SerializationError("Expected change_type_data to be type AvatarChange.ChangeTypeDataEquipment for change_type " + AvatarChangeType(data._change_type).name + ".")
            AvatarChange.ChangeTypeDataEquipment.serialize(writer, data._change_type_data)
        elif data._change_type == AvatarChangeType.Hair:
            if not isinstance(data._change_type_data, AvatarChange.ChangeTypeDataHair):
                raise SerializationError("Expected change_type_data to be type AvatarChange.ChangeTypeDataHair for change_type " + AvatarChangeType(data._change_type).name + ".")
            AvatarChange.ChangeTypeDataHair.serialize(writer, data._change_type_data)
        elif data._change_type == AvatarChangeType.HairColor:
            if not isinstance(data._change_type_data, AvatarChange.ChangeTypeDataHairColor):
                raise SerializationError("Expected change_type_data to be type AvatarChange.ChangeTypeDataHairColor for change_type " + AvatarChangeType(data._change_type).name + ".")
            AvatarChange.ChangeTypeDataHairColor.serialize(writer, data._change_type_data)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AvatarChange 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
AvatarChange AvatarChange

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/avatar_change.py
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
@staticmethod
def deserialize(reader: EoReader) -> "AvatarChange":
    """
    Deserializes an instance of `AvatarChange` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        AvatarChange: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        change_type = AvatarChangeType(reader.get_char())
        sound = reader.get_char() != 0
        change_type_data: AvatarChange.ChangeTypeData = None
        if change_type == AvatarChangeType.Equipment:
            change_type_data = AvatarChange.ChangeTypeDataEquipment.deserialize(reader)
        elif change_type == AvatarChangeType.Hair:
            change_type_data = AvatarChange.ChangeTypeDataHair.deserialize(reader)
        elif change_type == AvatarChangeType.HairColor:
            change_type_data = AvatarChange.ChangeTypeDataHairColor.deserialize(reader)
        result = AvatarChange(player_id=player_id, change_type=change_type, sound=sound, change_type_data=change_type_data)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

AvatarAgreeServerPacket

Bases: Packet

Nearby player changed appearance

Source code in src/eolib/protocol/_generated/net/server/avatar_agree_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
class AvatarAgreeServerPacket(Packet):
    """
    Nearby player changed appearance
    """
    _byte_size: int = 0
    _change: AvatarChange

    def __init__(self, *, change: AvatarChange):
        """
        Create a new instance of AvatarAgreeServerPacket.

        Args:
            change (AvatarChange): 
        """
        self._change = change

    @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 change(self) -> AvatarChange:
        return self._change

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Avatar

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Agree

    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.
        """
        AvatarAgreeServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "AvatarAgreeServerPacket") -> None:
        """
        Serializes an instance of `AvatarAgreeServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AvatarAgreeServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._change is None:
                raise SerializationError("change must be provided.")
            AvatarChange.serialize(writer, data._change)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "AvatarAgreeServerPacket":
        """
        Deserializes an instance of `AvatarAgreeServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            AvatarAgreeServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            change = AvatarChange.deserialize(reader)
            result = AvatarAgreeServerPacket(change=change)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"AvatarAgreeServerPacket(byte_size={repr(self._byte_size)}, change={repr(self._change)})"

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.

change: AvatarChange property

__init__(*, change)

Create a new instance of AvatarAgreeServerPacket.

Parameters:

Name Type Description Default
change AvatarChange
required
Source code in src/eolib/protocol/_generated/net/server/avatar_agree_server_packet.py
21
22
23
24
25
26
27
28
def __init__(self, *, change: AvatarChange):
    """
    Create a new instance of AvatarAgreeServerPacket.

    Args:
        change (AvatarChange): 
    """
    self._change = change

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/avatar_agree_server_packet.py
44
45
46
47
48
49
50
51
52
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Avatar

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/avatar_agree_server_packet.py
54
55
56
57
58
59
60
61
62
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Agree

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/avatar_agree_server_packet.py
64
65
66
67
68
69
70
71
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.
    """
    AvatarAgreeServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of AvatarAgreeServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data AvatarAgreeServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/avatar_agree_server_packet.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@staticmethod
def serialize(writer: EoWriter, data: "AvatarAgreeServerPacket") -> None:
    """
    Serializes an instance of `AvatarAgreeServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AvatarAgreeServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._change is None:
            raise SerializationError("change must be provided.")
        AvatarChange.serialize(writer, data._change)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AvatarAgreeServerPacket 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
AvatarAgreeServerPacket AvatarAgreeServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/avatar_agree_server_packet.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
@staticmethod
def deserialize(reader: EoReader) -> "AvatarAgreeServerPacket":
    """
    Deserializes an instance of `AvatarAgreeServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        AvatarAgreeServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        change = AvatarChange.deserialize(reader)
        result = AvatarAgreeServerPacket(change=change)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

AvatarAdminServerPacket

Bases: Packet

Nearby player hit by a damage spell from a player

Source code in src/eolib/protocol/_generated/net/server/avatar_admin_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
class AvatarAdminServerPacket(Packet):
    """
    Nearby player hit by a damage spell from a player
    """
    _byte_size: int = 0
    _caster_id: int
    _victim_id: int
    _damage: int
    _caster_direction: Direction
    _hp_percentage: int
    _victim_died: bool
    _spell_id: int

    def __init__(self, *, caster_id: int, victim_id: int, damage: int, caster_direction: Direction, hp_percentage: int, victim_died: bool, spell_id: int):
        """
        Create a new instance of AvatarAdminServerPacket.

        Args:
            caster_id (int): (Value range is 0-64008.)
            victim_id (int): (Value range is 0-64008.)
            damage (int): (Value range is 0-16194276.)
            caster_direction (Direction): 
            hp_percentage (int): (Value range is 0-252.)
            victim_died (bool): 
            spell_id (int): (Value range is 0-64008.)
        """
        self._caster_id = caster_id
        self._victim_id = victim_id
        self._damage = damage
        self._caster_direction = caster_direction
        self._hp_percentage = hp_percentage
        self._victim_died = victim_died
        self._spell_id = spell_id

    @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 caster_id(self) -> int:
        return self._caster_id

    @property
    def victim_id(self) -> int:
        return self._victim_id

    @property
    def damage(self) -> int:
        return self._damage

    @property
    def caster_direction(self) -> Direction:
        return self._caster_direction

    @property
    def hp_percentage(self) -> int:
        return self._hp_percentage

    @property
    def victim_died(self) -> bool:
        return self._victim_died

    @property
    def spell_id(self) -> int:
        return self._spell_id

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Avatar

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Admin

    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.
        """
        AvatarAdminServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "AvatarAdminServerPacket") -> None:
        """
        Serializes an instance of `AvatarAdminServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AvatarAdminServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._caster_id is None:
                raise SerializationError("caster_id must be provided.")
            writer.add_short(data._caster_id)
            if data._victim_id is None:
                raise SerializationError("victim_id must be provided.")
            writer.add_short(data._victim_id)
            if data._damage is None:
                raise SerializationError("damage must be provided.")
            writer.add_three(data._damage)
            if data._caster_direction is None:
                raise SerializationError("caster_direction must be provided.")
            writer.add_char(int(data._caster_direction))
            if data._hp_percentage is None:
                raise SerializationError("hp_percentage must be provided.")
            writer.add_char(data._hp_percentage)
            if data._victim_died is None:
                raise SerializationError("victim_died must be provided.")
            writer.add_char(1 if data._victim_died else 0)
            if data._spell_id is None:
                raise SerializationError("spell_id must be provided.")
            writer.add_short(data._spell_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "AvatarAdminServerPacket":
        """
        Deserializes an instance of `AvatarAdminServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            AvatarAdminServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            caster_id = reader.get_short()
            victim_id = reader.get_short()
            damage = reader.get_three()
            caster_direction = Direction(reader.get_char())
            hp_percentage = reader.get_char()
            victim_died = reader.get_char() != 0
            spell_id = reader.get_short()
            result = AvatarAdminServerPacket(caster_id=caster_id, victim_id=victim_id, damage=damage, caster_direction=caster_direction, hp_percentage=hp_percentage, victim_died=victim_died, spell_id=spell_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"AvatarAdminServerPacket(byte_size={repr(self._byte_size)}, caster_id={repr(self._caster_id)}, victim_id={repr(self._victim_id)}, damage={repr(self._damage)}, caster_direction={repr(self._caster_direction)}, hp_percentage={repr(self._hp_percentage)}, victim_died={repr(self._victim_died)}, spell_id={repr(self._spell_id)})"

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.

caster_id: int property

victim_id: int property

damage: int property

caster_direction: Direction property

hp_percentage: int property

victim_died: bool property

spell_id: int property

__init__(*, caster_id, victim_id, damage, caster_direction, hp_percentage, victim_died, spell_id)

Create a new instance of AvatarAdminServerPacket.

Parameters:

Name Type Description Default
caster_id int

(Value range is 0-64008.)

required
victim_id int

(Value range is 0-64008.)

required
damage int

(Value range is 0-16194276.)

required
caster_direction Direction
required
hp_percentage int

(Value range is 0-252.)

required
victim_died bool
required
spell_id int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/avatar_admin_server_packet.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
def __init__(self, *, caster_id: int, victim_id: int, damage: int, caster_direction: Direction, hp_percentage: int, victim_died: bool, spell_id: int):
    """
    Create a new instance of AvatarAdminServerPacket.

    Args:
        caster_id (int): (Value range is 0-64008.)
        victim_id (int): (Value range is 0-64008.)
        damage (int): (Value range is 0-16194276.)
        caster_direction (Direction): 
        hp_percentage (int): (Value range is 0-252.)
        victim_died (bool): 
        spell_id (int): (Value range is 0-64008.)
    """
    self._caster_id = caster_id
    self._victim_id = victim_id
    self._damage = damage
    self._caster_direction = caster_direction
    self._hp_percentage = hp_percentage
    self._victim_died = victim_died
    self._spell_id = spell_id

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/avatar_admin_server_packet.py
86
87
88
89
90
91
92
93
94
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Avatar

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/avatar_admin_server_packet.py
 96
 97
 98
 99
100
101
102
103
104
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Admin

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/avatar_admin_server_packet.py
106
107
108
109
110
111
112
113
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.
    """
    AvatarAdminServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of AvatarAdminServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data AvatarAdminServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/avatar_admin_server_packet.py
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
@staticmethod
def serialize(writer: EoWriter, data: "AvatarAdminServerPacket") -> None:
    """
    Serializes an instance of `AvatarAdminServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AvatarAdminServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._caster_id is None:
            raise SerializationError("caster_id must be provided.")
        writer.add_short(data._caster_id)
        if data._victim_id is None:
            raise SerializationError("victim_id must be provided.")
        writer.add_short(data._victim_id)
        if data._damage is None:
            raise SerializationError("damage must be provided.")
        writer.add_three(data._damage)
        if data._caster_direction is None:
            raise SerializationError("caster_direction must be provided.")
        writer.add_char(int(data._caster_direction))
        if data._hp_percentage is None:
            raise SerializationError("hp_percentage must be provided.")
        writer.add_char(data._hp_percentage)
        if data._victim_died is None:
            raise SerializationError("victim_died must be provided.")
        writer.add_char(1 if data._victim_died else 0)
        if data._spell_id is None:
            raise SerializationError("spell_id must be provided.")
        writer.add_short(data._spell_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AvatarAdminServerPacket 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
AvatarAdminServerPacket AvatarAdminServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/avatar_admin_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "AvatarAdminServerPacket":
    """
    Deserializes an instance of `AvatarAdminServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        AvatarAdminServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        caster_id = reader.get_short()
        victim_id = reader.get_short()
        damage = reader.get_three()
        caster_direction = Direction(reader.get_char())
        hp_percentage = reader.get_char()
        victim_died = reader.get_char() != 0
        spell_id = reader.get_short()
        result = AvatarAdminServerPacket(caster_id=caster_id, victim_id=victim_id, damage=damage, caster_direction=caster_direction, hp_percentage=hp_percentage, victim_died=victim_died, spell_id=spell_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

AttackPlayerServerPacket

Bases: Packet

Nearby player attacking

Source code in src/eolib/protocol/_generated/net/server/attack_player_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class AttackPlayerServerPacket(Packet):
    """
    Nearby player attacking
    """
    _byte_size: int = 0
    _player_id: int
    _direction: Direction

    def __init__(self, *, player_id: int, direction: Direction):
        """
        Create a new instance of AttackPlayerServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            direction (Direction): 
        """
        self._player_id = player_id
        self._direction = direction

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def direction(self) -> Direction:
        return self._direction

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Attack

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Player

    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.
        """
        AttackPlayerServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "AttackPlayerServerPacket") -> None:
        """
        Serializes an instance of `AttackPlayerServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AttackPlayerServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            if data._direction is None:
                raise SerializationError("direction must be provided.")
            writer.add_char(int(data._direction))
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "AttackPlayerServerPacket":
        """
        Deserializes an instance of `AttackPlayerServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            AttackPlayerServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            direction = Direction(reader.get_char())
            result = AttackPlayerServerPacket(player_id=player_id, direction=direction)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"AttackPlayerServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, direction={repr(self._direction)})"

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.

player_id: int property

direction: Direction property

__init__(*, player_id, direction)

Create a new instance of AttackPlayerServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
direction Direction
required
Source code in src/eolib/protocol/_generated/net/server/attack_player_server_packet.py
22
23
24
25
26
27
28
29
30
31
def __init__(self, *, player_id: int, direction: Direction):
    """
    Create a new instance of AttackPlayerServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        direction (Direction): 
    """
    self._player_id = player_id
    self._direction = direction

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/attack_player_server_packet.py
51
52
53
54
55
56
57
58
59
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Attack

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/attack_player_server_packet.py
61
62
63
64
65
66
67
68
69
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Player

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/attack_player_server_packet.py
71
72
73
74
75
76
77
78
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.
    """
    AttackPlayerServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of AttackPlayerServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data AttackPlayerServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/attack_player_server_packet.py
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@staticmethod
def serialize(writer: EoWriter, data: "AttackPlayerServerPacket") -> None:
    """
    Serializes an instance of `AttackPlayerServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AttackPlayerServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        if data._direction is None:
            raise SerializationError("direction must be provided.")
        writer.add_char(int(data._direction))
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AttackPlayerServerPacket 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
AttackPlayerServerPacket AttackPlayerServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/attack_player_server_packet.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
@staticmethod
def deserialize(reader: EoReader) -> "AttackPlayerServerPacket":
    """
    Deserializes an instance of `AttackPlayerServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        AttackPlayerServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        direction = Direction(reader.get_char())
        result = AttackPlayerServerPacket(player_id=player_id, direction=direction)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

AttackErrorServerPacket

Bases: Packet

Show flood protection message (vestigial)

Source code in src/eolib/protocol/_generated/net/server/attack_error_server_packet.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
class AttackErrorServerPacket(Packet):
    """
    Show flood protection message (vestigial)
    """
    _byte_size: int = 0

    def __init__(self):
        """
        Create a new instance of AttackErrorServerPacket.
        """

    @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 family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Attack

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Error

    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.
        """
        AttackErrorServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "AttackErrorServerPacket") -> None:
        """
        Serializes an instance of `AttackErrorServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AttackErrorServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.add_byte(255)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "AttackErrorServerPacket":
        """
        Deserializes an instance of `AttackErrorServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            AttackErrorServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_byte()
            result = AttackErrorServerPacket()
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"AttackErrorServerPacket(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 AttackErrorServerPacket.

Source code in src/eolib/protocol/_generated/net/server/attack_error_server_packet.py
18
19
20
21
def __init__(self):
    """
    Create a new instance of AttackErrorServerPacket.
    """

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/attack_error_server_packet.py
33
34
35
36
37
38
39
40
41
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Attack

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/attack_error_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Error

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/attack_error_server_packet.py
53
54
55
56
57
58
59
60
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.
    """
    AttackErrorServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of AttackErrorServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data AttackErrorServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/attack_error_server_packet.py
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@staticmethod
def serialize(writer: EoWriter, data: "AttackErrorServerPacket") -> None:
    """
    Serializes an instance of `AttackErrorServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AttackErrorServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.add_byte(255)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AttackErrorServerPacket 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
AttackErrorServerPacket AttackErrorServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/attack_error_server_packet.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@staticmethod
def deserialize(reader: EoReader) -> "AttackErrorServerPacket":
    """
    Deserializes an instance of `AttackErrorServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        AttackErrorServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_byte()
        result = AttackErrorServerPacket()
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ArenaUseServerPacket

Bases: Packet

Arena start message

Source code in src/eolib/protocol/_generated/net/server/arena_use_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class ArenaUseServerPacket(Packet):
    """
    Arena start message
    """
    _byte_size: int = 0
    _players_count: int

    def __init__(self, *, players_count: int):
        """
        Create a new instance of ArenaUseServerPacket.

        Args:
            players_count (int): (Value range is 0-252.)
        """
        self._players_count = players_count

    @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 players_count(self) -> int:
        return self._players_count

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Arena

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Use

    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.
        """
        ArenaUseServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ArenaUseServerPacket") -> None:
        """
        Serializes an instance of `ArenaUseServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ArenaUseServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._players_count is None:
                raise SerializationError("players_count must be provided.")
            writer.add_char(data._players_count)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ArenaUseServerPacket":
        """
        Deserializes an instance of `ArenaUseServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ArenaUseServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            players_count = reader.get_char()
            result = ArenaUseServerPacket(players_count=players_count)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ArenaUseServerPacket(byte_size={repr(self._byte_size)}, players_count={repr(self._players_count)})"

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.

players_count: int property

__init__(*, players_count)

Create a new instance of ArenaUseServerPacket.

Parameters:

Name Type Description Default
players_count int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/server/arena_use_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, players_count: int):
    """
    Create a new instance of ArenaUseServerPacket.

    Args:
        players_count (int): (Value range is 0-252.)
    """
    self._players_count = players_count

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/arena_use_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Arena

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/arena_use_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Use

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/arena_use_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    ArenaUseServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ArenaUseServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ArenaUseServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/arena_use_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "ArenaUseServerPacket") -> None:
    """
    Serializes an instance of `ArenaUseServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ArenaUseServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._players_count is None:
            raise SerializationError("players_count must be provided.")
        writer.add_char(data._players_count)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ArenaUseServerPacket 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
ArenaUseServerPacket ArenaUseServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/arena_use_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "ArenaUseServerPacket":
    """
    Deserializes an instance of `ArenaUseServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ArenaUseServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        players_count = reader.get_char()
        result = ArenaUseServerPacket(players_count=players_count)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

Direction

Bases: IntEnum

The direction a player or NPC is facing

Source code in src/eolib/protocol/_generated/direction.py
 9
10
11
12
13
14
15
16
class Direction(IntEnum, metaclass=ProtocolEnumMeta):
    """
    The direction a player or NPC is facing
    """
    Down = 0
    Left = 1
    Up = 2
    Right = 3

Down = 0 class-attribute instance-attribute

Left = 1 class-attribute instance-attribute

Up = 2 class-attribute instance-attribute

Right = 3 class-attribute instance-attribute

ArenaSpecServerPacket

Bases: Packet

Arena kill message

Source code in src/eolib/protocol/_generated/net/server/arena_spec_server_packet.py
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
class ArenaSpecServerPacket(Packet):
    """
    Arena kill message
    """
    _byte_size: int = 0
    _player_id: int
    _direction: Direction
    _kills_count: int
    _killer_name: str
    _victim_name: str

    def __init__(self, *, player_id: int, direction: Direction, kills_count: int, killer_name: str, victim_name: str):
        """
        Create a new instance of ArenaSpecServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
            direction (Direction): 
            kills_count (int): (Value range is 0-4097152080.)
            killer_name (str): 
            victim_name (str): 
        """
        self._player_id = player_id
        self._direction = direction
        self._kills_count = kills_count
        self._killer_name = killer_name
        self._victim_name = victim_name

    @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 player_id(self) -> int:
        return self._player_id

    @property
    def direction(self) -> Direction:
        return self._direction

    @property
    def kills_count(self) -> int:
        return self._kills_count

    @property
    def killer_name(self) -> str:
        return self._killer_name

    @property
    def victim_name(self) -> str:
        return self._victim_name

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Arena

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Spec

    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.
        """
        ArenaSpecServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ArenaSpecServerPacket") -> None:
        """
        Serializes an instance of `ArenaSpecServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ArenaSpecServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
            writer.add_byte(0xFF)
            if data._direction is None:
                raise SerializationError("direction must be provided.")
            writer.add_char(int(data._direction))
            writer.add_byte(0xFF)
            if data._kills_count is None:
                raise SerializationError("kills_count must be provided.")
            writer.add_int(data._kills_count)
            writer.add_byte(0xFF)
            if data._killer_name is None:
                raise SerializationError("killer_name must be provided.")
            writer.add_string(data._killer_name)
            writer.add_byte(0xFF)
            if data._victim_name is None:
                raise SerializationError("victim_name must be provided.")
            writer.add_string(data._victim_name)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ArenaSpecServerPacket":
        """
        Deserializes an instance of `ArenaSpecServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ArenaSpecServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            player_id = reader.get_short()
            reader.next_chunk()
            direction = Direction(reader.get_char())
            reader.next_chunk()
            kills_count = reader.get_int()
            reader.next_chunk()
            killer_name = reader.get_string()
            reader.next_chunk()
            victim_name = reader.get_string()
            reader.chunked_reading_mode = False
            result = ArenaSpecServerPacket(player_id=player_id, direction=direction, kills_count=kills_count, killer_name=killer_name, victim_name=victim_name)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ArenaSpecServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)}, direction={repr(self._direction)}, kills_count={repr(self._kills_count)}, killer_name={repr(self._killer_name)}, victim_name={repr(self._victim_name)})"

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.

player_id: int property

direction: Direction property

kills_count: int property

killer_name: str property

victim_name: str property

__init__(*, player_id, direction, kills_count, killer_name, victim_name)

Create a new instance of ArenaSpecServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
direction Direction
required
kills_count int

(Value range is 0-4097152080.)

required
killer_name str
required
victim_name str
required
Source code in src/eolib/protocol/_generated/net/server/arena_spec_server_packet.py
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
def __init__(self, *, player_id: int, direction: Direction, kills_count: int, killer_name: str, victim_name: str):
    """
    Create a new instance of ArenaSpecServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
        direction (Direction): 
        kills_count (int): (Value range is 0-4097152080.)
        killer_name (str): 
        victim_name (str): 
    """
    self._player_id = player_id
    self._direction = direction
    self._kills_count = kills_count
    self._killer_name = killer_name
    self._victim_name = victim_name

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/arena_spec_server_packet.py
72
73
74
75
76
77
78
79
80
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Arena

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/arena_spec_server_packet.py
82
83
84
85
86
87
88
89
90
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Spec

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/arena_spec_server_packet.py
92
93
94
95
96
97
98
99
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.
    """
    ArenaSpecServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ArenaSpecServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ArenaSpecServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/arena_spec_server_packet.py
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
@staticmethod
def serialize(writer: EoWriter, data: "ArenaSpecServerPacket") -> None:
    """
    Serializes an instance of `ArenaSpecServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ArenaSpecServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
        writer.add_byte(0xFF)
        if data._direction is None:
            raise SerializationError("direction must be provided.")
        writer.add_char(int(data._direction))
        writer.add_byte(0xFF)
        if data._kills_count is None:
            raise SerializationError("kills_count must be provided.")
        writer.add_int(data._kills_count)
        writer.add_byte(0xFF)
        if data._killer_name is None:
            raise SerializationError("killer_name must be provided.")
        writer.add_string(data._killer_name)
        writer.add_byte(0xFF)
        if data._victim_name is None:
            raise SerializationError("victim_name must be provided.")
        writer.add_string(data._victim_name)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ArenaSpecServerPacket 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
ArenaSpecServerPacket ArenaSpecServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/arena_spec_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "ArenaSpecServerPacket":
    """
    Deserializes an instance of `ArenaSpecServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ArenaSpecServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        player_id = reader.get_short()
        reader.next_chunk()
        direction = Direction(reader.get_char())
        reader.next_chunk()
        kills_count = reader.get_int()
        reader.next_chunk()
        killer_name = reader.get_string()
        reader.next_chunk()
        victim_name = reader.get_string()
        reader.chunked_reading_mode = False
        result = ArenaSpecServerPacket(player_id=player_id, direction=direction, kills_count=kills_count, killer_name=killer_name, victim_name=victim_name)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ArenaDropServerPacket

Bases: Packet

"Arena is blocked" message

Source code in src/eolib/protocol/_generated/net/server/arena_drop_server_packet.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
class ArenaDropServerPacket(Packet):
    """
    "Arena is blocked" message
    """
    _byte_size: int = 0

    def __init__(self):
        """
        Create a new instance of ArenaDropServerPacket.
        """

    @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 family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Arena

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Drop

    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.
        """
        ArenaDropServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ArenaDropServerPacket") -> None:
        """
        Serializes an instance of `ArenaDropServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ArenaDropServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.add_string("N")
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ArenaDropServerPacket":
        """
        Deserializes an instance of `ArenaDropServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ArenaDropServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            result = ArenaDropServerPacket()
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ArenaDropServerPacket(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 ArenaDropServerPacket.

Source code in src/eolib/protocol/_generated/net/server/arena_drop_server_packet.py
18
19
20
21
def __init__(self):
    """
    Create a new instance of ArenaDropServerPacket.
    """

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/arena_drop_server_packet.py
33
34
35
36
37
38
39
40
41
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Arena

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/arena_drop_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Drop

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/arena_drop_server_packet.py
53
54
55
56
57
58
59
60
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.
    """
    ArenaDropServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ArenaDropServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ArenaDropServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/arena_drop_server_packet.py
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@staticmethod
def serialize(writer: EoWriter, data: "ArenaDropServerPacket") -> None:
    """
    Serializes an instance of `ArenaDropServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ArenaDropServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.add_string("N")
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ArenaDropServerPacket 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
ArenaDropServerPacket ArenaDropServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/arena_drop_server_packet.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
@staticmethod
def deserialize(reader: EoReader) -> "ArenaDropServerPacket":
    """
    Deserializes an instance of `ArenaDropServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ArenaDropServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        result = ArenaDropServerPacket()
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ArenaAcceptServerPacket

Bases: Packet

Arena win message

Source code in src/eolib/protocol/_generated/net/server/arena_accept_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
class ArenaAcceptServerPacket(Packet):
    """
    Arena win message
    """
    _byte_size: int = 0
    _winner_name: str
    _kills_count: int
    _killer_name: str
    _victim_name: str

    def __init__(self, *, winner_name: str, kills_count: int, killer_name: str, victim_name: str):
        """
        Create a new instance of ArenaAcceptServerPacket.

        Args:
            winner_name (str): 
            kills_count (int): (Value range is 0-4097152080.)
            killer_name (str): 
            victim_name (str): 
        """
        self._winner_name = winner_name
        self._kills_count = kills_count
        self._killer_name = killer_name
        self._victim_name = victim_name

    @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 winner_name(self) -> str:
        return self._winner_name

    @property
    def kills_count(self) -> int:
        return self._kills_count

    @property
    def killer_name(self) -> str:
        return self._killer_name

    @property
    def victim_name(self) -> str:
        return self._victim_name

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.Arena

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Accept

    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.
        """
        ArenaAcceptServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "ArenaAcceptServerPacket") -> None:
        """
        Serializes an instance of `ArenaAcceptServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ArenaAcceptServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._winner_name is None:
                raise SerializationError("winner_name must be provided.")
            writer.add_string(data._winner_name)
            writer.add_byte(0xFF)
            if data._kills_count is None:
                raise SerializationError("kills_count must be provided.")
            writer.add_int(data._kills_count)
            writer.add_byte(0xFF)
            if data._killer_name is None:
                raise SerializationError("killer_name must be provided.")
            writer.add_string(data._killer_name)
            writer.add_byte(0xFF)
            if data._victim_name is None:
                raise SerializationError("victim_name must be provided.")
            writer.add_string(data._victim_name)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ArenaAcceptServerPacket":
        """
        Deserializes an instance of `ArenaAcceptServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ArenaAcceptServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            winner_name = reader.get_string()
            reader.next_chunk()
            kills_count = reader.get_int()
            reader.next_chunk()
            killer_name = reader.get_string()
            reader.next_chunk()
            victim_name = reader.get_string()
            reader.chunked_reading_mode = False
            result = ArenaAcceptServerPacket(winner_name=winner_name, kills_count=kills_count, killer_name=killer_name, victim_name=victim_name)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ArenaAcceptServerPacket(byte_size={repr(self._byte_size)}, winner_name={repr(self._winner_name)}, kills_count={repr(self._kills_count)}, killer_name={repr(self._killer_name)}, victim_name={repr(self._victim_name)})"

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.

winner_name: str property

kills_count: int property

killer_name: str property

victim_name: str property

__init__(*, winner_name, kills_count, killer_name, victim_name)

Create a new instance of ArenaAcceptServerPacket.

Parameters:

Name Type Description Default
winner_name str
required
kills_count int

(Value range is 0-4097152080.)

required
killer_name str
required
victim_name str
required
Source code in src/eolib/protocol/_generated/net/server/arena_accept_server_packet.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
def __init__(self, *, winner_name: str, kills_count: int, killer_name: str, victim_name: str):
    """
    Create a new instance of ArenaAcceptServerPacket.

    Args:
        winner_name (str): 
        kills_count (int): (Value range is 0-4097152080.)
        killer_name (str): 
        victim_name (str): 
    """
    self._winner_name = winner_name
    self._kills_count = kills_count
    self._killer_name = killer_name
    self._victim_name = victim_name

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/arena_accept_server_packet.py
64
65
66
67
68
69
70
71
72
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.Arena

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/arena_accept_server_packet.py
74
75
76
77
78
79
80
81
82
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Accept

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/arena_accept_server_packet.py
84
85
86
87
88
89
90
91
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.
    """
    ArenaAcceptServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of ArenaAcceptServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ArenaAcceptServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/arena_accept_server_packet.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "ArenaAcceptServerPacket") -> None:
    """
    Serializes an instance of `ArenaAcceptServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ArenaAcceptServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._winner_name is None:
            raise SerializationError("winner_name must be provided.")
        writer.add_string(data._winner_name)
        writer.add_byte(0xFF)
        if data._kills_count is None:
            raise SerializationError("kills_count must be provided.")
        writer.add_int(data._kills_count)
        writer.add_byte(0xFF)
        if data._killer_name is None:
            raise SerializationError("killer_name must be provided.")
        writer.add_string(data._killer_name)
        writer.add_byte(0xFF)
        if data._victim_name is None:
            raise SerializationError("victim_name must be provided.")
        writer.add_string(data._victim_name)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ArenaAcceptServerPacket 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
ArenaAcceptServerPacket ArenaAcceptServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/arena_accept_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "ArenaAcceptServerPacket":
    """
    Deserializes an instance of `ArenaAcceptServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ArenaAcceptServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        winner_name = reader.get_string()
        reader.next_chunk()
        kills_count = reader.get_int()
        reader.next_chunk()
        killer_name = reader.get_string()
        reader.next_chunk()
        victim_name = reader.get_string()
        reader.chunked_reading_mode = False
        result = ArenaAcceptServerPacket(winner_name=winner_name, kills_count=kills_count, killer_name=killer_name, victim_name=victim_name)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

Weight

Current carry weight and maximum carry capacity of a player

Source code in src/eolib/protocol/_generated/net/weight.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
class Weight:
    """
    Current carry weight and maximum carry capacity of a player
    """
    _byte_size: int = 0
    _current: int
    _max: int

    def __init__(self, *, current: int, max: int):
        """
        Create a new instance of Weight.

        Args:
            current (int): (Value range is 0-252.)
            max (int): (Value range is 0-252.)
        """
        self._current = current
        self._max = max

    @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 current(self) -> int:
        return self._current

    @property
    def max(self) -> int:
        return self._max

    @staticmethod
    def serialize(writer: EoWriter, data: "Weight") -> None:
        """
        Serializes an instance of `Weight` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (Weight): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._current is None:
                raise SerializationError("current must be provided.")
            writer.add_char(data._current)
            if data._max is None:
                raise SerializationError("max must be provided.")
            writer.add_char(data._max)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "Weight":
        """
        Deserializes an instance of `Weight` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            Weight: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            current = reader.get_char()
            max = reader.get_char()
            result = Weight(current=current, max=max)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"Weight(byte_size={repr(self._byte_size)}, current={repr(self._current)}, max={repr(self._max)})"

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.

current: int property

max: int property

__init__(*, current, max)

Create a new instance of Weight.

Parameters:

Name Type Description Default
current int

(Value range is 0-252.)

required
max int

(Value range is 0-252.)

required
Source code in src/eolib/protocol/_generated/net/weight.py
18
19
20
21
22
23
24
25
26
27
def __init__(self, *, current: int, max: int):
    """
    Create a new instance of Weight.

    Args:
        current (int): (Value range is 0-252.)
        max (int): (Value range is 0-252.)
    """
    self._current = current
    self._max = max

serialize(writer, data) staticmethod

Serializes an instance of Weight to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data Weight

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/weight.py
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@staticmethod
def serialize(writer: EoWriter, data: "Weight") -> None:
    """
    Serializes an instance of `Weight` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (Weight): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._current is None:
            raise SerializationError("current must be provided.")
        writer.add_char(data._current)
        if data._max is None:
            raise SerializationError("max must be provided.")
        writer.add_char(data._max)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of Weight 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
Weight Weight

The data to serialize.

Source code in src/eolib/protocol/_generated/net/weight.py
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def deserialize(reader: EoReader) -> "Weight":
    """
    Deserializes an instance of `Weight` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        Weight: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        current = reader.get_char()
        max = reader.get_char()
        result = Weight(current=current, max=max)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

CharacterStatsInfoLookup

Character stats data. Sent with character info lookups.

Source code in src/eolib/protocol/_generated/net/server/character_stats_info_lookup.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
class CharacterStatsInfoLookup:
    """
    Character stats data.
    Sent with character info lookups.
    """
    _byte_size: int = 0
    _hp: int
    _max_hp: int
    _tp: int
    _max_tp: int
    _base_stats: CharacterBaseStats
    _secondary_stats: CharacterSecondaryStatsInfoLookup
    _elemental_stats: CharacterElementalStats

    def __init__(self, *, hp: int, max_hp: int, tp: int, max_tp: int, base_stats: CharacterBaseStats, secondary_stats: CharacterSecondaryStatsInfoLookup, elemental_stats: CharacterElementalStats):
        """
        Create a new instance of CharacterStatsInfoLookup.

        Args:
            hp (int): (Value range is 0-64008.)
            max_hp (int): (Value range is 0-64008.)
            tp (int): (Value range is 0-64008.)
            max_tp (int): (Value range is 0-64008.)
            base_stats (CharacterBaseStats): 
            secondary_stats (CharacterSecondaryStatsInfoLookup): 
            elemental_stats (CharacterElementalStats): 
        """
        self._hp = hp
        self._max_hp = max_hp
        self._tp = tp
        self._max_tp = max_tp
        self._base_stats = base_stats
        self._secondary_stats = secondary_stats
        self._elemental_stats = elemental_stats

    @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 hp(self) -> int:
        return self._hp

    @property
    def max_hp(self) -> int:
        return self._max_hp

    @property
    def tp(self) -> int:
        return self._tp

    @property
    def max_tp(self) -> int:
        return self._max_tp

    @property
    def base_stats(self) -> CharacterBaseStats:
        return self._base_stats

    @property
    def secondary_stats(self) -> CharacterSecondaryStatsInfoLookup:
        return self._secondary_stats

    @property
    def elemental_stats(self) -> CharacterElementalStats:
        return self._elemental_stats

    @staticmethod
    def serialize(writer: EoWriter, data: "CharacterStatsInfoLookup") -> None:
        """
        Serializes an instance of `CharacterStatsInfoLookup` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (CharacterStatsInfoLookup): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._hp is None:
                raise SerializationError("hp must be provided.")
            writer.add_short(data._hp)
            if data._max_hp is None:
                raise SerializationError("max_hp must be provided.")
            writer.add_short(data._max_hp)
            if data._tp is None:
                raise SerializationError("tp must be provided.")
            writer.add_short(data._tp)
            if data._max_tp is None:
                raise SerializationError("max_tp must be provided.")
            writer.add_short(data._max_tp)
            if data._base_stats is None:
                raise SerializationError("base_stats must be provided.")
            CharacterBaseStats.serialize(writer, data._base_stats)
            if data._secondary_stats is None:
                raise SerializationError("secondary_stats must be provided.")
            CharacterSecondaryStatsInfoLookup.serialize(writer, data._secondary_stats)
            if data._elemental_stats is None:
                raise SerializationError("elemental_stats must be provided.")
            CharacterElementalStats.serialize(writer, data._elemental_stats)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "CharacterStatsInfoLookup":
        """
        Deserializes an instance of `CharacterStatsInfoLookup` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            CharacterStatsInfoLookup: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            hp = reader.get_short()
            max_hp = reader.get_short()
            tp = reader.get_short()
            max_tp = reader.get_short()
            base_stats = CharacterBaseStats.deserialize(reader)
            secondary_stats = CharacterSecondaryStatsInfoLookup.deserialize(reader)
            elemental_stats = CharacterElementalStats.deserialize(reader)
            result = CharacterStatsInfoLookup(hp=hp, max_hp=max_hp, tp=tp, max_tp=max_tp, base_stats=base_stats, secondary_stats=secondary_stats, elemental_stats=elemental_stats)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"CharacterStatsInfoLookup(byte_size={repr(self._byte_size)}, hp={repr(self._hp)}, max_hp={repr(self._max_hp)}, tp={repr(self._tp)}, max_tp={repr(self._max_tp)}, base_stats={repr(self._base_stats)}, secondary_stats={repr(self._secondary_stats)}, elemental_stats={repr(self._elemental_stats)})"

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.

hp: int property

max_hp: int property

tp: int property

max_tp: int property

base_stats: CharacterBaseStats property

secondary_stats: CharacterSecondaryStatsInfoLookup property

elemental_stats: CharacterElementalStats property

__init__(*, hp, max_hp, tp, max_tp, base_stats, secondary_stats, elemental_stats)

Create a new instance of CharacterStatsInfoLookup.

Parameters:

Name Type Description Default
hp int

(Value range is 0-64008.)

required
max_hp int

(Value range is 0-64008.)

required
tp int

(Value range is 0-64008.)

required
max_tp int

(Value range is 0-64008.)

required
base_stats CharacterBaseStats
required
secondary_stats CharacterSecondaryStatsInfoLookup
required
elemental_stats CharacterElementalStats
required
Source code in src/eolib/protocol/_generated/net/server/character_stats_info_lookup.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
def __init__(self, *, hp: int, max_hp: int, tp: int, max_tp: int, base_stats: CharacterBaseStats, secondary_stats: CharacterSecondaryStatsInfoLookup, elemental_stats: CharacterElementalStats):
    """
    Create a new instance of CharacterStatsInfoLookup.

    Args:
        hp (int): (Value range is 0-64008.)
        max_hp (int): (Value range is 0-64008.)
        tp (int): (Value range is 0-64008.)
        max_tp (int): (Value range is 0-64008.)
        base_stats (CharacterBaseStats): 
        secondary_stats (CharacterSecondaryStatsInfoLookup): 
        elemental_stats (CharacterElementalStats): 
    """
    self._hp = hp
    self._max_hp = max_hp
    self._tp = tp
    self._max_tp = max_tp
    self._base_stats = base_stats
    self._secondary_stats = secondary_stats
    self._elemental_stats = elemental_stats

serialize(writer, data) staticmethod

Serializes an instance of CharacterStatsInfoLookup to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data CharacterStatsInfoLookup

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/character_stats_info_lookup.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "CharacterStatsInfoLookup") -> None:
    """
    Serializes an instance of `CharacterStatsInfoLookup` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (CharacterStatsInfoLookup): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._hp is None:
            raise SerializationError("hp must be provided.")
        writer.add_short(data._hp)
        if data._max_hp is None:
            raise SerializationError("max_hp must be provided.")
        writer.add_short(data._max_hp)
        if data._tp is None:
            raise SerializationError("tp must be provided.")
        writer.add_short(data._tp)
        if data._max_tp is None:
            raise SerializationError("max_tp must be provided.")
        writer.add_short(data._max_tp)
        if data._base_stats is None:
            raise SerializationError("base_stats must be provided.")
        CharacterBaseStats.serialize(writer, data._base_stats)
        if data._secondary_stats is None:
            raise SerializationError("secondary_stats must be provided.")
        CharacterSecondaryStatsInfoLookup.serialize(writer, data._secondary_stats)
        if data._elemental_stats is None:
            raise SerializationError("elemental_stats must be provided.")
        CharacterElementalStats.serialize(writer, data._elemental_stats)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of CharacterStatsInfoLookup 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
CharacterStatsInfoLookup CharacterStatsInfoLookup

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/character_stats_info_lookup.py
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
@staticmethod
def deserialize(reader: EoReader) -> "CharacterStatsInfoLookup":
    """
    Deserializes an instance of `CharacterStatsInfoLookup` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        CharacterStatsInfoLookup: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        hp = reader.get_short()
        max_hp = reader.get_short()
        tp = reader.get_short()
        max_tp = reader.get_short()
        base_stats = CharacterBaseStats.deserialize(reader)
        secondary_stats = CharacterSecondaryStatsInfoLookup.deserialize(reader)
        elemental_stats = CharacterElementalStats.deserialize(reader)
        result = CharacterStatsInfoLookup(hp=hp, max_hp=max_hp, tp=tp, max_tp=max_tp, base_stats=base_stats, secondary_stats=secondary_stats, elemental_stats=elemental_stats)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

BigCoords

Map coordinates with 2-byte values

Source code in src/eolib/protocol/_generated/net/server/big_coords.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
class BigCoords:
    """
    Map coordinates with 2-byte values
    """
    _byte_size: int = 0
    _x: int
    _y: int

    def __init__(self, *, x: int, y: int):
        """
        Create a new instance of BigCoords.

        Args:
            x (int): (Value range is 0-64008.)
            y (int): (Value range is 0-64008.)
        """
        self._x = x
        self._y = y

    @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 x(self) -> int:
        return self._x

    @property
    def y(self) -> int:
        return self._y

    @staticmethod
    def serialize(writer: EoWriter, data: "BigCoords") -> None:
        """
        Serializes an instance of `BigCoords` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (BigCoords): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._x is None:
                raise SerializationError("x must be provided.")
            writer.add_short(data._x)
            if data._y is None:
                raise SerializationError("y must be provided.")
            writer.add_short(data._y)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "BigCoords":
        """
        Deserializes an instance of `BigCoords` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            BigCoords: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            x = reader.get_short()
            y = reader.get_short()
            result = BigCoords(x=x, y=y)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"BigCoords(byte_size={repr(self._byte_size)}, x={repr(self._x)}, y={repr(self._y)})"

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.

x: int property

y: int property

__init__(*, x, y)

Create a new instance of BigCoords.

Parameters:

Name Type Description Default
x int

(Value range is 0-64008.)

required
y int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/big_coords.py
18
19
20
21
22
23
24
25
26
27
def __init__(self, *, x: int, y: int):
    """
    Create a new instance of BigCoords.

    Args:
        x (int): (Value range is 0-64008.)
        y (int): (Value range is 0-64008.)
    """
    self._x = x
    self._y = y

serialize(writer, data) staticmethod

Serializes an instance of BigCoords to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data BigCoords

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/big_coords.py
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@staticmethod
def serialize(writer: EoWriter, data: "BigCoords") -> None:
    """
    Serializes an instance of `BigCoords` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (BigCoords): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._x is None:
            raise SerializationError("x must be provided.")
        writer.add_short(data._x)
        if data._y is None:
            raise SerializationError("y must be provided.")
        writer.add_short(data._y)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of BigCoords 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
BigCoords BigCoords

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/big_coords.py
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def deserialize(reader: EoReader) -> "BigCoords":
    """
    Deserializes an instance of `BigCoords` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        BigCoords: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        x = reader.get_short()
        y = reader.get_short()
        result = BigCoords(x=x, y=y)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

AdminInteractTellServerPacket

Bases: Packet

Admin character info lookup

Source code in src/eolib/protocol/_generated/net/server/admin_interact_tell_server_packet.py
 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
class AdminInteractTellServerPacket(Packet):
    """
    Admin character info lookup
    """
    _byte_size: int = 0
    _name: str
    _usage: int
    _gold_bank: int
    _exp: int
    _level: int
    _map_id: int
    _map_coords: BigCoords
    _stats: CharacterStatsInfoLookup
    _weight: Weight

    def __init__(self, *, name: str, usage: int, gold_bank: int, exp: int, level: int, map_id: int, map_coords: BigCoords, stats: CharacterStatsInfoLookup, weight: Weight):
        """
        Create a new instance of AdminInteractTellServerPacket.

        Args:
            name (str): 
            usage (int): (Value range is 0-4097152080.)
            gold_bank (int): (Value range is 0-4097152080.)
            exp (int): (Value range is 0-4097152080.)
            level (int): (Value range is 0-252.)
            map_id (int): (Value range is 0-64008.)
            map_coords (BigCoords): 
            stats (CharacterStatsInfoLookup): 
            weight (Weight): 
        """
        self._name = name
        self._usage = usage
        self._gold_bank = gold_bank
        self._exp = exp
        self._level = level
        self._map_id = map_id
        self._map_coords = map_coords
        self._stats = stats
        self._weight = weight

    @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 name(self) -> str:
        return self._name

    @property
    def usage(self) -> int:
        return self._usage

    @property
    def gold_bank(self) -> int:
        return self._gold_bank

    @property
    def exp(self) -> int:
        return self._exp

    @property
    def level(self) -> int:
        return self._level

    @property
    def map_id(self) -> int:
        return self._map_id

    @property
    def map_coords(self) -> BigCoords:
        return self._map_coords

    @property
    def stats(self) -> CharacterStatsInfoLookup:
        return self._stats

    @property
    def weight(self) -> Weight:
        return self._weight

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.AdminInteract

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Tell

    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.
        """
        AdminInteractTellServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "AdminInteractTellServerPacket") -> None:
        """
        Serializes an instance of `AdminInteractTellServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AdminInteractTellServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._name is None:
                raise SerializationError("name must be provided.")
            writer.add_string(data._name)
            writer.add_byte(0xFF)
            if data._usage is None:
                raise SerializationError("usage must be provided.")
            writer.add_int(data._usage)
            writer.add_byte(0xFF)
            if data._gold_bank is None:
                raise SerializationError("gold_bank must be provided.")
            writer.add_int(data._gold_bank)
            writer.add_byte(0xFF)
            if data._exp is None:
                raise SerializationError("exp must be provided.")
            writer.add_int(data._exp)
            if data._level is None:
                raise SerializationError("level must be provided.")
            writer.add_char(data._level)
            if data._map_id is None:
                raise SerializationError("map_id must be provided.")
            writer.add_short(data._map_id)
            if data._map_coords is None:
                raise SerializationError("map_coords must be provided.")
            BigCoords.serialize(writer, data._map_coords)
            if data._stats is None:
                raise SerializationError("stats must be provided.")
            CharacterStatsInfoLookup.serialize(writer, data._stats)
            if data._weight is None:
                raise SerializationError("weight must be provided.")
            Weight.serialize(writer, data._weight)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "AdminInteractTellServerPacket":
        """
        Deserializes an instance of `AdminInteractTellServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            AdminInteractTellServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            name = reader.get_string()
            reader.next_chunk()
            usage = reader.get_int()
            reader.next_chunk()
            gold_bank = reader.get_int()
            reader.next_chunk()
            exp = reader.get_int()
            level = reader.get_char()
            map_id = reader.get_short()
            map_coords = BigCoords.deserialize(reader)
            stats = CharacterStatsInfoLookup.deserialize(reader)
            weight = Weight.deserialize(reader)
            reader.chunked_reading_mode = False
            result = AdminInteractTellServerPacket(name=name, usage=usage, gold_bank=gold_bank, exp=exp, level=level, map_id=map_id, map_coords=map_coords, stats=stats, weight=weight)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"AdminInteractTellServerPacket(byte_size={repr(self._byte_size)}, name={repr(self._name)}, usage={repr(self._usage)}, gold_bank={repr(self._gold_bank)}, exp={repr(self._exp)}, level={repr(self._level)}, map_id={repr(self._map_id)}, map_coords={repr(self._map_coords)}, stats={repr(self._stats)}, weight={repr(self._weight)})"

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.

name: str property

usage: int property

gold_bank: int property

exp: int property

level: int property

map_id: int property

map_coords: BigCoords property

stats: CharacterStatsInfoLookup property

weight: Weight property

__init__(*, name, usage, gold_bank, exp, level, map_id, map_coords, stats, weight)

Create a new instance of AdminInteractTellServerPacket.

Parameters:

Name Type Description Default
name str
required
usage int

(Value range is 0-4097152080.)

required
gold_bank int

(Value range is 0-4097152080.)

required
exp int

(Value range is 0-4097152080.)

required
level int

(Value range is 0-252.)

required
map_id int

(Value range is 0-64008.)

required
map_coords BigCoords
required
stats CharacterStatsInfoLookup
required
weight Weight
required
Source code in src/eolib/protocol/_generated/net/server/admin_interact_tell_server_packet.py
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
def __init__(self, *, name: str, usage: int, gold_bank: int, exp: int, level: int, map_id: int, map_coords: BigCoords, stats: CharacterStatsInfoLookup, weight: Weight):
    """
    Create a new instance of AdminInteractTellServerPacket.

    Args:
        name (str): 
        usage (int): (Value range is 0-4097152080.)
        gold_bank (int): (Value range is 0-4097152080.)
        exp (int): (Value range is 0-4097152080.)
        level (int): (Value range is 0-252.)
        map_id (int): (Value range is 0-64008.)
        map_coords (BigCoords): 
        stats (CharacterStatsInfoLookup): 
        weight (Weight): 
    """
    self._name = name
    self._usage = usage
    self._gold_bank = gold_bank
    self._exp = exp
    self._level = level
    self._map_id = map_id
    self._map_coords = map_coords
    self._stats = stats
    self._weight = weight

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/admin_interact_tell_server_packet.py
102
103
104
105
106
107
108
109
110
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.AdminInteract

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/admin_interact_tell_server_packet.py
112
113
114
115
116
117
118
119
120
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Tell

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/admin_interact_tell_server_packet.py
122
123
124
125
126
127
128
129
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.
    """
    AdminInteractTellServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of AdminInteractTellServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data AdminInteractTellServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/admin_interact_tell_server_packet.py
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
@staticmethod
def serialize(writer: EoWriter, data: "AdminInteractTellServerPacket") -> None:
    """
    Serializes an instance of `AdminInteractTellServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AdminInteractTellServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._name is None:
            raise SerializationError("name must be provided.")
        writer.add_string(data._name)
        writer.add_byte(0xFF)
        if data._usage is None:
            raise SerializationError("usage must be provided.")
        writer.add_int(data._usage)
        writer.add_byte(0xFF)
        if data._gold_bank is None:
            raise SerializationError("gold_bank must be provided.")
        writer.add_int(data._gold_bank)
        writer.add_byte(0xFF)
        if data._exp is None:
            raise SerializationError("exp must be provided.")
        writer.add_int(data._exp)
        if data._level is None:
            raise SerializationError("level must be provided.")
        writer.add_char(data._level)
        if data._map_id is None:
            raise SerializationError("map_id must be provided.")
        writer.add_short(data._map_id)
        if data._map_coords is None:
            raise SerializationError("map_coords must be provided.")
        BigCoords.serialize(writer, data._map_coords)
        if data._stats is None:
            raise SerializationError("stats must be provided.")
        CharacterStatsInfoLookup.serialize(writer, data._stats)
        if data._weight is None:
            raise SerializationError("weight must be provided.")
        Weight.serialize(writer, data._weight)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AdminInteractTellServerPacket 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
AdminInteractTellServerPacket AdminInteractTellServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/admin_interact_tell_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "AdminInteractTellServerPacket":
    """
    Deserializes an instance of `AdminInteractTellServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        AdminInteractTellServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        name = reader.get_string()
        reader.next_chunk()
        usage = reader.get_int()
        reader.next_chunk()
        gold_bank = reader.get_int()
        reader.next_chunk()
        exp = reader.get_int()
        level = reader.get_char()
        map_id = reader.get_short()
        map_coords = BigCoords.deserialize(reader)
        stats = CharacterStatsInfoLookup.deserialize(reader)
        weight = Weight.deserialize(reader)
        reader.chunked_reading_mode = False
        result = AdminInteractTellServerPacket(name=name, usage=usage, gold_bank=gold_bank, exp=exp, level=level, map_id=map_id, map_coords=map_coords, stats=stats, weight=weight)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

AdminMessageType

Bases: IntEnum

Type of message sent to admins via the Help menu

Source code in src/eolib/protocol/_generated/net/server/admin_message_type.py
 9
10
11
12
13
14
class AdminMessageType(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Type of message sent to admins via the Help menu
    """
    Message = 1
    Report = 2

Message = 1 class-attribute instance-attribute

Report = 2 class-attribute instance-attribute

AdminInteractReplyServerPacket

Bases: Packet

Incoming admin message

Source code in src/eolib/protocol/_generated/net/server/admin_interact_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
class AdminInteractReplyServerPacket(Packet):
    """
    Incoming admin message
    """
    _byte_size: int = 0
    _message_type: AdminMessageType
    _message_type_data: 'AdminInteractReplyServerPacket.MessageTypeData'

    def __init__(self, *, message_type: AdminMessageType, message_type_data: 'AdminInteractReplyServerPacket.MessageTypeData' = None):
        """
        Create a new instance of AdminInteractReplyServerPacket.

        Args:
            message_type (AdminMessageType): 
            message_type_data (AdminInteractReplyServerPacket.MessageTypeData): Data associated with the `message_type` field.
        """
        self._message_type = message_type
        self._message_type_data = message_type_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 message_type(self) -> AdminMessageType:
        return self._message_type

    @property
    def message_type_data(self) -> 'AdminInteractReplyServerPacket.MessageTypeData':
        """
        AdminInteractReplyServerPacket.MessageTypeData: Data associated with the `message_type` field.
        """
        return self._message_type_data

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.AdminInteract

    @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.
        """
        AdminInteractReplyServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "AdminInteractReplyServerPacket") -> None:
        """
        Serializes an instance of `AdminInteractReplyServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AdminInteractReplyServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._message_type is None:
                raise SerializationError("message_type must be provided.")
            writer.add_char(int(data._message_type))
            writer.add_byte(0xFF)
            if data._message_type == AdminMessageType.Message:
                if not isinstance(data._message_type_data, AdminInteractReplyServerPacket.MessageTypeDataMessage):
                    raise SerializationError("Expected message_type_data to be type AdminInteractReplyServerPacket.MessageTypeDataMessage for message_type " + AdminMessageType(data._message_type).name + ".")
                AdminInteractReplyServerPacket.MessageTypeDataMessage.serialize(writer, data._message_type_data)
            elif data._message_type == AdminMessageType.Report:
                if not isinstance(data._message_type_data, AdminInteractReplyServerPacket.MessageTypeDataReport):
                    raise SerializationError("Expected message_type_data to be type AdminInteractReplyServerPacket.MessageTypeDataReport for message_type " + AdminMessageType(data._message_type).name + ".")
                AdminInteractReplyServerPacket.MessageTypeDataReport.serialize(writer, data._message_type_data)
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "AdminInteractReplyServerPacket":
        """
        Deserializes an instance of `AdminInteractReplyServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            AdminInteractReplyServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            message_type = AdminMessageType(reader.get_char())
            reader.next_chunk()
            message_type_data: AdminInteractReplyServerPacket.MessageTypeData = None
            if message_type == AdminMessageType.Message:
                message_type_data = AdminInteractReplyServerPacket.MessageTypeDataMessage.deserialize(reader)
            elif message_type == AdminMessageType.Report:
                message_type_data = AdminInteractReplyServerPacket.MessageTypeDataReport.deserialize(reader)
            reader.chunked_reading_mode = False
            result = AdminInteractReplyServerPacket(message_type=message_type, message_type_data=message_type_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"AdminInteractReplyServerPacket(byte_size={repr(self._byte_size)}, message_type={repr(self._message_type)}, message_type_data={repr(self._message_type_data)})"

    MessageTypeData = Union['AdminInteractReplyServerPacket.MessageTypeDataMessage', 'AdminInteractReplyServerPacket.MessageTypeDataReport', None]
    """
    Data associated with different values of the `message_type` field.
    """

    class MessageTypeDataMessage:
        """
        Data associated with message_type value AdminMessageType.Message
        """
        _byte_size: int = 0
        _player_name: str
        _message: str

        def __init__(self, *, player_name: str, message: str):
            """
            Create a new instance of AdminInteractReplyServerPacket.MessageTypeDataMessage.

            Args:
                player_name (str): 
                message (str): 
            """
            self._player_name = player_name
            self._message = message

        @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 player_name(self) -> str:
            return self._player_name

        @property
        def message(self) -> str:
            return self._message

        @staticmethod
        def serialize(writer: EoWriter, data: "AdminInteractReplyServerPacket.MessageTypeDataMessage") -> None:
            """
            Serializes an instance of `AdminInteractReplyServerPacket.MessageTypeDataMessage` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (AdminInteractReplyServerPacket.MessageTypeDataMessage): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._player_name is None:
                    raise SerializationError("player_name must be provided.")
                writer.add_string(data._player_name)
                writer.add_byte(0xFF)
                if data._message is None:
                    raise SerializationError("message must be provided.")
                writer.add_string(data._message)
                writer.add_byte(0xFF)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "AdminInteractReplyServerPacket.MessageTypeDataMessage":
            """
            Deserializes an instance of `AdminInteractReplyServerPacket.MessageTypeDataMessage` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                AdminInteractReplyServerPacket.MessageTypeDataMessage: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                player_name = reader.get_string()
                reader.next_chunk()
                message = reader.get_string()
                reader.next_chunk()
                result = AdminInteractReplyServerPacket.MessageTypeDataMessage(player_name=player_name, message=message)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"AdminInteractReplyServerPacket.MessageTypeDataMessage(byte_size={repr(self._byte_size)}, player_name={repr(self._player_name)}, message={repr(self._message)})"

    class MessageTypeDataReport:
        """
        Data associated with message_type value AdminMessageType.Report
        """
        _byte_size: int = 0
        _player_name: str
        _message: str
        _reportee_name: str

        def __init__(self, *, player_name: str, message: str, reportee_name: str):
            """
            Create a new instance of AdminInteractReplyServerPacket.MessageTypeDataReport.

            Args:
                player_name (str): 
                message (str): 
                reportee_name (str): 
            """
            self._player_name = player_name
            self._message = message
            self._reportee_name = reportee_name

        @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 player_name(self) -> str:
            return self._player_name

        @property
        def message(self) -> str:
            return self._message

        @property
        def reportee_name(self) -> str:
            return self._reportee_name

        @staticmethod
        def serialize(writer: EoWriter, data: "AdminInteractReplyServerPacket.MessageTypeDataReport") -> None:
            """
            Serializes an instance of `AdminInteractReplyServerPacket.MessageTypeDataReport` to the provided `EoWriter`.

            Args:
                writer (EoWriter): The writer that the data will be serialized to.
                data (AdminInteractReplyServerPacket.MessageTypeDataReport): The data to serialize.
            """
            old_string_sanitization_mode: bool = writer.string_sanitization_mode
            try:
                if data._player_name is None:
                    raise SerializationError("player_name must be provided.")
                writer.add_string(data._player_name)
                writer.add_byte(0xFF)
                if data._message is None:
                    raise SerializationError("message must be provided.")
                writer.add_string(data._message)
                writer.add_byte(0xFF)
                if data._reportee_name is None:
                    raise SerializationError("reportee_name must be provided.")
                writer.add_string(data._reportee_name)
                writer.add_byte(0xFF)
            finally:
                writer.string_sanitization_mode = old_string_sanitization_mode

        @staticmethod
        def deserialize(reader: EoReader) -> "AdminInteractReplyServerPacket.MessageTypeDataReport":
            """
            Deserializes an instance of `AdminInteractReplyServerPacket.MessageTypeDataReport` from the provided `EoReader`.

            Args:
                reader (EoReader): The writer that the data will be serialized to.

            Returns:
                AdminInteractReplyServerPacket.MessageTypeDataReport: The data to serialize.
            """
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                player_name = reader.get_string()
                reader.next_chunk()
                message = reader.get_string()
                reader.next_chunk()
                reportee_name = reader.get_string()
                reader.next_chunk()
                result = AdminInteractReplyServerPacket.MessageTypeDataReport(player_name=player_name, message=message, reportee_name=reportee_name)
                result._byte_size = reader.position - reader_start_position
                return result
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"AdminInteractReplyServerPacket.MessageTypeDataReport(byte_size={repr(self._byte_size)}, player_name={repr(self._player_name)}, message={repr(self._message)}, reportee_name={repr(self._reportee_name)})"

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.

message_type: AdminMessageType property

message_type_data: AdminInteractReplyServerPacket.MessageTypeData property

AdminInteractReplyServerPacket.MessageTypeData: Data associated with the message_type field.

MessageTypeData = Union['AdminInteractReplyServerPacket.MessageTypeDataMessage', 'AdminInteractReplyServerPacket.MessageTypeDataReport', None] class-attribute instance-attribute

Data associated with different values of the message_type field.

MessageTypeDataMessage

Data associated with message_type value AdminMessageType.Message

Source code in src/eolib/protocol/_generated/net/server/admin_interact_reply_server_packet.py
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
class MessageTypeDataMessage:
    """
    Data associated with message_type value AdminMessageType.Message
    """
    _byte_size: int = 0
    _player_name: str
    _message: str

    def __init__(self, *, player_name: str, message: str):
        """
        Create a new instance of AdminInteractReplyServerPacket.MessageTypeDataMessage.

        Args:
            player_name (str): 
            message (str): 
        """
        self._player_name = player_name
        self._message = message

    @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 player_name(self) -> str:
        return self._player_name

    @property
    def message(self) -> str:
        return self._message

    @staticmethod
    def serialize(writer: EoWriter, data: "AdminInteractReplyServerPacket.MessageTypeDataMessage") -> None:
        """
        Serializes an instance of `AdminInteractReplyServerPacket.MessageTypeDataMessage` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AdminInteractReplyServerPacket.MessageTypeDataMessage): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_name is None:
                raise SerializationError("player_name must be provided.")
            writer.add_string(data._player_name)
            writer.add_byte(0xFF)
            if data._message is None:
                raise SerializationError("message must be provided.")
            writer.add_string(data._message)
            writer.add_byte(0xFF)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "AdminInteractReplyServerPacket.MessageTypeDataMessage":
        """
        Deserializes an instance of `AdminInteractReplyServerPacket.MessageTypeDataMessage` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            AdminInteractReplyServerPacket.MessageTypeDataMessage: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_name = reader.get_string()
            reader.next_chunk()
            message = reader.get_string()
            reader.next_chunk()
            result = AdminInteractReplyServerPacket.MessageTypeDataMessage(player_name=player_name, message=message)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"AdminInteractReplyServerPacket.MessageTypeDataMessage(byte_size={repr(self._byte_size)}, player_name={repr(self._player_name)}, message={repr(self._message)})"

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.

player_name: str property

message: str property

__init__(*, player_name, message)

Create a new instance of AdminInteractReplyServerPacket.MessageTypeDataMessage.

Parameters:

Name Type Description Default
player_name str
required
message str
required
Source code in src/eolib/protocol/_generated/net/server/admin_interact_reply_server_packet.py
157
158
159
160
161
162
163
164
165
166
def __init__(self, *, player_name: str, message: str):
    """
    Create a new instance of AdminInteractReplyServerPacket.MessageTypeDataMessage.

    Args:
        player_name (str): 
        message (str): 
    """
    self._player_name = player_name
    self._message = message

serialize(writer, data) staticmethod

Serializes an instance of AdminInteractReplyServerPacket.MessageTypeDataMessage to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data MessageTypeDataMessage

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/admin_interact_reply_server_packet.py
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
@staticmethod
def serialize(writer: EoWriter, data: "AdminInteractReplyServerPacket.MessageTypeDataMessage") -> None:
    """
    Serializes an instance of `AdminInteractReplyServerPacket.MessageTypeDataMessage` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AdminInteractReplyServerPacket.MessageTypeDataMessage): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_name is None:
            raise SerializationError("player_name must be provided.")
        writer.add_string(data._player_name)
        writer.add_byte(0xFF)
        if data._message is None:
            raise SerializationError("message must be provided.")
        writer.add_string(data._message)
        writer.add_byte(0xFF)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AdminInteractReplyServerPacket.MessageTypeDataMessage from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
MessageTypeDataMessage

AdminInteractReplyServerPacket.MessageTypeDataMessage: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/admin_interact_reply_server_packet.py
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
@staticmethod
def deserialize(reader: EoReader) -> "AdminInteractReplyServerPacket.MessageTypeDataMessage":
    """
    Deserializes an instance of `AdminInteractReplyServerPacket.MessageTypeDataMessage` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        AdminInteractReplyServerPacket.MessageTypeDataMessage: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_name = reader.get_string()
        reader.next_chunk()
        message = reader.get_string()
        reader.next_chunk()
        result = AdminInteractReplyServerPacket.MessageTypeDataMessage(player_name=player_name, message=message)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

MessageTypeDataReport

Data associated with message_type value AdminMessageType.Report

Source code in src/eolib/protocol/_generated/net/server/admin_interact_reply_server_packet.py
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
class MessageTypeDataReport:
    """
    Data associated with message_type value AdminMessageType.Report
    """
    _byte_size: int = 0
    _player_name: str
    _message: str
    _reportee_name: str

    def __init__(self, *, player_name: str, message: str, reportee_name: str):
        """
        Create a new instance of AdminInteractReplyServerPacket.MessageTypeDataReport.

        Args:
            player_name (str): 
            message (str): 
            reportee_name (str): 
        """
        self._player_name = player_name
        self._message = message
        self._reportee_name = reportee_name

    @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 player_name(self) -> str:
        return self._player_name

    @property
    def message(self) -> str:
        return self._message

    @property
    def reportee_name(self) -> str:
        return self._reportee_name

    @staticmethod
    def serialize(writer: EoWriter, data: "AdminInteractReplyServerPacket.MessageTypeDataReport") -> None:
        """
        Serializes an instance of `AdminInteractReplyServerPacket.MessageTypeDataReport` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AdminInteractReplyServerPacket.MessageTypeDataReport): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_name is None:
                raise SerializationError("player_name must be provided.")
            writer.add_string(data._player_name)
            writer.add_byte(0xFF)
            if data._message is None:
                raise SerializationError("message must be provided.")
            writer.add_string(data._message)
            writer.add_byte(0xFF)
            if data._reportee_name is None:
                raise SerializationError("reportee_name must be provided.")
            writer.add_string(data._reportee_name)
            writer.add_byte(0xFF)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "AdminInteractReplyServerPacket.MessageTypeDataReport":
        """
        Deserializes an instance of `AdminInteractReplyServerPacket.MessageTypeDataReport` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            AdminInteractReplyServerPacket.MessageTypeDataReport: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_name = reader.get_string()
            reader.next_chunk()
            message = reader.get_string()
            reader.next_chunk()
            reportee_name = reader.get_string()
            reader.next_chunk()
            result = AdminInteractReplyServerPacket.MessageTypeDataReport(player_name=player_name, message=message, reportee_name=reportee_name)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"AdminInteractReplyServerPacket.MessageTypeDataReport(byte_size={repr(self._byte_size)}, player_name={repr(self._player_name)}, message={repr(self._message)}, reportee_name={repr(self._reportee_name)})"

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.

player_name: str property

message: str property

reportee_name: str property

__init__(*, player_name, message, reportee_name)

Create a new instance of AdminInteractReplyServerPacket.MessageTypeDataReport.

Parameters:

Name Type Description Default
player_name str
required
message str
required
reportee_name str
required
Source code in src/eolib/protocol/_generated/net/server/admin_interact_reply_server_packet.py
244
245
246
247
248
249
250
251
252
253
254
255
def __init__(self, *, player_name: str, message: str, reportee_name: str):
    """
    Create a new instance of AdminInteractReplyServerPacket.MessageTypeDataReport.

    Args:
        player_name (str): 
        message (str): 
        reportee_name (str): 
    """
    self._player_name = player_name
    self._message = message
    self._reportee_name = reportee_name

serialize(writer, data) staticmethod

Serializes an instance of AdminInteractReplyServerPacket.MessageTypeDataReport to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data MessageTypeDataReport

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/admin_interact_reply_server_packet.py
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
@staticmethod
def serialize(writer: EoWriter, data: "AdminInteractReplyServerPacket.MessageTypeDataReport") -> None:
    """
    Serializes an instance of `AdminInteractReplyServerPacket.MessageTypeDataReport` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AdminInteractReplyServerPacket.MessageTypeDataReport): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_name is None:
            raise SerializationError("player_name must be provided.")
        writer.add_string(data._player_name)
        writer.add_byte(0xFF)
        if data._message is None:
            raise SerializationError("message must be provided.")
        writer.add_string(data._message)
        writer.add_byte(0xFF)
        if data._reportee_name is None:
            raise SerializationError("reportee_name must be provided.")
        writer.add_string(data._reportee_name)
        writer.add_byte(0xFF)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AdminInteractReplyServerPacket.MessageTypeDataReport from the provided EoReader.

Parameters:

Name Type Description Default
reader EoReader

The writer that the data will be serialized to.

required

Returns:

Type Description
MessageTypeDataReport

AdminInteractReplyServerPacket.MessageTypeDataReport: The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/admin_interact_reply_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "AdminInteractReplyServerPacket.MessageTypeDataReport":
    """
    Deserializes an instance of `AdminInteractReplyServerPacket.MessageTypeDataReport` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        AdminInteractReplyServerPacket.MessageTypeDataReport: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_name = reader.get_string()
        reader.next_chunk()
        message = reader.get_string()
        reader.next_chunk()
        reportee_name = reader.get_string()
        reader.next_chunk()
        result = AdminInteractReplyServerPacket.MessageTypeDataReport(player_name=player_name, message=message, reportee_name=reportee_name)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

__init__(*, message_type, message_type_data=None)

Create a new instance of AdminInteractReplyServerPacket.

Parameters:

Name Type Description Default
message_type AdminMessageType
required
message_type_data MessageTypeData

Data associated with the message_type field.

None
Source code in src/eolib/protocol/_generated/net/server/admin_interact_reply_server_packet.py
23
24
25
26
27
28
29
30
31
32
def __init__(self, *, message_type: AdminMessageType, message_type_data: 'AdminInteractReplyServerPacket.MessageTypeData' = None):
    """
    Create a new instance of AdminInteractReplyServerPacket.

    Args:
        message_type (AdminMessageType): 
        message_type_data (AdminInteractReplyServerPacket.MessageTypeData): Data associated with the `message_type` field.
    """
    self._message_type = message_type
    self._message_type_data = message_type_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/admin_interact_reply_server_packet.py
55
56
57
58
59
60
61
62
63
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.AdminInteract

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/admin_interact_reply_server_packet.py
65
66
67
68
69
70
71
72
73
@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/admin_interact_reply_server_packet.py
75
76
77
78
79
80
81
82
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.
    """
    AdminInteractReplyServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of AdminInteractReplyServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data AdminInteractReplyServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/admin_interact_reply_server_packet.py
 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
@staticmethod
def serialize(writer: EoWriter, data: "AdminInteractReplyServerPacket") -> None:
    """
    Serializes an instance of `AdminInteractReplyServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AdminInteractReplyServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._message_type is None:
            raise SerializationError("message_type must be provided.")
        writer.add_char(int(data._message_type))
        writer.add_byte(0xFF)
        if data._message_type == AdminMessageType.Message:
            if not isinstance(data._message_type_data, AdminInteractReplyServerPacket.MessageTypeDataMessage):
                raise SerializationError("Expected message_type_data to be type AdminInteractReplyServerPacket.MessageTypeDataMessage for message_type " + AdminMessageType(data._message_type).name + ".")
            AdminInteractReplyServerPacket.MessageTypeDataMessage.serialize(writer, data._message_type_data)
        elif data._message_type == AdminMessageType.Report:
            if not isinstance(data._message_type_data, AdminInteractReplyServerPacket.MessageTypeDataReport):
                raise SerializationError("Expected message_type_data to be type AdminInteractReplyServerPacket.MessageTypeDataReport for message_type " + AdminMessageType(data._message_type).name + ".")
            AdminInteractReplyServerPacket.MessageTypeDataReport.serialize(writer, data._message_type_data)
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AdminInteractReplyServerPacket 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
AdminInteractReplyServerPacket AdminInteractReplyServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/admin_interact_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
138
139
@staticmethod
def deserialize(reader: EoReader) -> "AdminInteractReplyServerPacket":
    """
    Deserializes an instance of `AdminInteractReplyServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        AdminInteractReplyServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        message_type = AdminMessageType(reader.get_char())
        reader.next_chunk()
        message_type_data: AdminInteractReplyServerPacket.MessageTypeData = None
        if message_type == AdminMessageType.Message:
            message_type_data = AdminInteractReplyServerPacket.MessageTypeDataMessage.deserialize(reader)
        elif message_type == AdminMessageType.Report:
            message_type_data = AdminInteractReplyServerPacket.MessageTypeDataReport.deserialize(reader)
        reader.chunked_reading_mode = False
        result = AdminInteractReplyServerPacket(message_type=message_type, message_type_data=message_type_data)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

AdminInteractRemoveServerPacket

Bases: Packet

Nearby player disappearing (admin hide)

Source code in src/eolib/protocol/_generated/net/server/admin_interact_remove_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class AdminInteractRemoveServerPacket(Packet):
    """
    Nearby player disappearing (admin hide)
    """
    _byte_size: int = 0
    _player_id: int

    def __init__(self, *, player_id: int):
        """
        Create a new instance of AdminInteractRemoveServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
        """
        self._player_id = player_id

    @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 player_id(self) -> int:
        return self._player_id

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.AdminInteract

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Remove

    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.
        """
        AdminInteractRemoveServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "AdminInteractRemoveServerPacket") -> None:
        """
        Serializes an instance of `AdminInteractRemoveServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AdminInteractRemoveServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "AdminInteractRemoveServerPacket":
        """
        Deserializes an instance of `AdminInteractRemoveServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            AdminInteractRemoveServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            result = AdminInteractRemoveServerPacket(player_id=player_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"AdminInteractRemoveServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)})"

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.

player_id: int property

__init__(*, player_id)

Create a new instance of AdminInteractRemoveServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/admin_interact_remove_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, player_id: int):
    """
    Create a new instance of AdminInteractRemoveServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
    """
    self._player_id = player_id

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/admin_interact_remove_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.AdminInteract

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/admin_interact_remove_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Remove

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/admin_interact_remove_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    AdminInteractRemoveServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of AdminInteractRemoveServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data AdminInteractRemoveServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/admin_interact_remove_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "AdminInteractRemoveServerPacket") -> None:
    """
    Serializes an instance of `AdminInteractRemoveServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AdminInteractRemoveServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AdminInteractRemoveServerPacket 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
AdminInteractRemoveServerPacket AdminInteractRemoveServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/admin_interact_remove_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "AdminInteractRemoveServerPacket":
    """
    Deserializes an instance of `AdminInteractRemoveServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        AdminInteractRemoveServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        result = AdminInteractRemoveServerPacket(player_id=player_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

Item

An item reference with a 4-byte amount

Source code in src/eolib/protocol/_generated/net/item.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
class Item:
    """
    An item reference with a 4-byte amount
    """
    _byte_size: int = 0
    _id: int
    _amount: int

    def __init__(self, *, id: int, amount: int):
        """
        Create a new instance of Item.

        Args:
            id (int): (Value range is 0-64008.)
            amount (int): (Value range is 0-4097152080.)
        """
        self._id = id
        self._amount = amount

    @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 id(self) -> int:
        return self._id

    @property
    def amount(self) -> int:
        return self._amount

    @staticmethod
    def serialize(writer: EoWriter, data: "Item") -> None:
        """
        Serializes an instance of `Item` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (Item): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._id is None:
                raise SerializationError("id must be provided.")
            writer.add_short(data._id)
            if data._amount is None:
                raise SerializationError("amount must be provided.")
            writer.add_int(data._amount)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "Item":
        """
        Deserializes an instance of `Item` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            Item: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            id = reader.get_short()
            amount = reader.get_int()
            result = Item(id=id, amount=amount)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"Item(byte_size={repr(self._byte_size)}, id={repr(self._id)}, amount={repr(self._amount)})"

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.

id: int property

amount: int property

__init__(*, id, amount)

Create a new instance of Item.

Parameters:

Name Type Description Default
id int

(Value range is 0-64008.)

required
amount int

(Value range is 0-4097152080.)

required
Source code in src/eolib/protocol/_generated/net/item.py
18
19
20
21
22
23
24
25
26
27
def __init__(self, *, id: int, amount: int):
    """
    Create a new instance of Item.

    Args:
        id (int): (Value range is 0-64008.)
        amount (int): (Value range is 0-4097152080.)
    """
    self._id = id
    self._amount = amount

serialize(writer, data) staticmethod

Serializes an instance of Item to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data Item

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/item.py
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@staticmethod
def serialize(writer: EoWriter, data: "Item") -> None:
    """
    Serializes an instance of `Item` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (Item): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._id is None:
            raise SerializationError("id must be provided.")
        writer.add_short(data._id)
        if data._amount is None:
            raise SerializationError("amount must be provided.")
        writer.add_int(data._amount)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of Item 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
Item Item

The data to serialize.

Source code in src/eolib/protocol/_generated/net/item.py
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def deserialize(reader: EoReader) -> "Item":
    """
    Deserializes an instance of `Item` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        Item: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        id = reader.get_short()
        amount = reader.get_int()
        result = Item(id=id, amount=amount)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ThreeItem

An item reference with a 3-byte amount. Used for shops, lockers, and various item transfers.

Source code in src/eolib/protocol/_generated/net/three_item.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
class ThreeItem:
    """
    An item reference with a 3-byte amount.
    Used for shops, lockers, and various item transfers.
    """
    _byte_size: int = 0
    _id: int
    _amount: int

    def __init__(self, *, id: int, amount: int):
        """
        Create a new instance of ThreeItem.

        Args:
            id (int): (Value range is 0-64008.)
            amount (int): (Value range is 0-16194276.)
        """
        self._id = id
        self._amount = amount

    @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 id(self) -> int:
        return self._id

    @property
    def amount(self) -> int:
        return self._amount

    @staticmethod
    def serialize(writer: EoWriter, data: "ThreeItem") -> None:
        """
        Serializes an instance of `ThreeItem` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (ThreeItem): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._id is None:
                raise SerializationError("id must be provided.")
            writer.add_short(data._id)
            if data._amount is None:
                raise SerializationError("amount must be provided.")
            writer.add_three(data._amount)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "ThreeItem":
        """
        Deserializes an instance of `ThreeItem` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            ThreeItem: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            id = reader.get_short()
            amount = reader.get_three()
            result = ThreeItem(id=id, amount=amount)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"ThreeItem(byte_size={repr(self._byte_size)}, id={repr(self._id)}, amount={repr(self._amount)})"

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.

id: int property

amount: int property

__init__(*, id, amount)

Create a new instance of ThreeItem.

Parameters:

Name Type Description Default
id int

(Value range is 0-64008.)

required
amount int

(Value range is 0-16194276.)

required
Source code in src/eolib/protocol/_generated/net/three_item.py
19
20
21
22
23
24
25
26
27
28
def __init__(self, *, id: int, amount: int):
    """
    Create a new instance of ThreeItem.

    Args:
        id (int): (Value range is 0-64008.)
        amount (int): (Value range is 0-16194276.)
    """
    self._id = id
    self._amount = amount

serialize(writer, data) staticmethod

Serializes an instance of ThreeItem to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data ThreeItem

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/three_item.py
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
@staticmethod
def serialize(writer: EoWriter, data: "ThreeItem") -> None:
    """
    Serializes an instance of `ThreeItem` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (ThreeItem): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._id is None:
            raise SerializationError("id must be provided.")
        writer.add_short(data._id)
        if data._amount is None:
            raise SerializationError("amount must be provided.")
        writer.add_three(data._amount)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of ThreeItem 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
ThreeItem ThreeItem

The data to serialize.

Source code in src/eolib/protocol/_generated/net/three_item.py
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@staticmethod
def deserialize(reader: EoReader) -> "ThreeItem":
    """
    Deserializes an instance of `ThreeItem` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        ThreeItem: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        id = reader.get_short()
        amount = reader.get_three()
        result = ThreeItem(id=id, amount=amount)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

AdminInteractListServerPacket

Bases: Packet

Admin character inventory popup

Source code in src/eolib/protocol/_generated/net/server/admin_interact_list_server_packet.py
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
class AdminInteractListServerPacket(Packet):
    """
    Admin character inventory popup
    """
    _byte_size: int = 0
    _name: str
    _usage: int
    _gold_bank: int
    _inventory: tuple[Item, ...]
    _bank: tuple[ThreeItem, ...]

    def __init__(self, *, name: str, usage: int, gold_bank: int, inventory: Iterable[Item], bank: Iterable[ThreeItem]):
        """
        Create a new instance of AdminInteractListServerPacket.

        Args:
            name (str): 
            usage (int): (Value range is 0-4097152080.)
            gold_bank (int): (Value range is 0-4097152080.)
            inventory (Iterable[Item]): 
            bank (Iterable[ThreeItem]): 
        """
        self._name = name
        self._usage = usage
        self._gold_bank = gold_bank
        self._inventory = tuple(inventory)
        self._bank = tuple(bank)

    @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 name(self) -> str:
        return self._name

    @property
    def usage(self) -> int:
        return self._usage

    @property
    def gold_bank(self) -> int:
        return self._gold_bank

    @property
    def inventory(self) -> tuple[Item, ...]:
        return self._inventory

    @property
    def bank(self) -> tuple[ThreeItem, ...]:
        return self._bank

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.AdminInteract

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.List

    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.
        """
        AdminInteractListServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "AdminInteractListServerPacket") -> None:
        """
        Serializes an instance of `AdminInteractListServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AdminInteractListServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            writer.string_sanitization_mode = True
            if data._name is None:
                raise SerializationError("name must be provided.")
            writer.add_string(data._name)
            writer.add_byte(0xFF)
            if data._usage is None:
                raise SerializationError("usage must be provided.")
            writer.add_int(data._usage)
            writer.add_byte(0xFF)
            if data._gold_bank is None:
                raise SerializationError("gold_bank must be provided.")
            writer.add_int(data._gold_bank)
            writer.add_byte(0xFF)
            if data._inventory is None:
                raise SerializationError("inventory must be provided.")
            for i in range(len(data._inventory)):
                Item.serialize(writer, data._inventory[i])
            writer.add_byte(0xFF)
            if data._bank is None:
                raise SerializationError("bank must be provided.")
            for i in range(len(data._bank)):
                ThreeItem.serialize(writer, data._bank[i])
            writer.string_sanitization_mode = False
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "AdminInteractListServerPacket":
        """
        Deserializes an instance of `AdminInteractListServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            AdminInteractListServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            name = reader.get_string()
            reader.next_chunk()
            usage = reader.get_int()
            reader.next_chunk()
            gold_bank = reader.get_int()
            reader.next_chunk()
            inventory_length = int(reader.remaining / 6)
            inventory = []
            for i in range(inventory_length):
                inventory.append(Item.deserialize(reader))
            reader.next_chunk()
            bank_length = int(reader.remaining / 5)
            bank = []
            for i in range(bank_length):
                bank.append(ThreeItem.deserialize(reader))
            reader.chunked_reading_mode = False
            result = AdminInteractListServerPacket(name=name, usage=usage, gold_bank=gold_bank, inventory=inventory, bank=bank)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"AdminInteractListServerPacket(byte_size={repr(self._byte_size)}, name={repr(self._name)}, usage={repr(self._usage)}, gold_bank={repr(self._gold_bank)}, inventory={repr(self._inventory)}, bank={repr(self._bank)})"

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.

name: str property

usage: int property

gold_bank: int property

inventory: tuple[Item, ...] property

bank: tuple[ThreeItem, ...] property

__init__(*, name, usage, gold_bank, inventory, bank)

Create a new instance of AdminInteractListServerPacket.

Parameters:

Name Type Description Default
name str
required
usage int

(Value range is 0-4097152080.)

required
gold_bank int

(Value range is 0-4097152080.)

required
inventory Iterable[Item]
required
bank Iterable[ThreeItem]
required
Source code in src/eolib/protocol/_generated/net/server/admin_interact_list_server_packet.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
def __init__(self, *, name: str, usage: int, gold_bank: int, inventory: Iterable[Item], bank: Iterable[ThreeItem]):
    """
    Create a new instance of AdminInteractListServerPacket.

    Args:
        name (str): 
        usage (int): (Value range is 0-4097152080.)
        gold_bank (int): (Value range is 0-4097152080.)
        inventory (Iterable[Item]): 
        bank (Iterable[ThreeItem]): 
    """
    self._name = name
    self._usage = usage
    self._gold_bank = gold_bank
    self._inventory = tuple(inventory)
    self._bank = tuple(bank)

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/admin_interact_list_server_packet.py
75
76
77
78
79
80
81
82
83
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.AdminInteract

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/admin_interact_list_server_packet.py
85
86
87
88
89
90
91
92
93
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.List

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/admin_interact_list_server_packet.py
 95
 96
 97
 98
 99
100
101
102
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.
    """
    AdminInteractListServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of AdminInteractListServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data AdminInteractListServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/admin_interact_list_server_packet.py
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
@staticmethod
def serialize(writer: EoWriter, data: "AdminInteractListServerPacket") -> None:
    """
    Serializes an instance of `AdminInteractListServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AdminInteractListServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        writer.string_sanitization_mode = True
        if data._name is None:
            raise SerializationError("name must be provided.")
        writer.add_string(data._name)
        writer.add_byte(0xFF)
        if data._usage is None:
            raise SerializationError("usage must be provided.")
        writer.add_int(data._usage)
        writer.add_byte(0xFF)
        if data._gold_bank is None:
            raise SerializationError("gold_bank must be provided.")
        writer.add_int(data._gold_bank)
        writer.add_byte(0xFF)
        if data._inventory is None:
            raise SerializationError("inventory must be provided.")
        for i in range(len(data._inventory)):
            Item.serialize(writer, data._inventory[i])
        writer.add_byte(0xFF)
        if data._bank is None:
            raise SerializationError("bank must be provided.")
        for i in range(len(data._bank)):
            ThreeItem.serialize(writer, data._bank[i])
        writer.string_sanitization_mode = False
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AdminInteractListServerPacket 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
AdminInteractListServerPacket 'AdminInteractListServerPacket'

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/admin_interact_list_server_packet.py
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
@staticmethod
def deserialize(reader: EoReader) -> "AdminInteractListServerPacket":
    """
    Deserializes an instance of `AdminInteractListServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        AdminInteractListServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        name = reader.get_string()
        reader.next_chunk()
        usage = reader.get_int()
        reader.next_chunk()
        gold_bank = reader.get_int()
        reader.next_chunk()
        inventory_length = int(reader.remaining / 6)
        inventory = []
        for i in range(inventory_length):
            inventory.append(Item.deserialize(reader))
        reader.next_chunk()
        bank_length = int(reader.remaining / 5)
        bank = []
        for i in range(bank_length):
            bank.append(ThreeItem.deserialize(reader))
        reader.chunked_reading_mode = False
        result = AdminInteractListServerPacket(name=name, usage=usage, gold_bank=gold_bank, inventory=inventory, bank=bank)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

AdminInteractAgreeServerPacket

Bases: Packet

Nearby player appearing (admin un-hide)

Source code in src/eolib/protocol/_generated/net/server/admin_interact_agree_server_packet.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
class AdminInteractAgreeServerPacket(Packet):
    """
    Nearby player appearing (admin un-hide)
    """
    _byte_size: int = 0
    _player_id: int

    def __init__(self, *, player_id: int):
        """
        Create a new instance of AdminInteractAgreeServerPacket.

        Args:
            player_id (int): (Value range is 0-64008.)
        """
        self._player_id = player_id

    @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 player_id(self) -> int:
        return self._player_id

    @staticmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.AdminInteract

    @staticmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        return PacketAction.Agree

    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.
        """
        AdminInteractAgreeServerPacket.serialize(writer, self)

    @staticmethod
    def serialize(writer: EoWriter, data: "AdminInteractAgreeServerPacket") -> None:
        """
        Serializes an instance of `AdminInteractAgreeServerPacket` to the provided `EoWriter`.

        Args:
            writer (EoWriter): The writer that the data will be serialized to.
            data (AdminInteractAgreeServerPacket): The data to serialize.
        """
        old_string_sanitization_mode: bool = writer.string_sanitization_mode
        try:
            if data._player_id is None:
                raise SerializationError("player_id must be provided.")
            writer.add_short(data._player_id)
        finally:
            writer.string_sanitization_mode = old_string_sanitization_mode

    @staticmethod
    def deserialize(reader: EoReader) -> "AdminInteractAgreeServerPacket":
        """
        Deserializes an instance of `AdminInteractAgreeServerPacket` from the provided `EoReader`.

        Args:
            reader (EoReader): The writer that the data will be serialized to.

        Returns:
            AdminInteractAgreeServerPacket: The data to serialize.
        """
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            player_id = reader.get_short()
            result = AdminInteractAgreeServerPacket(player_id=player_id)
            result._byte_size = reader.position - reader_start_position
            return result
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"AdminInteractAgreeServerPacket(byte_size={repr(self._byte_size)}, player_id={repr(self._player_id)})"

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.

player_id: int property

__init__(*, player_id)

Create a new instance of AdminInteractAgreeServerPacket.

Parameters:

Name Type Description Default
player_id int

(Value range is 0-64008.)

required
Source code in src/eolib/protocol/_generated/net/server/admin_interact_agree_server_packet.py
20
21
22
23
24
25
26
27
def __init__(self, *, player_id: int):
    """
    Create a new instance of AdminInteractAgreeServerPacket.

    Args:
        player_id (int): (Value range is 0-64008.)
    """
    self._player_id = player_id

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/admin_interact_agree_server_packet.py
43
44
45
46
47
48
49
50
51
@staticmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    return PacketFamily.AdminInteract

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/admin_interact_agree_server_packet.py
53
54
55
56
57
58
59
60
61
@staticmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    return PacketAction.Agree

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/admin_interact_agree_server_packet.py
63
64
65
66
67
68
69
70
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.
    """
    AdminInteractAgreeServerPacket.serialize(writer, self)

serialize(writer, data) staticmethod

Serializes an instance of AdminInteractAgreeServerPacket to the provided EoWriter.

Parameters:

Name Type Description Default
writer EoWriter

The writer that the data will be serialized to.

required
data AdminInteractAgreeServerPacket

The data to serialize.

required
Source code in src/eolib/protocol/_generated/net/server/admin_interact_agree_server_packet.py
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
@staticmethod
def serialize(writer: EoWriter, data: "AdminInteractAgreeServerPacket") -> None:
    """
    Serializes an instance of `AdminInteractAgreeServerPacket` to the provided `EoWriter`.

    Args:
        writer (EoWriter): The writer that the data will be serialized to.
        data (AdminInteractAgreeServerPacket): The data to serialize.
    """
    old_string_sanitization_mode: bool = writer.string_sanitization_mode
    try:
        if data._player_id is None:
            raise SerializationError("player_id must be provided.")
        writer.add_short(data._player_id)
    finally:
        writer.string_sanitization_mode = old_string_sanitization_mode

deserialize(reader) staticmethod

Deserializes an instance of AdminInteractAgreeServerPacket 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
AdminInteractAgreeServerPacket AdminInteractAgreeServerPacket

The data to serialize.

Source code in src/eolib/protocol/_generated/net/server/admin_interact_agree_server_packet.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
@staticmethod
def deserialize(reader: EoReader) -> "AdminInteractAgreeServerPacket":
    """
    Deserializes an instance of `AdminInteractAgreeServerPacket` from the provided `EoReader`.

    Args:
        reader (EoReader): The writer that the data will be serialized to.

    Returns:
        AdminInteractAgreeServerPacket: The data to serialize.
    """
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        player_id = reader.get_short()
        result = AdminInteractAgreeServerPacket(player_id=player_id)
        result._byte_size = reader.position - reader_start_position
        return result
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

PacketFamily

Bases: IntEnum

The type of operation that a packet performs. Part of the unique packet ID.

Source code in src/eolib/protocol/_generated/net/packet_family.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
class PacketFamily(IntEnum, metaclass=ProtocolEnumMeta):
    """
    The type of operation that a packet performs.
    Part of the unique packet ID.
    """
    Connection = 1
    Account = 2
    Character = 3
    Login = 4
    Welcome = 5
    Walk = 6
    Face = 7
    Chair = 8
    Emote = 9
    Attack = 11
    Spell = 12
    Shop = 13
    Item = 14
    StatSkill = 16
    Global = 17
    Talk = 18
    Warp = 19
    Jukebox = 21
    Players = 22
    Avatar = 23
    Party = 24
    Refresh = 25
    Npc = 26
    PlayerRange = 27
    NpcRange = 28
    Range = 29
    Paperdoll = 30
    Effect = 31
    Trade = 32
    Chest = 33
    Door = 34
    Message = 35
    Bank = 36
    Locker = 37
    Barber = 38
    Guild = 39
    Music = 40
    Sit = 41
    Recover = 42
    Board = 43
    Cast = 44
    Arena = 45
    Priest = 46
    Marriage = 47
    AdminInteract = 48
    Citizen = 49
    Quest = 50
    Book = 51
    Error = 250
    Init = 255

Connection = 1 class-attribute instance-attribute

Account = 2 class-attribute instance-attribute

Character = 3 class-attribute instance-attribute

Login = 4 class-attribute instance-attribute

Welcome = 5 class-attribute instance-attribute

Walk = 6 class-attribute instance-attribute

Face = 7 class-attribute instance-attribute

Chair = 8 class-attribute instance-attribute

Emote = 9 class-attribute instance-attribute

Attack = 11 class-attribute instance-attribute

Spell = 12 class-attribute instance-attribute

Shop = 13 class-attribute instance-attribute

Item = 14 class-attribute instance-attribute

StatSkill = 16 class-attribute instance-attribute

Global = 17 class-attribute instance-attribute

Talk = 18 class-attribute instance-attribute

Warp = 19 class-attribute instance-attribute

Jukebox = 21 class-attribute instance-attribute

Players = 22 class-attribute instance-attribute

Avatar = 23 class-attribute instance-attribute

Party = 24 class-attribute instance-attribute

Refresh = 25 class-attribute instance-attribute

Npc = 26 class-attribute instance-attribute

PlayerRange = 27 class-attribute instance-attribute

NpcRange = 28 class-attribute instance-attribute

Range = 29 class-attribute instance-attribute

Paperdoll = 30 class-attribute instance-attribute

Effect = 31 class-attribute instance-attribute

Trade = 32 class-attribute instance-attribute

Chest = 33 class-attribute instance-attribute

Door = 34 class-attribute instance-attribute

Message = 35 class-attribute instance-attribute

Bank = 36 class-attribute instance-attribute

Locker = 37 class-attribute instance-attribute

Barber = 38 class-attribute instance-attribute

Guild = 39 class-attribute instance-attribute

Music = 40 class-attribute instance-attribute

Sit = 41 class-attribute instance-attribute

Recover = 42 class-attribute instance-attribute

Board = 43 class-attribute instance-attribute

Cast = 44 class-attribute instance-attribute

Arena = 45 class-attribute instance-attribute

Priest = 46 class-attribute instance-attribute

Marriage = 47 class-attribute instance-attribute

AdminInteract = 48 class-attribute instance-attribute

Citizen = 49 class-attribute instance-attribute

Quest = 50 class-attribute instance-attribute

Book = 51 class-attribute instance-attribute

Error = 250 class-attribute instance-attribute

Init = 255 class-attribute instance-attribute

PacketAction

Bases: IntEnum

The specific action that a packet performs. Part of the unique packet ID.

Source code in src/eolib/protocol/_generated/net/packet_action.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
class PacketAction(IntEnum, metaclass=ProtocolEnumMeta):
    """
    The specific action that a packet performs.
    Part of the unique packet ID.
    """
    Request = 1
    Accept = 2
    Reply = 3
    Remove = 4
    Agree = 5
    Create = 6
    Add = 7
    Player = 8
    Take = 9
    Use = 10
    Buy = 11
    Sell = 12
    Open = 13
    Close = 14
    Msg = 15
    Spec = 16
    Admin = 17
    List = 18
    Tell = 20
    Report = 21
    Announce = 22
    Server = 23
    Drop = 24
    Junk = 25
    Obtain = 26
    Get = 27
    Kick = 28
    Rank = 29
    TargetSelf = 30
    TargetOther = 31
    TargetGroup = 33
    Dialog = 34
    Ping = 240
    Pong = 241
    Net242 = 242
    Net243 = 243
    Net244 = 244
    Error = 250
    Init = 255

Request = 1 class-attribute instance-attribute

Accept = 2 class-attribute instance-attribute

Reply = 3 class-attribute instance-attribute

Remove = 4 class-attribute instance-attribute

Agree = 5 class-attribute instance-attribute

Create = 6 class-attribute instance-attribute

Add = 7 class-attribute instance-attribute

Player = 8 class-attribute instance-attribute

Take = 9 class-attribute instance-attribute

Use = 10 class-attribute instance-attribute

Buy = 11 class-attribute instance-attribute

Sell = 12 class-attribute instance-attribute

Open = 13 class-attribute instance-attribute

Close = 14 class-attribute instance-attribute

Msg = 15 class-attribute instance-attribute

Spec = 16 class-attribute instance-attribute

Admin = 17 class-attribute instance-attribute

List = 18 class-attribute instance-attribute

Tell = 20 class-attribute instance-attribute

Report = 21 class-attribute instance-attribute

Announce = 22 class-attribute instance-attribute

Server = 23 class-attribute instance-attribute

Drop = 24 class-attribute instance-attribute

Junk = 25 class-attribute instance-attribute

Obtain = 26 class-attribute instance-attribute

Get = 27 class-attribute instance-attribute

Kick = 28 class-attribute instance-attribute

Rank = 29 class-attribute instance-attribute

TargetSelf = 30 class-attribute instance-attribute

TargetOther = 31 class-attribute instance-attribute

TargetGroup = 33 class-attribute instance-attribute

Dialog = 34 class-attribute instance-attribute

Ping = 240 class-attribute instance-attribute

Pong = 241 class-attribute instance-attribute

Net242 = 242 class-attribute instance-attribute

Net243 = 243 class-attribute instance-attribute

Net244 = 244 class-attribute instance-attribute

Error = 250 class-attribute instance-attribute

Init = 255 class-attribute instance-attribute

SerializationError

Bases: Exception

Represents an error in serializing a protocol data structure.

Source code in src/eolib/protocol/serialization_error.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
class SerializationError(Exception):
    """
    Represents an error in serializing a protocol data structure.
    """

    def __init__(self, message: str):
        """
        Constructs a SerializationError with the specified error message.

        Args:
            message (str): The error message.
        """
        super().__init__(message)

__init__(message)

Constructs a SerializationError with the specified error message.

Parameters:

Name Type Description Default
message str

The error message.

required
Source code in src/eolib/protocol/serialization_error.py
 6
 7
 8
 9
10
11
12
13
def __init__(self, message: str):
    """
    Constructs a SerializationError with the specified error message.

    Args:
        message (str): The error message.
    """
    super().__init__(message)

Packet

Bases: ABC

Object representation of a packet in the EO network protocol.

Source code in src/eolib/protocol/net/packet.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
class Packet(ABC):
    """
    Object representation of a packet in the EO network protocol.
    """

    @staticmethod
    @abstractmethod
    def family() -> PacketFamily:
        """
        Returns the packet family associated with this packet.

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        raise NotImplementedError()

    @staticmethod
    @abstractmethod
    def action() -> PacketAction:
        """
        Returns the packet action associated with this packet.

        Returns:
            PacketAction: The packet action associated with this packet.
        """
        raise NotImplementedError()

    @abstractmethod
    def write(self, writer: EoWriter) -> None:
        """
        Serializes and writes this packet to the provided EoWriter.

        Args:
            writer (EoWriter): the writer that this packet will be written to.
        """
        raise NotImplementedError()

family() abstractmethod 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/net/packet.py
13
14
15
16
17
18
19
20
21
22
@staticmethod
@abstractmethod
def family() -> PacketFamily:
    """
    Returns the packet family associated with this packet.

    Returns:
        PacketFamily: The packet family associated with this packet.
    """
    raise NotImplementedError()

action() abstractmethod 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/net/packet.py
24
25
26
27
28
29
30
31
32
33
@staticmethod
@abstractmethod
def action() -> PacketAction:
    """
    Returns the packet action associated with this packet.

    Returns:
        PacketAction: The packet action associated with this packet.
    """
    raise NotImplementedError()

write(writer) abstractmethod

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/net/packet.py
35
36
37
38
39
40
41
42
43
@abstractmethod
def write(self, writer: EoWriter) -> None:
    """
    Serializes and writes this packet to the provided EoWriter.

    Args:
        writer (EoWriter): the writer that this packet will be written to.
    """
    raise NotImplementedError()

EoWriter

Source code in src/eolib/data/eo_writer.py
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
class EoWriter:
    def __init__(self):
        self.data = bytearray()
        self._string_sanitization_mode = False

    def add_byte(self, value: int) -> None:
        """
        Adds a raw byte to the writer data.

        Args:
            value (int): The byte to add.

        Raises:
            ValueError: If the value is above `0xFF`.
        """
        self._check_number_size(value, 0xFF)
        self.data.append(value)

    def add_bytes(self, bytes: bytes) -> None:
        """
        Adds raw bytes to the writer data.

        Args:
            bytes (bytes): The bytes to add.
        """
        self.data.extend(bytes)

    def add_char(self, number: int) -> None:
        """
        Adds an encoded 1-byte integer to the writer data.

        Args:
            number (int): The number to encode and add.

        Raises:
            ValueError: If the value is not below `CHAR_MAX`.
        """
        self._check_number_size(number, CHAR_MAX - 1)
        number_bytes = encode_number(number)
        self._add_bytes_with_length(number_bytes, 1)

    def add_short(self, number: int) -> None:
        """
        Adds an encoded 2-byte integer to the writer data.

        Args:
            number (int): The number to encode and add.

        Raises:
            ValueError: If the value is not below `SHORT_MAX`.
        """
        self._check_number_size(number, SHORT_MAX - 1)
        number_bytes = encode_number(number)
        self._add_bytes_with_length(number_bytes, 2)

    def add_three(self, number: int) -> None:
        """
        Adds an encoded 3-byte integer to the writer data.

        Args:
            number (int): The number to encode and add.

        Raises:
            ValueError: If the value is not below `THREE_MAX`.
        """
        self._check_number_size(number, THREE_MAX - 1)
        number_bytes = encode_number(number)
        self._add_bytes_with_length(number_bytes, 3)

    def add_int(self, number: int) -> None:
        """
        Adds an encoded 4-byte integer to the writer data.

        Args:
            number (int): The number to encode and add.

        Raises:
            ValueError: If the value is not below `INT_MAX`.
        """
        self._check_number_size(number, INT_MAX - 1)
        number_bytes = encode_number(number)
        self._add_bytes_with_length(number_bytes, 4)

    def add_string(self, string: str) -> None:
        """
        Adds a string to the writer data.

        Args:
            string (str): The string to be added.
        """
        string_bytes = self._encode_ansi(string)
        self._sanitize_string(string_bytes)
        self.add_bytes(string_bytes)

    def add_fixed_string(self, string: str, length: int, padded: bool = False) -> None:
        """
        Adds a fixed-length string to the writer data.

        Args:
            string (str): The string to be added.
            length (int): The expected length of the string.
            padded (bool, optional): True if the string should be padded to the length with
                trailing `0xFF` bytes. Defaults to False.
        """
        self._check_string_length(string, length, padded)
        string_bytes = self._encode_ansi(string)
        self._sanitize_string(string_bytes)
        if padded:
            string_bytes = self._add_padding(string_bytes, length)
        self.add_bytes(string_bytes)

    def add_encoded_string(self, string: str) -> None:
        """
        Adds an encoded string to the writer data.

        Args:
            string (str): The string to be encoded and added.
        """
        string_bytes = self._encode_ansi(string)
        self._sanitize_string(string_bytes)
        encode_string(string_bytes)
        self.add_bytes(string_bytes)

    def add_fixed_encoded_string(self, string: str, length: int, padded: bool = False) -> None:
        """
        Adds a fixed-length encoded string to the writer data.

        Args:
            string (str): The string to be encoded and added.
            length (int): The expected length of the string.
            padded (bool, optional): True if the string should be padded to the length with
                trailing `0xFF` bytes. Defaults to False.
        """
        self._check_string_length(string, length, padded)
        string_bytes = self._encode_ansi(string)
        self._sanitize_string(string_bytes)
        if padded:
            string_bytes = self._add_padding(string_bytes, length)
        encode_string(string_bytes)
        self.add_bytes(string_bytes)

    @property
    def string_sanitization_mode(self) -> bool:
        """
        Gets the string sanitization mode for the writer.

        Returns:
            bool: True if string sanitization is enabled.
        """
        return self._string_sanitization_mode

    @string_sanitization_mode.setter
    def string_sanitization_mode(self, string_sanitization_mode: bool) -> None:
        self._string_sanitization_mode = string_sanitization_mode

    def to_bytearray(self) -> bytearray:
        """
        Gets the writer data as a byte array.

        Returns:
            bytearray: A copy of the writer data as a byte array.
        """
        return self.data.copy()

    def __len__(self) -> int:
        """
        Gets the length of the writer data.

        Returns:
            int: The length of the writer data.
        """
        return len(self.data)

    def _add_bytes_with_length(self, bytes: bytes, bytes_length: int) -> None:
        """
        Adds raw bytes with a specified length to the writer data.

        Args:
            bytes (bytes): The bytes to add.
            bytes_length (int): The number of bytes to add.
        """
        self.data.extend(bytes[:bytes_length])

    def _sanitize_string(self, bytes: bytearray) -> None:
        if self.string_sanitization_mode:
            for i in range(len(bytes)):
                if bytes[i] == 0xFF:  # 'ÿ'
                    bytes[i] = 0x79  # 'y'

    @staticmethod
    def _check_number_size(number: int, max_value: int) -> None:
        if number > max_value:
            raise ValueError(f"Value {number} exceeds maximum of {max_value}.")

    @staticmethod
    def _add_padding(bytes: bytearray, length: int) -> bytearray:
        if len(bytes) == length:
            return bytes

        result = bytearray(length)
        result[: len(bytes)] = bytes
        result[len(bytes) :] = bytearray([0xFF] * (length - len(bytes)))

        return result

    @staticmethod
    def _check_string_length(string: str, length: int, padded: bool) -> None:
        if padded:
            if length >= len(string):
                return
            raise ValueError(f'Padded string "{string}" is too large for a length of {length}.')

        if len(string) != length:
            raise ValueError(f'String "{string}" does not have expected length of {length}.')

    @staticmethod
    def _encode_ansi(string: str) -> bytearray:
        """
        Encodes string to windows-1252 bytes.

        Args:
            string (str): The string to encode.

        Returns:
            bytearray: The encoded string.
        """
        return bytearray(string, 'windows-1252', 'replace')

data = bytearray() instance-attribute

string_sanitization_mode: bool property writable

Gets the string sanitization mode for the writer.

Returns:

Name Type Description
bool bool

True if string sanitization is enabled.

__init__()

Source code in src/eolib/data/eo_writer.py
7
8
9
def __init__(self):
    self.data = bytearray()
    self._string_sanitization_mode = False

add_byte(value)

Adds a raw byte to the writer data.

Parameters:

Name Type Description Default
value int

The byte to add.

required

Raises:

Type Description
ValueError

If the value is above 0xFF.

Source code in src/eolib/data/eo_writer.py
11
12
13
14
15
16
17
18
19
20
21
22
def add_byte(self, value: int) -> None:
    """
    Adds a raw byte to the writer data.

    Args:
        value (int): The byte to add.

    Raises:
        ValueError: If the value is above `0xFF`.
    """
    self._check_number_size(value, 0xFF)
    self.data.append(value)

add_bytes(bytes)

Adds raw bytes to the writer data.

Parameters:

Name Type Description Default
bytes bytes

The bytes to add.

required
Source code in src/eolib/data/eo_writer.py
24
25
26
27
28
29
30
31
def add_bytes(self, bytes: bytes) -> None:
    """
    Adds raw bytes to the writer data.

    Args:
        bytes (bytes): The bytes to add.
    """
    self.data.extend(bytes)

add_char(number)

Adds an encoded 1-byte integer to the writer data.

Parameters:

Name Type Description Default
number int

The number to encode and add.

required

Raises:

Type Description
ValueError

If the value is not below CHAR_MAX.

Source code in src/eolib/data/eo_writer.py
33
34
35
36
37
38
39
40
41
42
43
44
45
def add_char(self, number: int) -> None:
    """
    Adds an encoded 1-byte integer to the writer data.

    Args:
        number (int): The number to encode and add.

    Raises:
        ValueError: If the value is not below `CHAR_MAX`.
    """
    self._check_number_size(number, CHAR_MAX - 1)
    number_bytes = encode_number(number)
    self._add_bytes_with_length(number_bytes, 1)

add_short(number)

Adds an encoded 2-byte integer to the writer data.

Parameters:

Name Type Description Default
number int

The number to encode and add.

required

Raises:

Type Description
ValueError

If the value is not below SHORT_MAX.

Source code in src/eolib/data/eo_writer.py
47
48
49
50
51
52
53
54
55
56
57
58
59
def add_short(self, number: int) -> None:
    """
    Adds an encoded 2-byte integer to the writer data.

    Args:
        number (int): The number to encode and add.

    Raises:
        ValueError: If the value is not below `SHORT_MAX`.
    """
    self._check_number_size(number, SHORT_MAX - 1)
    number_bytes = encode_number(number)
    self._add_bytes_with_length(number_bytes, 2)

add_three(number)

Adds an encoded 3-byte integer to the writer data.

Parameters:

Name Type Description Default
number int

The number to encode and add.

required

Raises:

Type Description
ValueError

If the value is not below THREE_MAX.

Source code in src/eolib/data/eo_writer.py
61
62
63
64
65
66
67
68
69
70
71
72
73
def add_three(self, number: int) -> None:
    """
    Adds an encoded 3-byte integer to the writer data.

    Args:
        number (int): The number to encode and add.

    Raises:
        ValueError: If the value is not below `THREE_MAX`.
    """
    self._check_number_size(number, THREE_MAX - 1)
    number_bytes = encode_number(number)
    self._add_bytes_with_length(number_bytes, 3)

add_int(number)

Adds an encoded 4-byte integer to the writer data.

Parameters:

Name Type Description Default
number int

The number to encode and add.

required

Raises:

Type Description
ValueError

If the value is not below INT_MAX.

Source code in src/eolib/data/eo_writer.py
75
76
77
78
79
80
81
82
83
84
85
86
87
def add_int(self, number: int) -> None:
    """
    Adds an encoded 4-byte integer to the writer data.

    Args:
        number (int): The number to encode and add.

    Raises:
        ValueError: If the value is not below `INT_MAX`.
    """
    self._check_number_size(number, INT_MAX - 1)
    number_bytes = encode_number(number)
    self._add_bytes_with_length(number_bytes, 4)

add_string(string)

Adds a string to the writer data.

Parameters:

Name Type Description Default
string str

The string to be added.

required
Source code in src/eolib/data/eo_writer.py
89
90
91
92
93
94
95
96
97
98
def add_string(self, string: str) -> None:
    """
    Adds a string to the writer data.

    Args:
        string (str): The string to be added.
    """
    string_bytes = self._encode_ansi(string)
    self._sanitize_string(string_bytes)
    self.add_bytes(string_bytes)

add_fixed_string(string, length, padded=False)

Adds a fixed-length string to the writer data.

Parameters:

Name Type Description Default
string str

The string to be added.

required
length int

The expected length of the string.

required
padded bool

True if the string should be padded to the length with trailing 0xFF bytes. Defaults to False.

False
Source code in src/eolib/data/eo_writer.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
def add_fixed_string(self, string: str, length: int, padded: bool = False) -> None:
    """
    Adds a fixed-length string to the writer data.

    Args:
        string (str): The string to be added.
        length (int): The expected length of the string.
        padded (bool, optional): True if the string should be padded to the length with
            trailing `0xFF` bytes. Defaults to False.
    """
    self._check_string_length(string, length, padded)
    string_bytes = self._encode_ansi(string)
    self._sanitize_string(string_bytes)
    if padded:
        string_bytes = self._add_padding(string_bytes, length)
    self.add_bytes(string_bytes)

add_encoded_string(string)

Adds an encoded string to the writer data.

Parameters:

Name Type Description Default
string str

The string to be encoded and added.

required
Source code in src/eolib/data/eo_writer.py
117
118
119
120
121
122
123
124
125
126
127
def add_encoded_string(self, string: str) -> None:
    """
    Adds an encoded string to the writer data.

    Args:
        string (str): The string to be encoded and added.
    """
    string_bytes = self._encode_ansi(string)
    self._sanitize_string(string_bytes)
    encode_string(string_bytes)
    self.add_bytes(string_bytes)

add_fixed_encoded_string(string, length, padded=False)

Adds a fixed-length encoded string to the writer data.

Parameters:

Name Type Description Default
string str

The string to be encoded and added.

required
length int

The expected length of the string.

required
padded bool

True if the string should be padded to the length with trailing 0xFF bytes. Defaults to False.

False
Source code in src/eolib/data/eo_writer.py
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
def add_fixed_encoded_string(self, string: str, length: int, padded: bool = False) -> None:
    """
    Adds a fixed-length encoded string to the writer data.

    Args:
        string (str): The string to be encoded and added.
        length (int): The expected length of the string.
        padded (bool, optional): True if the string should be padded to the length with
            trailing `0xFF` bytes. Defaults to False.
    """
    self._check_string_length(string, length, padded)
    string_bytes = self._encode_ansi(string)
    self._sanitize_string(string_bytes)
    if padded:
        string_bytes = self._add_padding(string_bytes, length)
    encode_string(string_bytes)
    self.add_bytes(string_bytes)

to_bytearray()

Gets the writer data as a byte array.

Returns:

Name Type Description
bytearray bytearray

A copy of the writer data as a byte array.

Source code in src/eolib/data/eo_writer.py
161
162
163
164
165
166
167
168
def to_bytearray(self) -> bytearray:
    """
    Gets the writer data as a byte array.

    Returns:
        bytearray: A copy of the writer data as a byte array.
    """
    return self.data.copy()

__len__()

Gets the length of the writer data.

Returns:

Name Type Description
int int

The length of the writer data.

Source code in src/eolib/data/eo_writer.py
170
171
172
173
174
175
176
177
def __len__(self) -> int:
    """
    Gets the length of the writer data.

    Returns:
        int: The length of the writer data.
    """
    return len(self.data)

EoReader

Bases: object

A class for reading EO data from a sequence of bytes.

EoReader features a chunked reading mode, which is important for accurate emulation of the official game client.

See documentation for chunked reading: https://github.com/Cirras/eo-protocol/blob/master/docs/chunks.md

Source code in src/eolib/data/eo_reader.py
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
class EoReader(object):
    """
    A class for reading EO data from a sequence of bytes.

    `EoReader` features a chunked reading mode, which is important for accurate emulation of
    the official game client.

    See documentation for chunked reading:
    https://github.com/Cirras/eo-protocol/blob/master/docs/chunks.md
    """

    _data: memoryview
    _position: int
    _chunked_reading_mode: bool
    _chunk_start: int
    _next_break: int

    def __init__(self, data: bytes):
        """
        Creates a new `EoReader` instance for the specified data.

        Args:
            data (bytes): The byte array containing the input data.
        """
        self._data = memoryview(data)
        self._position = 0
        self._chunked_reading_mode = False
        self._chunk_start = 0
        self._next_break = -1

    def slice(self, index: Optional[int] = None, length: Optional[int] = None) -> "EoReader":
        """
        Creates a new `EoReader` whose input data is a shared subsequence of this reader's
        data.

        The input data of the new reader will start at position `index` in this reader and contain
        up to `length` bytes. The two reader's position and chunked reading mode will be
        independent.

        The new reader's position will be zero, and its chunked reading mode will be false.

        Args:
            index (int, optional): The position in this reader at which the data of the new reader
                will start; must be non-negative. Defaults to the current reader position.
            length (int, optional): The length of the shared subsequence of data to supply to the
                new reader; must be non-negative. Defaults to the length of the remaining data
                starting from `index`.

        Returns:
            EoReader: The new reader.

        Raises:
            ValueError: If `index` or `length` is negative.
        """
        if index is None:
            index = self.position
        if length is None:
            length = max(0, len(self._data) - index)

        if index < 0:
            raise ValueError(f"negative index: {index}")

        if length < 0:
            raise ValueError(f"negative length: {length}")

        begin = max(0, min(len(self._data), index))
        end = begin + min(len(self._data) - begin, length)

        return EoReader(self._data[begin:end])

    def get_byte(self) -> int:
        """
        Reads a raw byte from the input data.

        Returns:
            int: A raw byte.
        """
        return self._read_byte()

    def get_bytes(self, length: int) -> bytearray:
        """
        Reads an array of raw bytes from the input data.

        Args:
            length (int): The number of bytes to read.

        Returns:
            bytearray: An array of raw bytes.
        """
        return self._read_bytes(length)

    def get_char(self) -> int:
        """
        Reads an encoded 1-byte integer from the input data.

        Returns:
            int: A decoded 1-byte integer.
        """
        return decode_number(self._read_bytes(1))

    def get_short(self) -> int:
        """
        Reads an encoded 2-byte integer from the input data.

        Returns:
            int: A decoded 2-byte integer.
        """
        return decode_number(self._read_bytes(2))

    def get_three(self) -> int:
        """
        Reads an encoded 3-byte integer from the input data.

        Returns:
            int: A decoded 3-byte integer.
        """
        return decode_number(self._read_bytes(3))

    def get_int(self) -> int:
        """
        Reads an encoded 4-byte integer from the input data.

        Returns:
            int: A decoded 4-byte integer.
        """
        return decode_number(self._read_bytes(4))

    def get_string(self) -> str:
        """
        Reads a string from the input data.

        Returns:
            str: A string.
        """
        string_bytes = self._read_bytes(self.remaining)
        return self._decode_ansi(string_bytes)

    def get_fixed_string(self, length: int, padded: bool = False) -> str:
        """
        Reads a string with a fixed length from the input data.

        Args:
            length (int): The length of the string.
            padded (bool, optional): True if the string is padded with trailing `0xFF` bytes.

        Returns:
            str: A decoded string.

        Raises:
            ValueError: If the length is negative.
        """
        if length < 0:
            raise ValueError("Negative length")
        bytes_ = self._read_bytes(length)
        if padded:
            bytes_ = self._remove_padding(bytes_)
        return self._decode_ansi(bytes_)

    def get_encoded_string(self) -> str:
        """
        Reads an encoded string from the input data.

        Returns:
            str: A decoded string.
        """
        bytes_ = self._read_bytes(self.remaining)
        decode_string(bytes_)
        return self._decode_ansi(bytes_)

    def get_fixed_encoded_string(self, length: int, padded: bool = False) -> str:
        """
        Reads an encoded string with a fixed length from the input data.

        Args:
            length (int): The length of the string.
            padded (bool, optional): True if the string is padded with trailing `0xFF` bytes.

        Returns:
            str: A decoded string.

        Raises:
            ValueError: If the length is negative.
        """
        if length < 0:
            raise ValueError("Negative length")
        bytes_ = self._read_bytes(length)
        decode_string(bytes_)
        if padded:
            bytes_ = self._remove_padding(bytes_)
        return self._decode_ansi(bytes_)

    @property
    def chunked_reading_mode(self) -> bool:
        """
        bool: Gets or sets the chunked reading mode for the reader.

        In chunked reading mode:
        - The reader will treat `0xFF` bytes as the end of the current chunk.
        - `next_chunk()` can be called to move to the next chunk.
        """
        return self._chunked_reading_mode

    @chunked_reading_mode.setter
    def chunked_reading_mode(self, chunked_reading_mode: bool) -> None:
        self._chunked_reading_mode = chunked_reading_mode
        if self._next_break == -1:
            self._next_break = self._find_next_break_index()

    @property
    def remaining(self) -> int:
        """
        int: If chunked reading mode is enabled, gets the number of bytes remaining in the current
            chunk. Otherwise, gets the total number of bytes remaining in the input data.
        """
        if self.chunked_reading_mode:
            return self._next_break - min(self.position, self._next_break)
        else:
            return len(self._data) - self.position

    def next_chunk(self) -> None:
        """
        Moves the reader position to the start of the next chunk in the input data.

        Raises:
            RuntimeError: If not in chunked reading mode.
        """
        if not self.chunked_reading_mode:
            raise RuntimeError("Not in chunked reading mode.")

        self._position = self._next_break
        if self._position < len(self._data):
            # Skip the break byte
            self._position += 1

        self._chunk_start = self._position
        self._next_break = self._find_next_break_index()

    @property
    def position(self) -> int:
        """
        int: Gets the current position in the input data.
        """
        return self._position

    def _read_byte(self) -> int:
        """
        Reads a raw byte from the input data.

        Returns:
            int: A raw byte.
        """
        if self.remaining > 0:
            byte = self._data[self._position]
            self._position += 1
            return byte
        return 0

    def _read_bytes(self, length) -> bytearray:
        """
        Reads an array of raw bytes from the input data.

        Args:
            length (int): The number of bytes to read.

        Returns:
            bytearray: An array of raw bytes.
        """
        length = min(length, self.remaining)

        result = bytearray(self._data[self._position : self._position + length])
        self._position += length

        return result

    def _find_next_break_index(self) -> int:
        """
        Finds the index of the next break byte (0xFF) in the input data.

        Returns:
            int: The index of the next break byte, or the length of the data if not found.
        """
        for i in range(self._chunk_start, len(self._data)):
            if self._data[i] == 0xFF:
                return i
        return len(self._data)

    @staticmethod
    def _remove_padding(array: bytearray) -> bytearray:
        """
        Removes padding (trailing 0xFF bytes) from a sequence of bytes.

        Args:
            array (bytearray): The sequence of bytes.

        Returns:
            bytearray: The bytes without padding.
        """
        padding_start = array.find(bytes([0xFF]))
        if padding_start != -1:
            return array[:padding_start]
        return array

    @staticmethod
    def _decode_ansi(bytes: bytearray) -> str:
        """
        Decodes windows-1252 bytes to a string.

        Args:
            bytes (bytearray): The sequence of bytes to decode.

        Returns:
            str: The decoded string.
        """
        return bytes.decode('windows-1252', 'replace')

chunked_reading_mode: bool property writable

bool: Gets or sets the chunked reading mode for the reader.

In chunked reading mode: - The reader will treat 0xFF bytes as the end of the current chunk. - next_chunk() can be called to move to the next chunk.

remaining: int property

If chunked reading mode is enabled, gets the number of bytes remaining in the current

chunk. Otherwise, gets the total number of bytes remaining in the input data.

position: int property

int: Gets the current position in the input data.

__init__(data)

Creates a new EoReader instance for the specified data.

Parameters:

Name Type Description Default
data bytes

The byte array containing the input data.

required
Source code in src/eolib/data/eo_reader.py
23
24
25
26
27
28
29
30
31
32
33
34
def __init__(self, data: bytes):
    """
    Creates a new `EoReader` instance for the specified data.

    Args:
        data (bytes): The byte array containing the input data.
    """
    self._data = memoryview(data)
    self._position = 0
    self._chunked_reading_mode = False
    self._chunk_start = 0
    self._next_break = -1

slice(index=None, length=None)

Creates a new EoReader whose input data is a shared subsequence of this reader's data.

The input data of the new reader will start at position index in this reader and contain up to length bytes. The two reader's position and chunked reading mode will be independent.

The new reader's position will be zero, and its chunked reading mode will be false.

Parameters:

Name Type Description Default
index int

The position in this reader at which the data of the new reader will start; must be non-negative. Defaults to the current reader position.

None
length int

The length of the shared subsequence of data to supply to the new reader; must be non-negative. Defaults to the length of the remaining data starting from index.

None

Returns:

Name Type Description
EoReader EoReader

The new reader.

Raises:

Type Description
ValueError

If index or length is negative.

Source code in src/eolib/data/eo_reader.py
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
def slice(self, index: Optional[int] = None, length: Optional[int] = None) -> "EoReader":
    """
    Creates a new `EoReader` whose input data is a shared subsequence of this reader's
    data.

    The input data of the new reader will start at position `index` in this reader and contain
    up to `length` bytes. The two reader's position and chunked reading mode will be
    independent.

    The new reader's position will be zero, and its chunked reading mode will be false.

    Args:
        index (int, optional): The position in this reader at which the data of the new reader
            will start; must be non-negative. Defaults to the current reader position.
        length (int, optional): The length of the shared subsequence of data to supply to the
            new reader; must be non-negative. Defaults to the length of the remaining data
            starting from `index`.

    Returns:
        EoReader: The new reader.

    Raises:
        ValueError: If `index` or `length` is negative.
    """
    if index is None:
        index = self.position
    if length is None:
        length = max(0, len(self._data) - index)

    if index < 0:
        raise ValueError(f"negative index: {index}")

    if length < 0:
        raise ValueError(f"negative length: {length}")

    begin = max(0, min(len(self._data), index))
    end = begin + min(len(self._data) - begin, length)

    return EoReader(self._data[begin:end])

get_byte()

Reads a raw byte from the input data.

Returns:

Name Type Description
int int

A raw byte.

Source code in src/eolib/data/eo_reader.py
76
77
78
79
80
81
82
83
def get_byte(self) -> int:
    """
    Reads a raw byte from the input data.

    Returns:
        int: A raw byte.
    """
    return self._read_byte()

get_bytes(length)

Reads an array of raw bytes from the input data.

Parameters:

Name Type Description Default
length int

The number of bytes to read.

required

Returns:

Name Type Description
bytearray bytearray

An array of raw bytes.

Source code in src/eolib/data/eo_reader.py
85
86
87
88
89
90
91
92
93
94
95
def get_bytes(self, length: int) -> bytearray:
    """
    Reads an array of raw bytes from the input data.

    Args:
        length (int): The number of bytes to read.

    Returns:
        bytearray: An array of raw bytes.
    """
    return self._read_bytes(length)

get_char()

Reads an encoded 1-byte integer from the input data.

Returns:

Name Type Description
int int

A decoded 1-byte integer.

Source code in src/eolib/data/eo_reader.py
 97
 98
 99
100
101
102
103
104
def get_char(self) -> int:
    """
    Reads an encoded 1-byte integer from the input data.

    Returns:
        int: A decoded 1-byte integer.
    """
    return decode_number(self._read_bytes(1))

get_short()

Reads an encoded 2-byte integer from the input data.

Returns:

Name Type Description
int int

A decoded 2-byte integer.

Source code in src/eolib/data/eo_reader.py
106
107
108
109
110
111
112
113
def get_short(self) -> int:
    """
    Reads an encoded 2-byte integer from the input data.

    Returns:
        int: A decoded 2-byte integer.
    """
    return decode_number(self._read_bytes(2))

get_three()

Reads an encoded 3-byte integer from the input data.

Returns:

Name Type Description
int int

A decoded 3-byte integer.

Source code in src/eolib/data/eo_reader.py
115
116
117
118
119
120
121
122
def get_three(self) -> int:
    """
    Reads an encoded 3-byte integer from the input data.

    Returns:
        int: A decoded 3-byte integer.
    """
    return decode_number(self._read_bytes(3))

get_int()

Reads an encoded 4-byte integer from the input data.

Returns:

Name Type Description
int int

A decoded 4-byte integer.

Source code in src/eolib/data/eo_reader.py
124
125
126
127
128
129
130
131
def get_int(self) -> int:
    """
    Reads an encoded 4-byte integer from the input data.

    Returns:
        int: A decoded 4-byte integer.
    """
    return decode_number(self._read_bytes(4))

get_string()

Reads a string from the input data.

Returns:

Name Type Description
str str

A string.

Source code in src/eolib/data/eo_reader.py
133
134
135
136
137
138
139
140
141
def get_string(self) -> str:
    """
    Reads a string from the input data.

    Returns:
        str: A string.
    """
    string_bytes = self._read_bytes(self.remaining)
    return self._decode_ansi(string_bytes)

get_fixed_string(length, padded=False)

Reads a string with a fixed length from the input data.

Parameters:

Name Type Description Default
length int

The length of the string.

required
padded bool

True if the string is padded with trailing 0xFF bytes.

False

Returns:

Name Type Description
str str

A decoded string.

Raises:

Type Description
ValueError

If the length is negative.

Source code in src/eolib/data/eo_reader.py
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
def get_fixed_string(self, length: int, padded: bool = False) -> str:
    """
    Reads a string with a fixed length from the input data.

    Args:
        length (int): The length of the string.
        padded (bool, optional): True if the string is padded with trailing `0xFF` bytes.

    Returns:
        str: A decoded string.

    Raises:
        ValueError: If the length is negative.
    """
    if length < 0:
        raise ValueError("Negative length")
    bytes_ = self._read_bytes(length)
    if padded:
        bytes_ = self._remove_padding(bytes_)
    return self._decode_ansi(bytes_)

get_encoded_string()

Reads an encoded string from the input data.

Returns:

Name Type Description
str str

A decoded string.

Source code in src/eolib/data/eo_reader.py
164
165
166
167
168
169
170
171
172
173
def get_encoded_string(self) -> str:
    """
    Reads an encoded string from the input data.

    Returns:
        str: A decoded string.
    """
    bytes_ = self._read_bytes(self.remaining)
    decode_string(bytes_)
    return self._decode_ansi(bytes_)

get_fixed_encoded_string(length, padded=False)

Reads an encoded string with a fixed length from the input data.

Parameters:

Name Type Description Default
length int

The length of the string.

required
padded bool

True if the string is padded with trailing 0xFF bytes.

False

Returns:

Name Type Description
str str

A decoded string.

Raises:

Type Description
ValueError

If the length is negative.

Source code in src/eolib/data/eo_reader.py
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
def get_fixed_encoded_string(self, length: int, padded: bool = False) -> str:
    """
    Reads an encoded string with a fixed length from the input data.

    Args:
        length (int): The length of the string.
        padded (bool, optional): True if the string is padded with trailing `0xFF` bytes.

    Returns:
        str: A decoded string.

    Raises:
        ValueError: If the length is negative.
    """
    if length < 0:
        raise ValueError("Negative length")
    bytes_ = self._read_bytes(length)
    decode_string(bytes_)
    if padded:
        bytes_ = self._remove_padding(bytes_)
    return self._decode_ansi(bytes_)

next_chunk()

Moves the reader position to the start of the next chunk in the input data.

Raises:

Type Description
RuntimeError

If not in chunked reading mode.

Source code in src/eolib/data/eo_reader.py
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
def next_chunk(self) -> None:
    """
    Moves the reader position to the start of the next chunk in the input data.

    Raises:
        RuntimeError: If not in chunked reading mode.
    """
    if not self.chunked_reading_mode:
        raise RuntimeError("Not in chunked reading mode.")

    self._position = self._next_break
    if self._position < len(self._data):
        # Skip the break byte
        self._position += 1

    self._chunk_start = self._position
    self._next_break = self._find_next_break_index()

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 &gt; 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 &gt; 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

ProtocolEnumMeta

Bases: EnumMeta

Source code in src/eolib/protocol/protocol_enum_meta.py
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
class ProtocolEnumMeta(EnumMeta):
    def __call__(cls, value, names=None, *, module=None, qualname=None, type=None, start=1):
        if names is not None:
            return super().__call__(
                value, names=names, module=module, qualname=qualname, type=type, start=start
            )
        try:
            return super().__call__(value, module=module, qualname=qualname, type=type, start=start)
        except ValueError:
            unrecognized = int.__new__(cls, value)
            unrecognized._name_ = f"Unrecognized({int(value)})"
            unrecognized._value_ = value
            return unrecognized

__call__(value, names=None, *, module=None, qualname=None, type=None, start=1)

Source code in src/eolib/protocol/protocol_enum_meta.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
def __call__(cls, value, names=None, *, module=None, qualname=None, type=None, start=1):
    if names is not None:
        return super().__call__(
            value, names=names, module=module, qualname=qualname, type=type, start=start
        )
    try:
        return super().__call__(value, module=module, qualname=qualname, type=type, start=start)
    except ValueError:
        unrecognized = int.__new__(cls, value)
        unrecognized._name_ = f"Unrecognized({int(value)})"
        unrecognized._value_ = value
        return unrecognized

AccountReply

Bases: IntEnum

Reply code sent with ACCOUNT_REPLY packet

Source code in src/eolib/protocol/_generated/net/server/account_reply.py
 9
10
11
12
13
14
15
16
17
18
class AccountReply(IntEnum, metaclass=ProtocolEnumMeta):
    """
    Reply code sent with ACCOUNT_REPLY packet
    """
    Exists = 1
    NotApproved = 2
    Created = 3
    ChangeFailed = 5
    Changed = 6
    RequestDenied = 7

Exists = 1 class-attribute instance-attribute

NotApproved = 2 class-attribute instance-attribute

Created = 3 class-attribute instance-attribute

ChangeFailed = 5 class-attribute instance-attribute

Changed = 6 class-attribute instance-attribute

RequestDenied = 7 class-attribute instance-attribute