Updated to allow multiple protocol versions

This commit is contained in:
Shoghi Cervantes Pueyo
2012-12-06 17:05:05 +01:00
parent 8b1c010b4d
commit 7732d6b6f7
9 changed files with 124 additions and 49 deletions

41
pstruct/4.php Normal file
View File

@ -0,0 +1,41 @@
<?php
/*
-
/ \
/ \
/ POCKET \
/ MINECRAFT PHP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
//Protocol Version: 4
define("MC_KEEP_ALIVE", 0x00);
define("MC_CLIENT_HANDSHAKE", 0x09);
define("MC_SERVER_HANDSHAKE", 0x10);
define("MC_CLIENT_CONNECT", 0x13);
define("MC_CLIENT_DISCONNECT", 0x15);
define("MC_LOGIN", 0x86);
define("MC_LOGIN_STATUS", 0x87);
define("MC_READY", 0x88);
define("MC_CHAT", 0x89);
define("MC_SET_TIME", 0x8a);
define("MC_START_GAME", 0x8b);

41
pstruct/5.php Normal file
View File

@ -0,0 +1,41 @@
<?php
/*
-
/ \
/ \
/ POCKET \
/ MINECRAFT PHP \
|\ @shoghicp /|
|. \ / .|
| .. \ / .. |
| .. | .. |
| .. | .. |
\ | /
\ | /
\ | /
\ | /
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
//Protocol Version: 5
define("MC_KEEP_ALIVE", 0x00);
define("MC_CLIENT_HANDSHAKE", 0x09);
define("MC_SERVER_HANDSHAKE", 0x10);
define("MC_CLIENT_CONNECT", 0x13);
define("MC_CLIENT_DISCONNECT", 0x15);
define("MC_LOGIN", 0x82);
define("MC_LOGIN_STATUS", 0x83);
define("MC_READY", 0x84);
define("MC_CHAT", 0x85);
define("MC_SET_TIME", 0x86);
define("MC_START_GAME", 0x87);

View File

@ -26,23 +26,23 @@ the Free Software Foundation, either version 3 of the License, or
*/
$dataName = array(
0x00 => "KeepAlive",
MC_KEEP_ALIVE => "KeepAlive",
0x09 => "ClientHandshake",
0x10 => "ServerHandshake",
MC_CLIENT_HANDSHAKE => "ClientHandshake",
MC_SERVER_HANDSHAKE => "ServerHandshake",
0x13 => "ClientConnect",
MC_CLIENT_CONNECT => "ClientConnect",
0x15 => "ClientDisconnect",
MC_CLIENT_DISCONNECT => "ClientDisconnect",
0x18 => "ServerDisconnect",
0x18 => "Unknown",
0x82 => "Login",
0x83 => "LoginStatus",
0x84 => "Ready",
0x85 => "Message",
0x86 => "SetTime",
0x87 => "StartGame",
MC_LOGIN => "Login",
MC_LOGIN_STATUS => "LoginStatus",
MC_READY => "Ready",
MC_CHAT => "Chat",
MC_SET_TIME => "SetTime",
MC_START_GAME => "StartGame",
0x93 => "MoveEntity_PosRot",
0x94 => "MovePlayer",
@ -59,4 +59,6 @@ $dataName = array(
0xa5 => "SetHealth",
0xa7 => "Animate",
0xb1 => "ClientMessage"
);