25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
stream_Set_Timeout($socket, $timeout);
stream_Set_Blocking($socket, true);
$OFFLINE_MESSAGE_DATA_ID = pack('c*', 0x00, 0xFF, 0xFF, 0x00, 0xFE, 0xFE, 0xFE, 0xFE, 0xFD, 0xFD, 0xFD, 0xFD, 0x12, 0x34, 0x56, 0x78);
$command = pack('cQ', 0x01, time()); // DefaultMessageIDTypes::ID_UNCONNECTED_PING + 64bit current time
$command .= $OFFLINE_MESSAGE_DATA_ID;
$command .= pack('Q', 2); // 64bit guid
$length = strlen($command);
if ($length !== fwrite($socket, $command, $length)) {
$this->errors[] = "Failed to write on socket.";
return;
}
$data = fread($socket, 4096);
fclose($socket);
if (empty($data)) {
$this->errors[] = "Server failed to respond";
return;
#0 (): pocketmine\errorhandler\ErrorToExceptionHandler::handle(int 8, string[70] fwrite(): Send of 33 bytes failed with errno=1 Operation not permitted, string[87] phar:///home/anmine/servers/hub/plugins/Hub.phar/src/corndan/Hub/classes/QueryCl, int 34)
#1 /home/anmine/servers/hub/plugins/Hub.phar/src/corndan/Hub/classes/QueryClass(34): fwrite(resource Resource id #441890, string[33] ..G.e.................4Vx........, int 33)
#2 /home/anmine/servers/hub/plugins/Hub.phar/src/corndan/Hub/HubMain(105): corndan\Hub\classes\QueryClass->__construct(string[13] ananasmine.ru, int 19133)
#3 pmsrc/src/scheduler/AsyncTask(83): pocketmine\scheduler\AsyncTask@anonymous�phar:///home/anmine/servers/hub/plugins/Hub.phar/src/corndan/Hub/HubMain.php:95$244->onRun()
#4 (): pocketmine\scheduler\AsyncTask->run()