Difference between revisions of "342 Protocol"
Line 332: | Line 332: | ||
| Logout | | Logout | ||
| Disconnects the client from the server. | | Disconnects the client from the server. | ||
+ | |- | ||
+ | | 240 | ||
+ | | FIXED | ||
+ | | 0 | ||
+ | | Clear screen | ||
+ | | Clears the screen of all open interfaces. | ||
|- | |- | ||
|} | |} |
Revision as of 16:28, 15 August 2009
Contents
- 1 Login Protocol
- 1.1 Variables:
- 1.1.1 Name Hash
- 1.1.2 Return Code
- 1.1.2.1 Return Code Value: 0
- 1.1.2.2 Return Code Value: 1
- 1.1.2.3 Return Code Value: 2
- 1.1.2.4 Return Code Value: 3
- 1.1.2.5 Return Code Value: 4
- 1.1.2.6 Return Code Value: 5
- 1.1.2.7 Return Code Value: 6
- 1.1.2.8 Return Code Value: 7
- 1.1.2.9 Return Code Value: 8
- 1.1.2.10 Return Code Value: 9
- 1.1.2.11 Return Code Value: 10
- 1.1.2.12 Return Code Value: 11
- 1.1.2.13 Return Code Value: 12
- 1.1.2.14 Return Code Value: 13
- 1.1.2.15 Return Code Value: 14
- 1.1.2.16 Return Code Value: 15
- 1.1.2.17 Return Code Value: 16
- 1.1.2.18 Return Code Value: 17
- 1.1.2.19 Return Code Value: 20
- 1.1.2.20 Return Code Value: 21
- 1.1.2.21 Return Code Value: 22
- 1.1.3 Server Session Key
- 1.1.4 "Data File Version"
- 1.1.5 User ID
- 1.1.6 Username
- 1.1.7 Password
- 1.1.8 Client Session Key
- 1.1.9 Connect Status
- 1.1.10 Size
- 1.1.11 Client Version
- 1.1.12 CRC Values
- 1.1.13 Player Status
- 1.1.14 Flagged
- 1.2 Login Process:
- 1.1 Variables:
- 2 Game Protocol
Login Protocol
The Login Protocol for the 342 is very similar in structure to that of the 317 (and other versions). The login is comprised of four stages in which the client and server switch in regards to which one is reading and which one is writing.
Variables:
The login process has a lot of variable data, compiled here is a list of the variables and their different values.
Name Hash
A hash of the player name, thought to be used to select an appropriate login server. This has no use in current private servers.
Return Code
The return code is a code used to identify which part of login the session is currently at.
Return Code Value: 0
Signifies that the session will exchange session keys in order to obtain encryption.
Return Code Value: 1
Signifies that the session should re-attempt the login procedure.
Return Code Value: 2
This is used to signify that the login process has successfully completed.
Return Code Value: 3
Client displays message - "Invalid username or password".
Used to let the player know that the account credentials they have entered are invalid.
Return Code Value: 4
Client displays message - "Your account has been disabled".
Used to tell the player that their account has been banned from the server.
Return Code Value: 5
Client displays message - "Your account is already logged in".
Used to let the player know that their account is already logged in.
Return Code Value: 6
Client displays message - "RuneScape has been updated!".
Used to let the player know that the game has been updated, and they should refresh the page in order to load the new client version.
Return Code Value: 7
Client displays message - "This world is full".
used to let the player know that the world they have selected is full.
Return Code Value: 8
Client displays message - "Unable to connect, loginserver offline".
Used to let the player know that the game server was unable to connect with a loginserver.
Return Code Value: 9
Client displays message - "Login limit exceeded".
Used to let the player know that there are too many current connections from their IP address to log in another account.
Return Code Value: 10
Client displays message - "Unable to connect, bad session ID".
Used to let the player know that the session ID the client provided to the server is bad.
Return Code Value: 11
Client displays message - "Loginserver rejected session".
Used to let the player know that the loginserver that was selected by the game server rejected the session.
Return Code Value: 12
Client displays message - "You need a members account to sign into this world".
Used to let the player know that the world they have selected is a members-only world, and the account they are using is not a member.
Return Code Value: 13
Client displays message - "Could not complete login".
Used to let the player know that the server was unable to complete the login request.
Return Code Value: 14
Client displays message - "Server is being updated".
Used to let the player know that the server is currently being updated, and they should wait for the update to complete.
Return Code Value: 15
Unknown.
Return Code Value: 16
Client displays message - "Login attempts exceeded".
Used to let the player know that they have made too many logins with invalid username+password combinations, and they need to wait 5 minutes in order to try again.
Return Code Value: 17
Client displays message - "You are standing in a members only area".
Used to let the player know that they are attempting to log into a free-world and their character is located in a members-area.
Return Code Value: 20
Client displays message - "Invalid loginserver requested".
Used to let the player know that the loginserver that was requested by the game server is invalid.
Return Code Value: 21
Client displays message - "You have only just left another world".
Used to let the player know that they have just left another world, and they must wait to enter another.
Return Code Value: 22
Client displays message - "Malformed login packet".
Used to let the player know that the login-packet that the client sent to the server was malformed.
Server Session Key
The server-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms.
"Data File Version"
Unknown, quoted from a Winterlove private server.
User ID
The ID of the user.
Username
The username of the player, used to identify their account.
Password
The password of the player account, used so only they can log into their account.
Client Session Key
The client-session-key is one of two ciphers used to encrypt the game protocol, using the ISAAC algorithms.
Connect Status
The status of the connection.
Connect Status Value: 16
Signifies that the connection is new.
Connect Status Value: 18
Signifies that the session is reconnecting a previously lost connection.
Size
The size of the unencrypted login packet, used to determine how many bytes need to be read from the stream by the server.
Client Version
The memory-version of the game client.
Client Version Value: 0
Signifies that the client is a low-memory client.
Client Version Value: 1
Signifies that the client is a high-memory client.
CRC Values
Unknown.
Player Status
The in-game player status - player, player moderator, or administrator.
Player Status Value: 0
Signifies that this player is a normal player.
Player Status Value: 1
Signifies that this player is a player moderator.
Player Status Value: 2
Signifies that this player is an administrator.
Flagged
If set to 1, information about mouse movements etc. are sent to the server. Suspected bot accounts are flagged.
Login Process:
Stage 1: Client -> Server
Type | Value |
---|---|
ubyte | 14 |
ubyte | "name hash" |
Stage 2: Server -> Client
Type | Value |
---|---|
byte | 0 |
byte | 0 |
byte | 0 |
byte | 0 |
byte | 0 |
byte | 0 |
byte | 0 |
byte | 0 |
byte | "return code" |
long | "server session key" |
Stage 3: Client -> Server
Type | Value |
byte | 10 |
int | "datafileversion"[0] |
int | "datafileversion"[1] |
int | "datafileversion"[2] |
int | "datafileversion"[3] |
int | "user id" |
string | "username" |
string | "password" |
long | "client session key" |
long | "server session key" |
byte | "connect status" |
byte | "size" |
byte | 255 |
short | 342 |
byte | "client version" |
int | "crc values"[0] |
int | "crc values"[1] |
int | "crc values"[2] |
int | "crc values"[3] |
int | "crc values"[4] |
int | "crc values"[5] |
int | "crc values"[6] |
int | "crc values"[7] |
int | "crc values"[8] |
Stage 4: Server -> Client
Type | Value |
byte | "return code" |
byte | "player status" |
byte | "flagged" |
Game Protocol
(needs to be documented)
Server -> Client Packets
Opcode | Type | Length (bytes) | Name | Description |
---|---|---|---|---|
192 | FIXED | 0 | Logout | Disconnects the client from the server. |
240 | FIXED | 0 | Clear screen | Clears the screen of all open interfaces. |
Client -> Server Packets
Opcode | Type | Length (bytes) | Name | Description |
---|