Daenks/Meridian59_103 — pull request #162 by Daenks (2014-01-01 19:28:23+00:00)
Title: Mysql - The Beginning

This Pull Request adds basic MySQL connectivity to blakserv.
There is a new kod function RecordStat() that passes information to C_RecordStat() in blakserv.
C_RecordStat() parses the information sent to it by RecordStat(), checks for the kind of statistic, makes sure the data received correlates to the kind of statistic, and passes the information to the appropriate MySQLRecordStat...() function in database.c, where the data is actually written. The STAT_* constants must be defined in blakserv.h and in blakston.khd.

There are currently three statistics:
STAT_TOTALMONEY = 1
STAT_MONEYCREATED = 2
STAT_ASSESS_DAM = 3

TotalMoney is a count of all player held money plus player bank accounts, written to the DB with a timestamp each system save.

MoneyCreated is a count of all new money that has entered the game through drops, selling to npcs, signet ring quests, etc., written to the DB each system save

AssessDamage is a record of all damage done to all players, written to the DB live as it happens with additional info about the attacker, the target, the damage done, and the weapon or spell of choice. ( Example: http://i.imgur.com/hJZGoAL.png )

Also included is a table that records user logins, account, character, ip address that can be used to quickly and easily check what accounts belong to whom.

The database structure can be created using structure.sql in the .\sql\ folder. In the future this will be handled by MySQLCheckSchema() and MySQLCreateSchema() in database.c

A lot of you are new to MySQL, so here's an easy to follow beginners guide for your reference: http://www.elated.com/articles/mysql-for-absolute-beginners/

There is still much work to be done, but I want to get what I have so far into the master branch ASAP so that we can start recording useful game and balance statistics to assist in making reasonable changes backed up by objective data instead of subjective opinions.

Please merge this branch and give it a shot!

-Daenks