+#if defined(CSQC)
+#elif defined(MENUQC)
+#elif defined(SVQC)
+ #include "../dpdefs/progsdefs.qh"
+ #include "../dpdefs/dpextensions.qh"
+ #include "constants.qh"
+ #include "util.qh"
+ #include "urllib.qh"
+ #include "weapons/weapons.qh"
+ #include "../server/weapons/accuracy.qh"
+ #include "../server/defs.qh"
+ #include "playerstats.qh"
+ #include "../server/scores.qh"
+#endif
+
#ifdef SVQC
void PlayerStats_Prematch(void)
{
void PlayerStats_GameReport_Accuracy(entity p)
{
- entity w;
- float i;
+ int i;
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
{
- w = get_weaponinfo(i);
+ entity w = get_weaponinfo(i);
#define ACCMAC(suffix,field) \
PS_GR_P_ADDVAL(p, sprintf("acc-%s-%s", w.netname, suffix), p.accuracy.(field[i-1]));
if(autocvar_g_playerstats_gamereport_uri != "")
{
- PlayerStats_GameReport_DelayMapVote = TRUE;
+ PlayerStats_GameReport_DelayMapVote = true;
url_multi_fopen(
autocvar_g_playerstats_gamereport_uri,
FILE_APPEND,
}
else
{
- PlayerStats_GameReport_DelayMapVote = FALSE;
+ PlayerStats_GameReport_DelayMapVote = false;
db_close(PS_GR_OUT_DB);
PS_GR_OUT_DB = -1;
}
{
if(autocvar_g_playerstats_gamereport_uri == "") { return; }
- PS_GR_OUT_DB = -1;
PS_GR_OUT_DB = db_create();
if(PS_GR_OUT_DB >= 0)
{
- PlayerStats_GameReport_DelayMapVote = TRUE;
+ PlayerStats_GameReport_DelayMapVote = true;
serverflags |= SERVERFLAG_PLAYERSTATS;
PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD);
PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM);
}
- else { PlayerStats_GameReport_DelayMapVote = FALSE; }
+ else { PlayerStats_GameReport_DelayMapVote = false; }
}
void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)
{
// url_fclose has finished
dprint("Player stats written\n");
- PlayerStats_GameReport_DelayMapVote = FALSE;
+ PlayerStats_GameReport_DelayMapVote = false;
if(PS_GR_OUT_DB >= 0)
{
db_close(PS_GR_OUT_DB);
default:
{
print("Player stats writing failed: ", ftos(status), "\n");
- PlayerStats_GameReport_DelayMapVote = FALSE;
+ PlayerStats_GameReport_DelayMapVote = false;
if(PS_GR_OUT_DB >= 0)
{
db_close(PS_GR_OUT_DB);
{
// create the database if it doesn't already exist
if(PS_B_IN_DB < 0)
- {
- PS_B_IN_DB = -1;
PS_B_IN_DB = db_create();
- }
// now request the information
uri = strcat(uri, "/player/", uri_escape(uri_escape(joiningplayer.crypto_idfp)), "/elo.txt");
{
// create the database if it doesn't already exist
if(PS_D_IN_DB < 0)
- {
- PS_D_IN_DB = -1;
PS_D_IN_DB = db_create();
- }
//uri = strcat(uri, "/player/", uri_escape(crypto_getmyidfp(0)));
dprint("Retrieving playerstats from URL: ", autocvar_g_playerstats_playerdetail_uri, "\n");
void PlayerInfo_Init()
{
- playerinfo_db = -1;
playerinfo_db = db_create();
}
#ifdef CSQC
/*
- * FIXME - crypto_* builtin functions missing in CSQC (csprogsdefs.qc:885)
+ * FIXME - crypto_* builtin functions missing in CSQC (csprogsdefs.qh:885)
void PlayerInfo_Details()
{
print("-- Getting detailed PlayerInfo for local player (CSQC)\n");