fsockopen 10053 error when writing Chars to Java socket

前端 未结 2 1132
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-28 00:21

Right,

I\'m trying to write a wee script in PHP that will send an in game chat package to Minecraft.

//Deliberately low timeout
$mc = fsockopen(\"localho         


        
相关标签:
2条回答
  • 2021-01-28 00:37

    try the plugin HTTPConsole and

    and use a function like this to execute the command:

    function exec_shell_command($command) {
    $command = urlencode($command);
    $url = "http://127.0.0.1:25560/console?command=$command";
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    
    $out = curl_exec($ch);
    curl_close($ch);
    return $out;
    }
    $retval = exec_shell_command("say this is a server message");
    

    I am not sure if this is doing what you want when you say "send a chat message", This posts a console message to the server.

    0 讨论(0)
  • 2021-01-28 00:57

    10053 is the winsock error code for WSAECONNABORTED.
    An "understandable" explaination of that error condition can be found at http://www.chilkatsoft.com/p/p_299.asp

    0 讨论(0)
提交回复
热议问题