Jump to content

[A16-SERVER] Simply MySQL statistics mod


Recommended Posts


This is a simple modification that allows you to write server statistics to the MySQL (or MariaDB) database. Mod has been tested for several months on one of the servers in Poland.


Below is a brief description:


The Mod connects to the MySql database (or MariaDB) and sends statistics from the game in given periods of time.





1. Unpack the archive and copy all directories to the main server folder.

2. Go to the directory ~/Mods/7d2sql/ and edit the file "7d2sql-config.xml".

3. Run Server.




# 7d2sql-config.xml


host - name or MySQL Server IP (for example: "localhost", "" or "7dtdmyserver.com")

port - the port on which the SQL server is running. 3306 by default

login - database login

password - SQL password

schema - database name (NOTE: it must be created earlier, mod can not create it himself!)

table - table in which statistics are saved

delay - game *tick's delay. The higher, the longer the intervals between the saves. Values ​​less than 200 can cause lags.



# Entry in the database:


ID, gametime, time, playerid, nick, pos1, pos2, pos3, resp1, resp2, resp3, remote, health, deaths, zombies, players, score, level, steamid, ip, ping, date






>>Download <<


>>or here <<


Ps. Mod is part of a larger anti-hack system ;) and is used to display statistics on the website.



Link to comment
Share on other sites

Hey Belugo, a quick note: I had a peek at the code and it didn't appear to sanitise the players name, so it may be possible to do SQL injection with a special name.


Otherwise nice work :)


Hey Stompy!

there is a line of code, that deletes some of the characters from the player's name.

Probably quotes and similar chars, but I do not remember exactly.


Link to comment
Share on other sites

  • 11 months later...


This topic is now archived and is closed to further replies.

  • Create New...