33 lines
1.3 KiB
Plaintext
33 lines
1.3 KiB
Plaintext
// For management purposes, player information is collected and stored into the MySQL database.
|
|
// If there is a problem with cheating/exploiting or any other reason we have records to refer to for disciplinary action
|
|
|
|
#include "aps_include"
|
|
#include "inc_system_const"
|
|
#include "inc_mysql_tables"
|
|
|
|
void main()
|
|
{
|
|
object oPC = GetEnteringObject();
|
|
|
|
string sPlayerName = SQLEncodeSpecialChars(GetPCPlayerName(oPC));
|
|
string sIP = SQLEncodeSpecialChars(GetPCIPAddress(oPC));
|
|
string sKey = SQLEncodeSpecialChars(GetPCPublicCDKey(oPC));
|
|
string sCharName = SQLEncodeSpecialChars(GetName(oPC));
|
|
|
|
string sSQL = "INSERT IGNORE INTO " + PLAYER_INFO_TABLE + " (Account, IP_Address, CDKey, CharName) VALUES ('" + sPlayerName + "', '" + sIP + "', '" + sKey + "', ' " + sCharName + "');";
|
|
|
|
SQLExecDirect(sSQL);
|
|
|
|
// Players (non-DMs) also get their character names stored, for use with the housing system in particular
|
|
if(GetIsPC(oPC) && !GetIsDM(oPC))
|
|
{
|
|
object oDatabase = GetItemPossessedBy(oPC, PC_DATABASE);
|
|
int iPCID = GetLocalInt(oDatabase, PC_ID_NUMBER);
|
|
string sPCID = IntToString(iPCID);
|
|
|
|
sSQL = "INSERT IGNORE INTO " + CHARACTER_INFO_TABLE + " (ID, Name) VALUES (" + sPCID + ", '" + sCharName + "');";
|
|
|
|
SQLExecDirect(sSQL);
|
|
}
|
|
}
|