Edit on GitHub
This packet is sent by the PangYa server in a variety of circumstances, and has many different forms. The primary function of this packet is to provide a response to the client Login request packet.
The other roles this packet is used in are still fairly related. During
first login, a user is sent this packet with status::need_set_nickname
,
which prompts the client to set a nickname. After that, the login packet
is sent again with status::need_select_character
. Finally, it is sent
with the usual status::success
once the character is selected.
When the server returns error_code::already_logged_in
, the client then
automatically sends
LoginService Client 0x0004 Ghost
to end the old session. This may happen, for example, if your last session
was disconnected before you were able to log out or exit properly. If you
are still connected, the server will instead return
error_code::duplicate_connection
.
In hsreina/pangya-server
, the packet ID is TSLPID.LOGIN
.
See Also: LoginService Client 0x0001 Login Packet
Name | Type | Summary |
---|---|---|
status | u1 | Status code; zero when the login was successful. |
response | switch(status) | |
case | login_success | Case when status == |
case | login_need_set_nickname | Case when status == |
case | login_need_select_character | Case when status == |
case | login_error | Case when status == |
Sent after a successful login.
Name | Type | Summary |
---|---|---|
username | pstring | Name used for authentication. The game typically enforces that this differ from your nickname. |
user_id | u4 | User ID. Probably usually just the primary key in a database. |
unknown | bytes[14] | Some unknown bytes; most of these are zeros. |
nickname | pstring | The user's nickname. As a wrinkle, official servers seem to return an empty string for this after the first login process is completed, despite the fact that a nickname was set already. |
Name | Type | Summary |
---|---|---|
unused | bytes | Appears to just be a constant, 0xff 0xff 0xff 0xff. |
Name | Type | Summary |
---|---|---|
This structure does not have any fields of its own. |
Name | Type | Summary |
---|---|---|
error_code | u4 | An error code. See the error_code enumeration for known possible values. |
Key | Value |
---|---|
status::success | 0 |
status::need_set_nickname | 217 |
status::need_select_character | 218 |
status::error | 227 |
Key | Value |
---|---|
error_code::already_logged_in | 5100019 |
error_code::duplicate_connection | 5100107 |
error_code::invalid_credentials | 5100143 |
error_code::bad_reconnect_token | 5157002 |
meta:
id: loginservice_server_0001_login
title: LoginService Server Login Packet
encoding: ASCII
endian: le
imports:
- ../../common/pstring
seq:
- id: status
type: u1
enum: status
- id: response
type:
switch-on: status
cases:
status::success: login_success
status::need_set_nickname: login_need_set_nickname
status::need_select_character: login_need_select_character
status::error: login_error
types:
login_success:
seq:
- id: username
type: pstring
- id: user_id
type: u4
- id: unknown
size: 14
- id: nickname
type: pstring
login_need_set_nickname:
seq:
- id: unused
contents:
- 255
- 255
- 255
- 255
login_need_select_character:
seq: []
login_error:
seq:
- id: error_code
type: u4
enum: error_code
enums:
status:
0: success
217: need_set_nickname
218: need_select_character
227: error
error_code:
5100019: already_logged_in
5100107: duplicate_connection
5100143: invalid_credentials
5157002: bad_reconnect_token
00000000
packetId = 101 00 data > status = 227e3 data > response > errorCode = 51001436f d2 4d 00 ...o.M.
00000000
packetId = 101 00 data > status = 227e3 data > response > errorCode = 5100019f3 d1 4d 00 .....M.
00000000
packetId = 101 00 data > status = 217d9 data > response > unused = 255,255,255,255ff ff ff ff .......
00000000
packetId = 101 00 data > status = 218da ...
00000000
00000010
packetId = 101 00 data > status = 000 data > response > username > length = 707 00 data > response > username > data = pangbox70 61 6e 67 62 6f 78 data > response > userId = 4834514d2 c4 49 00
data > response > unknown = 0,0,0,0,37,0,0,0,0,0,0,0,0,000 00 00 00 25 00 00 00 00 00 00 00 00 00 data > response > nickname > length = 000 00 .....pangbox..I.
....%...........