Binary strict types (#969)

* Some Binary cleanup, type-hints and strict types
yes, I know this is very crashy... that's good, because it highlights unexpected behaviour

* added some default values
This commit is contained in:
Dylan K. Taylor
2017-06-03 09:39:45 +01:00
committed by GitHub
parent 8bb0e8d398
commit 22ba017965
8 changed files with 234 additions and 114 deletions

View File

@ -50,19 +50,19 @@ class EntityEventPacket extends DataPacket{
public $eid;
public $event;
public $unknown;
public $data = 0;
public function decode(){
$this->eid = $this->getEntityRuntimeId();
$this->event = $this->getByte();
$this->unknown = $this->getVarInt();
$this->data = $this->getVarInt();
}
public function encode(){
$this->reset();
$this->putEntityRuntimeId($this->eid);
$this->putByte($this->event);
$this->putVarInt($this->unknown);
$this->putVarInt($this->data);
}
public function handle(NetworkSession $session) : bool{