ATTRIB(XonoticServerInfoDialog, title, string, "Server Information")
ATTRIB(XonoticServerInfoDialog, color, vector, SKINCOLOR_DIALOG_SERVERINFO)
ATTRIB(XonoticServerInfoDialog, intendedWidth, float, 0.68)
- ATTRIB(XonoticServerInfoDialog, rows, float, 14)
+ ATTRIB(XonoticServerInfoDialog, rows, float, 15)
ATTRIB(XonoticServerInfoDialog, columns, float, 12)
ATTRIB(XonoticServerInfoDialog, currentServerName, string, string_null)
ATTRIB(XonoticServerInfoDialog, currentServerID, string, string_null)
ATTRIB(XonoticServerInfoDialog, currentServerEncrypt, string, string_null)
ATTRIB(XonoticServerInfoDialog, currentServerCanConnect, string, string_null)
+ ATTRIB(XonoticServerInfoDialog, currentServerPure, string, string_null)
ATTRIB(XonoticServerInfoDialog, nameLabel, entity, NULL)
ATTRIB(XonoticServerInfoDialog, cnameLabel, entity, NULL)
ATTRIB(XonoticServerInfoDialog, idLabel, entity, NULL)
ATTRIB(XonoticServerInfoDialog, encryptLabel, entity, NULL)
ATTRIB(XonoticServerInfoDialog, canConnectLabel, entity, NULL)
+ ATTRIB(XonoticServerInfoDialog, pureLabel, entity, NULL)
ENDCLASS(XonoticServerInfoDialog)
float SLIST_FIELD_NAME;
#ifdef IMPLEMENTATION
void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
{
- float m;
- string s, typestr, versionstr, numh, maxp;
+ float m, pure, j;
+ string s, typestr, versionstr, numh, maxp, k, v;
SLIST_FIELD_NAME = gethostcacheindexforkey("name");
me.currentServerName = strzone(gethostcachestring(SLIST_FIELD_NAME, i));
me.currentServerCName = strzone(gethostcachestring(SLIST_FIELD_CNAME, i));
me.cnameLabel.setText(me.cnameLabel, me.currentServerCName);
+ pure = -1;
+ typestr = "N/A";
+ versionstr = "N/A";
+
SLIST_FIELD_QCSTATUS = gethostcacheindexforkey("qcstatus");
s = gethostcachestring(SLIST_FIELD_QCSTATUS, i);
m = tokenizebyseparator(s, ":");
- if(m > 1)
+ if(m >= 2)
{
- typestr = argv (0);
+ typestr = argv(0);
versionstr = argv(1);
}
- else
+ for(j = 2; j < m; ++j)
{
- typestr = "N/A";
- versionstr = "N/A";
+ if(argv(j) == "")
+ break;
+ k = substring(argv(j), 0, 1);
+ v = substring(argv(j), 1, -1);
+ if(k == "P")
+ pure = stof(v);
}
+
me.currentServerType = strzone(typestr);
me.typeLabel.setText(me.typeLabel, me.currentServerType);
me.currentServerVersion = strzone(versionstr);
me.versionLabel.setText(me.versionLabel, me.currentServerVersion);
+ me.currentServerPure = ((pure < 0) ? "N/A" : (pure == 0) ? "Official settings" : sprintf("%d modified settings", pure));
+ me.pureLabel.setText(me.pureLabel, me.currentServerPure);
+
SLIST_FIELD_PING = gethostcacheindexforkey("ping");
s = ftos(gethostcachenumber(SLIST_FIELD_PING, i));
me.currentServerPing = strzone(s);
me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
e.allowCut = 1;
me.mapLabel = e;
+ me.TR(me);
+ me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Gameplay:"));
+ me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
+ e.allowCut = 1;
+ me.pureLabel = e;
me.TR(me);
me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Players:"));
me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
ATTRIB(XonoticServerList, realFontSize, vector, '0 0 0')
ATTRIB(XonoticServerList, realUpperMargin, float, 0)
+ ATTRIB(XonoticServerList, columnIconsOrigin, float, 0)
+ ATTRIB(XonoticServerList, columnIconsSize, float, 0)
ATTRIB(XonoticServerList, columnPingOrigin, float, 0)
ATTRIB(XonoticServerList, columnPingSize, float, 0)
ATTRIB(XonoticServerList, columnNameOrigin, float, 0)
me.realFontSize_x = me.fontSize / (absSize_x * (1 - me.controlWidth));
me.realUpperMargin = 0.5 * (1 - me.realFontSize_y);
- me.columnPingOrigin = 0;
+ me.columnIconsOrigin = 0;
+ me.columnIconsSize = me.realFontSize_x * 2;
me.columnPingSize = me.realFontSize_x * 4;
me.columnMapSize = me.realFontSize_x * 12;
me.columnTypeSize = me.realFontSize_x * 4;
me.columnPlayersSize = me.realFontSize_x * 6;
- me.columnNameSize = 1 - me.columnPlayersSize - me.columnMapSize - me.columnPingSize - me.columnTypeSize - 4 * me.realFontSize_x;
+ me.columnNameSize = 1 - me.columnPlayersSize - me.columnMapSize - me.columnPingSize - me.columnIconsSize - me.columnTypeSize - 5 * me.realFontSize_x;
+ me.columnPingOrigin = me.columnIconsOrigin + me.columnIconsSize + me.realFontSize_x;
me.columnNameOrigin = me.columnPingOrigin + me.columnPingSize + me.realFontSize_x;
me.columnMapOrigin = me.columnNameOrigin + me.columnNameSize + me.realFontSize_x;
me.columnTypeOrigin = me.columnMapOrigin + me.columnMapSize + me.realFontSize_x;
theColor = SKINCOLOR_SERVERLIST_IMPOSSIBLE;
theAlpha = SKINALPHA_SERVERLIST_IMPOSSIBLE;
}
- // TODO show an icon for encryption status
+
+ if(q == 1)
+ {
+ if(cvar("crypto_aeslevel") >= 2)
+ q |= 4;
+ }
+ if(q == 2)
+ {
+ if(cvar("crypto_aeslevel") >= 1)
+ q |= 4;
+ }
+ if(q == 3)
+ q = 5;
+ if(q >= 3)
+ q -= 2;
+ // possible status:
+ // 0: crypto off
+ // 1: AES possible
+ // 2: AES recommended but not available
+ // 3: AES possible and will be used
+ // 4: AES recommended and will be used
+ // 5: AES required
+
+ s = gethostcachestring(SLIST_FIELD_QCSTATUS, i);
+ {
+ vector iconSize;
+ iconSize_y = 1;
+ iconSize_x = iconSize_y * (absSize_y / absSize_x);
+
+ vector iconPos;
+ iconPos_x = (me.columnIconsSize - 2 * iconSize_x) * 0.5;
+ iconPos_y = (1 - iconSize_y) * 0.5;
+
+ draw_Picture(iconPos, strcat("icon_pure", ftos(strstrofs(s, ":P0:", 0) >= 0)), iconSize, '1 1 1', 1);
+
+ iconPos_x += iconSize_x;
+ draw_Picture(iconPos, strcat("icon_aeslevel", ftos(q)), iconSize, '1 1 1', 1);
+ }
s = ftos(p);
draw_Text(me.realUpperMargin * eY + (me.columnPingSize - draw_TextWidth(s, 0, me.realFontSize)) * eX, s, me.realFontSize, theColor, theAlpha, 0);