This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function ping($host, $port=25565, $timeout=30) { | |
//Set up our socket | |
$fp = fsockopen($host, $port, $errno, $errstr, $timeout); | |
if (!$fp) return false; | |
//Send 0xFE: Server list ping | |
fwrite($fp, "\xFE"); | |
fwrite($fp, "\x00"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
def get_info(host, port): | |
#Set up our socket | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.connect((host, port)) | |
#Send 0xFE: Server list ping |