Author Topic: SoldStat - A Windows-based statistics solution  (Read 3972 times)

0 Members and 1 Guest are viewing this topic.

Offline Sebra

  • Major(1)
  • Posts: 9
SoldStat - A Windows-based statistics solution
« on: October 14, 2008, 06:48:02 pm »
Hello,

I've built a web based statistics solution for Soldat which I would like to share if anyone is interested.

FEATURES
 * Clean and powerful web interface for viewing of statistics, including:
¬  ¬  - Leaderboard
¬  ¬  - Secondary weapon toplist
¬  ¬  - Individual leaderboard
¬  ¬  - K/D-ratio over time graph
¬  ¬  - Current server information
¬  ¬  - and more (screenshot1, screenshot2, live demo)
 * MSN-bot for player login notifications
 * IP-based stats, no one can steal your nick and ruin your stats (unless you let them play on your IP...)
 * In-game display and logging of kill streaks and death streaks
 * Can show stats by "All-time" or by "30-days"
 * Seperation possible between soldat server, database server and web front end
 * Can probably (!) scale to several Soldat Servers (though not tested)

REQUIREMENTS
 * Windows-based Soldat Server
 * .NET Framework 2.0
 * MySQL
 * IIS
 * Good overall computer know-how

WHY
Me and some friends played Soldat quite much, and someone got the idea it would be even more fun if we could actually SEE who was best (in short, someone got tired of the bragging ;-)).

I mostly built this to learn HOW to do it. There might not be ideal solutions everywhere, and I can't guarentee it's bug free. That said, I've been running it for quite some time on my server and it runs just fine. So I thought I could share it if anyone else wants to use it. To be able to, you need to know how to do the following:
 * Create a MySQL-database from a provided SQL-script (or examine the script and create the database manually)
 * Setup a ASP.NET IIS web application
 * Install scripts on your Soldat server (actually just a Ctrl+C, Ctrl+V here)
 * Overall knowledge of Windows Services, MySQL-databases, etc

HOW
The application consists of four parts:
 * A MySQL database for storing the frags
 * Some scripts to be installed on the Soldat Server to extend logging
 * A collector service to be installed on the server where the Soldat Server is running which will upload the stats to the database server
 * A ASP.NET powered web interface to display the statistics, getting them from the database server

Everything is written in C#, and you can download the source code below if you would like to take a look at it.

SUGGESTED INSTALLATION PROCEDURE
1. Download all the files below.
2. Decide what should run on which server (you could run all parts on the same server, but when the number of stats increase the server can get laggy if someone access the page while there are players online).
3. Create the MySQL database using the script you downloaded.
4. Create a user for the newly created database.
5. Run the installer for the collector service. READ THE README (first page of the installation). If you don't, you won't get it to work.
6. Deploy the web interface to IIS.
7. Modify the settings in Web.Config as you like.
8. OPTIONAL: Create a new MSN account for the MSN-bot. Add it's information according to instructions in the collector service readme.

FILES
 * MySQL Create Database Script
 * SoldStat Collector Service
 * SoldStat Web Interface
 * Full source code

DISCLAIMER
The usual, I WON'T pay if your computer blows up. Use this AT YOUR OWN RISK!

QUESTIONS?
Just post them here, I'll try to answer as fast as I can.
« Last Edit: October 15, 2008, 02:50:47 am by Sebra »

Offline BombSki

  • Flagrunner
  • ****
  • Posts: 927
    • Climbing-soldiers.net
Re: SoldStat - A Windows-based statistics solution
« Reply #1 on: October 14, 2008, 07:12:29 pm »
looks nice, can we see it live somewhere?
it could be a serious competition with zitrostats ;)

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5017
Re: SoldStat - A Windows-based statistics solution
« Reply #2 on: October 14, 2008, 08:35:43 pm »
it could be a serious competition with zitrostats ;)
Not really since it's written in Microsoft C# when most of the Soldat Related web servers that show stats are almost always running linux / apache instead of windows / iis. It can possibly run under Mono, but not all servers have that installed.

Anyway, looks like you put in some good work. :) Nice job.

I've added it to the fan apps list.
Careful with that axe, Eugene.

Offline Sebra

  • Major(1)
  • Posts: 9
Re: SoldStat - A Windows-based statistics solution
« Reply #3 on: October 15, 2008, 02:49:28 am »
You can have a look at it here. It's really not much more than what's shown in the screenshots, though it could be easily extended with more views on the statistics if you know some C#/ASP.NET. Give me a tip and maybe I'll add it.

I know most people run Soldat Servers on Linux, but this app is for those who don't :)

Offline ElephantHunter

  • Retired Administrator
  • Camper
  • *****
  • Posts: 431
  • Third President
    • - home of the admins -
Re: SoldStat - A Windows-based statistics solution
« Reply #4 on: October 15, 2008, 03:09:32 am »
This is a handy looking stats program! I especially like the chart idea.

Too bad it's written for .NET, or more people could use it.
Everything you have done in life is measured by the DASH on your gravestone.
Stop wasting time.
Make your dash count.

Offline PKS|Shooter

  • Soldier
  • **
  • Posts: 130
  • Dont fuck with us!
    • PKS - La Familia
Re: SoldStat - A Windows-based statistics solution
« Reply #5 on: October 15, 2008, 04:34:41 am »
wow thats looks rly awesome but can u add some graphic? like the Weapon gfx's

the layout is a littebit boring, need more graphic :P

Offline Sebra

  • Major(1)
  • Posts: 9
Re: SoldStat - A Windows-based statistics solution
« Reply #6 on: October 15, 2008, 08:19:28 am »
wow thats looks rly awesome but can u add some graphic? like the Weapon gfx's

the layout is a littebit boring, need more graphic :P

Yes, I could definitely add some graphics. Where can I find them?

This is a handy looking stats program! I especially like the chart idea.

Too bad it's written for .NET, or more people could use it.

Well, I guess that's true. But on the other hand, if I wrote it in PHP it would have been more messy for Windows users already running a server with IIS. Also, I guess the stats collector service would have been a daemon (?) (Linux for service) and thus could not be run on Windows.

What could have worked is writing it in Java... but I don't like Java. I like .NET  ;D Well, it's not really aimed for the big masses, I just had it running and thought I would share it. Take it or leave it  :)

Which graphs are you missing?

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5017
Re: SoldStat - A Windows-based statistics solution
« Reply #7 on: October 16, 2008, 06:12:48 am »
Well, I guess that's true. But on the other hand, if I wrote it in PHP it would have been more messy for Windows users already running a server with IIS. Also, I guess the stats collector service would have been a daemon (?) (Linux for service) and thus could not be run on Windows.

What could have worked is writing it in Java... but I don't like Java. I like .NET¬  ;D Well, it's not really aimed for the big masses, I just had it running and thought I would share it. Take it or leave it¬  :)
Not exactly true. You'd be surprised how portable and flexible php is. A php app that's designed to read and parse logs on Linux (like Zitrostats) will work just about as good on windows (again, like Zitrostats). And why are you using MySQL anyway? I'd expect a Microsoft aficionado would use MSSQL instead.

And as for the auto updating thing, you can just have the parsing php script run whenever you want, either by a scheduled task thing on windows or a cronjob on linux. It doesn't need to go as far as being a Linux daemon or service.

I suggest you take a look at the source code of Zitrostats for some installation friendly inspiration and to see how flexible and portable php really is.
« Last Edit: October 16, 2008, 06:16:11 am by jrgp »
Careful with that axe, Eugene.

Offline Sebra

  • Major(1)
  • Posts: 9
Re: SoldStat - A Windows-based statistics solution
« Reply #8 on: October 16, 2008, 08:33:56 am »
Well, I don't want this to be a discussion on PHP vs. ASP.NET. I built this mostly to learn how to build a windows service, and since I'm running my soldat servers on Windows I did not consider writing it in anything else than .NET.

MySQL is still free, that's why I'm using it instead of MSSQL. Also, my database server is running Linux which makes it possible for me to seperate the database server and the web servers without paying for an extra Windows Server license.

I'm using this app myself and just thought I would share it IF anyone was interested, and maybe get some new ideas on different views on statistics and additional graphs. Take it or leave it :)

Offline medoix

  • Major(1)
  • Posts: 2
Re: SoldStat - A Windows-based statistics solution
« Reply #9 on: November 08, 2008, 09:47:33 pm »
i cannot download the SQL file. The link seems to be invalid... anyone able to put it up?

Offline Kagesha

  • Flagrunner
  • ****
  • Posts: 702
  • cunts
Re: SoldStat - A Windows-based statistics solution
« Reply #10 on: November 11, 2008, 03:53:15 am »
IP-Based Stats, what if I had a dynamic Ip adress, would it effect the stats at all?

Offline medoix

  • Major(1)
  • Posts: 2
Re: SoldStat - A Windows-based statistics solution
« Reply #11 on: November 14, 2008, 04:34:13 pm »
hello? anyone able to fix or re-post the SQL file?