• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Beta Release [Mod] Server Extension Webpage

I made a little java program to extract the playerstats and save them to a database and also a webpage to view the stats.

What you need to run this:
  • Server Extension Mod from marco running on your server
  • computer where you can execute the java program
  • mysql-database (5.5 or higher)
  • a webspace or something like this with php
MySQL:
Create a new database with any name you would like (you will have to enter this name into the config files later).
Import the kf2stats.sql which you can find in the uploaded ServerExtWebMod.rar.

PHP:
Open the Webpage/secret.php and enter:
  • hostname at $mysql_host
  • port which will be used to connect to the MySQL server at $mysql_port (3306 is the standard port)
  • username to access the MySQL server at $mysql_user
  • password to access the MySQL server at $mysql_pass
  • database name which you created at the beginning at $mysql_db
kf2stats_php.PNG

To show the webpage use .../kf2stats.php?page=0&count=25

Java Program:
Open the USAConverter.ini and enter:
  • directory where your .usa file are at Directory (always use \\ for the folders instead of a single \)
  • hostname where your MySQL server runs at Hostname
  • port which will be used to connect to the MySQL server at Port (3306 is the standard port)
  • username to access the MySQL server at Username
  • password to access the MySQL server at Password
  • database name which you created at the beginning at Database
  • how frequently it should update the database at UpdateTimer in seconds (default here is every hour).
kf2stats_java.PNG

DON'T CHANGE LastUpdate. It saves the time when the database was updated so it only updates active users next time.

The initial run when i tested it took around 8 minutes for over 3000 users with 9000 stats and 4000 traits. (run locally where the database is hosted)
Drastical performance update: initial run took only 22 seconds for 2000 users with 10000 stats and 6000 traits. (run locally where the database is hosted)

Spoiler!

Spoiler!


V3:
Spoiler!

V2:
Spoiler!

V1: Released.

IF YOU ALREADY SETUP AN OLDER VERSION DON'T OVERWRITE THE "secret.php" AND THE "USAConverter.ini" OR YOU HAVE TO ENTER YOUR USER, PASSWORD,... AGAIN.

Download: here

Github Repo: https://github.com/j1gs4w/USAConverter

Known Issues: Players information like Playername are never updated once they are in the database.

Credits:
OldSchool - for sharing the stat files from his server.
Sheep - for sharing the stat files from his server.
Marco - for the Server Extension Mod.
 
Last edited:
this mod is so exciting to me but i cant figure out the stupid java part. I installed the latest: Java SE Runtime Environment 8 from here: http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

then i received a registry error here:

Code:
C:\Users\anicow\Downloads\ServerExtWebMod>java -jar C:\Users\anicow\Downloads\Se
rverExtWebMod\USAConverter.jar
Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'

has value '1.8', but '1.7' is required.
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.

ok, version mismatch, so then i changed the CurrentVersion to 1.7 and received this error instead:

Code:
C:\Users\anicow\Downloads\ServerExtWebMod>java -jar C:\Users\anicow\Downloads\Se
rverExtWebMod\USAConverter.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: j1gs4w/ddns/n
et/USAConverter : Unsupported major.minor version 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

so now i dont know what to do, please to be helping me fix?
 
Upvote 0
Code:
Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'

has value '1.8', but '1.7' is required.
ok, version mismatch, so then i changed the CurrentVersion to 1.7 and received this error instead:

Code:
Exception in thread "main" java.lang.UnsupportedClassVersionError: j1gs4w/ddns/n
et/USAConverter : Unsupported major.minor version 52.0)
so now i dont know what to do, please to be helping me fix?

Strange because the second error says it was compiled with java 8 and you try to run it on a lower version. For me it worked fine when i ran it on my server with the newest java version.
But i recompiled it with java 6 as minimum version, so maybe it helps you. It should run now on java version 6 or higher.
Just download the rar again and try it.
 
Upvote 0
have all done
and website and USAConverter,ja ist running
but i dont see any stats
How does it works
ich have running 3 kf2 servers
from where fetch this jar the stats ?

have have now seting up update to 10 mins
Hope i see then anything ....

are you running the server extension mod from marco on your server?
are you running the jar on the same machine as the servers are running?
have you put the path were the .usa files are into the ini for the USAConverter?
 
Upvote 0
i am from Russia so that sorry my English...

big request to rewrite the events for the old version of PHP and MySQL
utf8mb4 dont work, redid to utf8 and table 'kf2stats' always empty


Server version: 5.0.45-community-nt
phpMyAdmin - 2.11.2.1
MySQL client version: 5.0.45

Update all to me it makes no sense. Since there is only one site which is already running

Please !!!!!!
 
Last edited:
Upvote 0
i am from Russia so that sorry my English...

big request to rewrite the events for the old version of PHP and MySQL

Server version: 5.0.45-community-nt
phpMyAdmin - 2.11.2.1
MySQL client version: 5.0.45

Update all to me it makes no sense. Since there is only one site which is already running

Please !!!!!!
The problem with lower mysql versions is that they don't support some signs that players use in their names, like emojis or chinese letters.
 
Upvote 0
I just want to say thanks for the update with new classes! appreciate your time and effort.

I updated my files on my test site. The only problem I ran into was with the images within the image folder. When using my ftp program it copied the added images with Uppercase file extensions which caused the web page to not recognize the file name. Not sure if that's a problem on my end or the new update download?


I just renamed the files with .png(lowercase) in filezilla and it fixed the problem. Otherwise awesome job and thanks for your quick work!
 
Upvote 0
When using my ftp program it copied the added images with Uppercase file extensions which caused the web page to not recognize the file name. Not sure if that's a problem on my end or the new update download.

Ty for the feedback, i renamed the files and uploaded it again.

matttthias please. you my last hope
ep.gif

Maybe if i find some time, i'm studing two different studies so don't expect me to get it done too soon.
 
Upvote 0
Hi Mathias,

The web has well few days, then ...

Open connection...
Fetching stats...
U_0x011000010002A120.usaU_0x0110000100B393E4.usa
U_0x0110000100B3F8AE.usa
U_0x0110000100BA36E6.usa
U_0x0110000100BB5598.usa
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 117440606
at j1gs4w.ddns.net.USAConverter.readInt(USAConverter.java:473)
at j1gs4w.ddns.net.USAConverter.readIntString(USAConverter.java:464)
at j1gs4w.ddns.net.USAConverter.readStrings(USAConverter.java:432)
at j1gs4w.ddns.net.USAConverter.main(USAConverter.java:109)

Or is the problem in your opinion ?


Edit: Ok I understand, I put the latest version of Marco ServerExt

Notice: Undefined index: PoisonDmg in /home/chezdarl/public_html/kf2playerstats.php on line 59
Notice: Undefined index: PoisonDmg in /home/chezdarl/public_html/kf2playerstats.php on line 63
 
Last edited:
Upvote 0