Added Ping / Pong system

This commit is contained in:
Shoghi Cervantes Pueyo 2013-04-01 16:03:43 +02:00
parent 1cb30601b5
commit 1ef0a41944
3 changed files with 17 additions and 15 deletions

View file

@ -604,13 +604,13 @@ class Player{
break;
}
switch($data["id"]){
case MC_KEEP_ALIVE:
break;
case 0x01:
case 0x03:
break;
case MC_PING:
$this->dataPacket(MC_PONG, array(
"ptime" => $data["time"],
"time" => (int) (microtime(true) * 1000),
));
break;
case MC_DISCONNECT:
$this->close("client disconnect");