Query Mechanism: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "== The backbone of packets == {| class="wikitable" style="text-align: center;" |- ! Byte !! PHP !! Hexadecimal !! Description |- ! 0-3 | style="background: #444; color: #FFF"...")
 
No edit summary
Line 32: Line 32:
| style="background: #444; color: #FFF" | "i" || style="background: #555; color: #EDD400" | 69 || The opcode that you would like to query.
| style="background: #444; color: #FFF" | "i" || style="background: #555; color: #EDD400" | 69 || The opcode that you would like to query.
|}
|}
== Opcodes ==
'''The packet table'''
{| class="wikitable" style="text-align: center;"
|-
! Packet 'opcode' !! Description
|-
! i
| Server information
|-
! p
| Ping
|-
! c
| Client list
|}
== Recieving the packets ==
The header of the query response will be the exact same thing that the client sent, except that the header sent by the server will always be MP04, and not VCMP. This acts as a compatibility check due to the differing protocols.
[[Category:Server_Documentation]]

Revision as of 07:06, 16 November 2014

The backbone of packets

Byte PHP Hexadecimal Description
0-3 "VCMP" 56 43 4D 50 The magic of the packet.
4 chr('192'); C0 The first byte in the server's IP address.
5 chr('168'); A8 The second byte in the server's IP address.
6 chr('200'); C8 The third byte in the server's IP address.
7 chr('103'); 67 The fourth byte in the server's IP address.
8 chr('5192' & 0xFF); 48 The first byte of the port.
9 chr('5192' >> 8 & 0xFF); 14 The second byte of the port.
10 "i" 69 The opcode that you would like to query.

Opcodes

The packet table

Packet 'opcode' Description
i Server information
p Ping
c Client list

Recieving the packets

The header of the query response will be the exact same thing that the client sent, except that the header sent by the server will always be MP04, and not VCMP. This acts as a compatibility check due to the differing protocols.