METHOD(XonoticServerInfoDialog, loadServerInfo, void(entity, float))
ATTRIB(XonoticServerInfoDialog, title, string, _("Server Information"))
ATTRIB(XonoticServerInfoDialog, color, vector, SKINCOLOR_DIALOG_SERVERINFO)
- ATTRIB(XonoticServerInfoDialog, intendedWidth, float, 0.68)
+ ATTRIB(XonoticServerInfoDialog, intendedWidth, float, 0.8)
ATTRIB(XonoticServerInfoDialog, rows, float, 15)
ATTRIB(XonoticServerInfoDialog, columns, float, 12)
#ifdef IMPLEMENTATION
void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
{
- float m, pure, j, numh, maxp;
+ float m, pure, freeslots, j, numh, maxp, numb, sflags;
string s, typestr, versionstr, k, v;
if(me.currentServerName)
typestr = argv(0);
versionstr = argv(1);
}
+ freeslots = -1;
+ sflags = -1;
for(j = 2; j < m; ++j)
{
if(argv(j) == "")
v = substring(argv(j), 1, -1);
if(k == "P")
pure = stof(v);
+ else if(k == "S")
+ freeslots = stof(v);
+ else if(k == "F")
+ sflags = stof(v);
}
me.currentServerType = strzone(typestr);
numh = gethostcachenumber(SLIST_FIELD_NUMHUMANS, i);
SLIST_FIELD_MAXPLAYERS = gethostcacheindexforkey("maxplayers");
maxp = gethostcachenumber(SLIST_FIELD_MAXPLAYERS, i);
- me.currentServerNumPlayers = strzone(sprintf(_("%d/%d"), numh, maxp));
+ SLIST_FIELD_NUMBOTS = gethostcacheindexforkey("numbots");
+ numb = gethostcachenumber(SLIST_FIELD_NUMBOTS, i);
+ if(freeslots < 0)
+ freeslots = maxp - numh - numb;
+ me.currentServerNumPlayers = strzone(sprintf(_("%d/%d, %d free player slots"), numh, maxp, freeslots));
me.numPlayersLabel.setText(me.numPlayersLabel, me.currentServerNumPlayers);
- SLIST_FIELD_NUMBOTS = gethostcacheindexforkey("numbots");
- s = ftos(gethostcachenumber(SLIST_FIELD_NUMBOTS, i));
+ s = ftos(numb);
me.currentServerNumBots = strzone(s);
me.numBotsLabel.setText(me.numBotsLabel, me.currentServerNumBots);