Barf on trying to read/write nonexisting fields of packets

this should make it easier to debug problems when content of packets changes during protocol updates.
This commit is contained in:
Dylan K. Taylor 2018-11-30 18:36:28 +00:00
parent b473ffdedc
commit 4c08a05fae

View File

@ -134,4 +134,12 @@ abstract class DataPacket extends NetworkBinaryStream{
return $data;
}
public function __get($name){
throw new \Error("Cannot read non-existing field \"$name\"");
}
public function __set($name, $value){
throw new \Error("Cannot write non-existing field \"$name\"");
}
}