0.7.4 compatibility update - new chat message handling [part1]

This commit is contained in:
Shoghi Cervantes 2013-08-26 18:16:30 +02:00
parent 3779a66bdb
commit dc0577dcfa
4 changed files with 26 additions and 17 deletions

View file

@ -185,8 +185,10 @@ class CustomPacketHandler{
break;
case MC_CHAT:
if($this->c === false){
$this->data["player"] = $this->get(Utils::readShort($this->get(2), false));
$this->data["message"] = $this->get(Utils::readShort($this->get(2), false));
}else{
$this->raw .= Utils::writeShort(strlen($this->data["player"])).$this->data["player"];
$this->raw .= Utils::writeShort(strlen($this->data["message"])).$this->data["message"];
}
break;
@ -808,7 +810,7 @@ class CustomPacketHandler{
$this->raw .= Utils::writeShort(strlen($this->data["message"])).$this->data["message"];
}
break;
case MC_SIGN_UPDATE:
/*case MC_SIGN_UPDATE:
if($this->c === false){
$this->data["x"] = Utils::readShort($this->get(2));
$this->data["y"] = ord($this->get(1));
@ -824,7 +826,7 @@ class CustomPacketHandler{
$this->raw .= Utils::writeLShort(strlen($this->data["line$i"])).$this->data["line$i"];
}
}
break;
break;*/
case MC_ADVENTURE_SETTINGS:
if($this->c === false){
$this->data["flags"] = Utils::readInt($this->get(4));

View file

@ -29,7 +29,7 @@ the Free Software Foundation, either version 3 of the License, or
define("DEFLATEPACKET_LEVEL", 1);
define("CURRENT_STRUCTURE", 5);
define("CURRENT_PROTOCOL", 11);
define("CURRENT_PROTOCOL", 12);
define("RAKNET_MAGIC", "\x00\xff\xff\x00\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\x12\x34\x56\x78");
@ -98,8 +98,8 @@ define("MC_CONTAINER_SET_DATA", 0xb2);
define("MC_CONTAINER_SET_CONTENT", 0xb3);
//define("MC_CONTAINER_ACK", 0xb4);
define("MC_CLIENT_MESSAGE", 0xb5);
define("MC_SIGN_UPDATE", 0xb6);
define("MC_ADVENTURE_SETTINGS", 0xb7);
define("MC_ADVENTURE_SETTINGS", 0xb6);
define("MC_ENTITY_DATA", 0xb7);
class Protocol{
@ -166,7 +166,7 @@ class Protocol{
MC_CONTAINER_SET_SLOT => "Set Container Slot",
MC_CLIENT_MESSAGE => "Client Message",
MC_SIGN_UPDATE => "Sign Update",
//MC_SIGN_UPDATE => "Sign Update",
MC_ADVENTURE_SETTINGS => "Adventure Settings",
);