187 lines
4.2 KiB
Plaintext
187 lines
4.2 KiB
Plaintext
|
|
Notes:
|
|
"FATAL ERROR" means "terminate the damn connection".
|
|
|
|
Base encapsulation:
|
|
0x0F baselen.u8 base[baselen] 0x00:
|
|
S->C Set base directory
|
|
|
|
This is the first message sent from the server.
|
|
The client MUST wait for this message, and this message ONLY.
|
|
|
|
The local client does NOT receive this message;
|
|
the base dir is already set.
|
|
|
|
If the base dir is already set, FATAL ERROR
|
|
|
|
/*
|
|
0x10 salt[32] version.u32 namelen.u8 name[namelen] 0x00:
|
|
C->S Authentication with server
|
|
"salt" is agreed on from some sort of master server
|
|
Currently ignored and should all be 0x00
|
|
"name" is also ignored at the moment and should be all 0x00
|
|
"version" is the current protocol version
|
|
|
|
current: 0x00000001
|
|
|
|
TODO: add some sort of auth method
|
|
|
|
0x11:
|
|
S->C Authentication acknowledgement
|
|
|
|
Gives the package directory
|
|
*/
|
|
|
|
0x17 msglen.u8 msg[msglen] 0x00:
|
|
C->S Quit / S->C Kick
|
|
|
|
Connection MUST be terminated
|
|
after sending/receiving this message
|
|
|
|
0x30 flags.u8 namelen.u8 name[namelen] 0x00:
|
|
C->S ONLY
|
|
Request file to be transferred
|
|
"name" is the filename
|
|
"flags" has these bits:
|
|
bits 0-3:
|
|
0000 = * RESERVED *
|
|
0001 = JSON data
|
|
0010 = log data [ NOT SUPPORTED YET ]
|
|
0011 = lua script
|
|
0100 = icemap data
|
|
0101 = vxl data
|
|
0110 = autodetected map data
|
|
0111 = pmf model
|
|
1000 = tga image
|
|
1001 = wav audio [ NOT SUPPORTED YET ]
|
|
101x = * RESERVED *
|
|
11xx = * RESERVED *
|
|
|
|
if the server is still sending a file, FATAL ERROR
|
|
0x31 clen.u32 ulen.u32:
|
|
S->C ONLY
|
|
Start file transfer
|
|
"clen" is the compressed length
|
|
"ulen" is the uncompressed length
|
|
|
|
All files are compressed as zlib streams
|
|
|
|
if the client didn't request any files, IGNORE + SEND 0x34
|
|
0x32:
|
|
S->C ONLY
|
|
Successfully end file transfer
|
|
|
|
If it doesn't unpack correctly, FATAL ERROR
|
|
If no file transfer active, IGNORE
|
|
0x33: offset.u32 len.u16 data[len]
|
|
S->C ONLY
|
|
Send a block of data
|
|
Maximum length of len is 1024
|
|
|
|
If offset+len > clen, FATAL ERROR
|
|
If no file transfer active, IGNORE + SEND 0x34
|
|
0x34:
|
|
C->S ONLY
|
|
Abort incoming file transfer
|
|
0x35:
|
|
S->C ONLY
|
|
Abort outgoing file transfer
|
|
|
|
0x40..0x7E data[this-0x3F]:
|
|
Lua packet of length (this-0x3F)
|
|
0x7F length.u16 data[length]:
|
|
Lua packet of length "length"
|
|
Minimum length of a packet is 1
|
|
Maximum length of a packet is 1276
|
|
Exceeding these bounds is a FATAL ERROR
|
|
|
|
Iceball Base Mod:
|
|
Notes:
|
|
- pid is from the range 1 to 250.
|
|
|
|
0x01 time.u16:
|
|
ping with lower 16 bits of current time in msecs
|
|
0x02 time.u16:
|
|
pong with lower 16 bits of current time in msecs
|
|
|
|
if the connection exceeds 10 seconds of lag, kill it
|
|
|
|
if the gap between the server and client time
|
|
extends by 10 seconds, client is probably using CE speedhack
|
|
|
|
0x03 pid x.s16 y.s16 z.s16: @
|
|
player set position
|
|
|
|
positions are 11.5 fixed point,
|
|
giving a hypothetical max map size of 1024x128x1024
|
|
|
|
note, for C->S pid MUST be 0x00
|
|
|
|
0x04 pid ya.u8 xa.u8 keys.u8: @
|
|
player set orientation / keys
|
|
|
|
angles are as defined:
|
|
for ya, -128->128 is full circle
|
|
for xa, -128->128 is half circle
|
|
|
|
keys are:
|
|
0x01: up
|
|
0x02: down
|
|
0x04: left
|
|
0x08: right
|
|
0x10: sneak | scope
|
|
0x20: crouch
|
|
0x40: jump
|
|
0x80: * RESERVED *
|
|
|
|
note, for C->S pid MUST be 0x00
|
|
|
|
0x05 pid team weapon score.s16 kills.s16 deaths.s16 namelen name[namelen]: (S->C) @
|
|
adds player to server
|
|
|
|
note, this can be used to update a player on the server
|
|
|
|
"weapon" can be one of these:
|
|
1: rifle
|
|
|
|
yeah that's it really.
|
|
|
|
0x06 pid: (S->C) @
|
|
sets client player id to "pid"
|
|
|
|
0x07 pid: (S->C) @
|
|
removes player from server
|
|
|
|
0x08 x.u16 y.u16 z.u16 b g r typ:
|
|
place a block
|
|
|
|
0x09 x.u16 y.u16 z.u16:
|
|
destroy a block
|
|
|
|
0x0A x.u16 y.u16 z.u16:
|
|
destroy a 3 high pillar
|
|
|
|
0x0B x.u16 y.u16 z.u16:
|
|
collapse a section of blocks
|
|
|
|
NOTE: will be IGNORED if the floodfill hits the bottom!
|
|
|
|
0x0C msg.z (C->S) @
|
|
send chat message
|
|
|
|
0x0D msg.z (C->S) @
|
|
send teamchat message
|
|
|
|
0x0E bgra.u32 msg.z (S->C) @
|
|
add text to chat
|
|
|
|
0x0F bgra.u32 msg.z (S->C) @
|
|
add text to killfeed
|
|
|
|
0x10 pid x.fs y.fs z.fs ya.u8 xa.u8: (S->C) @
|
|
player spawn
|
|
|
|
0x11 team.s8 weapon.u8 name.z (C->S) @
|
|
offer player
|
|
if team == -1, server autoselects
|