///////////////////////////
// cvar constants
-const int CVAR_SAVE = 1;
-const int CVAR_NOTIFY = 2;
-const int CVAR_READONLY = 4;
+const int CVAR_SAVE = BIT(0);
+const int CVAR_NOTIFY = BIT(1);
+const int CVAR_READONLY = BIT(2);
///////////////////////////
// csqc communication stuff
const int FRAGS_PLAYER_OUT_OF_GAME = -616;
// server flags
-const int SERVERFLAG_ALLOW_FULLBRIGHT = 1;
-const int SERVERFLAG_TEAMPLAY = 2;
-const int SERVERFLAG_PLAYERSTATS = 4;
+const int SERVERFLAG_ALLOW_FULLBRIGHT = BIT(0);
+const int SERVERFLAG_TEAMPLAY = BIT(1);
+const int SERVERFLAG_PLAYERSTATS = BIT(2);
+const int SERVERFLAG_PLAYERSTATS_CUSTOM = BIT(3);
// a bit more constant
const vector PL_MAX_CONST = '16 16 45';
PlayerStats_GameReport_DelayMapVote = true;
serverflags |= SERVERFLAG_PLAYERSTATS;
+ if(autocvar_g_playerstats_gamereport_uri != "http://stats.xonotic.org/stats/submit")
+ {
+ serverflags |= SERVERFLAG_PLAYERSTATS_CUSTOM;
+ }
PlayerStats_GameReport_AddEvent(PLAYERSTATS_ALIVETIME);
PlayerStats_GameReport_AddEvent(PLAYERSTATS_AVGLATENCY);
if (!s) { s = _("N/A"); }
me.currentServerKey = strzone(s);
me.keyLabel.setText(me.keyLabel, me.currentServerKey);
+
+ me.currentServerStatsStatus = ((sflags >= 0 && (sflags & SERVERFLAG_PLAYERSTATS)) ? ((sflags & SERVERFLAG_PLAYERSTATS_CUSTOM) ? _("custom stats server") : _("stats enabled")) : _("stats disabled"));
+ me.currentServerStatsStatus = strzone(me.currentServerStatsStatus);
+ me.statsLabel.setText(me.statsLabel, me.currentServerStatsStatus);
}
void XonoticServerInfoDialog_fill(entity me)
me.TD(me, 1, 5.4, e = makeXonoticTextLabel(0, ""));
e.allowCut = 1;
me.idLabel = e;
+ me.TR(me);
+ me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Stats:")));
+ me.TD(me, 1, 5.4, e = makeXonoticTextLabel(0, ""));
+ e.allowCut = 1;
+ me.statsLabel = e;
me.gotoRC(me, 2, 2.2); me.setFirstColumn(me, me.currentColumn);
me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Players:")));
ATTRIB(XonoticServerInfoDialog, currentServerID, string);
ATTRIB(XonoticServerInfoDialog, currentServerEncrypt, string);
ATTRIB(XonoticServerInfoDialog, currentServerPure, string);
+ ATTRIB(XonoticServerInfoDialog, currentServerStatsStatus, string);
ATTRIB(XonoticServerInfoDialog, nameLabel, entity);
ATTRIB(XonoticServerInfoDialog, cnameLabel, entity);
ATTRIB(XonoticServerInfoDialog, encryptLabel, entity);
ATTRIB(XonoticServerInfoDialog, canConnectLabel, entity);
ATTRIB(XonoticServerInfoDialog, pureLabel, entity);
+ ATTRIB(XonoticServerInfoDialog, statsLabel, entity);
ENDCLASS(XonoticServerInfoDialog)
void Join_Click(entity btn, entity me);
// Stats
if(sflags >= 0 && (sflags & SERVERFLAG_PLAYERSTATS))
- draw_Picture(iconPos, "icon_stats1", iconSize, '1 1 1', 1);
+ {
+ if (sflags & SERVERFLAG_PLAYERSTATS_CUSTOM)
+ {
+ draw_Picture(iconPos, "icon_mod_", iconSize, '1 1 1', 1); // TODO: icon
+ }
+ else
+ {
+ draw_Picture(iconPos, "icon_stats1", iconSize, '1 1 1', 1);
+ }
+ }
+ else
+ {
+ draw_Picture(iconPos, "icon_mod_jeff", iconSize, '1 1 1', 1); // TODO: icon
+ }
if(isFocused && me.mouseOverIcons && !me.tooltip)
{
if(pure_available)
t = strcat(t, sprintf(" (%s)", (pure) ? _("official settings") : _("modified settings")));
t = strcat(t, ", ");
- t = strcat(t, ((sflags >= 0 && (sflags & SERVERFLAG_PLAYERSTATS)) ? _("stats enabled") : _("stats disabled")));
+ t = strcat(t, ((sflags >= 0 && (sflags & SERVERFLAG_PLAYERSTATS)) ? ((sflags & SERVERFLAG_PLAYERSTATS_CUSTOM) ? _("custom stats server") : _("stats enabled")) : _("stats disabled")));
setZonedTooltip(me, t, string_null);
}
// --------------