mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
Packet Cleaning
This commit is contained in:
parent
4ea4431986
commit
822adcae2d
@ -326,8 +326,6 @@ class Protocol{
|
||||
"customData",
|
||||
),
|
||||
|
||||
|
||||
|
||||
0xa0 => array(
|
||||
"special1",
|
||||
),
|
||||
|
@ -135,20 +135,10 @@ class Packet{
|
||||
case "short":
|
||||
$this->addRaw(Utils::writeShort($this->data[$field]));
|
||||
break;
|
||||
case "byteArray":
|
||||
$this->addRaw($this->data[$field]);
|
||||
break;
|
||||
case "string":
|
||||
$this->addRaw(Utils::writeShort(strlen($this->data[$field])));
|
||||
$this->addRaw($this->data[$field]);
|
||||
break;
|
||||
case "slotData":
|
||||
$this->addRaw(Utils::writeShort($this->data[$field][0]));
|
||||
if($this->data[$field][0]!=-1){
|
||||
$this->addRaw(Utils::writeByte($this->data[$field][1]));
|
||||
$this->addRaw(Utils::writeShort($this->data[$field][2]));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$this->addRaw(Utils::writeByte($this->data[$field]));
|
||||
break;
|
||||
@ -173,7 +163,6 @@ class Packet{
|
||||
}
|
||||
|
||||
public function parse(){
|
||||
$continue = true;
|
||||
foreach($this->struct as $field => $type){
|
||||
if(is_int($type)){
|
||||
$this->data[] = $this->get($type);
|
||||
@ -247,9 +236,6 @@ class Packet{
|
||||
$this->data[] = Utils::readBool($this->get(1));
|
||||
break;
|
||||
}
|
||||
if($continue === false){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user