minerCPP
Current Public Protocol (v7) - Printable Version

+- minerCPP (./)
+-- Forum: minerCPP (/forumdisplay.php?fid=3)
+--- Forum: Development (/forumdisplay.php?fid=13)
+--- Thread: Current Public Protocol (v7) (/showthread.php?tid=5)


Current Public Protocol (v7) - TkTech - 02-27-2010 08:09 AM

(Note: because Java uses Big Endian internally, all datatypes are also in big endian.)

Datatypes
  • char - (0x01 | 1) byte(s)
  • short - (0x02 | 2) byte(s)
  • string - (0x40 | 64) byte(s) - Padded with spaces (0x20 | 32)
  • array - (0x400 | 1024) byte(s) - Padded with NULLs (0x00 | 0)

Client => Server
All of these packets are sent from the client to the server. The packet may be reused by the server.

Handshake
Packet ID: (0x00 | 0)
Packet Length: (0x83 | 131)
Description: Sent when a user first connects to the server. The only interesting tidbit here is the Authentication Token, which is a MD5 hash generated from the salt sent to the list server by the game server in its heartbeat.

Packet {
Packet ID: char
Protocol Version: char
Username: string
Authentication Token: string
Unknown: char
}

Set Block
Packet ID: (0x05 | 5)
Packet Length: (0x09 | 9)
Description: Creates (Mode = 0x01) or destroys (Mode = 0x00) the block located at <X,Y,Z>

Packet {
Packet ID: char
X Position: short
Y Position: short
Z Position: short
Mode: char
Block Type: char
}

Move Update
Packet ID: (0x08 | 8)
Packet Length: (0x0A | 10)
Description:

Packet {
Packet ID: char
Player ID: char
X Position: short
Y Position: short
Z Position: short
Heading: char
Pitch: char
}

Chat Message
Packet ID: (0x0D | 14)
Packet Length: (0x42 | 66)
Description: Contains a chat message sent from the client to the server. At the moment, the convention is; chat prefixed with a '/' is a server command, chat prefixed with a '@' is a whisper to another user.

Packet {
Packet ID: char
Unknown: char
Message: string
}

Server => Client

Handshake
Packet ID: (0x00 | 0)
Packet Length: (0x83 | 131)

Packet {
Packet ID: char
Protocol Version: char
Server Name: string
MOTD: string
Usertype: char
}

Ping
Packet ID: (0x01 | 1)
Packet Length: (0x01 | 1)

Packet {
Packet ID: char
}

Map Init
Packet ID (0x02 | 2)
Packet Length: (0x01 | 1)

Packet {
Packet ID: char
}

Map Chunk
Packet ID: (0x03 | 3)
Packet Length: (0x0404 | 1028)

Packet {
Packet ID: char
Chunk Length: short
Chunk: array
Percentage sent (0-100): char
}

Map Finish
Packet ID: (0x04 | 4)
Packet Length: (0x07 | 7)

Packet {
Packet ID: char
Map dimension (X): short
Map dimension (Y): short
Map dimension (Z): short
}

Block Update
Packet ID: (0x06 | 6)
Packet Length: (0x08 | 8)

Packet {
Packet ID: char
Block position (X): short
Block position (Y): short
Block position (Z): short
Block type: char
}

Player Teleport
Packet ID: (0x08 | 8)
Packet Length: (0x0A | 10)

Packet {
Packet ID: char
Player ID: char
Player position (X): short
Player position (Y): short
Player position (Z): short
Camera Heading: char
Camera Pitch: char
}

(Note: Work in progress)