]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/playerstats.qh
Add back a simple playerdetail handler
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / playerstats.qh
1 #ifdef SVQC
2
3 // time the player was alive and kicking
4 const string PLAYERSTATS_ALIVETIME  = "alivetime";
5 const string PLAYERSTATS_AVGLATENCY = "avglatency";
6 const string PLAYERSTATS_WINS = "wins";
7 const string PLAYERSTATS_MATCHES = "matches";
8 const string PLAYERSTATS_JOINS = "joins";
9 const string PLAYERSTATS_SCOREBOARD_VALID = "scoreboardvalid";
10 const string PLAYERSTATS_RANK = "rank";
11 const string PLAYERSTATS_SCOREBOARD_POS = "scoreboardpos";
12
13 const string PLAYERSTATS_TOTAL = "total-";
14 const string PLAYERSTATS_SCOREBOARD = "scoreboard-";
15
16 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3 = "achievement-kill-spree-3";
17 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5 = "achievement-kill-spree-5";
18 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_10 = "achievement-kill-spree-10";
19 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_15 = "achievement-kill-spree-15";
20 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_20 = "achievement-kill-spree-20";
21 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_25 = "achievement-kill-spree-25";
22 const string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_30 = "achievement-kill-spree-30";
23 const string PLAYERSTATS_ACHIEVEMENT_BOTLIKE = "achievement-botlike";
24 const string PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD = "achievement-firstblood";
25 const string PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM = "achievement-firstvictim";
26
27 // delay map switch until this is set
28 float PlayerStats_GameReport_DelayMapVote;
29
30 // call at initialization
31 void PlayerStats_GameReport_Init();
32
33 // add a new player
34 void PlayerStats_GameReport_AddPlayer(entity e);
35
36 // add a new team
37 void PlayerStats_GameReport_AddTeam(float t);
38
39 // add a new event
40 void PlayerStats_GameReport_AddEvent(string event_id);
41
42 // call on each event to track, or at player disconnect OR match end for "global stuff"
43 #define PS_GR_P_ADDVAL(ent,eventid,val) PlayerStats_GameReport_Event(ent.playerstats_id, eventid, val)
44 #define PS_GR_T_ADDVAL(team,eventid,val) PlayerStats_GameReport_Event(sprintf("team#%d", team), eventid, val)
45 float PlayerStats_GameReport_Event(string prefix, string event_id, float value);
46
47 void PlayerStats_GameReport_Accuracy(entity p);
48
49 // call this whenever a player leaves
50 void PlayerStats_GameReport_FinalizePlayer(entity p);
51
52 // call this at the end of the match
53 void PlayerStats_GameReport_EndMatch(float finished);
54
55 void PlayerStats_GameReport_Handler(entity fh, entity pass, float status);
56
57 .string playerstats_id;
58
59 //string autocvar_g_playerstats_uri;
60
61 string autocvar_g_playerstats_gamereport_ladder;
62 var string autocvar_g_playerstats_gamereport_uri = "-";
63
64 #endif //SVQC
65 #ifdef MENUQC
66 var string autocvar_g_playerstats_playerdetail_uri = "http://stats.xonotic.org/player/me";
67 void PlayerStats_PlayerDetail();
68 #endif
69
70
71 /*
72 //// WIP -zykure /////////////////////////////////////////////////////
73
74
75 //const string playerinfo_uri = "http://localhost:6543"; // FIXME
76
77 string PlayerInfo_GetItem(entity e, string item_id);
78 string PlayerInfo_GetItemLocal(string item_id);
79
80 void PlayerInfo_Init();
81 #ifdef SVQC
82 string autocvar_g_playerinfo_uri;
83 void PlayerInfo_Basic(entity p);
84 #endif
85 #ifdef MENUQC
86 string autocvar_g_playerinfo_uri;
87 void PlayerInfo_Details();
88 #endif
89 #ifdef CSQC
90
91 //void PlayerInfo_Details();
92 #endif
93 */