[Project] Nanogrid

InsaneInsane Anomaly Join Date: 2002-05-13 Member: 605Members, Super Administrators, Forum Admins, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Subnautica Developer, Pistachionauts, Future Perfect Developer
edited May 2012 in Squad Five
<div class="IPBDescription">Web-Based Server Browser</div><!--sizeo:4--><span style="font-size:14pt;line-height:100%"><!--/sizeo--><a href="http://hypernovadesign.co.uk/nanogrid/" target="_blank">Nanogrid Server Browser</a><!--sizec--></span><!--/sizec-->

<!--coloro:#008080--><span style="color:#008080"><!--/coloro--><b>What It Is.</b><!--colorc--></span><!--/colorc-->
Nanogrid is a web-based server browser for NS2, written in JavaScript and PHP.

<!--coloro:#008080--><span style="color:#008080"><!--/coloro--><b>What It's For.</b><!--colorc--></span><!--/colorc-->
Nanogrid lets you browse and connect to NS2 servers from your web browser. Since the current in-game menu is in a transitional state and lacking some features, I thought I would post this up as it might be of use to some people. It has a couple of features the in-game menu doesn't have yet, most notably sorting by name, map and player count. You click on any server to see the player list, which I find quite useful for seeing if anyone I know is playing on a server. It also displays the build number of a server, and the tickrate of servers running player's <a href="http://www.unknownworlds.com/ns2/forums/index.php?showtopic=112026" target="_blank">GameOvermind</a> admin mod.

<!--coloro:#008080--><span style="color:#008080"><!--/coloro--><b>Why It's Here.</b><!--colorc--></span><!--/colorc-->
Squad 5 seemed to be the best place on the forums to post this. I am a developer, but this was done in my spare time as a personal project, so I reckon it fits in here ok.


Feel free to post any suggestions, feedback or feature requests!
«1

Comments

  • NeutralX2NeutralX2 Join Date: 2007-06-29 Member: 61421Members, Reinforced - Gold
    Excellent work. I bookmarked this and anticipate using it a lot. There are specific servers that I prefer to play on, and often times I will load up the game only to find they are all full. This makes checking the status of those servers and joining them much easier. Thanks!
  • WilsonWilson Join Date: 2010-07-26 Member: 72867Members
    Very nice work. I'd like to see some filters to hide empty servers etc.
  • AezayAezay Join Date: 2003-04-19 Member: 15660Members
    That server list looks really nice, hoping that the ingame browser will eventually be "molded" into something of similar looks.

    Been testing out the Steam URI, and it either seems like Steam cannot handle the NS2 servers, or that NS2 servers aren't responding properly to the query response. I am unaware of how NS2 servers actually respond to query requests, but they have no reply for standard Source queries.
  • FloodinatorFloodinator [HBZ] Member Join Date: 2005-02-22 Member: 42087Members, Reinforced - Shadow
    Is that Buildinfo correct? Because I see Servers running ob B203/B189/B199/B207/B193/B187!!!!?
  • peregrinusperegrinus Join Date: 2010-07-16 Member: 72445Members
    That's awesome - wish I had the skills to make stuff like this!

    My fav thing is you can see which players are in which servers.
  • InsaneInsane Anomaly Join Date: 2002-05-13 Member: 605Members, Super Administrators, Forum Admins, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Subnautica Developer, Pistachionauts, Future Perfect Developer
    <!--quoteo(post=1937729:date=May 20 2012, 05:32 PM:name=Aezay)--><div class='quotetop'>QUOTE (Aezay @ May 20 2012, 05:32 PM) <a href="index.php?act=findpost&pid=1937729"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->That server list looks really nice, hoping that the ingame browser will eventually be "molded" into something of similar looks.<!--QuoteEnd--></div><!--QuoteEEnd-->

    I actually based some of the design on concepts for the main menu and marine UI, so I would expect the finished in-game browser to look similar (but much better).

    <!--quoteo(post=1937729:date=May 20 2012, 05:32 PM:name=Aezay)--><div class='quotetop'>QUOTE (Aezay @ May 20 2012, 05:32 PM) <a href="index.php?act=findpost&pid=1937729"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Been testing out the Steam URI, and it either seems like Steam cannot handle the NS2 servers, or that NS2 servers aren't responding properly to the query response. I am unaware of how NS2 servers actually respond to query requests, but they have no reply for standard Source queries.<!--QuoteEnd--></div><!--QuoteEEnd-->

    It's a bit of a tricky one. <a href="http://steam://rungameid/4920" target="_blank">steam://rungameid/4920</a> works just fine, but the server just doesn't respond to a steam://connect/ link. NS2 does however implement the Source server query protocol pretty well; Nanogrid is based on <a href="https://github.com/xPaw/PHP-Source-Query-Class" target="_blank">this</a> PHP class.

    <!--quoteo(post=1937742:date=May 20 2012, 06:46 PM:name=Floodinator)--><div class='quotetop'>QUOTE (Floodinator @ May 20 2012, 06:46 PM) <a href="index.php?act=findpost&pid=1937742"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Is that Buildinfo correct? Because I see Servers running ob B203/B189/B199/B207/B193/B187!!!!?<!--QuoteEnd--></div><!--QuoteEEnd-->

    That's the info that Nanogrid gets back from those servers when it queries them. It doesn't particularly surprise me to discover that there are out of date servers out there. If you find a server that you know for sure has the wrong build number (for instance you can join it on 208 but its listed here as 203), let me know.
  • WilsonWilson Join Date: 2010-07-26 Member: 72867Members
    <!--quoteo(post=1937896:date=May 21 2012, 12:20 PM:name=Insane)--><div class='quotetop'>QUOTE (Insane @ May 21 2012, 12:20 PM) <a href="index.php?act=findpost&pid=1937896"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->It's a bit of a tricky one. <a href="http://steam://rungameid/4920" target="_blank">steam://rungameid/4920</a> works just fine, but the server just doesn't respond to a steam://connect/ link. NS2 does however implement the Source server query protocol pretty well; Nanogrid is based on <a href="https://github.com/xPaw/PHP-Source-Query-Class" target="_blank">this</a> PHP class.<!--QuoteEnd--></div><!--QuoteEEnd-->

    I always thought that was because NS2 wasn't officially released on steam. The same as it doesn't show to friends who don't own it. If you are already in-game then you can join through friends, but it doesn't work directly from the friends list.
  • AezayAezay Join Date: 2003-04-19 Member: 15660Members
    <!--quoteo(post=1937896:date=May 21 2012, 01:20 PM:name=Insane)--><div class='quotetop'>QUOTE (Insane @ May 21 2012, 01:20 PM) <a href="index.php?act=findpost&pid=1937896"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->It's a bit of a tricky one. <a href="http://steam://rungameid/4920" target="_blank">steam://rungameid/4920</a> works just fine, but the server just doesn't respond to a steam://connect/ link. NS2 does however implement the Source server query protocol pretty well; Nanogrid is based on <a href="https://github.com/xPaw/PHP-Source-Query-Class" target="_blank">this</a> PHP class.<!--QuoteEnd--></div><!--QuoteEEnd-->
    One of the things I wrote when learning how sockets and network programming worked, was a tool that could query source servers for info, players and rules. Using this tool, I have no problems getting normal source servers, such as tf2, cs, ns1 and others to reply to my queries; no such luck with the NS2 servers though. I know NS2 isn't using the source or goldsource engine, like the other servers I had success in getting info from, but maybe that is the problem? As Wilson said, the game isn't properly released on Steam, and thus it might not know how to query the NS2 servers?

    Doing some quick investigating, using Process Monitor, I noticed when trying to refresh the server details of Steam's Game Info dialog, it sends out 25 bytes of data to the NS2 server, it does however not receive any data back. I'm pretty sure the data Steam sends out is "<!--coloro:#FFFF00--><span style="color:#FFFF00"><!--/coloro-->ÿÿÿÿTSource Engine Query\0<!--colorc--></span><!--/colorc-->", exactly 25 bytes.

    I will admit I know too little about all there is to know about source protocol queries, like RCON and packet compression, so if NS2 is using any of that, just ignore my post.
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    I know _everything_ (well most of it anyway). The first thing that needs to happen is NS2.exe needs to support the +connect-parameter again (it used to, but it got broken around B190). After that there are still a couple things here and there that need sorting (connect- & query-port differ), but I've already done most of that.
  • InsaneInsane Anomaly Join Date: 2002-05-13 Member: 605Members, Super Administrators, Forum Admins, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Subnautica Developer, Pistachionauts, Future Perfect Developer
    So you're saying that a steam://connect/ link would have worked before B190, is that correct?
  • ScardyBobScardyBob ScardyBob Join Date: 2009-11-25 Member: 69528Forum Admins, Forum Moderators, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow
    208.167.250.62 A New Gameservers.com NS2 server is born maps/ns2_rockdown.level 0/6 <!--sizeo:4--><span style="font-size:14pt;line-height:100%"><!--/sizeo--><b>Build 187</b><!--sizec--></span><!--/sizec-->

    Someone needs to give devicenull an award for most unupdated server :)
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    <!--quoteo(post=1938234:date=May 22 2012, 08:11 PM:name=Insane)--><div class='quotetop'>QUOTE (Insane @ May 22 2012, 08:11 PM) <a href="index.php?act=findpost&pid=1938234"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->So you're saying that a steam://connect/ link would have worked before B190, is that correct?<!--QuoteEnd--></div><!--QuoteEEnd-->
    NS2 uses different ports for the query-responder and the client-connects, and that ###### with Steam a bit. What you can do to get it to work right now (well, at least when +connect is supported), is use "steam://run/4920 +connect <IP>:<Port>", that ought to work.
  • AezayAezay Join Date: 2003-04-19 Member: 15660Members
    <!--quoteo(post=1938252:date=May 22 2012, 10:55 PM:name=player)--><div class='quotetop'>QUOTE (player @ May 22 2012, 10:55 PM) <a href="index.php?act=findpost&pid=1938252"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->NS2 uses different ports for the query-responder and the client-connects, and that ###### with Steam a bit.<!--QuoteEnd--></div><!--QuoteEEnd-->
    It's using a different port to respond to a query request?! How are you suppose to know which port that is?

    From a networking perspective, how does this make more sense than just replying on the same port?

    Is this also the reason why Steam's "Game Info" dialog doesn't work and won't show any information for NS2 servers?
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    It is located directly above the connect-port (+1). The reason it is seperate is because it is part of the Steam-API (basically, it doesn't have anything to do with NS2 at all). There is however the possibility to have incoming datagram-packets routed into your program, so NS2 can use it directly for client-connects too, if it wanted to. As it stands, it uses the GamePort-field in the query-response to direct clients to the correct connect-port. And yea this is the reason why Steam acts a bit flaky with NS2, as all the Gldsrc- and Source-games always communicate directly through their query-ports.
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    edited May 2012
    <!--quoteo(post=1938252:date=May 22 2012, 10:55 PM:name=player)--><div class='quotetop'>QUOTE (player @ May 22 2012, 10:55 PM) <a href="index.php?act=findpost&pid=1938252"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->NS2 uses different ports for the query-responder and the client-connects, and that ###### with Steam a bit. What you can do to get it to work right now (well, at least when +connect is supported), is use "steam://run/4920 +connect <IP>:<Port>", that ought to work.<!--QuoteEnd--></div><!--QuoteEEnd-->
    God, it's so simple it hurts, I didn't think of that. You don't pass parameters to the app with Steam URIs like that, though, which is why it's not working.

    I just tested and "steam://run/4920//connect IP:Port" works, the port needs to be the game port, though. Since he's parsing my data, that's already done... Only need to update the links he's generating and it will work.
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    Oddly enough that does work, it must take the route through the Steam-API where NS2 picks off the data correctly internally, where it does not from the command-line (or NS2 is deviating from standard-convention in its commandline-params). Anyhoo, problem solved.
  • InsaneInsane Anomaly Join Date: 2002-05-13 Member: 605Members, Super Administrators, Forum Admins, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Subnautica Developer, Pistachionauts, Future Perfect Developer
    Problem most definitely solved. Thanks very much for your help!

    Topic post updated.
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    edited May 2012
    The command line parameters for NS2 are indeed weird, as they do not require the + or - that you'd normally expect, so if you made a shortcut for connecting a server it'd be "NS2.exe connect IP:Port". Same with map loading (which is what I use with a bat file in the editor to quickly test maps), which is "NS2.exe map mapname".
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    Agh I didn't even know that, I figured after +connect stopped working (it worked at some point) they just broke the functionality for some reason, but yea apparently the plus-sign is no longer allowed. That's pretty non-standard, should probably be rectified one of these days.
  • JibrailJibrail Join Date: 2009-04-16 Member: 67200Members
    edited May 2012
    I would like to submit what looks like a "bug" if u have the game open and minimized and try to connect thru this site steam will launch another instance of NS2 I know it should not be that way but Idk if that is something byond ur reach. I dont know if this have been said allready I havnt read everything here so.
    never the less great job man and thanks for this.
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    <!--quoteo(post=1938291:date=May 23 2012, 01:25 AM:name=Jibrail)--><div class='quotetop'>QUOTE (Jibrail @ May 23 2012, 01:25 AM) <a href="index.php?act=findpost&pid=1938291"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I would like to submit what looks like a "bug" if u have the game open and minimized and try to connect thru this site steam will launch another instance of NS2 I know it should not be that way but Idk if that is something byond ur reach. I dont know if this have been said allready I havnt read everything here so.
    never the less great job man and thanks for this.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Can't fix that, it's the only way to make the joining actually work. It launches NS2 and passes the connect parameter...
  • InsaneInsane Anomaly Join Date: 2002-05-13 Member: 605Members, Super Administrators, Forum Admins, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Subnautica Developer, Pistachionauts, Future Perfect Developer
    That's correct; because the connect URI isn't working I'm using a workaround that sends a "run" command to the NS2 client, so it would always open a new instance of NS2.

    I'm considering making some changes that will allow you to connect to Nanogrid via the Steam Overlay web browser and connect to a server inside that instance of NS2, which ought to solve that issue.
  • AichmanAichman Join Date: 2003-11-13 Member: 22782Members, Constellation, Reinforced - Shadow, WC 2013 - Silver, WC 2013 - Shadow
    edited May 2012
    What about a filter thing allowing to hide empty servers?

    I know is really easy to spot servers with players, but just for cleaning the not so long server list( that we have now) that i expect it will be longer as we approach the 1.0 and linux dedicated servers.
  • InsaneInsane Anomaly Join Date: 2002-05-13 Member: 605Members, Super Administrators, Forum Admins, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Subnautica Developer, Pistachionauts, Future Perfect Developer
    Various kinds of filtering are on the to-do list. In particular:

    <ul><li>Filter out empty servers.</li><li>Filter by map.</li><li>Filter by country.</li></ul>
  • DghelneshiDghelneshi Aims to surpass Fana in post edits. Join Date: 2011-11-01 Member: 130634Members, Squad Five Blue, Reinforced - Shadow
    Great job, Insane!

    <!--quoteo(post=1938686:date=May 24 2012, 09:08 PM:name=Insane)--><div class='quotetop'>QUOTE (Insane @ May 24 2012, 09:08 PM) <a href="index.php?act=findpost&pid=1938686"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->[*]Filter by country.<!--QuoteEnd--></div><!--QuoteEEnd-->
    You should consider filtering by general area (i.e. NA, EU, AUS, Asia), since most people won't care if the server is in the Netherlands rather than Germany, for example.
  • ArgathorArgathor Join Date: 2011-07-18 Member: 110942Members, Squad Five Blue
    Thank you for this Insane, it makes deciding whether to jump into a game or not even easier and more convenient!

    I am just wondering, where do you pull the information from about the servers? I am looking to put the information for the two duplex servers on our site. Is there an xml file or rss feed, etc? Or are you polling each server?

    While I am after your expertise, do you know how the left4dead site gets its information about dev forum posts? Is there an xml/rss feed or something similar?

    I would greatly appreciate any knowledge you can share!

    P.S. Would you mind a future community site linking to your webpage?
  • InsaneInsane Anomaly Join Date: 2002-05-13 Member: 605Members, Super Administrators, Forum Admins, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Subnautica Developer, Pistachionauts, Future Perfect Developer
    Thanks Argathor!

    The way Nanogrid works is that it first retrieves an NS2 server master list that Mendasp hosts. The list is updated every six hours, so Nanogrid caches that list locally and only queries Mendasp's sever a maximum of once every six hours.

    It then queries every server on that list directly using the <a href="https://developer.valvesoftware.com/wiki/Server_queries" target="_blank">Source server query protocol</a> for up-to-date information. So for the duplex servers, since you already know their IP addresses, you would just query them directly without worrying about the master list component.

    I don't know for sure what Play4Dead does to get the developer posts, I think it does something like trawl developer forum profiles for updates. Plasma put quite a lot of information in <a href="http://www.unknownworlds.com/ns2/forums/index.php?showtopic=112494&st=0" target="_blank">his thread</a>, so you should give that a read.

    You're more than welcome to link to it from your site.
  • InsaneInsane Anomaly Join Date: 2002-05-13 Member: 605Members, Super Administrators, Forum Admins, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Subnautica Developer, Pistachionauts, Future Perfect Developer
    Just noticed that Nanogrid has been misbehaving and refusing to update servers despite getting data for them. That's fixed now, and it ought to refresh slightly faster, too.
  • ArgathorArgathor Join Date: 2011-07-18 Member: 110942Members, Squad Five Blue
    <!--quoteo(post=1946914:date=Jun 27 2012, 11:17 AM:name=Insane)--><div class='quotetop'>QUOTE (Insane @ Jun 27 2012, 11:17 AM) <a href="index.php?act=findpost&pid=1946914"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->...<!--QuoteEnd--></div><!--QuoteEEnd-->
    Thank you for making the time to give me so much information, all very useful.

    I had a look through the server query, all very straight forward thanks for that!

    I had a brief look at Plasma's thread but fear to get what I am after (a complete list of all developer threads) I will have to do it the hard way myself, bummer!

    Good luck with the continued development of Nano Grid, it is awesome so far and I love the futuristic feel of the styling!
  • InsaneInsane Anomaly Join Date: 2002-05-13 Member: 605Members, Super Administrators, Forum Admins, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Subnautica Developer, Pistachionauts, Future Perfect Developer
    I have been working on filtering, and have it half-implemented, but I just don't have the time to devote to it right now. With NS2 getting closer and closer to release, all spare time gets devoted to finishing Refining.

    However, in light of the recent boost in players thanks to the Totalbiscuit videos, Charlie suggested I put a player/server count on there. That was easy enough to do, so I've added it on!
Sign In or Register to comment.