1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

get players from another server

Discussion in 'Development' started by kaliiks, Feb 7, 2017.

  1. kaliiks

    kaliiks Zombie

    Messages:
    250
    is it possible?
     
  2. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    If you want to get the player names it might be possible using query
     
  3. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    maybe if you build another command listener on the remote server that execute things onto players on behalf of your plugin that's on the local server
     
  4. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
  5. kaliiks

    kaliiks Zombie

    Messages:
    250
    I searched one post where any people do it but i dont understand the link in code can anyone explain me how to use ?
    http://forums.pocketmine.net/threads/get-players-of-another-server.9696/
    i used code from thread
    $lines = file_get_contents("http://minecraft-api.com/api/query/playeronline.php?ip=/*MyServerIp*/&port=19132");
    $this->getLogger($lines);
    it say
    Code:
    Warning: file_get_contents(http://minecraft-api.com/api/query/playeronline.php?ip=127.0.0.1&port=19132): failed to open stream: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? in C:\Users\uzivatel\Desktop\Server\plugins\Core\src\Core\Core.php on line 74
    
     
  6. kaliiks

    kaliiks Zombie

    Messages:
    250
    Now i written extension=php_openssl.dll to php configuration file for enable it then load plugin without error but dont get number of players
     
    Last edited: Feb 11, 2017
  7. Redux

    Redux Spider Jockey

    Messages:
    49
    GitHub:
    reduxredstone
    That website is trying to remotely query the server. You entered the IP 127.0.0.1 (as seen in the first error), which is the loopback IP (local host). It means the website is trying to query players on a server run on its own machine, which there isn't one. That's why it won't give you the player count.
     
  8. kaliiks

    kaliiks Zombie

    Messages:
    250
    I tested your plugin i writen [SSS] on first line 2nd line ip 3line port and console say
    Code:
    6
    [20:24:14] [Asynchronous Worker #1 thread/CRITICAL]: TypeError: "Argument 1 passed to robske_110\SSS\SSSAsyncTask::doQuery() must be of the type integer, string given, called in C:\Users\uzivatel\Desktop\Server\plugins\SSS\src\robske_110\SSS\rootPlugin.php on line 354" (EXCEPTION) in "/SSS/src/robske_110/SSS/rootPlugin" at line 291
    [20:24:14] [Server thread/CRITICAL]: Could not execute asynchronous task SSSAsyncTask: Task crashed
    
     
  9. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    You used the direct master branch, which currently has WIP stuff on it (idk why i didn't do that on a branch). Please use https://github.com/robske110/SignServerStats/tree/0.9.1. (Or simply SignServerStats_v0.9.1.phar)
     
  10. kaliiks

    kaliiks Zombie

    Messages:
    250
  11. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    you just have to make sure that the target server has query enabled. most server have that.
     
  12. kaliiks

    kaliiks Zombie

    Messages:
    250
    enable-query in server.properties is enabled
    edit: it working but loading was slow thank you!
     
    Last edited: Feb 15, 2017
  13. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    I just tested and confirmed that it works. Have you bumped the API?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.