1. When making a thread, please tag your thread accordingly using the menu to the left of the textfield where you name your thread where applicable. Server Advertisements and Mod Releases should be contained to their respective subforums.

Server Discussion CommandStar: Real-Time Chat, Online Players, and Server Status

Discussion in 'Multiplayer' started by Seriallos, Dec 15, 2013.

  1. Seriallos

    Seriallos Space Penguin Leader

    Yeah, YAML is a little funny. It has some really nice features that can make it way nicer to use than JSON but those extra features can make it a bit tricker.

    I'm planning on coding up some better config validation so that the errors from commandstar are a bit easier to understand.

    I've also tweaked the default config file to provide slightly better instructions and examples which may help.
     
  2. malobre

    malobre Orbital Explorer

    I've made some modification for compatibility with http://starbound-servers.net/
    Code:
    Code:
    getPlayerList = (req, res, next) ->
      plist = []
      for i of playersOnline
        plist.push(nickname: playersOnline[i])
      resData =
        playercount: playersOnline.length
        playerlist: plist
      res.send resData
      next()
    and
    Code:
    server.get( '/server/playerList', getPlayerList )
    Enjoy ! :D
    I've made a pull request on GIthub
     
    Last edited: Dec 21, 2013
  3. Seriallos

    Seriallos Space Penguin Leader

    Cool! Just out of curiousity, is this an easier approach than using the playersOnline array in the /server/status endpoint?
     
  4. malobre

    malobre Orbital Explorer

    I don't if it's an easier approach but it work, that's all that matters to me :D
     
  5. Seriallos

    Seriallos Space Penguin Leader

    I don't see the pull request on GitHub - I do see your changes in your fork though! I think you need to initiate the pull request and then I can merge it into the main branch and folks will eventually get it when they update their install.
     
  6. malobre

    malobre Orbital Explorer

    I've juste forget to press the submit button on github x)
     
  7. Seriallos

    Seriallos Space Penguin Leader

    @FuzzyThor and anyone else interested, I've added experimental support for relaying in-game chat to IRC. it's in the master branch right now and requires setting up IRC configuration the config directory.

    I have it working on a personal IRC server without issue right now so test it out and let me know if it works!
     
  8. supernet2

    supernet2 Existential Complex

    I think UUID is generated based on users username. seems when i make the username supernet2 on multiple accounts UUIDs seem to be similary mapped out, work exploring but..... thats what i get from the meta file.
     
    Last edited: Dec 22, 2013
  9. Seriallos

    Seriallos Space Penguin Leader

    0.1.4 Released - IRC + (Some) Configurable Panels + Starbound-servers.net Support!

    Download from GitHub: https://github.com/seriallos/commandstar/releases/tag/v0.1.4

    Or just clone the master branch if you're into that kind of thing

    New

    • Relay in-game chat to IRC. See config/default.yaml for details on configuring
    • Configuration flag to enable/disable active systems display
    • Configuration flag to enable/disable the API list in the footer
    • /server/players API endpoint (thanks https://github.com/malobre !)
      • Alias: /server/playerList
    • Detect crashes caused by segfaults
    Fixes/Tweaks
    • Player list is sorted by name
    • Reduced logging from server.coffee
    • Player names surrounded by <brackets> in chat log
    • Properly remove multiple color codes in player names and chat messages
    • Tweaks to default player list and system list (thanks malobre!)
    Technical
    • No longer install testing dependencies by default
     
    NakashimaKun likes this.
  10. NakashimaKun

    NakashimaKun Pangalactic Porcupine

    Nice update
     
  11. shibdib

    shibdib Starship Captain

    Any way to make it so chat doesn't jump to a new line when you're scrolled up?
     
    malobre likes this.
  12. Seriallos

    Seriallos Space Penguin Leader

    Not at the moment. Right now I just scroll to the new chat line whenever one is received. I'll take a look at detecting if you're not scrolled to the bottom and not issuing the automatic scroll.
     
    supernet2 likes this.
  13. malobre

    malobre Orbital Explorer

    Pull request posted. Now the chat scroll down only if you were already at the bottom before the new message was posted :)
     
  14. Seriallos

    Seriallos Space Penguin Leader

    Merged in and cleaned up a bit! Thanks @malobre!

    Chat scroll should now work as expected.
     
    NakashimaKun likes this.
  15. Another suggestion since I discovered some players on my servers where generating a huge amount of Exception (log file size 100MB+)
    Basically in the array I'm storing the exception name, number times it happened, suspected players generating the error, the score (how much time a user is suspected of the exception)

    This gives pretty good results, on the demo link you can notice a user generated 8000 exception is few minutes, causing even more stability issues

    PHP:
                    else if(preg_match("/[^\s]+Exception:\s*No\s*such\s*object\s*named\s*\'[^']*\'/"$line$val) ||
                            
    preg_match("/[^\s]+Exception:\s*No\s*such\s*item\s*\'[^']*\'/"$line$val) ||
                            
    preg_match("/[^\s]+Exception:\s*No\s*such\s*asset\s*\'[^']*\'/"$line$val))
                    {
                        if (!isset(
    $this->ex[$val[0]]))
                            
    $this->ex[$val[0]] = array();
                        if (!isset(
    $this->ex[$val[0]]['count']))
                            
    $this->ex[$val[0]]['count'] = 0;
                        if (!isset(
    $this->ex[$val[0]]['players']))
                            
    $this->ex[$val[0]]['players'] = array();
                        
    $l implode(","$lines);
                        
    $this->ex[$val[0]]['count']++;
                        
    //Warn: UniverseServer: Logged in account  as player Blossom
                        //Loading ship world received from client <315> <User: Blossom>
                        //Info: Client 'susan' <316> (100.XX.X.XXX:1729) connected
                        //if(preg_match("/.*\'(.*)\'.*\(.*\)(.*)/", $l, $val2)) {
                            //if ($this->ex[$val[0]][$val2[1]] == null)
                            //    $this->ex[$val[0]][$val2[1]] = 0;
                        //    $this->ex[$val[0]][$val2[1]]++;
                        //}
                        
    if(preg_match("/Loading\s*ship\s*world\s*received\s*from\s*client.*\<User:\s*([^>]*)\>/"$l$val2)) {
                            if (!isset(
    $this->ex[$val[0]]['players'][$val2[1]]))
                                
    $this->ex[$val[0]]['players'][$val2[1]] = 0;
                            
    $this->ex[$val[0]]['players'][$val2[1]]++;
                        }
                        if(
    preg_match("/Warn:\s*UniverseServer:\s*Logged\s*in\s*account.*as player\s*(.*)/"$l$val2)) {
                            if (!isset(
    $this->ex[$val[0]]['players'][$val2[1]]))
                                
    $this->ex[$val[0]]['players'][$val2[1]] = 0;
                            
    $this->ex[$val[0]]['players'][$val2[1]]++;
                        }
                    }
    HTML:
            <div id="chat" style="overflow:auto; height:300px; margin-bottom:15px;">
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th>Exception</th>
                            <th>Count</th>
                            <th style='font-size:10px;'>Suspect player/Score</th>
                        </tr>
                    </thead>
                    <tbody>
                        <? if(count($ex) > 0):?>
                        <? foreach($ex as $k => $v): ?>
                            <?="<tr><td style='font-size:12px;'>".strip_tags($k)."</td><td style='font-size:10px;'>".$v['count']."</td><td style='font-size:10px;'>".implode(", ", array_map(function ($k, $v) { return $k."/".$v; }, array_keys($v['players']), array_values($v['players'])))."</td></tr>"?>
                        <? endforeach;?>
                        <? endif;?>
                    </tbody>
                </table>
            </div>
    
    http://class101.org:55100/demo/
     
  16. Axiomatic

    Axiomatic Star Wrangler

    Hey Seriallos,

    Please know that I am truly a linux newbie. But I was unable to make any of this work until this was done. Without having done this I was not able to run "npm install" successfully.

    $ sudo apt-get update
    # Install needed packages
    $ sudo apt-get install git-core curl build-essential openssl libssl-dev
    # Install node.js
    $ git clone https://github.com/joyent/node.git && cd node
    $ ./configure
    $ make
    $ sudo make install
    $ cd
    # Install npm
    $ curl http://npmjs.org/install.sh | sudo sh
    #Install CoffeeScript
    $ sudo npm install -g coffee-script
     
  17. Seriallos

    Seriallos Space Penguin Leader

    I'll keep an eye on this if I end up building out more admin tools. Right now I'm focusing on making the site as useful for the players as possible and as easy for admins to run. The other admin tools/wrappers are certainly going to have more features like this than mine will. And hopefully the next patch makes it unnecessary to track these many errors! :)
     
    supernet2 likes this.
  18. Seriallos

    Seriallos Space Penguin Leader

    What version of Linux are you using? Ubuntu, CentOS, or something else?

    At some point in the last week I added a little bit more info about installing NodeJS, basically pointing to some of the official docs: https://github.com/seriallos/commandstar#installation - was that available when you were trying to install or did I write it too late to help you?
     
  19. Mortalsinn

    Mortalsinn Zero Gravity Genie

    This new version works great! one small request - Starlight (Wrapper) has an admin chat channel feature where you put a # in front of what you're saying "#lets ban that noob" and this of course shows up on the web chat. Would it be a big deal to add a filter for this?
     
  20. Axiomatic

    Axiomatic Star Wrangler

    It was available but I had already worked it out on my own. Let me add. FANTASTIC WORK SIR! I did not mean to sound like I was complaining. :) Just trying to help others.

    I am running Ubuntu Server 13.10. So maybe there were changes there. But the article I got that data from sounded like what I posted goes as far back as Ubuntu 12.04.
     

Share This Page