array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "w") ), $pipes); if (is_resource($process)) { stream_set_blocking($pipes[1], false); stream_set_blocking($pipes[2], false); stream_set_timeout($pipes[1], $timeout); stream_set_timeout($pipes[2], $timeout); $stdout = stream_get_contents($pipes[1]); $stderr = stream_get_contents($pipes[2]); fclose($pipes[0]); fclose($pipes[1]); fclose($pipes[2]); proc_close($process); return array( 'stdout' => nl2br($stdout), 'stderr' => nl2br($stderr) ); } return false; } $command = "cd C:/novetus-windows/bin && NovetusCMD.exe --no3d --port " . $_POST['port'] . " --map \"" . $_POST['file'] . "\" --client " . $_POST['client']; $timeout = 10; $result = executeCommandWithTimeout($command, $timeout); if ($result === false) { echo "Process took longer than {$timeout} seconds and was killed."; } else { echo "Command output:\n"; echo "STDOUT:\n{$result['stdout']}\n"; echo "STDERR:\n{$result['stderr']}\n"; } } } ?>
Add Server prepare(" SELECT * FROM servers ORDER BY JSON_LENGTH(players) DESC, online DESC, started DESC LIMIT 10 "); $stmt->execute(); $serverCount = 0; echo '
'; while($server = $stmt->fetch(PDO::FETCH_ASSOC)) { $server['players'] = json_decode($server['players'], true); echo '
'; ?>

by

Client:

/ ">

'; $serverCount++; if ($serverCount % 2 == 0 && $serverCount < 10) { echo '
'; } } echo '
'; ?>