Pocket Edition Login: Difference between revisions
Jump to navigation
Jump to search
imported>Jython234 Added chunks note |
imported>Boredphoton Added CLIENT_HANDSHAKE |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
[[Category:Pocket_Minecraft]] | |||
This article describes the 0.14.3 login sequence in Minecraft: PE | |||
The recommended login sequence and ping sequence looks like this, where C is the client and S is the server: | |||
== Pinging == | |||
# C->S <code>0x01</code> ID_UNCONNECTED_PING_OPEN_CONNECTIONS | |||
# S->C <code>0x1C</code> ID_UNCONNECTED_PONG | |||
Note that the servername field in the ID_UNCONNECTED_PONG follows a specific format for MCPE as described below: | |||
{| class="wikitable" | |||
!width="10%"| Field Name | |||
!width="35%"| Field Value | |||
!width="53%"| Notes | |||
|- | |||
| Prefix | |||
| MCPE | |||
| | |||
|- | |||
| Server Name | |||
| The MOTD of your server | |||
| Can also include any MCPE colors | |||
|- | |||
| Protocol Number | |||
| Represented as ‘10 10’ if 10 was the current number | |||
| Must be the minor major separated by a space | |||
|- | |||
| The Text Version | |||
| A string that is shown to the player, must be MAJOR.MINOR.PATCH | |||
| The protocol number affects if the client rejects the connection or not, this can have any value | |||
|- | |||
| Online Players | |||
| A number of online players | |||
| | |||
|- | |||
| Max Players | |||
| A number of max players | |||
| | |||
|} | |||
Each value is separated by a colon.<br /> | |||
An example is: <code>MCPE;A Minecraft: PE Server;70 70;0.14.3;0;20</code> | |||
== Connecting == | |||
Firstly, you’ll need the RakNet handshake: | |||
# C->S <code>0x05</code> OPEN_CONNECTION_REQUEST_1 | |||
# S->C <code>0x06</code> OPEN_CONNECTION_REPLY_1 | |||
# C->S <code>0x07</code> OPEN_CONNECTION_REQUEST_2 | |||
# S->C <code>0x08</code> OPEN_CONNECTION_REPLY_2 | |||
# C->S <code>0x09</code> CLIENT_CONNECT | |||
# S->C <code>0x10</code> SERVER_HANDSHAKE | |||
# C->S <code>0x13</code> CLIENT_HANDSHAKE | |||
Then you may start pinging the client and get ready for login, once you have finished the RakNet handshake: | |||
# C->S <code>0x8f</code> GAME_LOGIN | |||
# S->C <code>0x90</code> PLAYER_STATUS of 0 | |||
# S->C <code>0x9d</code> MOVE_PLAYER (note: entity id of -1) | |||
# S->C <code>0x95</code> START_GAME (note: entity id of -1) | |||
# S->C <code>0xb1</code> SET_SPAWN_POSITION | |||
# S->C <code>0x9d</code> MOVE_PLAYER (note: entity id of -1) | |||
# S->C <code>0x94</code> SET_TIME | |||
# S->C <code>0xbc</code> ADVENTURE_SETTINGS | |||
# S->C <code>0xb3</code> RESPAWN | |||
# C->S <code>0xc8</code> REQUEST_CHUNK_RADIUS | |||
# S->C <code>0xc9</code> CHUNK_RADIUS_UPDATE (optional) | |||
# S->C <code>0xbf</code> FULL_CHUNK_DATA (batch packet) | |||
# S->C <code>0x90</code> PLAYER_STATUS of 3 | |||
# S->C <code>0x94</code> SET_TIME |
Latest revision as of 09:34, 16 August 2016
This article describes the 0.14.3 login sequence in Minecraft: PE
The recommended login sequence and ping sequence looks like this, where C is the client and S is the server:
Pinging
- C->S
0x01
ID_UNCONNECTED_PING_OPEN_CONNECTIONS - S->C
0x1C
ID_UNCONNECTED_PONG
Note that the servername field in the ID_UNCONNECTED_PONG follows a specific format for MCPE as described below:
Field Name | Field Value | Notes |
---|---|---|
Prefix | MCPE | |
Server Name | The MOTD of your server | Can also include any MCPE colors |
Protocol Number | Represented as ‘10 10’ if 10 was the current number | Must be the minor major separated by a space |
The Text Version | A string that is shown to the player, must be MAJOR.MINOR.PATCH | The protocol number affects if the client rejects the connection or not, this can have any value |
Online Players | A number of online players | |
Max Players | A number of max players |
Each value is separated by a colon.
An example is: MCPE;A Minecraft: PE Server;70 70;0.14.3;0;20
Connecting
Firstly, you’ll need the RakNet handshake:
- C->S
0x05
OPEN_CONNECTION_REQUEST_1 - S->C
0x06
OPEN_CONNECTION_REPLY_1 - C->S
0x07
OPEN_CONNECTION_REQUEST_2 - S->C
0x08
OPEN_CONNECTION_REPLY_2 - C->S
0x09
CLIENT_CONNECT - S->C
0x10
SERVER_HANDSHAKE - C->S
0x13
CLIENT_HANDSHAKE
Then you may start pinging the client and get ready for login, once you have finished the RakNet handshake:
- C->S
0x8f
GAME_LOGIN - S->C
0x90
PLAYER_STATUS of 0 - S->C
0x9d
MOVE_PLAYER (note: entity id of -1) - S->C
0x95
START_GAME (note: entity id of -1) - S->C
0xb1
SET_SPAWN_POSITION - S->C
0x9d
MOVE_PLAYER (note: entity id of -1) - S->C
0x94
SET_TIME - S->C
0xbc
ADVENTURE_SETTINGS - S->C
0xb3
RESPAWN - C->S
0xc8
REQUEST_CHUNK_RADIUS - S->C
0xc9
CHUNK_RADIUS_UPDATE (optional) - S->C
0xbf
FULL_CHUNK_DATA (batch packet) - S->C
0x90
PLAYER_STATUS of 3 - S->C
0x94
SET_TIME