20 public const NETWORK_ID = ProtocolInfo::PACKET_VIOLATION_WARNING_PACKET;
22 public const TYPE_MALFORMED = 0;
24 public const SEVERITY_WARNING = 0;
25 public const SEVERITY_FINAL_WARNING = 1;
26 public const SEVERITY_TERMINATING_CONNECTION = 2;
29 private int $severity;
30 private int $packetId;
31 private string $message;
36 public static function create(
int $type,
int $severity,
int $packetId,
string $message) : self{
38 $result->type = $type;
39 $result->severity = $severity;
40 $result->packetId = $packetId;
41 $result->message = $message;
45 public function getType() : int{ return $this->type; }
47 public function getSeverity() : int{ return $this->severity; }
49 public function getPacketId() : int{ return $this->packetId; }
51 public function getMessage() : string{ return $this->message; }
54 $this->type = $in->getVarInt();
61 $out->putVarInt($this->type);
64 $out->putString($this->message);
68 return $handler->handlePacketViolationWarning($this);