24 public const NETWORK_ID = ProtocolInfo::COMMAND_OUTPUT_PACKET;
26 public const TYPE_LAST = 1;
27 public const TYPE_SILENT = 2;
28 public const TYPE_ALL = 3;
29 public const TYPE_DATA_SET = 4;
32 public int $outputType;
33 public int $successCount;
35 public array $messages = [];
36 public string $unknownString;
39 $this->originData = $in->getCommandOriginData();
40 $this->outputType = $in->
getByte();
44 $this->messages[] = $this->getCommandMessage($in);
47 if($this->outputType === self::TYPE_DATA_SET){
48 $this->unknownString = $in->getString();
58 $message->isInternal = $in->
getBool();
62 $message->parameters[] = $in->getString();
69 $out->putCommandOriginData($this->originData);
70 $out->putByte($this->outputType);
74 foreach($this->messages as $message){
75 $this->putCommandMessage($message, $out);
78 if($this->outputType === self::TYPE_DATA_SET){
79 $out->putString($this->unknownString);
83 protected function putCommandMessage(CommandOutputMessage $message, PacketSerializer $out) : void{
84 $out->putBool($message->isInternal);
85 $out->putString($message->messageId);
87 $out->putUnsignedVarInt(count($message->parameters));
88 foreach($message->parameters as $parameter){
89 $out->putString($parameter);
94 return $handler->handleCommandOutput($this);