1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

API Statistic sites for servers [Update log]

Discussion in 'Community Dev Corner' started by lavalord, Oct 10, 2012.

Mods: Downburst, Mazey
  1. lavalord

    lavalord Haxor Staff Alumni Donator Tester

    Messages:
    672
    So i discovered DrFrink's open-source code the other day and decided to set up a website to manage statistics for my KAG server (Australian Server). After having quite along talk i with the creator himself, i got it up.

    DrFrink's - http://frink.gnudist.com/

    Lavalord's - http://australianserver.no-ip.org/

    After i started hosting the website i realized the possibilities this could be for a server. So as Drfrink will be updating the the code with all these great features you can think of, i though i would make an update log on whats available in the current version.

    Update Log (Current version 1.2A):
    Everything made easier to install and update to later versions:
    Moved all KAG_DIR variable to frinkweb/settings.py
    Centralized KAG_DIR definition. Increased parse Speed.
    Cleaned up CSS/Moved all styling to CSS
    Included a couple example styles Red.css, Green.css and Blue.css
    Changed clan page to new styling format
    Added "Parser" folder in KAG_DIR
    Mostly architectural changes:
    Parsing accuracy greatly increased
    Previous version only parses the chat logs
    This one also parses the console logs
    The new database tracks lives and playing sessions
    Database structures for server information so you can track players over time and the session information will allow us to know who was playing at any given time and even what thier k/d and multikills were

    KAG management script now has a realtime player count and it can reboot the server when it sees an error in the console log

    Player search is case insensitive now
    Has 4 time frames: All-time, weekly, daily and hourly
    Instant search bar - capital sensitive at the moment

    Main page
    -List player: Profile picture from forums, rank, kills, deaths, and KDR
    -List clans: total kills, total deaths, total KDR and member number
    -List specific player rank and kills for: hammer, sword, bomb, bow, catapult and foot
    -Table headings will sort the content

    -Player names have links to their profiles
    -Clan names have links to a page with there members (some clan names with brackets not work at the moment in firefox)

    Profile pages:
    -Profile picture from forums
    -Link to banner
    -List players you have killed and died from with how you killed/died

    Banner generator:
    -Medals base on kills obtained for All-time, Weekly and Daily
    -Clan + Name
    -KDR rank:
    1 chevron for KDR <1​
    2 chevrons for KDR <2​
    3 chevrons for KDR <3​
    1 star for each KDR integer >3​
    -Watermark to set to your website address
    Wishlist:
    Console Log Parsing
    Restart Server if the log says something like:
    "[18:29:23] WARNING: API call failed: serverPort or serverAddress not present for putStatus()"
    Identify Play Sessions
    Lives
    Kill Streaks
    Multi Kills
    Calculate Play Time
    Kills/Hour
    Plot K/D over Time

    Realtime Player Count
    Write to DB

    Handle Weird clan names
    html encode everything all links, since firefox doesn't trust my webserver.

    Add more information to player page
    Add link to forum profile?
    get player # from avatar url
    link to https://forum.kag2d.com/members/playername.XXXX/

    Per Weapon Rank tables in database to improve speed

    Write server state to database
    Graph Players, kills, deaths, admin presence

    SSO Login
    Map Submission
    Map voting

    Parse Security Configs to identify admins
    Provide Server Control Interface to Admins
    Provide Text Editor Interface for configuration files
    Provide GIT revision control for server configuration
    Write RCON actions to database

    Write chats to database
    Make chats searchable

    Customizable player pages
    Clan Leaders
    Clan Management

    Banner Legend
    Kill Streak Banner
    Crystal Skull = 50 kills
    Jade Skull = 25 kills
    Gold skull = 10 kills
    Silver skull = 5 kills
    Bone skull = 1 kill
    MultiKill Banner Element
    Gold Bomb = 10 kills
    Silver Bomb = 5 kills
    Bomb = 1 kill

    Refactor Style, Minimal CSS in HTML files.
    Add a Blue CSS style

    Optimize DB access and Page Generation

    Compress Old Logs

    Get KAG PID from pid.txt instead of ps
    Then we know we're attaching to the right process
    Then we can run multiple servers on the same machine

    Installer
    Find all Magic Values, Hard-Coding, configure automagically
    Install to current directory, or ask user for install directory
    ask user for DNS name
    Ask for Server Name, Owner
    create database password, randomize token
    Install nginx, postgres
    copy configurations
    turn on cc_killfeed
    Try firing up everything


    Multi-Server Statistics
    Add Server Model to Database
    Assign Server->Kill,Death, Session relationships
    create FTP log fetcher
    Create a multi-server management script

    Server Side RCON
    Web RCON

    Automated Video Capture
    Keep a 10 minute buffer of video
    save crop and archive "interesting events"
    link events to videos on frinkweb

    Blacklist Network
    Query a list of trusted servers
    Synchronize bans

    If you would like to use this very tasty site on your server. Get all the current files from here. It you don't know what to do jump on IRC and have a chat with DrFrink or me. We'd be very happy to help!
    https://github.com/sprucegum/Frinkweb

    Thinking about upgrading your site? If your unsure just give us a call!
     
    MadDog, Noburu, Calindrus and 13 others like this.
  2. SentinelTank

    SentinelTank Shark Slayer

    Messages:
    27
    great to see frinks excellant work is being put to use all in other great servers!
     
    Beepo and Ruleral like this.
  3. Antman

    Antman Base Burner

    Messages:
    344
    I could do this with RTDM if I ever bother to bring my server back, that'd only require a little tweaking right?
     
  4. lavalord

    lavalord Haxor Staff Alumni Donator Tester

    Messages:
    672
    Its quite a lot of work setting it up, as you need to change heaps of files and also get used to running it in a slightly different way, but yeah it would be nice.
    </br>--- merged: Oct 16, 2012 8:49 PM ---</br>
    Beta 1.1A is out!
     
    Antman likes this.
  5. Antman

    Antman Base Burner

    Messages:
    344
    But it doesn't work :p
     
  6. frink

    frink Shopkeep Stealer

    Messages:
    40
    We need to streamline the upgrade process, but I assure you, the stats system works.
     
  7. Antman

    Antman Base Burner

    Messages:
    344
    It seems to be having problems, or is it just me?
    Frink's works, but not lava's.
     
  8. Downburst

    Downburst Mindblown Global Moderator Forum Moderator Donator Tester

    Messages:
    1,813
    I don't get the database to work properly for some reason, it keeps telling me I have the wrong password.

    I am 100% sure the password at the settings page is the same password I made the database with so I am now trying to figure out what went wrong. Any ideas?
     
  9. Mazey

    Mazey Haxor Global Moderator Forum Moderator Staff Alumni Donator Official Server Admin

    Messages:
    1,914
    Norill of The Original Damn Small Server also have a stats site.

    Damnsmallserver.site40.net
     
  10. frink

    frink Shopkeep Stealer

    Messages:
    40
    I idle on #kag.funhouse and can give support when I'm free.

    My first guess says that, if the passwords are right, then perhaps the database permissions are invalid.

     
    Beepo likes this.
  11. Lava said he was going to update it. This is probably a problem caused during his attempt.
     
  12. lavalord

    lavalord Haxor Staff Alumni Donator Tester

    Messages:
    672
    If your running in root try creating a database account "root" and use that. It worked for kai
    I fudged up the banner generator which brought the whole site down but its fixed now
     
  13. Antman

    Antman Base Burner

    Messages:
    344
    I haven't played for a whole day but my hourly kills is 50 something, ot looks like the stats from a week ago or something.
     
  14. lavalord

    lavalord Haxor Staff Alumni Donator Tester

    Messages:
    672
    the database was rebuilt in the update process so it was kind of reverted back to a point i think
     
  15. frink

    frink Shopkeep Stealer

    Messages:
    40
    I'm ironing out some bugs. I don't want to go into heavy details, but stats discrepancies are temporary. If there's a miscount today, it won't affect your all time score. Since, as long as we keep the logs, we can do a recount.

    Any time I make a major change to the database structure, or the parser, each server needs to recount the statistics to upgrade to the newest version. Generally, each major revision adds greater precision and accuracy to the statistics.
     
  16. lavalord

    lavalord Haxor Staff Alumni Donator Tester

    Messages:
    672
    New version 1.2A is out
     
    soulrealm and WarrFork like this.
  17. Beo

    Beo Bison Rider Tester

    Messages:
    62
    Put 'localhost' instead of empty string in 'HOST': in settings.py. Worked for me.
     
    Razi and Froghead48 like this.
  18. Froghead48

    Froghead48 Haxor

    Messages:
    703
    This is execptional, and very bright =.=
    Wish more people used this though ;I
     
  19. delankski

    delankski Horde Gibber

    Messages:
    435
  20. lavalord

    lavalord Haxor Staff Alumni Donator Tester

    Messages:
    672
    frink site isn't up at the moment because he is working on a big update
     
Mods: Downburst, Mazey