342:Update players

From RuneWiki
Jump to navigationJump to search
Update players
Updates all the players in the immediate area.
Opcode 99
Type Variable Short
Length N/A


Update players

Description

Updates all the players in the immediate area.

Packet Structure

Data type Description
Start of bit access.
Movement block Handles the movement of this player.
Local player list block Handles adding, managing and removing local players.
End of bit access.
Update blocks Update blocks contain the actual update data.

Movement Block

First off a single bit is read indicating if a movement or block update is required.

Data type Description
1 bit Movement or block update flag.

If this is set to 1 (true), 2 bits are read which indicates the movement type.

Data type Description
2 bits Movement type.
Movement type 0

No movement takes place, but a block update is required.

Movement type 1 (walk)
Data type Description
3 bits The first direction.
1 bit The block update flag.
Movement type 2 (run)
Data type Description
3 bits The first direction.
3 bits The second direction.
1 bit The block update flag.
Movement type 3 (teleport)
Data type Description
1 bit Discard client side walk queue flag.
7 bits Local y position.
7 bits Local x position.
1 bit Block update flag.
2 bits Height level.

Local player list block

Data type Description
8 bits Current player list size.
Current player list size * Other player movement block The other player movement blocks.
Add player blocks (for remainder of packet) The blocks for adding new players.

Other player movement block

Data type Description
1 bit Movement update or block update flag.


If this is set to 1 (true), 2 bits are read which indicates the movement type.

Data type Description
2 bits Movement type.
Movement type 0

No movement takes place, but a block update is required.

Movement type 1 (walk)
Data type Description
3 bits The first direction.
1 bit The block update flag.
Movement type 2 (run)
Data type Description
3 bits The first direction.
3 bits The second direction.
1 bit The block update flag.
Movement type 3

The player is removed from the local player list.

Add player block

Data type Description
11 bits The player id (note 0 cannot be used).

If the player id is 2047, that means an update block is appended at the end of the packet.

Otherwise, the add player block continues as normal:

Data type Description
5 bits Local x offset.
1 bit Block update required flag.
1 bit Reset walking queue flag.
5 bits Local y offset.

Update block

Data type Description
Unsigned Byte Update type bitmask.
Unsigned Byte (if bitmask & 0x8 != 0) Update type bitmask second byte.

Update masks

The ordering is:

  • 0x200
  • 0x4
  • 0x100
  • 0x20
  • 0x2 - appearance update
  • 0x1
  • 0x10
  • 0x80
  • 0x400
  • 0x40 - chat message
0x2 - Appearance update mask
Data type Description
Unsigned Byte Appearance mask length.
Unsigned Byte Gender.
Signed Byte Prayer icon.
Signed Byte Pk icon.
12 * Equipment Update The equipment/appearance updates.
5 Unsigned Bytes The colour array.
7 Unsigned Shorts The animation index array: stand, stand turn, walk, turn 180, turn 90 cw, turn 90 ccw, run.
Long Player name as long.
Unsigned Byte Combat level.
Unsigned Short Total skill level in a skill ordered area (or 0 in combat ordered area).
Equipment Update

If the player is wearing nothing in a slot and it does not count to their appearance, a single byte with value 0 is sent.

Otherwise, a short is sent. The short is either:

0x100 + appearance id, if there is no equipment. or 0x200 + item id, if there is a piece of equipment.