ServerBrowser with Maxplayers

JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver
edited July 2010 in Modding
Hey,

I made this short correction in the Server Browser so you can now see the current Players and the max Players available on the server,
just replace that file with your ServerBrowser.lua at steamapps\common\natural selection 2\ns2\lua


<a href="http://home.arcor.de/jim_west/ns2/ServerBrowser.lua" target="_blank">http://home.arcor.de/jim_west/ns2/ServerBrowser.lua</a>
(right-click and save at your folder)

Edit: A little bit buggy, i know, it just can show 3 numbers, so if there are actually 21 players on the Server u can only see 21/, I will fix it.

Cheers,
Marco

Comments

  • ItalianmagicItalianmagic Join Date: 2008-12-13 Member: 65755Members
    edited August 2010
    //EDIT
    Updated SWF File

    <a href="http://www.citylimitskate.com/download/main_menu.swf" target="_blank">main_menu.swf | v0.03</a> (Direct Link)
    Right Click + Save As...
    Download and put in ...\ns2\ui directory.

    Updates for v0.03
    - Shows if server is password protected
    - Capability of password sort (needs to be added in on LUA side)
    - Change gametype from "naturalselection2" to NS2 (spacial reasons)
    - Some cosmetic shifts..
  • AsranielAsraniel Join Date: 2002-06-03 Member: 724Members, Playtest Lead, Forum Moderators, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow, Subnautica Playtester, Retired Community Developer
    now you just need to add a way to identify password protected servers and everything is perfect :)
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver
    The problem is, that the list will be loaded into the Flash, and if you want new entrys, you need do edit the Flash-site,
    and I don't have a tool to edit Flash.
  • ItalianmagicItalianmagic Join Date: 2008-12-13 Member: 65755Members
    edited July 2010
    if any1 can crack the swf, i'd be able to modify it.

    //EDIT:
    I decompiled it. any requests?

    ...And they used AS1... not AS3... :/
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver
    If you recompile it, is it still working?
  • ItalianmagicItalianmagic Join Date: 2008-12-13 Member: 65755Members
    <!--quoteo(post=1789362:date=Jul 30 2010, 08:26 AM:name=JimWest)--><div class='quotetop'>QUOTE (JimWest @ Jul 30 2010, 08:26 AM) <a href="index.php?act=findpost&pid=1789362"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->If you recompile it, is it still working?<!--QuoteEnd--></div><!--QuoteEEnd-->

    yep. decompiling makes it just like it was in a FLA file.
  • ItalianmagicItalianmagic Join Date: 2008-12-13 Member: 65755Members
    edited August 2010
    <a href="http://www.2shared.com/video/VKQ0oAUJ/main_menu.html" target="_blank">main_menu.swf</a>
    Download and put in ...\ns2\ui directory.

    Changes...
    open more spaces to show players.
    went from Flash player 6 to 9 compatible (only downside).

    <a href="http://www.unknownworlds.com/ns2/forums/index.php?s=&showtopic=110608&view=findpost&p=1788128" target="_blank">Click Here for Latest download (v0.03)</a>
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver
    Can you make a new row, too, that the browser shows which Server got a password?
    The flash get those information allready from the Luascript , because the script returns:

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->            Main.GetServerName(serverIndex),
                Main.GetServerGameDesc(serverIndex),
                GetTrimmedMapName(Main.GetServerMapName(serverIndex)),
                Main.GetServerNumPlayers(serverIndex).."/"..Main.GetServerMaxPlayers(serverIndex),
                Main.GetServerPing(serverIndex),
                Main.GetServerAddress(serverIndex),
                Main.GetServerRequiresPassword(serverIndex)<!--c2--></div><!--ec2-->

    When yes, you need to put a new Function in the Action Script:

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->function SortByPass(ascending)
    {
         if (lua !=undefined)
         {          
                return lua("MainMenu_SBSortByPass", ascending);
         }
    }<!--c2--></div><!--ec2-->

    i would put the script in the lua, too, then we could also Sort by Servers without a password.
  • ItalianmagicItalianmagic Join Date: 2008-12-13 Member: 65755Members
    edited August 2010
    gotcha. will do. stay tuned!

    EDIT: I have got the coding working (other than a lock img next to the server name) ... i just need the sort function after that. :D

    EDIT2: Server now shows if pass protected or not... though i screwed the interface up a bit.. o.O
    <!--quoteo(post=1790018:date=Jul 31 2010, 08:20 AM:name=JimWest)--><div class='quotetop'>QUOTE (JimWest @ Jul 31 2010, 08:20 AM) <a href="index.php?act=findpost&pid=1790018"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Can you make a new row, too, that the browser shows which Server got a password?
    The flash get those information allready from the Luascript , because the script returns:

    i would put the script in the lua, too, then we could also Sort by Servers without a password.<!--QuoteEnd--></div><!--QuoteEEnd-->
  • ItalianmagicItalianmagic Join Date: 2008-12-13 Member: 65755Members
    edited August 2010
    <a href="http://www.unknownworlds.com/ns2/forums/index.php?s=&showtopic=110608&view=findpost&p=1788128" target="_blank">main_menu.swf | v0.03</a>
    Download and put in ...\ns2\ui directory.

    Updates for v0.03
    - Shows if server is password protected
    - Capability of password sort (needs to be added in on LUA side)
    - Change gametype from "naturalselection2" to NS2 (spacial reasons)
    - Some cosmetic shifts..
Sign In or Register to comment.