]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make it compile now
authorSamual Lenks <samual@xonotic.org>
Sat, 30 Nov 2013 23:40:16 +0000 (18:40 -0500)
committerSamual Lenks <samual@xonotic.org>
Sat, 30 Nov 2013 23:40:16 +0000 (18:40 -0500)
qcsrc/common/playerstats.qc
qcsrc/common/playerstats.qh
qcsrc/menu/command/menu_cmd.qc
qcsrc/menu/menu.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc
qcsrc/server/command/vote.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/scores.qc

index b7dac05cbe84a51734499254f150e31509726fd8..e90a92c9aae69116bd14ff72340841fb1e5def5e 100644 (file)
@@ -1,29 +1,29 @@
 #ifdef SVQC
-float PS_PM_IN_DB;   // playerstats_prematch_in_db      // db for info COLLECTED at the beginning of a match
+//float PS_PM_IN_DB;   // playerstats_prematch_in_db      // db for info COLLECTED at the beginning of a match
 float PS_GR_OUT_DB;  // playerstats_gamereport_out_db   // db of info SENT at the end of a match
-float PS_GR_IN_DB;   // playerstats_gamereport_in_db    // db for info COLLECTED at the end of a match
-float PS_B_IN_DB;    // playerstats_playerbasic_in_db   // db for info COLLECTED for basic player info (ELO)
+//float PS_GR_IN_DB;   // playerstats_gamereport_in_db    // db for info COLLECTED at the end of a match
+//float PS_B_IN_DB;    // playerstats_playerbasic_in_db   // db for info COLLECTED for basic player info (ELO)
 // http://stats.xonotic.org/player/GgXRw6piDtFIbMArMuiAi8JG4tiin8VLjZgsKB60Uds=/elo.txt
 #endif
 
 #ifdef MENUQC
-float PS_D_IN_DB; // playerstats_playerdetail_in_db  // db for info COLLECTED for detailed player profile display
+//float PS_D_IN_DB; // playerstats_playerdetail_in_db  // db for info COLLECTED for detailed player profile display
 // http://stats.xonotic.org/player/me
 #endif
 
 #ifdef SVQC
-string PS_PM_IN_EVL;   // playerstats_prematch_in_events_last
+//string PS_PM_IN_EVL;   // playerstats_prematch_in_events_last
 string PS_GR_OUT_TL;   // playerstats_gamereport_out_teams_last
 string PS_GR_OUT_PL;   // playerstats_gamereport_out_players_las
 string PS_GR_OUT_EVL;  // playerstats_gamereport_out_events_last
-string PS_GR_IN_PL;    // playerstats_gamereport_in_players_last
-string PS_GR_IN_EVL;   // playerstats_gamereport_in_events_last
-string PS_B_IN_PL;     // playerstats_playerbasic_in_players_las
-string PS_B_IN_EVL;    // playerstats_playerbasic_in_events_last
+//string PS_GR_IN_PL;    // playerstats_gamereport_in_players_last
+//string PS_GR_IN_EVL;   // playerstats_gamereport_in_events_last
+//string PS_B_IN_PL;     // playerstats_playerbasic_in_players_las
+//string PS_B_IN_EVL;    // playerstats_playerbasic_in_events_last
 #endif
 
 #ifdef MENUQC
-string PS_D_IN_EVL; // playerstats_playerdetail_in_events_last
+//string PS_D_IN_EVL; // playerstats_playerdetail_in_events_last
 #endif
 
 #ifdef SVQC
@@ -109,8 +109,7 @@ void PlayerStats_GameReport_AddEvent(string event_id)
                PS_GR_OUT_EVL = strzone(event_id);
        }
 }
-#define PS_GR_P_ADDVAL(ent,eventid,val) PlayerStats_GameReport_Event(ent.playerstats_id, eventid, val)
-#define PS_GR_T_ADDVAL(team,eventid,val) PlayerStats_GameReport_Event(sprintf("team#%d", team), eventid, val)
+
 // referred to by PS_GR_P_ADDVAL and PS_GR_T_ADDVAL
 float PlayerStats_GameReport_Event(string prefix, string event_id, float value)
 {
@@ -163,7 +162,7 @@ void PlayerStats_GameReport_AddGlobalInfo(entity p)
        if(stof(db_get(PS_GR_OUT_DB, sprintf("%s:%s", p.playerstats_id, PLAYERSTATS_ALIVETIME))) > 0)
                PS_GR_P_ADDVAL(p, PLAYERSTATS_JOINS, 1);
 
-       PlayerStats_Accuracy(p);
+       PlayerStats_GameReport_Accuracy(p);
 
        if(IS_REAL_CLIENT(p))
        {
index 32a3a5580d8035a178eafdab0870df131bd39081..e0570be342da1f40fff09a1234ca9a3550ed86ab 100644 (file)
@@ -28,33 +28,36 @@ const string PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM = "achievement-firstvictim";
 float playerstats_waitforme;
 
 // call at initialization
-void PlayerStats_Init();
+void PlayerStats_GameReport_Init();
 
 // add a new player
-void PlayerStats_AddPlayer(entity e);
+void PlayerStats_GameReport_AddPlayer(entity e);
 
 // add a new team
-void PlayerStats_AddTeam(float t);
+void PlayerStats_GameReport_AddTeam(float t);
 
 // add a new event
-void PlayerStats_AddEvent(string event_id);
+void PlayerStats_GameReport_AddEvent(string event_id);
 
 // call on each event to track, or at player disconnect OR match end for "global stuff"
-float PlayerStats_Event(entity e, string event_id, float value);
-
-// add a team score
-float PlayerStats_TeamScore(float t, string event_id, float value);
+#define PS_GR_P_ADDVAL(ent,eventid,val) PlayerStats_GameReport_Event(ent.playerstats_id, eventid, val)
+#define PS_GR_T_ADDVAL(team,eventid,val) PlayerStats_GameReport_Event(sprintf("team#%d", team), eventid, val)
+float PlayerStats_GameReport_Event(string prefix, string event_id, float value);
 
 // call at game over
-void PlayerStats_Shutdown(); // send stats to the server
+void PlayerStats_GameReport_Shutdown(); // send stats to the server
 
-void PlayerStats_Accuracy(entity p);
+void PlayerStats_GameReport_Accuracy(entity p);
 
 // call this whenever a player leaves
-void PlayerStats_AddGlobalInfo(entity p);
+void PlayerStats_GameReport_AddGlobalInfo(entity p);
 
 // call this at the end of the match
-void PlayerStats_EndMatch(float finished);
+void PlayerStats_GameReport_EndMatch(float finished);
+
+void PlayerStats_GameReport_Handler(entity fh, entity pass, float status);
+
+.string playerstats_id;
 
 string autocvar_g_playerstats_uri;
 
@@ -62,7 +65,7 @@ string autocvar_g_playerstats_uri;
 
 
 
-
+/*
 //// WIP -zykure /////////////////////////////////////////////////////
 
 
@@ -84,3 +87,4 @@ void PlayerInfo_Details();
 
 //void PlayerInfo_Details();
 #endif
+*/
index e89761cc34338b4ca6225cce9750fbb61926fd62..10a01395568b6ea2e137ff88793392b0a45f3863 100644 (file)
@@ -118,8 +118,8 @@ void GameCommand(string theCommand)
 
        if(argv(0) == "debugstats")
        {
-               PlayerInfo_Init();
-               PlayerInfo_Details();
+               //PlayerInfo_Init();
+               //PlayerInfo_Details();
                return;
        }
 
index 3e42dbaafbe792b54ac39fadb70ad2db3ca00a8b..7830460b1e6a1e214822836f74d3614ebf69447b 100644 (file)
@@ -94,7 +94,7 @@ void m_init()
                cvar_set("_menu_initialized", "1");
        }
 
-        PlayerInfo_Details();
+       //PlayerInfo_Details();
 }
 
 const float MENU_ASPECT = 1.25; // 1280x1024
index 1218e8737f6816354ab9dead9b94d3d4109c6af6..ae8e1b41f2e2475d955c5f08c97abeafe7293b6c 100644 (file)
@@ -171,7 +171,7 @@ void PutObserverInServer (void)
        if(self.alivetime)
        {
                if(!warmup_stage)
-                       PlayerStats_Event(self, PLAYERSTATS_ALIVETIME, time - self.alivetime);
+                       PS_GR_P_ADDVAL(self, PLAYERSTATS_ALIVETIME, time - self.alivetime);
                self.alivetime = 0;
        }
 
@@ -1039,7 +1039,7 @@ void ClientConnect (void)
                player_count = 0;
        }
 
-        PlayerInfo_Basic(self);
+       //PlayerInfo_Basic(self);
        PlayerScore_Attach(self);
        ClientData_Attach();
        accuracy_init(self);
@@ -1120,10 +1120,10 @@ void ClientConnect (void)
 
        self.playerid = (playerid_last = playerid_last + 1);
 
-       PlayerStats_AddEvent(sprintf("kills-%d", self.playerid));
+       PlayerStats_GameReport_AddEvent(sprintf("kills-%d", self.playerid));
 
     if(IS_BOT_CLIENT(self))
-        PlayerStats_AddPlayer(self);
+        PlayerStats_GameReport_AddPlayer(self);
 
        if(autocvar_sv_eventlog)
                GameLogEcho(strcat(":join:", ftos(self.playerid), ":", ftos(num_for_edict(self)), ":", ((IS_REAL_CLIENT(self)) ? self.netaddress : "bot"), ":", self.netname));
@@ -1256,7 +1256,7 @@ void ClientDisconnect (void)
                return;
        }
 
-       PlayerStats_AddGlobalInfo(self);
+       PlayerStats_GameReport_AddGlobalInfo(self);
 
        CheatShutdownClient();
 
index eb3e81fbb280a7d226e65f2554b22df8c5eab99d..4d80407f4f0234e5105f8d3528c325b4d7761a8a 100644 (file)
@@ -521,7 +521,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
 
                if(self.alivetime)
                {
-                       PlayerStats_Event(self, PLAYERSTATS_ALIVETIME, time - self.alivetime);
+                       PS_GR_P_ADDVAL(self, PLAYERSTATS_ALIVETIME, time - self.alivetime);
                        self.alivetime = 0;
                }
 
index c3e8ca9fb3bdaf9457ab2a797118055d2147d178..4c563168bb656b2f116ef2ee81445ea9c8b2f212 100644 (file)
@@ -423,7 +423,7 @@ void ReadyRestart_force()
        {
                tmp_player.alivetime = 0;
                tmp_player.killcount = 0;
-               PlayerStats_Event(tmp_player, PLAYERSTATS_ALIVETIME, -PlayerStats_Event(tmp_player, PLAYERSTATS_ALIVETIME, 0));
+               PS_GR_P_ADDVAL(tmp_player, PLAYERSTATS_ALIVETIME, -PS_GR_P_ADDVAL(tmp_player, PLAYERSTATS_ALIVETIME, 0));
        }
 
        restart_mapalreadyrestarted = 0; // reset this var, needed when cvar sv_ready_restart_repeatable is in use
index 195829b40d00c701f9e95d494b19178caeb1a815..700bd42688ca6e334528eb33c62d5ad492a30948 100644 (file)
@@ -99,7 +99,7 @@ void GiveFrags (entity attacker, entity targ, float f, float deathtype)
                // regular frag
                PlayerScore_Add(attacker, SP_KILLS, 1);
                if(targ.playerid)
-                       PlayerStats_Event(attacker, sprintf("kills-%d", targ.playerid), 1);
+                       PS_GR_P_ADDVAL(attacker, sprintf("kills-%d", targ.playerid), 1);
        }
 
        PlayerScore_Add(targ, SP_DEATHS, 1);
@@ -419,7 +419,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, float deathtype)
                                case counta: \
                                { \
                                        Send_Notification(NOTIF_ONE, attacker, MSG_ANNCE, ANNCE_KILLSTREAK_##countb); \
-                                       PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_##counta, 1); \
+                                       PS_GR_P_ADDVAL(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_##counta, 1); \
                                        break; \
                                }
                        switch(attacker.killcount)
@@ -433,8 +433,8 @@ void Obituary(entity attacker, entity inflictor, entity targ, float deathtype)
                        {
                                checkrules_firstblood = TRUE;
                                notif_firstblood = TRUE; // modify the current messages so that they too show firstblood information
-                               PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD, 1);
-                               PlayerStats_Event(targ, PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM, 1);
+                               PS_GR_P_ADDVAL(attacker, PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD, 1);
+                               PS_GR_P_ADDVAL(targ, PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM, 1);
 
                                // tell spree_inf and spree_cen that this is a first-blood and first-victim event
                                kill_count_to_attacker = -1;
@@ -541,7 +541,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, float deathtype)
                if(PlayerScore_Add(targ, SP_SCORE, 0) == -5)
                {
                        Send_Notification(NOTIF_ONE, targ, MSG_ANNCE, ANNCE_ACHIEVEMENT_BOTLIKE);
-                       PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_BOTLIKE, 1);
+                       PS_GR_P_ADDVAL(attacker, PLAYERSTATS_ACHIEVEMENT_BOTLIKE, 1);
                }
        }
 
index 74b0f2d246a312679044a22f8c470d72c9357918..53b6c930817846f71834832a6ef1dccaa29bb662 100644 (file)
@@ -237,7 +237,6 @@ void cvar_changes_init()
                BADPREFIX("g_playerstats_");
                BADPREFIX("g_respawn_ghosts");
                BADPREFIX("g_voice_flood_");
-                BADCVAR("g_playerstats_ladder");
                BADPREFIX("rcon_");
                BADPREFIX("sv_allowdownloads");
                BADPREFIX("sv_autodemo");
@@ -645,7 +644,7 @@ void spawnfunc_worldspawn (void)
 
        Map_MarkAsRecent(mapname);
 
-       PlayerStats_Init(); // we need this to be initiated before InitGameplayMode
+       PlayerStats_GameReport_Init(); // we need this to be initiated before InitGameplayMode
 
        precache_model ("null"); // we need this one before InitGameplayMode
        InitGameplayMode();
@@ -1506,12 +1505,12 @@ void NextLevel()
 
        DumpStats(TRUE);
 
-       // send statistics
+       // send statistics // fixme
        entity e;
-       PlayerStats_EndMatch(1);
+       PlayerStats_GameReport_EndMatch(1);
        FOR_EACH_CLIENT(e)
-               PlayerStats_AddGlobalInfo(e);
-       PlayerStats_Shutdown();
+               PlayerStats_GameReport_AddGlobalInfo(e);
+       PlayerStats_GameReport_Shutdown();
        WeaponStats_Shutdown();
 
        Kill_Notification(NOTIF_ALL, world, MSG_CENTER, 0); // kill all centerprints now
@@ -2835,10 +2834,11 @@ void Shutdown()
                print("Saving persistent data...\n");
                Ban_SaveBans();
 
-               PlayerStats_EndMatch(0);
+               // fixme
+               PlayerStats_GameReport_EndMatch(0);
                FOR_EACH_CLIENT(e)
-                       PlayerStats_AddGlobalInfo(e);
-               PlayerStats_Shutdown();
+                       PlayerStats_GameReport_AddGlobalInfo(e);
+               PlayerStats_GameReport_Shutdown();
 
                if(!cheatcount_total)
                {
index e7e771dc6ed03a26ff89f050aa1499ff2fc835ad..1178693864108d500a038b87d8b9d57753b6df33 100644 (file)
@@ -524,7 +524,7 @@ void GetCvars(float f)
                if (s == "cl_weaponpriority")
                        self.switchweapon = w_getbestweapon(self);
                if (s == "cl_allow_uidtracking")
-                       PlayerStats_AddPlayer(self);
+                       PlayerStats_GameReport_AddPlayer(self);
        }
 }
 
index 3a8b830d74c04e82063566368b0c949bc7f52878..f9d096e777fc6aa8e18a6d2d3afd150972d04669 100644 (file)
@@ -88,7 +88,7 @@ void TeamScore_Spawn(float t, string name)
        Net_LinkEntity(ts, FALSE, 0, TeamScore_SendEntity);
        teamscorekeepers[t - 1] = ts;
        ++teamscores_entities_count;
-       PlayerStats_AddTeam(t);
+       PlayerStats_GameReport_AddTeam(t);
 }
 
 float TeamScore_AddToTeam(float t, float scorefield, float score)
@@ -157,8 +157,8 @@ void ScoreInfo_SetLabel_PlayerScore(float i, string label, float scoreflags)
        }
        if(label != "")
        {
-               PlayerStats_AddEvent(strcat(PLAYERSTATS_TOTAL, label));
-               PlayerStats_AddEvent(strcat(PLAYERSTATS_SCOREBOARD, label));
+               PlayerStats_GameReport_AddEvent(strcat(PLAYERSTATS_TOTAL, label));
+               PlayerStats_GameReport_AddEvent(strcat(PLAYERSTATS_SCOREBOARD, label));
        }
 }
 
@@ -173,8 +173,8 @@ void ScoreInfo_SetLabel_TeamScore(float i, string label, float scoreflags)
        }
        if(label != "")
        {
-               PlayerStats_AddEvent(strcat(PLAYERSTATS_TOTAL, label));
-               PlayerStats_AddEvent(strcat(PLAYERSTATS_SCOREBOARD, label));
+               PlayerStats_GameReport_AddEvent(strcat(PLAYERSTATS_TOTAL, label));
+               PlayerStats_GameReport_AddEvent(strcat(PLAYERSTATS_SCOREBOARD, label));
        }
 }
 
@@ -350,7 +350,7 @@ float PlayerScore_Add(entity player, float scorefield, float score)
                if(scores_label[scorefield] != "")
                        s.SendFlags |= pow(2, scorefield);
        if(!warmup_stage)
-               PlayerStats_Event(s.owner, strcat(PLAYERSTATS_TOTAL, scores_label[scorefield]), score);
+               PS_GR_P_ADDVAL(s.owner, strcat(PLAYERSTATS_TOTAL, scores_label[scorefield]), score);
        return (s.(scores[scorefield]) += score);
 }
 
@@ -917,7 +917,7 @@ void PlayerScore_PlayerStats(entity p)
        for(i = 0; i < MAX_SCORE; ++i)
                if(s.(scores[i]) != 0)
                        if(scores_label[i] != "")
-                               PlayerStats_Event(s.owner, strcat(PLAYERSTATS_SCOREBOARD, scores_label[i]), s.(scores[i]));
+                               PS_GR_P_ADDVAL(s.owner, strcat(PLAYERSTATS_SCOREBOARD, scores_label[i]), s.(scores[i]));
 }
 
 void PlayerScore_TeamStats(void)
@@ -933,6 +933,6 @@ void PlayerScore_TeamStats(void)
                        if(sk.(teamscores[i]) != 0)
                                if(teamscores_label[i] != "")
                                        // the +1 is important here!
-                                       PlayerStats_TeamScore(t+1, strcat(PLAYERSTATS_SCOREBOARD, teamscores_label[i]), sk.(teamscores[i]));
+                                       PS_GR_T_ADDVAL(t+1, strcat(PLAYERSTATS_SCOREBOARD, teamscores_label[i]), sk.(teamscores[i]));
        }
 }