Guest User

Untitled

a guest
Dec 12th, 2019
114
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $ip = '127.0.0.1';
  2. $port = '7777';
  3.  
  4. $fp = fsockopen($ip, $port, $errno, $errstr, 1);
  5. $pck = pack("vCi", 8, 0, -3);
  6. fwrite($fp, $pck);
  7. $start = time();
  8. socket_set_timeout($fp, 1);
  9. $st = socket_get_status($fp);
  10. $st = $st["unread_bytes"];
  11. $st = fread($fp, 73);;
  12. if ($st) {
  13. //$st .= fread($fp, $st);
  14. fclose($fp);
  15. $a = unpack("vsize/Cid/iworld/imax/icurrent/iplaying/istore", $st);
  16.  
  17. $reply = $a;
  18. } else {
  19.  
  20. $reply = 'offline';
  21.  
  22. }
  23. echo $reply;
RAW Paste Data