2012-11-07 08:54:36 -05:00
[[Category RSC]]
2012-11-13 17:53:48 -05:00
This page refers to the RSC #135 client revision. You can find a partially refactored RSC #135 client [https://bitbucket.org/_mthd0/rsc here].
2012-11-07 08:54:36 -05:00
== '''Packet structure''' ==
2012-12-22 19:13:20 -05:00
<pre>if (len >= 160 {
[byte] (160 + (len / 256))
[byte] (len & 0xff)
} else {
[byte] len
2012-12-22 20:02:18 -05:00
[byte] data[len] // last byte
2012-12-22 19:13:20 -05:00
len--; // skip it
2012-12-22 07:57:30 -05:00
}
2012-12-22 19:13:20 -05:00
[byte] opcode
for (int i = 0; i < len; i++)
[byte] data[i]
2012-12-22 07:57:30 -05:00
</pre>
2012-11-14 18:43:47 -05:00
RSC-135 uses big-endian byte order exclusively.
2012-11-07 08:54:36 -05:00
2012-12-22 10:23:01 -05:00
'''Data types'''
int8 - an 8-bit integer, or byte.<br>
int16 - a 16-bit integer, or short, or WORD.<br>
int32 - a 32-bit integer, or int, or DWORD.<br>
int64 - a 64-bit integer, or long, or QWORD.<br>
u - unsigned<br>
a - [[Data Types#Non Standard Data Types|Special A]]<br>
'''[[Data Types#Bit Access|Bit access]]'''
2012-11-08 13:00:57 -05:00
== '''Reference''' ==
2012-12-22 07:57:30 -05:00
Player usernames are encoded and decoded with the following methods:
2012-11-08 12:55:34 -05:00
2012-12-22 07:57:30 -05:00
<pre>public static long encode_37(String s) {
String s1 = "";
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (c >= 'a' && c <= 'z')
s1 = s1 + c;
else if (c >= 'A' && c <= 'Z')
s1 = s1 + (char) ((c + 97) - 65);
else if (c >= '0' && c <= '9')
s1 = s1 + c;
else
s1 = s1 + ' ';
}
s1 = s1.trim();
if (s1.length() > 12)
s1 = s1.substring(0, 12);
long l = 0L;
for (int j = 0; j < s1.length(); j++) {
char c1 = s1.charAt(j);
l *= 37L;
if (c1 >= 'a' && c1 <= 'z')
l += (1 + c1) - 97;
else if (c1 >= '0' && c1 <= '9')
l += (27 + c1) - 48;
}
return l;
2012-11-11 18:09:11 -05:00
}
2012-12-22 07:57:30 -05:00
public static String decode_37(long l) {
String s = "";
while (l != 0L) {
int i = (int) (l % 37L);
l /= 37L;
if (i == 0) {
s = " " + s;
} else if (i < 27) {
if (l % 37L == 0L)
s = (char) ((i + 65) - 1) + s;
else
s = (char) ((i + 97) - 1) + s;
} else {
s = (char) ((i + 48) - 27) + s;
}
}
return s;
2012-11-14 18:43:47 -05:00
}
2012-11-13 17:28:21 -05:00
</pre>
2012-11-14 18:43:47 -05:00
== '''Login''' ==
* The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20.
* The connection with the server is established.
* The client reads a raw long from the server, this is the "session id".
* The client creates a new frame, opcode 0 or 19 if the player is reconnecting.
* A short, the client's revision number (135) is placed in the buffer.
* A long, the player's username encoded with mod37 (see above) is placed in the buffer.
* A string encoded with RSA and the player's session id (the password) is placed in the buffer.
* An integer, the player's "ranseed" value is placed in the buffer.
** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer.
* The stream is then flushed.
* A byte is read from the stream and discarded.
* Another byte is read, this is the login response code from the server.
2012-11-12 19:01:08 -05:00
2012-11-12 17:32:28 -05:00
{| class="wikitable"
|-
2012-11-12 19:01:08 -05:00
! Login Resp.
2012-11-12 17:32:28 -05:00
! Description
|-
2012-11-12 19:01:08 -05:00
| 0
| Successful login
|-
| 1
|?
|-
| 3
| Invalid username or password
|-
| 4
| Username already in use
|-
| 5
| Client has been updated
|-
| 6
| IP address is already in use
|-
| 7
| Login attempts exceeded
|-
| 11
| Account temporarily disabled
|-
| 12
| Account permanently disabled
|-
| 15
| Server is currently full
|-
| 16
| Members-only server
|-
| 17
2012-11-14 18:43:47 -05:00
| Members-only area?
2012-11-12 17:32:28 -05:00
|}
2012-11-12 09:45:43 -05:00
2012-11-14 18:43:47 -05:00
== '''Registration''' ==
* The username and password are prepared. This is done by replacing any spaces or illegal characters with _ and appending spaces to the string until its length is 20.
* The connection with the server is established.
* The client reads a raw long from the server, this is the "session id".
* The client creates a new frame, opcode 2.
* A short, the client's revision number (135) is placed in the buffer.
* A long, the player's username encoded with mod37 (see above) is placed in the buffer.
* A short, the applet's "referid" parameter is placed in the buffer.
* A string encoded with RSA and the player's session id (the password) is placed in the buffer.
* An integer, the player's "ranseed" value is placed in the buffer.
** "ranseed" does not seed anything. RSC135 does not use ISAAC ciphering. It is an applet parameter or read from uid.dat. Presumably, it was used to identify players connecting from the same computer.
* The stream is then flushed.
* A byte is read from the stream and discarded.
* Another byte is read, this is the newplayer response code from the server.
2012-11-12 17:32:28 -05:00
{| class="wikitable"
|-
2012-11-12 19:01:08 -05:00
! Newp Resp.
2012-11-12 17:32:28 -05:00
! Description
|-
2012-11-12 19:01:08 -05:00
| 2
| Successful registration
|-
| 3
| Username already taken
|-
| 5
| Client has been updated
|-
| 6
| IP address is already in use
|-
| 7
| Registration attempts exceeded?
2012-11-12 17:32:28 -05:00
|}
2012-11-07 08:54:36 -05:00
2012-12-23 10:25:54 -05:00
== '''Player Appearance Update''' ==
First, create a new packet with the opcode 250. Add the total number of expected updates ([u]int16).
Then, for each 'thing' to update, write the (server) index of the player the update applies to ([u]int16), and the 'update type' (int8) followed by whatever data that update type expects.
'''Update type 1 - Public chat messages'''
* [u]int8 - The length of the chat message.
* string (raw) - The chat message, scrambled by the sender's client.
'''Update type 2 - Combat damage'''
* [u]int8 - The damage recieved.
* [u]int8 - That player's 'current' hitpoints level.
* [u]int8 - That player's 'base' hitpoints
'''Update type 3/4 - Projectiles'''
The update type is 3 when the target is a NPC, or 4 is the target is a player.
The standard magic projectile id is 1, and the standard ranged projectile id is 2.
* [u]int16 - The projectile's id.
* [u]int16 - The (server) index of the projectile's target entity.
'''Update type 5 - Appearance'''
Hair style, body type, leg type, and colours are as they are sent by the client's character design packet.
* [u]int16 - The player's status? Doesn't appear to do anything. Jagex's server sends 9144.
* [u]int64 - The player's username encoded with mod37.
* [u]int8 - The size of the sub-update (but it reads by order so what's the point?)
** [u]int8 - The player's hair style + 1, or 0 if they are wearing a hemlet
** [u]int8 - The player's body type + 1, or 0 if they are wearing a platebody
** [u]int8 - The player's leg type + 1, or 0 if they are wearing legs
** [u]int8 - The animation id + 1 (look in the client) of the player's offhand item or 0.
** [u]int8 - The animation id + 1 of the player's hand item or 0.
** [u]int8 - The animation id + 1 of the player's head item or 0.
** [u]int8 - The animation id + 1 of the player's body item or 0.
** [u]int8 - The animation id + 1 of the player's leg item or 0.
** [u]int8 - The animation id + 1 of the player's neck item or 0.
** [u]int8 - The animation id + 1 of the player's shoes or 0.
** [u]int8 - The animation id + 1 of the player's gloves or 0.
** [u]int8 - The animation id + 1 of the player's cape or 0.
* [u]int8 - The player's hair colour.
* [u]int8 - The player's top colour.
* [u]int8 - The player's leg colour.
* [u]int8 - The player's skin colour.
* [u]int8 - The player's combat level.
* [u]int8 - 1 if the player is skulled.
2012-11-14 18:43:47 -05:00
== '''Packets''' ==
The packet opcodes are unchanged from previous revisions, presumably this was before the protocol was being regularly modified to deter the developers of bots such as [[AutoRune]]. The payload/structure is quite similar to most other RSC revisions.
=== '''Incoming Data''' ===
2012-12-23 10:25:54 -05:00
'''TODO: Duelling stuff, fully document 244, 240, NPCs '''
2012-11-14 18:43:47 -05:00
{| class="wikitable"
|-
2012-12-22 10:23:01 -05:00
! scope="col" width="140px" | Name
! scope="col" width="50px" | Opcode
! scope="col" width="350px" | Payload
! scope="col" width="300px" | Description
2012-11-14 18:43:47 -05:00
|-
! Display Message
| 8 ||
2012-12-22 10:23:01 -05:00
* string - A raw string, the message.
| Informs the client of a line to be printed in the in-game message box. Messages preceded by @que@ are sent to the quest history box, messages preceded by @pri@ are sent to the private chat history box.
2012-11-14 18:43:47 -05:00
|-
! Close Connection
| 9 ||
2012-12-22 10:23:01 -05:00
* None
| Forces the client to log out.
2012-11-14 18:43:47 -05:00
|-
! Logout Failed
| 10 ||
2012-12-22 10:23:01 -05:00
* None
| You can't log out now!
2012-11-14 18:43:47 -05:00
|-
! Initialize Friends List
| 23 ||
2012-12-22 10:23:01 -05:00
* uint8 - The total number of players in the list.
* uint64... - The friend's username, encoded with mod37.
* uint8... - The world the friend is logged in to. 0 indicates the player is logged out.
| Initializes the player's friends list. Variable length.
2012-11-14 18:43:47 -05:00
|-
! Update Friends List
| 24 ||
2012-12-22 10:23:01 -05:00
* uint64 - The friend's username, encoded with mod37.
* uint8 - 0 if the friend is logged in, 1 if the friend is logged out.
| Informs the client that a friend has logged in/out or that a new friend has been added to the list.
2012-11-14 18:43:47 -05:00
|-
2012-12-22 10:23:01 -05:00
! Initialize Ignore List
2012-11-14 18:43:47 -05:00
| 26 ||
2012-12-22 10:23:01 -05:00
* uint8 - The total number of players in the list.
* uint64... - The friend's username, encoded with mod37.
| Initializes the player's ignore list. Variable length.
2012-11-14 18:43:47 -05:00
|-
2012-12-22 07:57:30 -05:00
! Initialize Privacy Settings
2012-11-14 18:43:47 -05:00
| 27 ||
2012-12-22 10:23:01 -05:00
* int8 - 0/1. Block public chat messages.
* int8 - 0/1. Block private chat messages.
* int8 - 0/1. Block trade requests.
* int8 - 0/1. Block duel requests.
| Initializes the player's privacy settings.
2012-11-14 18:43:47 -05:00
|-
! Private Message
| 28 ||
2012-12-22 10:23:01 -05:00
* uint64 - The sender's username, encoded with mod37.
* string - The message, scrambled by the sender's client.
| Sends a private message to the client.
2012-11-14 18:43:47 -05:00
|-
2012-12-22 10:23:01 -05:00
! Player Movement
2012-11-14 18:43:47 -05:00
| 255 ||
2012-12-22 10:34:45 -05:00
* bits[10] - The player's x position.
* bits[12] - The player's y position.
2012-12-22 10:23:01 -05:00
* bits[4] - The player's direction.
* bits[8] - The number of players to update.
* bits[1]... - 0 if the player has not moved and the dir has not changed, otherwise 1
* bits[1]... - 1 if the player has not moved, but new dir
* bits[3/4]... - player's last direction (3), player's direction (4), or -1 to remove the player (4).
| Updates the position of the client's player and the movement status of nearby players. Usually sent every game engine tick (600ms) rather than when needed as with other packets. Variable length.
2012-11-14 18:43:47 -05:00
|-
2012-12-22 07:57:30 -05:00
! Ground Item Positions
2012-11-14 18:43:47 -05:00
| 254 ||
2012-12-22 10:23:01 -05:00
* uint16 - The id of the item to update
* int8 - The x position of the item relative to the player (item_x - player_x)
* int8 - The y position of the item relative to the player (item_y - player_y)
| Updates the positions of nearby ground items. if ((id & 0x8000) == 0), remove the item. Therefore, if the server increments the id by 0x8000, the item will be removed by the client. Variable length.
2012-11-14 18:43:47 -05:00
|-
2012-12-22 07:57:30 -05:00
! Object Positions
2012-11-14 18:43:47 -05:00
| 253 ||
2012-12-22 10:23:01 -05:00
* uint16 - The id of the object to update
* int8 - The x position of the object relative to the player (object_x - player_x)
* int8 - The y position of the object relative to the player (object_y - player_y)
| Updates the positions of nearby objects. Variable length. If the id is real fuckin' big, remove it.
2012-11-14 18:43:47 -05:00
|-
2012-12-22 07:57:30 -05:00
! Whole Inventory
2012-11-14 18:43:47 -05:00
| 252 ||
2012-12-22 10:23:01 -05:00
* uint8 - The number of items in the player's inventory.
* uint16... - The item's id. If equipped, increment by 0x8000.
* uint32a... - The item's stack size. Only sent when the item is stackable.
| Sends over the player's whole inventory. Variable length.
2012-11-14 18:43:47 -05:00
|-
2012-12-22 07:57:30 -05:00
! Players (Appearance)
2012-11-14 18:43:47 -05:00
| 250 ||
2012-12-23 10:25:54 -05:00
* See [[135 Protocol#Player Appearance Update|Player Appearance Update]]
| Updates things to do with nearby players that aren't related to movement.
2012-11-14 18:43:47 -05:00
|-
2012-12-22 07:57:30 -05:00
! Boundary Positions
2012-11-14 18:43:47 -05:00
| 249 ||
2012-12-22 10:23:01 -05:00
* uint16 - The id of the bound to update
* int8 - The x position of the bound relative to the player (object_x - player_x)
* int8 - The y position of the bound relative to the player (object_y - player_y)
* int8 - The bound's direction
| Updates the positions of nearby bounds. Variable length. If the id is real fuckin' big, remove it.
2012-11-14 18:43:47 -05:00
|-
2012-12-22 10:23:01 -05:00
! NPC Movement
2012-11-14 18:43:47 -05:00
| 248 ||
* ?
| ?
|-
2012-12-22 07:57:30 -05:00
! NPCs (Appearance)
2012-11-14 18:43:47 -05:00
| 247 ||
* ?
| ?
|-
2012-12-22 07:57:30 -05:00
! Display Dialog
2012-11-14 18:43:47 -05:00
| 246 ||
2012-12-22 10:23:01 -05:00
* uint8 - The total number of options.
* uint8... - The length of the option string.
* string... - The option string.
| Displays a NPC chat dialog. Variable length.
2012-11-14 18:43:47 -05:00
|-
! Hide Dialog
| 245 ||
2012-12-22 10:23:01 -05:00
* None
| Hides the NPC chat dialog.
2012-11-14 18:43:47 -05:00
|-
2012-12-22 07:57:30 -05:00
! Initialize World
2012-11-14 18:43:47 -05:00
| 244 ||
2012-12-22 10:23:01 -05:00
* uint16 - The player's server index.
* uint16 - ? (2304)
* uint16 - ? (1776)
2012-12-22 10:34:45 -05:00
* uint16 - The player's height level (player_y / 944).
2012-12-22 10:23:01 -05:00
* uint16 - ? (944)
| Initializes the world. Sent when the player first logs in, and when the player is teleported or moves up/down a height.
2012-11-14 18:43:47 -05:00
|-
2012-12-22 07:57:30 -05:00
! All Skills
2012-11-14 18:43:47 -05:00
| 243 ||
2012-12-22 10:23:01 -05:00
* for (int i = 0; i < skill_count; i++)
* uint8... - The skill's current level.
* for (int i = 0; i < skill_count; i++)
* uint8... - The skill's base level.
* for (int i = 0; i < skill_count; i++)
* uint32... - The skill's xp points.
* uint8 - The player's quest points.
| Updates all of the player's skills and quest points. The 135 client reads 18 skills: Attack, Defense, Strength, Hits, Ranged, Prayer, Magic, Cooking, Woodcutting, Fletching, Fishing, Firemaking, Crafting, Smithing, Mining, Herblaw, Carpentry, Thieving.
2012-11-14 18:43:47 -05:00
|-
! Equipment Bonuses
| 242 ||
2012-12-22 10:23:01 -05:00
* uint8 - The armour's bonus.
* uint8 - The weapon's accuracy bonus.
* uint8 - The weapon's strength bonus.
* uint8 - The magic bonus.
* unit8 - The prayer bonus.
| Updates the player's equipment bonuses. Variable length.
2012-11-14 18:43:47 -05:00
|-
! Player Death
| 241 ||
2012-12-22 10:23:01 -05:00
* None
| Displays the "Oh dear! You are dead..." screen.
2012-11-14 18:43:47 -05:00
|-
2012-12-22 07:57:30 -05:00
! Update Environment
2012-11-14 18:43:47 -05:00
| 240 ||
* ?
| ?
|-
2012-12-22 07:57:30 -05:00
! Display Character Design
2012-11-14 18:43:47 -05:00
| 239 ||
2012-12-22 10:23:01 -05:00
* None
| Displays the character design interface.
2012-11-14 18:43:47 -05:00
|-
! Display Trade Offer
| 238 ||
2012-12-22 10:23:01 -05:00
* uint16 - The server index of the player we are trading with.
| Displays the trade offer interface.
2012-11-14 18:43:47 -05:00
|-
! Hide Trade
| 237 ||
2012-12-22 10:23:01 -05:00
* None
| Hides the trade offer and confirm interfaces.
2012-11-14 18:43:47 -05:00
|-
! Update Trade Offer
| 236 ||
2012-12-22 10:23:01 -05:00
* int8 - The number of items the other player has traded.
* uint16... - The item's id.
* uint32a... - The item's stack size.
| Updates the other player's trade offer.
2012-11-14 18:43:47 -05:00
|-
! Other's Trade Status
| 235 ||
2012-12-22 10:23:01 -05:00
* int8 - 1 = yes, anything else = no
| Has the other player accepted the trade offer?
2012-11-14 18:43:47 -05:00
|-
! Display Shop
| 234 ||
2012-12-22 10:23:01 -05:00
* uint8 - The number of items in the shop.
* int8 - 1 if the shop is a general store.
* uint8 - This shop's selling price modifier.
* uint8 - This shop's buying price modifier.
* uint16... - The item's id.
* uint16... - The item's stack size.
* uint8... - The item's price.
| Displays the shop interface. Variable length.
2012-11-14 18:43:47 -05:00
|-
! Hide Shop
| 233 ||
2012-12-22 10:23:01 -05:00
* None
| Hides the shop interface.
2012-11-14 18:43:47 -05:00
|-
! Our Trade Status
| 229 ||
2012-12-22 10:23:01 -05:00
* int8 - 1 = yes, anything else = no
| Have we accepted the trade offer?
2012-11-14 18:43:47 -05:00
|-
2012-12-22 07:57:30 -05:00
! Init Game Settings
2012-11-14 18:43:47 -05:00
| 228 ||
2012-12-22 10:23:01 -05:00
* int8 - Automatic camera rotation. 1 = enabled, anything else is disabled.
* int8 - Single mouse button. 1 = enabled, anything else is disabled.
* int8 - Sound effects. 1 = disabled, anything else is enabled.
| Sets the player's gameplay settings.
2012-11-14 18:43:47 -05:00
|-
2012-12-22 07:57:30 -05:00
! Set Prayers
2012-11-14 18:43:47 -05:00
| 227 ||
2012-12-22 10:23:01 -05:00
* int8... - The prayer's status. 1 = enabled, anything else is disabled.
| Sets the status of every prayer. Variable length.
2012-11-14 18:43:47 -05:00
|-
2012-12-22 07:57:30 -05:00
! Set Quests
2012-11-14 18:43:47 -05:00
| 226 ||
2012-12-22 10:23:01 -05:00
* int8... - The quest's completion status. 1 = completed, anything else is incomplete.
| Sets the player's quest completion status. Variable length.
2012-11-14 18:43:47 -05:00
|-
! Display Bank
| 222 ||
2012-12-22 16:24:38 -05:00
* uint8 - The number of items in the player's bank.
* uint8 - The maximum number of items the player is allowed to store.
2012-12-22 10:23:01 -05:00
* uint16... - The item's id.
* uint32a... - The item's stack size.
| Displays the bank interface. Variable length.
2012-11-14 18:43:47 -05:00
|-
! Hide Bank
| 221 ||
2012-12-22 10:23:01 -05:00
* None
| Hides the bank interface.
2012-11-14 18:43:47 -05:00
|-
! Bank Update
| 214 ||
2012-12-22 10:23:01 -05:00
* uint8 - The item's slot.
* uint16 - The item's id.
* uint32a - The item's stack size. 0 to remove.
| Updates/adds/removes a single item in the bank interface to save bytes.
2012-11-14 18:43:47 -05:00
|-
2012-12-22 07:57:30 -05:00
! Single XP Update
2012-11-14 18:43:47 -05:00
| 220 ||
2012-12-22 10:23:01 -05:00
* uint8 - The skill's id.
* uint32 - The skill's xp.
| Updates a single skill's XP to save bytes.
2012-11-14 18:43:47 -05:00
|-
! Update InvItem
| 213 ||
2012-12-22 10:23:01 -05:00
* uint8 - The item's slot.
* uint16 - The item's id. Increment by 0x7fff to change stack size.
* uint32a - The item's stack size. May not be read.
| Adds a single item, or changes the ID, or changes the stack size to save bytes. If id / 32768 == 1, the item is equipped.
2012-11-14 18:43:47 -05:00
|-
! Remove InvItem
| 212 ||
2012-12-22 10:23:01 -05:00
* uint8 - The item's slot.
| Removes a single item from the player's inventory to save bytes.
2012-11-14 18:43:47 -05:00
|-
2012-12-22 07:57:30 -05:00
! Single Skill Update
2012-11-14 18:43:47 -05:00
| 211 ||
2012-12-22 10:23:01 -05:00
* uint8 - The skill's id.
* uint8 - The skill's current level.
* uint8 - The skill's base level.
* uint32 - The skill's experience points.
| Updates a single skill to save bytes.
2012-11-14 18:43:47 -05:00
|-
|}
2012-11-12 17:32:28 -05:00
=== '''Outgoing Data''' ===
2012-11-14 17:38:19 -05:00
'''TODO: Password recovery & recovery questions, 254'''
2012-11-08 12:10:49 -05:00
{| class="wikitable"
2012-11-08 11:56:46 -05:00
|-
2012-12-22 10:23:01 -05:00
! scope="col" width="140px" | Name
! scope="col" width="50px" | Opcode
! scope="col" width="350px" | Payload
! scope="col" width="300px" | Description
2012-11-08 11:56:46 -05:00
|-
2012-11-10 08:43:16 -05:00
! Disconnect
| 1 ||
* None
2012-11-11 10:59:20 -05:00
| Sends the disconnect packet
2012-11-10 08:43:16 -05:00
|-
2012-11-08 12:05:17 -05:00
! Newplayer (Registration)
| 2 ||
2012-12-22 10:23:01 -05:00
* int16 - The client's revision number (135)
* int64 - Long representation of the username
* int16 - Referrer ID
2012-11-08 12:05:17 -05:00
** Integer.parseInt(getParameter("referrerid"));
2012-12-22 10:23:01 -05:00
* The password encrypted with RSA
* int32 - The "ranseed" value
2012-11-12 17:32:28 -05:00
| Registers a new user.
|-
! Login
2012-11-14 18:43:47 -05:00
| 0 ||
2012-12-22 10:23:01 -05:00
* int16 - The client's revision number (135)
* int64 - Long representation of the username
* The password encrypted with RSA
* int32 - The "ranseed" value
2012-11-14 18:43:47 -05:00
| Logs the player in.
|-
2012-12-22 10:23:01 -05:00
! Public Chat
| 3 ||
* String - The message, scrambled.
| Sends a message to public chat.
|-
2012-11-14 18:43:47 -05:00
! Reconnect
| 19 ||
* Same as 0
| Reconnects the player after they are disconnected.
2012-11-08 12:08:49 -05:00
|-
! Logout
| 6 ||
2012-11-08 12:10:49 -05:00
* None
2012-11-08 12:08:49 -05:00
| Sends the logout packet to the server
2012-11-08 12:05:53 -05:00
|-
2012-11-12 17:32:28 -05:00
! Admin Command
2012-11-08 12:46:13 -05:00
| 7 ||
* String - The command
| Sends a command to the server to be executed
|-
2012-11-08 12:51:37 -05:00
! Report Abuse
| 10 ||
2012-12-22 10:23:01 -05:00
* int64 - The long representation of the username to report
2012-11-08 12:51:37 -05:00
| Sends an abuse report to the server
|-
! Add Friend
2012-11-08 12:01:18 -05:00
| 26 ||
2012-12-22 10:23:01 -05:00
* int64 - long representation of username
2012-11-08 12:08:49 -05:00
| Adds a user to your friends list
2012-11-08 12:51:37 -05:00
|-
! Remove Friend
| 27 ||
2012-12-22 10:23:01 -05:00
* int64 - The long representation of the username to report
2012-11-08 12:51:37 -05:00
| Removes a user from your friends list
|-
! Send Message
| 28 ||
2012-12-22 10:23:01 -05:00
* int64 - The long representation of the username to send the message to
* String - The message, scrambed
2012-11-08 12:51:37 -05:00
| Sends a message to the specified user
|-
! Ignore User
| 29 ||
2012-12-22 10:23:01 -05:00
* int64 - The long representation of the username to ignore
2012-11-08 12:51:37 -05:00
| Adds a user to your ignore list
2012-11-10 16:50:56 -05:00
|-
2012-11-12 17:32:28 -05:00
! Walk to Tile
| 255 ||
2012-12-22 10:23:01 -05:00
* int16 - (start_x + area_x). The initial position.
* int16 - (start_y + area_y)
* int8... - (route_x[i] - start_x)
* int8... - (route_y[i] - start_y)
2012-11-12 17:32:28 -05:00
| Variable length. Walks to a tile. The number of steps can be calculated by dividing the available data by 2.
|-
! Walk to Entity
| 215 ||
* The same as 255.
| Variable length. Walks to an entity. The number of steps can be calculated by dividing the available data by 2.
|-
! Acknowledge Players
| 254 ||
2012-12-22 10:23:01 -05:00
* int16 - Size?
* int16... - The player's server index
* int16... - ???
| Variable length. Informs the server of players. Why?
2012-11-12 17:32:28 -05:00
|-
2012-11-10 16:50:56 -05:00
! Drop Item
| 251 ||
2012-12-22 10:23:01 -05:00
* int16 - The slot of the item to drop
2012-11-10 16:50:56 -05:00
| Drops the specified item on the ground
2012-11-12 09:25:15 -05:00
|-
2012-11-12 17:32:28 -05:00
! Cast on Item
2012-11-12 09:25:15 -05:00
| 220 ||
2012-12-22 10:23:01 -05:00
* int16 - The slot of the item to cast a spell on
* int16 - The id of the spell to cast
2012-11-12 09:25:15 -05:00
| Casts a spell (such as High Alchemy) on the specified item
|-
2012-11-12 17:32:28 -05:00
! Use with Item
2012-11-12 09:25:15 -05:00
| 240 ||
2012-12-22 10:23:01 -05:00
* int16 - The slot of the first item to use
* int16 - The slot of the second item to use
2012-11-12 09:25:15 -05:00
| Uses an item in the player's inventory with another item in the player's inventory
|-
! Remove Item
| 248 ||
2012-12-22 10:23:01 -05:00
* int16 - The slot of the item to unequip
2012-11-12 17:32:28 -05:00
| Unequips the specified inventory item
2012-11-12 09:25:15 -05:00
|-
! Wear Item
| 249 ||
2012-12-22 10:23:01 -05:00
* int16 - The slot of the item to equip
2012-11-12 17:32:28 -05:00
| Equips the specified inventory item
2012-11-12 09:25:15 -05:00
|-
2012-11-12 17:32:28 -05:00
! Item Command
2012-11-12 09:25:15 -05:00
| 246 ||
2012-12-22 10:23:01 -05:00
* int16 - The slot of the item to use
2012-11-12 17:32:28 -05:00
| Buries, eats, etc the specified inventory item
2012-11-12 09:45:43 -05:00
|-
! Select Option
| 237 ||
2012-12-22 10:23:01 -05:00
* int8 - The position of the option in the dialog_options array
2012-11-12 09:45:43 -05:00
| Selects an option in a dialog (dialog referring to, for example, the menu displayed when certing)
|-
2012-11-12 17:32:28 -05:00
! Combat Style
2012-11-12 09:45:43 -05:00
| 231 ||
2012-12-22 10:23:01 -05:00
* int8 - The position of the combat style in the list
2012-11-12 17:32:28 -05:00
| Sets the player's combat style.
* 0 - Controlled
* 1 - Aggressive
* 2 - Accurate
* 3 - Defensive
2012-11-12 09:45:43 -05:00
|-
! Close Bank
| 207 ||
* None
| Informs the server that the player has closed the banking interface.
|-
! Withdraw Item
| 206 ||
2012-12-22 10:23:01 -05:00
* int16 - The ID of the item to withdraw
* int16 - The amount of the specified item to withdraw
2012-11-12 09:45:43 -05:00
| Withdraws a single type of item from the player's bank.
|-
! Deposit Item
| 205 ||
2012-12-22 10:23:01 -05:00
* int16 - The ID of the item to deposit
* int16 - The amount of the specified item to deposit
2012-11-12 09:45:43 -05:00
| Deposits a single type of item into the player's bank.
|-
! Disable Prayer
| 211 ||
2012-12-22 10:23:01 -05:00
* int8 - The ID of the prayer to disable
2012-11-12 09:45:43 -05:00
| Disables a prayer.
|-
! Enable Prayer
| 212 ||
2012-12-22 10:23:01 -05:00
* int8 - The ID of the prayer to enable
2012-11-12 09:45:43 -05:00
| Enables a prayer.
2012-11-12 17:32:28 -05:00
|-
! Confirm Trade
| 202 ||
* None
| Confirms the trade offer.
|-
! Accept Trade
| 232 ||
* None
| Accepts the trade offer.
|-
! Decline Trade
| 233 ||
* None
| Declines the trade offer.
|-
! Trade Update
| 234 ||
2012-12-22 10:23:01 -05:00
* int8 - The amount of traded items to send to the server
* int16... - The id of the item
* int32... - The amount/stack size of the item
2012-11-12 17:32:28 -05:00
| Variable length. Updates the trade offer.
|-
! Cast on GItem
| 224* ||
2012-12-22 10:23:01 -05:00
* int16 - The item's X coordinate
* int16 - The item's Y coordinate
* int16 - The item's ID
* int16 - The spell's ID
2012-11-12 17:32:28 -05:00
| Casts a spell on an item on the ground.
|-
! Use with GItem
| 250* ||
2012-12-22 10:23:01 -05:00
* int16 - The item's X coordinate
* int16 - The item's Y coordinate
* int16 - The item's ID
* int16 - The inventory slot
2012-11-12 17:32:28 -05:00
| Uses an item in the player's inventory with an item on the ground.
|-
! Take GItem
| 252* ||
2012-12-22 10:23:01 -05:00
* int16 - The item's X coordinate
* int16 - The item's Y coordinate
* int16 - The item's ID
2012-11-12 17:32:28 -05:00
| Picks up an item on the ground.
|-
! Cast on Boundary
| 223* ||
2012-12-22 10:23:01 -05:00
* int16 - The bound's X coordinate
* int16 - The bound's Y coordinate
* int8 - The bound's direction
* int16 - The spell's ID
2012-11-12 17:32:28 -05:00
| Casts a spell on a boundary (or 'wall object').
|-
! Use with Boundary
| 239* ||
2012-12-22 10:23:01 -05:00
* int16 - The bound's X coordinate
* int16 - The bound's Y coordinate
* int8 - The bound's direction
* int16 - The inventory slot
2012-11-12 17:32:28 -05:00
| Uses an item in the player's inventory with a boundary (or 'wall object').
|-
! Boundary Cmd 1
| 238* ||
2012-12-22 10:23:01 -05:00
* int16 - The bound's X coordinate
* int16 - The bound's Y coordinate
* int8 - The bound's direction
2012-11-12 17:32:28 -05:00
| Performs the primary action (usually 'open') on a boundary (or 'wall object').
|-
! Boundary Cmd 2
| 229* ||
2012-12-22 10:23:01 -05:00
* int16 - The bound's X coordinate
* int16 - The bound's Y coordinate
* int8 - The bound's direction
2012-11-12 17:32:28 -05:00
| Performs the secondary action (usually 'close' or 'picklock') on a boundary (or 'wall object').
|-
! Cast on Object
| 222* ||
2012-12-22 10:23:01 -05:00
* int16 - The object's X coordinate
* int16 - The object's Y coordinate
* int16 - The spell's ID
2012-11-12 17:32:28 -05:00
| Casts a spell on an object. Unused?
|-
! Use with Object
| 241* ||
2012-12-22 10:23:01 -05:00
* int16 - The object's X coordinate
* int16 - The object's Y coordinate
* int16 - The inventory slot
2012-11-12 17:32:28 -05:00
| Uses an item in the player's inventory with an object.
|-
! Object Cmd 1
| 241* ||
2012-12-22 10:23:01 -05:00
* int16 - The object's X coordinate
* int16 - The object's Y coordinate
2012-11-12 17:32:28 -05:00
| Performs the primary action on an object (for example, 'mine').
|-
! Object Cmd 2
| 230* ||
2012-12-22 10:23:01 -05:00
* int16 - The object's X coordinate
* int16 - The object's Y coordinate
2012-11-12 17:32:28 -05:00
| Performs the secondary action on an object (for example, 'prospect').
|-
! Cast on NPC
| 225* ||
2012-12-22 10:23:01 -05:00
* int16 - The NPC's server index
* int16 - The spell's ID
2012-11-12 17:32:28 -05:00
| Casts a spell on a non-player character.
|-
! Use with NPC
| 243* ||
2012-12-22 10:23:01 -05:00
* int16 - The NPC's server index
* int16 - The inventory slot
2012-11-12 17:32:28 -05:00
| Uses an item in the player's inventory with a non-player character.
|-
! Talk to NPC
| 245* ||
2012-12-22 10:23:01 -05:00
* int16 - The NPC's server index
2012-11-12 17:32:28 -05:00
| Starts talking to a non-player character.
|-
! Attack NPC
| 244* ||
2012-12-22 10:23:01 -05:00
* int16 - The NPC's server index
2012-11-12 17:32:28 -05:00
| Starts attacking a non-player character.
|-
! NPC Cmd 2
| 195* ||
2012-12-22 10:23:01 -05:00
* int16 - The NPC's server index
2012-11-12 17:32:28 -05:00
| Performs the secondary action on a non-player character, usually 'pickpocket'.
|-
! Cast on Player
| 226* ||
2012-12-22 10:23:01 -05:00
* int16 - The player's server index
* int16 - The spell's ID
2012-11-12 17:32:28 -05:00
| Casts a spell on another player.
|-
! Use with Player
| 219* ||
2012-12-22 10:23:01 -05:00
* int16 - The player's server index
* int16 - The inventory slot
2012-11-12 17:32:28 -05:00
| Uses an item (for example, a Gnomeball, or a Christmas cracker) on another player.
|-
! Attack Player
| 228* ||
2012-12-22 10:23:01 -05:00
* int16 - The player's server index
2012-11-12 17:32:28 -05:00
| Starts attacking another player.
|-
! Trade Player
| 235 ||
2012-12-22 10:23:01 -05:00
* int16 - The player's server index
2012-11-12 17:32:28 -05:00
| Sends a trade request to another player.
|-
! Follow Player
| 214 ||
2012-12-22 10:23:01 -05:00
* int16 - The player's server index
2012-11-12 17:32:28 -05:00
| Starts following another player.
|-
! Duel Player
| 204 ||
2012-12-22 10:23:01 -05:00
* int16 - The player's server index
2012-11-12 17:32:28 -05:00
| Sends a duel request to another player.
2012-11-12 17:52:51 -05:00
|-
! RuntimeException
| 17 ||
* String - The text of the error.
| Sent when the client throws an exception while processing data sent by the server.
2012-11-14 17:38:19 -05:00
|-
! Confirm Duel Offer
| 198 ||
* None
| Confirms the duel offer.
|-
! Accept Duel Offer
| 199 ||
* None
| Accepts the duel offer.
|-
! Duel Settings
| 200 ||
2012-12-22 10:23:01 -05:00
* int8 - No retreating, 0 or 1
* int8 - No magic, 0 or 1
* int8 - No prayers, 0 or 1
* int8 - No weapons, 0 or 1
2012-11-14 17:38:19 -05:00
| Updates the duel settings.
|-
! Duel Items
| 201 ||
2012-12-22 10:23:01 -05:00
* int8 - The total number of offered items
* int16... - Offered item ID
* int32... - Offered item stack size
2012-11-14 17:38:19 -05:00
| Variable length. Updates the stake.
|-
! Decline Duel Offer
| 203 ||
* None
| Declines the duel offer.
2012-11-15 18:52:41 -05:00
|-
! Character Design
| 236 ||
2012-12-22 10:23:01 -05:00
* int8 - The player's gender - 2=Female, 1=Male
* int8 - The player's hair style
* int8 - The player's 'body type' - 4=Female, 1=Male
* int8 - The player's 'leg type' - Always 2
* int8 - The player's hair colour
* int8 - The player's top colour
* int8 - The player's leg colour
* int8 - The player's skin colour
* int8 - The player's class
2012-11-15 18:52:41 -05:00
| Submits the player's chosen design when they log in for the first time.
* 0 - Adventurer class
* 1 - Warrior class
* 2 - Wizard class
* 3 - Ranger class
* 4 - Miner class
2012-11-12 17:32:28 -05:00
|}
Notes:
2012-11-14 17:38:19 -05:00
* Opcodes marked with * are preceded by Walk to Entity.
* When closing the duel confirm screen, it may send the decline trade packet, for some reason.