Updated utilities

This commit is contained in:
Shoghi Cervantes Pueyo 2012-12-01 01:17:32 +01:00
parent 8a26a4d858
commit c71801145e
6 changed files with 3804 additions and 262 deletions

View file

@ -35,7 +35,7 @@ class PocketMinecraftClient{
$this->username = $username;
$this->connected = false;
$this->cnt = 1;
$this->clientID = substr(Utils::generateKey(), 0, 8);
$this->clientID = Utils::getRandomBytes(8);
$this->events = array("disabled" => array());
$this->actions = array();
$this->interface = new MinecraftInterface("255.255.255.255", $protocol, 19132);
@ -118,7 +118,7 @@ class PocketMinecraftClient{
array(
"id" => 0x09,
"clientID" => $this->clientID,
"session" => "\x00\x0c\x98\x00",
"session" => Utils::getRandomBytes(2),
),
));
++$this->counter[0];
@ -141,6 +141,15 @@ class PocketMinecraftClient{
),
));
++$this->counter[0];
$this->send(0x84, array(
$this->counter[0],
0x00,
array(
"id" => 0x00,
"payload" => "\x00\x00\x00\x00\x00".$data["session"]."\x5e",
),
));
++$this->counter[0];
$this->send(0x84, array(
$this->counter[0],
0x00,