PHP-Minecraft-Rcon
PHP-Minecraft-Rcon copied to clipboard
unpack(): Type V: not enough input, need 4, have 0
I am using this code on a Laravel based system
$rcon = new Rcon('ip, port, 'password', 1);
if ($rcon->connect())
{
Log::info('connected');
$rcon->sendCommand("say Hello World!");
} else {
Log::info('disconected');
}
but if ($rcon->connect())
returns me the error unpack(): Type V: not enough input, need 4, have 0
which comes from
$size_data = fread($this->socket, 4);
$size_pack = unpack('V1size', $size_data);
But when I log all the variables inside the vendor src file, it does log the right info provided in the new Rcon.