Server Query?

agmikeagmike Join Date: 2011-01-13 Member: 77299Members
edited January 2011 in NS2 General Discussion
Now that there is a dedicated server with hldsupdatetool, is there a way we can query the server and get the same kind of information like a source engine query? I have a custom PHP for my website that queries my source servers, I'd like to modify it slightly to be able to get NS2 query info so I can display the information on my site using my own query image PHP.

Thanks, and I love the engine.

EDIT: Btw, if so I'm looking for specific information on what sort of packet you need to send like (<a href="http://developer.valvesoftware.com/wiki/Server_queries#A2S_INFO" target="_blank">http://developer.valvesoftware.com/wiki/Se...ueries#A2S_INFO</a>) and what it sends back.

Comments

  • devicenulldevicenull Join Date: 2003-04-30 Member: 15967Members, NS2 Playtester, Squad Five Blue
    <!--quoteo(post=1823983:date=Jan 13 2011, 09:48 AM:name=agmike)--><div class='quotetop'>QUOTE (agmike @ Jan 13 2011, 09:48 AM) <a href="index.php?act=findpost&pid=1823983"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->(<a href="http://developer.valvesoftware.com/wiki/Server_queries#A2S_INFO" target="_blank">http://developer.valvesoftware.com/wiki/Se...ueries#A2S_INFO</a>)<!--QuoteEnd--></div><!--QuoteEEnd-->

    There you go, that's what you need ;)

    NS2 listens for queries on join port + 1 (typically 27016). Note that it doesn't return useful data for A2S_PLAYERS nor A2S_RULES, but A2S_INFO returns useful data.
  • agmikeagmike Join Date: 2011-01-13 Member: 77299Members
    edited January 2011
    Hmm, interesting, except that it shows the port as being the +1 which can be confusing to anyone who reads it, but thanks anyway!

    EDIT: Also, seems I can't do a steam://connect so it's not very helpful at this point.
  • SgtBarlowSgtBarlow Level Designer Join Date: 2003-11-13 Member: 22749Members, NS2 Developer
    edited January 2011
    I am working on a version of the built in webAPI to return all information in JSON format so you can use CURL to login and send a JSON header request to return data in that format otherwise you will get the standard webform returned, then use json_decode php function on the returned data to convert it to an array. Then you can do anything you want with the info.
Sign In or Register to comment.