Get rid of some network-layer asserts

NEVER assert on user data. 🤦
This commit is contained in:
Dylan K. Taylor
2018-12-30 12:42:52 +00:00
parent 3f5e83a322
commit daf56e990b
2 changed files with 6 additions and 2 deletions

View File

@ -76,7 +76,9 @@ abstract class DataPacket extends NetworkBinaryStream{
protected function decodeHeader(){
$pid = $this->getUnsignedVarInt();
assert($pid === static::NETWORK_ID);
if($pid !== static::NETWORK_ID){
throw new \UnexpectedValueException("Expected " . static::NETWORK_ID . " for packet ID, got $pid");
}
}
/**