Improved NS2 Web Admin

2

Comments

  • ZaggyZaggy NullPointerException The Netherlands Join Date: 2003-12-10 Member: 24214Forum Moderators, NS2 Playtester, Reinforced - Onos, Subnautica Playtester
    edited January 2013
    I tried replacing my current web files with this mod but now the players don't show up below " Name Steamid IP Address Team Score Kills/Deaths Resources Ping Time Actions"
    Is it required to restart the server before they appear?

    edit: Disregard, I suck at extracting files, gotta wait until the server fills up again to see effect.
  • FuhrerDarqueSydeFuhrerDarqueSyde Join Date: 2004-10-04 Member: 32076Members, Constellation
    edited January 2013
    I noticed the weird timing on the perf graph. A few things I want to look at are having the y-axis in uniform integers rather than 33.0, 24.8, etc. and having the times on the x-axis to be more uniform as well such as 13:00, 13:30, 14:00, etc. I'll likely look into that when I figure out the entity count thing. Looking at the base url (non-index.html) i get json style output but nothing in there has the entity count. I'm assuming the other sites that show the entities are connect to the actually server via a socket to get this information?
  • WhosatWhosat Singapore Join Date: 2006-11-03 Member: 58301Members, Reinforced - Shadow
    edited January 2013
    <!--quoteo(post=2056724:date=Jan 6 2013, 10:39 AM:name=CoTTon)--><div class='quotetop'>QUOTE (CoTTon @ Jan 6 2013, 10:39 AM) <a href="index.php?act=findpost&pid=2056724"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I can get the entity count information from HLSW so I'm sure it's in there somewhere.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Entity count information is only available in the source query protocol response.

    The data returned from the web interface does not contain all the information available in the response via SourceQuery, and vice versa.

    I use a php script to extract both data and combine them into one data stream for my custom interface.

    I've voiced this out in the Google Moderator page: <a href="http://goo.gl/mod/pTQ8" target="_blank">http://goo.gl/mod/pTQ8</a>


    EDIT: Oh and the SourceQuery protocol does not work over HTTP - I do not know of any javascript libraries which does sourcequery.
    (Therefore its technically impossible getting the entity count in the webadmin interface through javascript alone)
  • FuhrerDarqueSydeFuhrerDarqueSyde Join Date: 2004-10-04 Member: 32076Members, Constellation
    yeah the last time i dealt with querying a server like that was in Perl back in the Half-Life 1 days. I could write a script to output it into a format compatible with the web admin interface but that'd take time when there are probably plenty of php or perl scripts out there that could perform this function already. That being said, it is still on my list because I like to do things myself. :P
  • ChaguiChagui Join Date: 2008-03-01 Member: 63773Members
    edited January 2013
    There are some bugs in the showPerfChart() function in rcon.js.

    First, in the x axis tick options, it sais '%H:%m', and it should say '%H:%M'.

    Also you can make the intervals in the y axis integers, just add "tickinterval: 5", like this:
    yaxis:{min:0,tickInterval: 5}

    Simlarly, in the x axis you can put a tick interval like this:
    tickInterval: '30 minutes'

    hope this helps :D

    Edit: Added picture
    <img src="http://i48.tinypic.com/307rk9c.png" border="0" class="linked-image" />
  • FuhrerDarqueSydeFuhrerDarqueSyde Join Date: 2004-10-04 Member: 32076Members, Constellation
    sounds good, thanks. I havent had time to work on it with work and all. I'll add these changes tomorrow as well as looking into writing a perl script to query an ns2 server for ent count.
  • devicenulldevicenull Join Date: 2003-04-30 Member: 15967Members, NS2 Playtester, Squad Five Blue
    edited January 2013
    <!--quoteo(post=2059516:date=Jan 12 2013, 12:11 AM:name=FuhrerDarqueSyde)--><div class='quotetop'>QUOTE (FuhrerDarqueSyde @ Jan 12 2013, 12:11 AM) <a href="index.php?act=findpost&pid=2059516"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->sounds good, thanks. I havent had time to work on it with work and all. I'll add these changes tomorrow as well as looking into writing a perl script to query an ns2 server for ent count.<!--QuoteEnd--></div><!--QuoteEEnd-->

    I asked to get the entity count included with the getperfdata results. This would make it a bit easier to add to the graph. Definitely won't be in for 236, but hopefully for 237.

    Perl script really wouldn't help a whole lot, as you wouldn't have any way to actually get it into the web interface.

    Edit: I also merged in all the changes so far to the github repo. Hope that's okay with everyone (let me know if it's not...)
  • CoTTonCoTTon Join Date: 2005-02-28 Member: 42773Members
    edited January 2013
    Looks like patch broke webadmin a bit.

    Here is chat log from web admin players list

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->(All) ie: rtv
    (All) Cat%2BCop: rtv
    (All) %255BcircleLerk%255DCoco: %2521rtv
    (All) %255BcircleLerk%255DCoco: votemap
    (All) Admin: Wat+map+u+want%3F
    (All) TWO+######ING+AP: DOCKING
    (All) Weiss: docking
    (All) ie: docking
    (All) Cat+Cop: docking+ftw
    (All) Weiss: docking+4+life
    (All) %25252D%25257CTBG%25257C%25252D%252BHeatSurge: derp
    (All) %252528%252B%2525E2%252595%2525AF%2525C2%2525B0%2525E2%252596%2525A1%2525C2%2525B0%2525EF%2525BC%252589%2525E2%252595%2525AF%2525EF%2525B8: the%252Bsnow%252Bis%252Bgone%25253F
    (All) %252528%252B%2525E2%252595%2525AF%2525C2%2525B0%2525E2%252596%2525A1%2525C2%2525B0%2525EF%2525BC%252589%2525E2%252595%2525AF%2525EF%2525B8: sad%252Bface
    (All) %25252D%25257CTBG%25257C%25252D%252BHeatSurge: what%252Bsnow%25252C%252Bthis%252Bis%252Bdocking
    (All) %25252D%25257CTBG%25257C%25252D%252BHeatSurge: oh%252BRR%252Bsnow
    (All) %25252D%25257CTBG%25257C%25252D%252BHeatSurge: meh
    (All) %252528%252B%2525E2%252595%2525AF%2525C2%2525B0%2525E2%252596%2525A1%2525C2%2525B0%2525EF%2525BC%252589%2525E2%252595%2525AF%2525EF%2525B8: yeah%252Blol
    (All) D153453D: New%252Bbuild%25253F
    (All) ie: yes
    (All) %25255BcircleLerk%25255DCoco: yes
    (All) D153453D: How%252Bis%252Bit%252Bso%252Bfar%25253F
    (All) ie: magic
    (All) D153453D: nice%2E%2E%2E
    (All) %2D%7CTBG%7C%2D+HeatSurge: how+should+I+know%2C+it+JUST+updated
    (Alien) %28+%E2%95%AF%C2%B0%E2%96%A1%C2%B0%EF%BC%89%E2%95%AF%EF%B8: sup
    (All) D153453D: ooo
    (All) ie: we+can+all+read+the+changelog
    (All) ie: %2E%2E%2E
    (All) %2D%7CTBG%7C%2D+HeatSurge: did+they+release+official%3F
    (All) %2D%7CTBG%7C%2D+HeatSurge: f%27n+delayed+patch+notes
    (All) the%5Fother%5Fbrand: yay%2C+only+working+server
    (All) %2D%7CTBG%7C%2D+HeatSurge: I+bet+my+ass+they%27ll+be+incomplete+too
    (All) Admin: Honestly+patch+should+have+been+released+tomorrow
    (All) %2D%7CTBG%7C%2D+HeatSurge: wat+is+this+east+wing
    (All) inv%2E+Rehevkor: this+map+is+still+bad
    (Marine) Mr%2E+Charles: onos+music+is+differnet
    (All) inv%2E+Rehevkor: can+we+change+it%3F
    (All) Admin: Ut+was+just+released+cuz+of+delays
    (All) the%5Fother%5Fbrand: this+map+is+bad%3F
    (All) inv%2E+Rehevkor: yes
    (All) JediPhreaK: fyi+we+are+not+having+a+normal+game%2C+gonna+need+a+round+restart+when+ppl+want+t
    (All) JediPhreaK: to+play
    (All) the%5Fother%5Fbrand: you+mean+worse+than+usual%2C+or+worse+than+other+maps%3F
    (All) inv%2E+Rehevkor: worse+than+other+maps
    (All) Mr%2E+Charles: what%27s+the+difference
    (All) D153453D: nah
    (All) Mr%2E+Charles: suicide
    (All) Codeine%5FFiend: im+sad+the+snowballs+are+gone
    (All) Nue: yea
    (All) Nue: lol
    (All) %28+%E2%95%AF%C2%B0%E2%96%A1%C2%B0%EF%BC%89%E2%95%AF%EF%B8: dafuq+east+wing
    (All) Nue: lol
    (All) %2D%7CTBG%7C%2D+HeatSurge: what
    (All) %2D%7CTBG%7C%2D+HeatSurge: the+<!--c2--></div><!--ec2-->
  • FuhrerDarqueSydeFuhrerDarqueSyde Join Date: 2004-10-04 Member: 32076Members, Constellation
    I see that, i didn't see a mention of serverwebadmin.lua (or w/e the lua of called for it) or anything else related to the webui's backend for the server being updated so im not sure why it is broken right now. We could just pass that through a parser.
  • SeeVeeSeeVee Join Date: 2012-10-31 Member: 165206Members
    The chat being messed up is not from the web admin mod. I have two servers and the one without this mod has the same issue.
  • dethovudethovu Join Date: 2009-06-23 Member: 67906Members
    <!--quoteo(post=2061995:date=Jan 17 2013, 09:38 AM:name=SeeVee)--><div class='quotetop'>QUOTE (SeeVee @ Jan 17 2013, 09:38 AM) <a href="index.php?act=findpost&pid=2061995"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->The chat being messed up is not from the web admin mod. I have two servers and the one without this mod has the same issue.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Confirmed: this has nothing to do with this modification. The chat bug is a part of the 236 and 237 builds.
  • FuhrerDarqueSydeFuhrerDarqueSyde Join Date: 2004-10-04 Member: 32076Members, Constellation
    Agreed as I just did a fresh reinstall and used the stock web admin and it still has the issues. I'll make a post in the tech support section as I rarely see any UWE replies over here in server discussion.
  • Florp_IncarnateFlorp_Incarnate Join Date: 2002-11-01 Member: 3045Members
    Verified, my server also has the strange text artifacts shown above. I am running DAK. Thanks FuhrerDarqueSyde for posting the bug report.
  • WhosatWhosat Singapore Join Date: 2006-11-03 Member: 58301Members, Reinforced - Shadow
    Anyone tried devicenull's original ns2web, which has just been recently updated? <a href="https://github.com/devicenull/ns2web" target="_blank">https://github.com/devicenull/ns2web</a>
  • SeeVeeSeeVee Join Date: 2012-10-31 Member: 165206Members
    I have been using it since it was released and no issues with the way I have it set up. I load it through the server.lua though to keep my server white listed.
  • WhosatWhosat Singapore Join Date: 2006-11-03 Member: 58301Members, Reinforced - Shadow
    This chat bug is an issue with the new builds. The AJAX response itself has the jumbled data. I've tried decodeURIComponent() but the data in the AJAX response is not even properly url encoded so it will require a more complex workaround for now.
  • FuhrerDarqueSydeFuhrerDarqueSyde Join Date: 2004-10-04 Member: 32076Members, Constellation
    well it seems more like a mix. Because normally you wouldn't see + for spaces, you'd see %20 but they have all of the other % hex values in there. It is just weird. Curious to know why they'd mess with that part of the code as im not sure what else needs to send data in that format other than the stuff for the webui.
  • FuhrerDarqueSydeFuhrerDarqueSyde Join Date: 2004-10-04 Member: 32076Members, Constellation
    edited January 2013
    i believe i fixed the chat portion by adding

    entry.message = decodeURIComponent(entry.message.replace(/\+/g, "%20"));

    into the refreshchat function, still gotta fix the name portion.

    It also needs more testing but i put that right under the entry = data[i]; line.
  • FuhrerDarqueSydeFuhrerDarqueSyde Join Date: 2004-10-04 Member: 32076Members, Constellation
    edited January 2013
    Confirmed fixed.

    Replace line 189 of rcon.js (entry = data[i];) with the following...

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->entry = data[i];
    entry.player = decodeURIComponent(entry.player.replace(/(25){5,}/g, "").replace(/(\+|\%2B)/g, "%20"));
    entry.message = decodeURIComponent(entry.message.replace(/(25){5,}/g, "").replace(/(\+|\%2B)/g, "%20"));<!--c2--></div><!--ec2-->

    If line 189 is not entry = data[i]; then find that line and replace it with that.

    I am uploading a new compilation zip to <a href="http://www.neonblu.com/upload/ImprovedNS2WebAdmin_20130119-1932GMT-6.zip" target="_blank">http://www.neonblu.com/upload/ImprovedNS2W...9-1932GMT-6.zip</a> with the fix.
  • Alpha.Alpha. Join Date: 2011-01-04 Member: 76186Members
    The chat 'bug' is actually not a bug - [surprise:] it's a feature! :] As mentioned <a href="https://groups.google.com/forum/#!topic/uwe-server-ops/WXIpRB077R8" target="_blank">here</a> it fixes an exploit.
  • FuhrerDarqueSydeFuhrerDarqueSyde Join Date: 2004-10-04 Member: 32076Members, Constellation
    I remember seeing that in a different post, just weird that they changed the AJAX response and never thought to update the webadmin to compensate.
  • SeeVeeSeeVee Join Date: 2012-10-31 Member: 165206Members
    edited January 2013
    <!--quoteo(post=2064501:date=Jan 21 2013, 06:27 PM:name=Alpha.)--><div class='quotetop'>QUOTE (Alpha. @ Jan 21 2013, 06:27 PM) <a href="index.php?act=findpost&pid=2064501"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->The chat 'bug' is actually not a bug - [surprise:] it's a feature! :] As mentioned <a href="https://groups.google.com/forum/#!topic/uwe-server-ops/WXIpRB077R8" target="_blank">here</a> it fixes an exploit.<!--QuoteEnd--></div><!--QuoteEEnd-->

    ... anything that is an unwanted result in programming is a bug by definition. The fact that he has to now fix the web admin supports this.
  • SidderSidder Join Date: 2012-12-23 Member: 176034Members
    Ive used the fix posted, but it seems 50/50 sometimes there is an clean line then other times its still bogged up, anyone else tried it?
  • FuhrerDarqueSydeFuhrerDarqueSyde Join Date: 2004-10-04 Member: 32076Members, Constellation
    edited January 2013
    it seems to happen for me when i dont log into the webadmin for a bit but the root cause of how they're sending the data now, it is not well formed.

    You can check this by going to <a href="http://YOURIP:YOURPORT/?request=getchatlist" target="_blank">http://YOURIP:YOURPORT/?request=getchatlist</a>

    sometimes you just gt %252525252525252525252525252525252525252525252525252525 prefixing every code. sometimes you just get the usual well formed %5B%21%3F%5D+Squirrels though sometimes the plus is escaped when it shouldnt be it seems so it comes over as %2B (if i recall correctly) so i have to convert that to a space as a stop-gap even when it may be a legitimate +.

    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->[ { "message": "testing", "player": "%255B%2521%253F%255D%2BSquirrels", "teamOnly": false, "id": 1, "team": 0, "steamId": 29239611 }, { "message": "1+2+3+this+is+a+test+%21+%3F", "player": "%5B%21%3F%5D+Squirrels", "teamOnly": false, "id": 2, "team": 0, "steamId": 29239611 } ]<!--QuoteEnd--></div><!--QuoteEEnd-->
  • mbrickmbrick Join Date: 2013-01-24 Member: 181869Members
    edited January 2013
    <!--quoteo(post=2063462:date=Jan 19 2013, 05:18 PM:name=FuhrerDarqueSyde)--><div class='quotetop'>QUOTE (FuhrerDarqueSyde @ Jan 19 2013, 05:18 PM) <a href="index.php?act=findpost&pid=2063462"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I am uploading a new compilation zip to <a href="http://www.neonblu.com/upload/ImprovedNS2WebAdmin_20130119-1932GMT-6.zip" target="_blank">http://www.neonblu.com/upload/ImprovedNS2W...9-1932GMT-6.zip</a> with the fix.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Thanks Fuhrer! I am running this now, had no trouble loading it in.

    Any chance you can fix the time scale on the performance monitor page? Across the bottom I see: 0:01, 0:01, 1:01, 1:01, 1:01. Is it resetting after each round and expanding to show the entire round? Or 1 hr total?

    Also sometimes the chat window stops updating, any ideas? In the NS2 Server window I can see the chat lines scrolling by however.
  • WhosatWhosat Singapore Join Date: 2006-11-03 Member: 58301Members, Reinforced - Shadow
    Incorporated Fuhrer's chat fix and submitted a pull request to devicenull for ns2web.

    Also includes all the community improvements in this thread.

    And I've also made the Change Map dropdown use maps from the maps list on the server, and you may also double-click the maps on the Maps tab to change to that map.

    <a href="https://github.com/ShrmnK/ns2web" target="_blank">https://github.com/ShrmnK/ns2web</a>
  • mbrickmbrick Join Date: 2013-01-24 Member: 181869Members
    <!--quoteo(post=2067263:date=Jan 26 2013, 08:05 PM:name=Whosat)--><div class='quotetop'>QUOTE (Whosat @ Jan 26 2013, 08:05 PM) <a href="index.php?act=findpost&pid=2067263"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Incorporated Fuhrer's chat fix and submitted a pull request to devicenull for ns2web.

    Also includes all the community improvements in this thread.

    And I've also made the Change Map dropdown use maps from the maps list on the server, and you may also double-click the maps on the Maps tab to change to that map.

    <a href="https://github.com/ShrmnK/ns2web" target="_blank">https://github.com/ShrmnK/ns2web</a><!--QuoteEnd--></div><!--QuoteEEnd-->
    Got it installed, thanks. What does this mean? "submitted a pull request to devicenull for ns2web" ?
  • FuhrerDarqueSydeFuhrerDarqueSyde Join Date: 2004-10-04 Member: 32076Members, Constellation
    edited January 2013
    Part of the chat fix is a little hacky because there seems to be some cases where the ajax response will show %2525252525252525252525252525252525 then put the 2 character hex ASCII value. So my fix tries to strip all of those 25s out, in addition to handling some cases where it encodes the + as a % hex encoded ASCII instead of leaving it as + symbol so a case could happen where a plus it turned into a space erroneously by my fix. There is no way to fix this from the webui. The Lua needs to be fixed.
  • WhosatWhosat Singapore Join Date: 2006-11-03 Member: 58301Members, Reinforced - Shadow
    Yup got that Fuhrer! I tried doing a decodeURI too but encountered that 2525252525 bug and gave up (oops ><)

    The pull request is to tell the original developer (in this case devicenull) that there is a new version of the code submitted by someone else, and would like to request for him to review it and incorporate the new version into his.
  • FuhrerDarqueSydeFuhrerDarqueSyde Join Date: 2004-10-04 Member: 32076Members, Constellation
    edited January 2013
    yeah, so my fix was to try and replace 5 or more instances of 25 with a empty string and replace + or 2B (hex version of plus since it seems to occasionally turn + into that when it shouldn't) to a space.

    So there will be some cases where someone will actually type a + in their message and it'll turn into a space or when someone uses 25 five or more times consecutively will get erased. "(All) [!?] Squirrels: 25252525252525" would become "(All) [!?] Squirrels: " and "(All) [!?] Squirrels: Hey, jut got my new HTC One X+!" would become "(All) [!?] Squirrels: Hey, jut got my new HTC One X !"

    It is unfortunate but until the server has its ajax response fixed, not much we can do.

    If i were to take a guess, I'd say their lua code for encoding strings is not 100% compliant, but almost. It is probably some edge case i'm randomly seeing that causes the + to become %2B when it should still be a + for spaces. the 252525252525252525252525 thing is probably some kind of match freaking out because 25 is the hex code for %.
Sign In or Register to comment.