X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fplayerstats.qh;h=ab4bc166f0b29f05134bf953f16a4ae75deb0c69;hb=0040a3c181e225fa7e1c38b9de5314e23ac7063a;hp=ba81ab754efd05c0cff303bd3dc1a2983d64df45;hpb=fb947a89fe18ec56cae0bd0af01ae676c8b1f081;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/playerstats.qh b/qcsrc/common/playerstats.qh index ba81ab754..ab4bc166f 100644 --- a/qcsrc/common/playerstats.qh +++ b/qcsrc/common/playerstats.qh @@ -1,3 +1,29 @@ +#ifdef SVQC +//float PS_PM_IN_DB = -1; // playerstats_prematch_in_db // db for info COLLECTED at the beginning of a match +float 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 = -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_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 +//string PS_B_IN_PL; // playerstats_playerbasic_in_players_last +//string PS_B_IN_EVL; // playerstats_playerbasic_in_events_last +#endif + +#ifdef MENUQC +string PS_D_IN_EVL; // playerstats_playerdetail_in_events_last +#endif + #ifdef SVQC // time the player was alive and kicking @@ -44,49 +70,46 @@ void PlayerStats_GameReport_AddEvent(string event_id); #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_GameReport_Shutdown(); // send stats to the server - void PlayerStats_GameReport_Accuracy(entity p); // call this whenever a player leaves void PlayerStats_GameReport_FinalizePlayer(entity p); // call this at the end of the match -void PlayerStats_GameReport_EndMatch(float finished); +void PlayerStats_GameReport(float finished); void PlayerStats_GameReport_Handler(entity fh, entity pass, float status); .string playerstats_id; //string autocvar_g_playerstats_uri; -string autocvar_g_playerstats_gamereport_ladder; -string autocvar_g_playerstats_gamereport_uri; +string autocvar_g_playerstats_gamereport_ladder; +var string autocvar_g_playerstats_gamereport_uri = "http://stats.xonotic.org/stats/submit"; + +#define PS_B_STATUS_ERROR -2 +#define PS_B_STATUS_IDLE -1 +#define PS_B_STATUS_WAITING 0 +#define PS_B_STATUS_RECEIVED 1 +#define PS_B_STATUS_UPDATING 2 +.float playerstats_basicstatus; +var 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 - - - -/* -//// 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(); +float PS_D_NEXTUPDATETIME; +float PS_D_LASTGAMECOUNT; +#define PS_D_STATUS_ERROR -2 +#define PS_D_STATUS_IDLE -1 +#define PS_D_STATUS_WAITING 0 +#define PS_D_STATUS_RECEIVED 1 +var float PlayerStats_PlayerDetail_Status = PS_D_STATUS_IDLE; +var string autocvar_g_playerstats_playerdetail_uri = "http://stats.xonotic.org/player/me"; +var float autocvar_g_playerstats_playerdetail_autoupdatetime = 1800; // automatically update every 30 minutes anyway +void PlayerStats_PlayerDetail(void); +void PlayerStats_PlayerDetail_CheckUpdate(void); +void PlayerStats_PlayerDetail_Handler(entity fh, entity p, float status); #endif -*/