X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fplayerstats.qh;h=39ffab623ef94d5f3790d2e7e9693efa75528ecc;hb=a8156930ac4a14c3fe33abfb41e47191691a6a4f;hp=e06882b3151a2b47be6c470f30afe6e3f7e2b571;hpb=557a1c57d6cf33a53f5b596c7fd94c0ad4354a97;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/playerstats.qh b/qcsrc/common/playerstats.qh index e06882b31..39ffab623 100644 --- a/qcsrc/common/playerstats.qh +++ b/qcsrc/common/playerstats.qh @@ -1,22 +1,20 @@ +#pragma once + #ifdef SVQC -//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) -// http://stats.xonotic.org/player/GgXRw6piDtFIbMArMuiAi8JG4tiin8VLjZgsKB60Uds=/elo.txt -- this works, -// http://stats.xonotic.org/player/ENkUjf83vKMVZcNm%2F6Ao1EmXEj1apQ6XvdQTxwELvmA%3D/elo.txt -- but this doesn't?!? -// ENkUjf83vKMVZcNm/6Ao1EmXEj1apQ6XvdQTxwELvmA= +//float PS_PM_IN_DB = -1; // playerstats_prematch_in_db // db for info COLLECTED at the beginning of a match +int PS_GR_OUT_DB = -1; // playerstats_gamereport_out_db // db of info SENT at the end of a match +//float PS_GR_IN_DB = -1; // playerstats_gamereport_in_db // db for info COLLECTED at the end of a match +float PS_B_IN_DB = -1; // playerstats_playerbasic_in_db // db for info COLLECTED for basic player info (ELO) #endif #ifdef MENUQC -float PS_D_IN_DB; // playerstats_playerdetail_in_db // db for info COLLECTED for detailed player profile display -// http://stats.xonotic.org/player/me +int PS_D_IN_DB = -1; // playerstats_playerdetail_in_db // db for info COLLECTED for detailed player profile display #endif #ifdef SVQC //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_PL; // playerstats_gamereport_out_players_last 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 @@ -42,6 +40,7 @@ const string PLAYERSTATS_SCOREBOARD_POS = "scoreboardpos"; const string PLAYERSTATS_TOTAL = "total-"; const string PLAYERSTATS_SCOREBOARD = "scoreboard-"; +const string PLAYERSTATS_ANTICHEAT = "anticheat-"; const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3 = "achievement-kill-spree-3"; const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5 = "achievement-kill-spree-5"; @@ -55,7 +54,9 @@ const string PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD = "achievement-firstblood"; const string PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM = "achievement-firstvictim"; // delay map switch until this is set -float PlayerStats_GameReport_DelayMapVote; +bool PlayerStats_GameReport_DelayMapVote; + +void PlayerStats_GameReport_Reset_All(); // call at initialization void PlayerStats_GameReport_Init(); @@ -70,8 +71,8 @@ void PlayerStats_GameReport_AddTeam(float t); void PlayerStats_GameReport_AddEvent(string event_id); // call on each event to track, or at player disconnect OR match end for "global stuff" -#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) +#define PlayerStats_GameReport_Event_Player(ent, eventid, val) PlayerStats_GameReport_Event(ent.playerstats_id, eventid, val) +#define PlayerStats_GameReport_Event_Team(team, eventid, val) PlayerStats_GameReport_Event(sprintf("team#%d", team), eventid, val) float PlayerStats_GameReport_Event(string prefix, string event_id, float value); void PlayerStats_GameReport_Accuracy(entity p); @@ -89,44 +90,31 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status); //string autocvar_g_playerstats_uri; string autocvar_g_playerstats_gamereport_ladder; -var string autocvar_g_playerstats_gamereport_uri = "http://stats.xonotic.org/stats/submit"; -var string autocvar_g_playerstats_playerbasic_uri = "http://stats.xonotic.org"; - -void PlayerStats_PlayerBasic(); +string autocvar_g_playerstats_gamereport_uri = "https://stats.xonotic.org/stats/submit"; + +const float PS_B_STATUS_ERROR = -2; +const float PS_B_STATUS_IDLE = -1; +const float PS_B_STATUS_WAITING = 0; +const float PS_B_STATUS_RECEIVED = 1; +const float PS_B_STATUS_UPDATING = 2; +.float playerstats_basicstatus; +string autocvar_g_playerstats_playerbasic_uri = "http://stats.xonotic.org"; + +void PlayerStats_PlayerBasic(entity joiningplayer, float newrequest); +void PlayerStats_PlayerBasic_CheckUpdate(entity joiningplayer); void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status); #endif //SVQC #ifdef MENUQC -#define PS_D_STATUS_ERROR -1 -#define PS_D_STATUS_IDLE 0 -#define PS_D_STATUS_WAITING 1 -#define PS_D_STATUS_RECEIVED 2 -var float PlayerStats_PlayerDetail_Status = PS_D_STATUS_IDLE; -var string autocvar_g_playerstats_playerdetail_uri = "http://stats.xonotic.org/player/me"; +float PS_D_NEXTUPDATETIME; +float PS_D_LASTGAMECOUNT; +const float PS_D_STATUS_ERROR = -2; +const float PS_D_STATUS_IDLE = -1; +const float PS_D_STATUS_WAITING = 0; +const float PS_D_STATUS_RECEIVED = 1; +float PlayerStats_PlayerDetail_Status = PS_D_STATUS_IDLE; +string autocvar_g_playerstats_playerdetail_uri = "http://stats.xonotic.org/player/me"; +float autocvar_g_playerstats_playerdetail_autoupdatetime = 1800; // automatically update every 30 minutes anyway void PlayerStats_PlayerDetail(); +void PlayerStats_PlayerDetail_CheckUpdate(); void PlayerStats_PlayerDetail_Handler(entity fh, entity p, float status); #endif - - -/* -//// WIP -zykure ///////////////////////////////////////////////////// - - -//const string playerinfo_uri = "http://localhost:6543"; // FIXME - -string PlayerInfo_GetItem(entity e, string item_id); -string PlayerInfo_GetItemLocal(string item_id); - -void PlayerInfo_Init(); -#ifdef SVQC -string autocvar_g_playerinfo_uri; -void PlayerInfo_Basic(entity p); -#endif -#ifdef MENUQC -string autocvar_g_playerinfo_uri; -void PlayerInfo_Details(); -#endif -#ifdef CSQC - -//void PlayerInfo_Details(); -#endif -*/