Skip to content

login_reply_server_packet

LoginReplyServerPacket

Bases: Packet

Login reply

Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
class LoginReplyServerPacket(Packet):
    """
    Login reply
    """
    _byte_size: int = 0
    _reply_code: LoginReply = None # type: ignore [assignment]
    _reply_code_data: 'LoginReplyServerPacket.ReplyCodeData' = None

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

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

    @property
    def reply_code(self) -> LoginReply:
        return self._reply_code

    @reply_code.setter
    def reply_code(self, reply_code: LoginReply) -> None:
        self._reply_code = reply_code

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

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

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

        Returns:
            PacketFamily: The packet family associated with this packet.
        """
        return PacketFamily.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.
        """
        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)

    @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.
        """
        data: LoginReplyServerPacket = LoginReplyServerPacket()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.chunked_reading_mode = True
            data._reply_code = LoginReply(reader.get_short())
            if data._reply_code == LoginReply.WrongUser:
                data._reply_code_data = LoginReplyServerPacket.ReplyCodeDataWrongUser.deserialize(reader)
            elif data._reply_code == LoginReply.WrongUserPassword:
                data._reply_code_data = LoginReplyServerPacket.ReplyCodeDataWrongUserPassword.deserialize(reader)
            elif data._reply_code == LoginReply.Ok:
                data._reply_code_data = LoginReplyServerPacket.ReplyCodeDataOk.deserialize(reader)
            elif data._reply_code == LoginReply.Banned:
                data._reply_code_data = LoginReplyServerPacket.ReplyCodeDataBanned.deserialize(reader)
            elif data._reply_code == LoginReply.LoggedIn:
                data._reply_code_data = LoginReplyServerPacket.ReplyCodeDataLoggedIn.deserialize(reader)
            elif data._reply_code == LoginReply.Busy:
                data._reply_code_data = LoginReplyServerPacket.ReplyCodeDataBusy.deserialize(reader)
            reader.chunked_reading_mode = False
            data._byte_size = reader.position - reader_start_position
            return data
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"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]
    ReplyCodeData.__doc__ = \
        """
        Data associated with different values of the `reply_code` field.
        """

    class ReplyCodeDataWrongUser:
        """
        Data associated with reply_code value LoginReply.WrongUser
        """
        _byte_size: int = 0

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

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


        @staticmethod
        def serialize(writer: EoWriter, data: "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.
            """
            writer.add_string("NO")

        @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.
            """
            data: LoginReplyServerPacket.ReplyCodeDataWrongUser = LoginReplyServerPacket.ReplyCodeDataWrongUser()
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.get_string()
                data._byte_size = reader.position - reader_start_position
                return data
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

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

    class ReplyCodeDataWrongUserPassword:
        """
        Data associated with reply_code value LoginReply.WrongUserPassword
        """
        _byte_size: int = 0

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

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


        @staticmethod
        def serialize(writer: EoWriter, data: "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.
            """
            writer.add_string("NO")

        @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.
            """
            data: LoginReplyServerPacket.ReplyCodeDataWrongUserPassword = LoginReplyServerPacket.ReplyCodeDataWrongUserPassword()
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.get_string()
                data._byte_size = reader.position - reader_start_position
                return data
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

        def __repr__(self):
            return f"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 = None # type: ignore [assignment]
        _characters: list[CharacterSelectionListEntry] = None # type: ignore [assignment]

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

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

        @property
        def characters(self) -> list[CharacterSelectionListEntry]:
            """
            Note:
              - Length must be 252 or less.
            """
            return self._characters

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

        @staticmethod
        def serialize(writer: EoWriter, data: "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.
            """
            if data._characters_count is None:
                raise SerializationError("characters_count must be provided.")
            writer.add_char(data._characters_count)
            writer.add_char(0)
            writer.add_byte(0xFF)
            if data._characters is None:
                raise SerializationError("characters must be provided.")
            if len(data._characters) > 252:
                raise SerializationError(f"Expected length of characters to be 252 or less, got {len(data._characters)}.")
            for i in range(data._characters_count):
                if i > 0:
                    writer.add_byte(0xFF)
                CharacterSelectionListEntry.serialize(writer, data._characters[i])

        @staticmethod
        def deserialize(reader: EoReader) -> "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.
            """
            data: LoginReplyServerPacket.ReplyCodeDataOk = LoginReplyServerPacket.ReplyCodeDataOk()
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                data._characters_count = reader.get_char()
                reader.get_char()
                reader.next_chunk()
                data._characters = []
                for i in range(data._characters_count):
                    data._characters.append(CharacterSelectionListEntry.deserialize(reader))
                    if i + 1 < data._characters_count:
                        reader.next_chunk()
                data._byte_size = reader.position - reader_start_position
                return data
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

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

        @property
        def byte_size(self) -> int:
            """
            Returns the size 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.
            """
            writer.add_string("NO")

        @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.
            """
            data: LoginReplyServerPacket.ReplyCodeDataBanned = LoginReplyServerPacket.ReplyCodeDataBanned()
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.get_string()
                data._byte_size = reader.position - reader_start_position
                return data
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

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

    class ReplyCodeDataLoggedIn:
        """
        Data associated with reply_code value LoginReply.LoggedIn
        """
        _byte_size: int = 0

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

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


        @staticmethod
        def serialize(writer: EoWriter, data: "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.
            """
            writer.add_string("NO")

        @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.
            """
            data: LoginReplyServerPacket.ReplyCodeDataLoggedIn = LoginReplyServerPacket.ReplyCodeDataLoggedIn()
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.get_string()
                data._byte_size = reader.position - reader_start_position
                return data
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

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

    class ReplyCodeDataBusy:
        """
        Data associated with reply_code value LoginReply.Busy
        """
        _byte_size: int = 0

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

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


        @staticmethod
        def serialize(writer: EoWriter, data: "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.
            """
            writer.add_string("NO")

        @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.
            """
            data: LoginReplyServerPacket.ReplyCodeDataBusy = LoginReplyServerPacket.ReplyCodeDataBusy()
            old_chunked_reading_mode: bool = reader.chunked_reading_mode
            try:
                reader_start_position: int = reader.position
                reader.get_string()
                data._byte_size = reader.position - reader_start_position
                return data
            finally:
                reader.chunked_reading_mode = old_chunked_reading_mode

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

reply_code_data: 'LoginReplyServerPacket.ReplyCodeData' property writable

LoginReplyServerPacket.ReplyCodeData: Gets or sets the 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

ReplyCodeDataWrongUser

Data associated with reply_code value LoginReply.WrongUser

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

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

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


    @staticmethod
    def serialize(writer: EoWriter, data: "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.
        """
        writer.add_string("NO")

    @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.
        """
        data: LoginReplyServerPacket.ReplyCodeDataWrongUser = LoginReplyServerPacket.ReplyCodeDataWrongUser()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            data._byte_size = reader.position - reader_start_position
            return data
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

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

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
181
182
183
184
185
186
187
188
189
190
@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.
    """
    writer.add_string("NO")

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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
@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.
    """
    data: LoginReplyServerPacket.ReplyCodeDataWrongUser = LoginReplyServerPacket.ReplyCodeDataWrongUser()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        data._byte_size = reader.position - reader_start_position
        return data
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataWrongUserPassword

Data associated with reply_code value LoginReply.WrongUserPassword

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

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

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


    @staticmethod
    def serialize(writer: EoWriter, data: "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.
        """
        writer.add_string("NO")

    @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.
        """
        data: LoginReplyServerPacket.ReplyCodeDataWrongUserPassword = LoginReplyServerPacket.ReplyCodeDataWrongUserPassword()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            data._byte_size = reader.position - reader_start_position
            return data
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

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

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
233
234
235
236
237
238
239
240
241
242
@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.
    """
    writer.add_string("NO")

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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
@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.
    """
    data: LoginReplyServerPacket.ReplyCodeDataWrongUserPassword = LoginReplyServerPacket.ReplyCodeDataWrongUserPassword()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        data._byte_size = reader.position - reader_start_position
        return data
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataOk

Data associated with reply_code value LoginReply.Ok

Source code in src/eolib/protocol/_generated/net/server/login_reply_server_packet.py
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
class ReplyCodeDataOk:
    """
    Data associated with reply_code value LoginReply.Ok
    """
    _byte_size: int = 0
    _characters_count: int = None # type: ignore [assignment]
    _characters: list[CharacterSelectionListEntry] = None # type: ignore [assignment]

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

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

    @property
    def characters(self) -> list[CharacterSelectionListEntry]:
        """
        Note:
          - Length must be 252 or less.
        """
        return self._characters

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

    @staticmethod
    def serialize(writer: EoWriter, data: "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.
        """
        if data._characters_count is None:
            raise SerializationError("characters_count must be provided.")
        writer.add_char(data._characters_count)
        writer.add_char(0)
        writer.add_byte(0xFF)
        if data._characters is None:
            raise SerializationError("characters must be provided.")
        if len(data._characters) > 252:
            raise SerializationError(f"Expected length of characters to be 252 or less, got {len(data._characters)}.")
        for i in range(data._characters_count):
            if i > 0:
                writer.add_byte(0xFF)
            CharacterSelectionListEntry.serialize(writer, data._characters[i])

    @staticmethod
    def deserialize(reader: EoReader) -> "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.
        """
        data: LoginReplyServerPacket.ReplyCodeDataOk = LoginReplyServerPacket.ReplyCodeDataOk()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            data._characters_count = reader.get_char()
            reader.get_char()
            reader.next_chunk()
            data._characters = []
            for i in range(data._characters_count):
                data._characters.append(CharacterSelectionListEntry.deserialize(reader))
                if i + 1 < data._characters_count:
                    reader.next_chunk()
            data._byte_size = reader.position - reader_start_position
            return data
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

    def __repr__(self):
        return f"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: list[CharacterSelectionListEntry] property writable

Note
  • Length must be 252 or less.

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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
@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.
    """
    if data._characters_count is None:
        raise SerializationError("characters_count must be provided.")
    writer.add_char(data._characters_count)
    writer.add_char(0)
    writer.add_byte(0xFF)
    if data._characters is None:
        raise SerializationError("characters must be provided.")
    if len(data._characters) > 252:
        raise SerializationError(f"Expected length of characters to be 252 or less, got {len(data._characters)}.")
    for i in range(data._characters_count):
        if i > 0:
            writer.add_byte(0xFF)
        CharacterSelectionListEntry.serialize(writer, data._characters[i])

deserialize(reader) staticmethod

Deserializes an instance of 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
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
@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.
    """
    data: LoginReplyServerPacket.ReplyCodeDataOk = LoginReplyServerPacket.ReplyCodeDataOk()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        data._characters_count = reader.get_char()
        reader.get_char()
        reader.next_chunk()
        data._characters = []
        for i in range(data._characters_count):
            data._characters.append(CharacterSelectionListEntry.deserialize(reader))
            if i + 1 < data._characters_count:
                reader.next_chunk()
        data._byte_size = reader.position - reader_start_position
        return data
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataBanned

Data associated with reply_code value LoginReply.Banned

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

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

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


    @staticmethod
    def serialize(writer: EoWriter, data: "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.
        """
        writer.add_string("NO")

    @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.
        """
        data: LoginReplyServerPacket.ReplyCodeDataBanned = LoginReplyServerPacket.ReplyCodeDataBanned()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            data._byte_size = reader.position - reader_start_position
            return data
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

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

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
374
375
376
377
378
379
380
381
382
383
@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.
    """
    writer.add_string("NO")

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
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
@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.
    """
    data: LoginReplyServerPacket.ReplyCodeDataBanned = LoginReplyServerPacket.ReplyCodeDataBanned()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        data._byte_size = reader.position - reader_start_position
        return data
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataLoggedIn

Data associated with reply_code value LoginReply.LoggedIn

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

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

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


    @staticmethod
    def serialize(writer: EoWriter, data: "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.
        """
        writer.add_string("NO")

    @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.
        """
        data: LoginReplyServerPacket.ReplyCodeDataLoggedIn = LoginReplyServerPacket.ReplyCodeDataLoggedIn()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            data._byte_size = reader.position - reader_start_position
            return data
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

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

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
426
427
428
429
430
431
432
433
434
435
@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.
    """
    writer.add_string("NO")

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
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
@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.
    """
    data: LoginReplyServerPacket.ReplyCodeDataLoggedIn = LoginReplyServerPacket.ReplyCodeDataLoggedIn()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        data._byte_size = reader.position - reader_start_position
        return data
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

ReplyCodeDataBusy

Data associated with reply_code value LoginReply.Busy

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

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

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


    @staticmethod
    def serialize(writer: EoWriter, data: "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.
        """
        writer.add_string("NO")

    @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.
        """
        data: LoginReplyServerPacket.ReplyCodeDataBusy = LoginReplyServerPacket.ReplyCodeDataBusy()
        old_chunked_reading_mode: bool = reader.chunked_reading_mode
        try:
            reader_start_position: int = reader.position
            reader.get_string()
            data._byte_size = reader.position - reader_start_position
            return data
        finally:
            reader.chunked_reading_mode = old_chunked_reading_mode

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

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
478
479
480
481
482
483
484
485
486
487
@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.
    """
    writer.add_string("NO")

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
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
@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.
    """
    data: LoginReplyServerPacket.ReplyCodeDataBusy = LoginReplyServerPacket.ReplyCodeDataBusy()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.get_string()
        data._byte_size = reader.position - reader_start_position
        return data
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode

family() staticmethod

Returns the packet family associated with this packet.

Returns:

Name Type Description
PacketFamily PacketFamily

The packet family associated with this packet.

Source code in src/eolib/protocol/_generated/net/server/login_reply_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.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
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.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
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.
    """
    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
 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
@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.
    """
    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)

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
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) -> "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.
    """
    data: LoginReplyServerPacket = LoginReplyServerPacket()
    old_chunked_reading_mode: bool = reader.chunked_reading_mode
    try:
        reader_start_position: int = reader.position
        reader.chunked_reading_mode = True
        data._reply_code = LoginReply(reader.get_short())
        if data._reply_code == LoginReply.WrongUser:
            data._reply_code_data = LoginReplyServerPacket.ReplyCodeDataWrongUser.deserialize(reader)
        elif data._reply_code == LoginReply.WrongUserPassword:
            data._reply_code_data = LoginReplyServerPacket.ReplyCodeDataWrongUserPassword.deserialize(reader)
        elif data._reply_code == LoginReply.Ok:
            data._reply_code_data = LoginReplyServerPacket.ReplyCodeDataOk.deserialize(reader)
        elif data._reply_code == LoginReply.Banned:
            data._reply_code_data = LoginReplyServerPacket.ReplyCodeDataBanned.deserialize(reader)
        elif data._reply_code == LoginReply.LoggedIn:
            data._reply_code_data = LoginReplyServerPacket.ReplyCodeDataLoggedIn.deserialize(reader)
        elif data._reply_code == LoginReply.Busy:
            data._reply_code_data = LoginReplyServerPacket.ReplyCodeDataBusy.deserialize(reader)
        reader.chunked_reading_mode = False
        data._byte_size = reader.position - reader_start_position
        return data
    finally:
        reader.chunked_reading_mode = old_chunked_reading_mode