17 float m, pure_violations, freeslots, numh, maxp, numb, sflags;
18 string s, typestr, versionstr, k,
v,
modname;
27 strfree(me.currentServerPlayers);
28 strfree(me.currentServerNumPlayers);
29 strfree(me.currentServerNumBots);
30 strfree(me.currentServerNumFreeSlots);
32 strfree(me.currentServerVersion);
43 me.infoTab.nameLabel.setText(me.infoTab.nameLabel, me.currentServerName);
46 me.infoTab.cnameLabel.setText(me.infoTab.cnameLabel, me.currentServerCName);
48 pure_available =
false;
51 versionstr = _(
"N/A");
63 bool ToSSpecified =
false;
64 for(
int j = 2; j < m; ++j)
72 pure_available =
true;
73 pure_violations =
stof(v);
90 string downloadurl =
v;
91 if (downloadurl ==
"INVALID")
93 me.ToSTab.textBox.setText(me.ToSTab.textBox, _(
"No Terms of Service specified"));
97 downloadurl = strreplace(
"|",
":", downloadurl);
98 me.ToSTab.loadToS(me.ToSTab, downloadurl);
105 me.ToSTab.textBox.setText(me.ToSTab.textBox, _(
"No Terms of Service specified"));
108 #ifdef COMPAT_NO_MOD_IS_XONOTIC 115 modname = sprintf(
"%s (%s)", modname, s);
120 me.currentServerType =
strzone(typestr);
121 me.infoTab.typeLabel.setText(me.infoTab.typeLabel, me.currentServerType);
124 me.infoTab.mapLabel.setText(me.infoTab.mapLabel, me.currentServerMap);
127 me.infoTab.rawPlayerList.setPlayerList(me.infoTab.rawPlayerList, me.currentServerPlayers);
132 me.currentServerNumPlayers =
strzone(sprintf(
"%d/%d", numh, maxp));
133 me.infoTab.numPlayersLabel.setText(me.infoTab.numPlayersLabel, me.currentServerNumPlayers);
136 me.currentServerNumBots =
strzone(s);
137 me.infoTab.numBotsLabel.setText(me.infoTab.numBotsLabel, me.currentServerNumBots);
139 if(freeslots < 0) { freeslots = maxp - numh - numb; }
141 me.currentServerNumFreeSlots =
strzone(s);
142 me.infoTab.numFreeSlotsLabel.setText(me.infoTab.numFreeSlotsLabel, me.currentServerNumFreeSlots);
144 me.currentServerMod = ((modname ==
"Xonotic") ?
ZCTX(_(
"MOD^Default")) : modname);
145 me.currentServerMod =
strzone(me.currentServerMod);
146 me.infoTab.modLabel.setText(me.infoTab.modLabel, me.currentServerMod);
148 me.currentServerVersion =
strzone(versionstr);
149 me.infoTab.versionLabel.setText(me.infoTab.versionLabel, me.currentServerVersion);
151 me.currentServerPure = ((!pure_available) ? _(
"N/A") : (pure_violations == 0) ? _(
"Official") : sprintf(_(
"%d modified"), pure_violations));
152 me.currentServerPure =
strzone(me.currentServerPure);
153 me.infoTab.pureLabel.setText(me.infoTab.pureLabel, me.currentServerPure);
155 s = crypto_getencryptlevel(me.currentServerCName);
158 if(
cvar(
"crypto_aeslevel") >= 3)
159 me.currentServerEncrypt = _(
"N/A (auth library missing, can't connect)");
161 me.currentServerEncrypt = _(
"N/A (auth library missing)");
166 if(
cvar(
"crypto_aeslevel") >= 3)
167 me.currentServerEncrypt = _(
"Not supported (can't connect)");
169 me.currentServerEncrypt = _(
"Not supported (won't encrypt)");
172 if(
cvar(
"crypto_aeslevel") >= 2)
173 me.currentServerEncrypt = _(
"Supported (will encrypt)");
175 me.currentServerEncrypt = _(
"Supported (won't encrypt)");
178 if(
cvar(
"crypto_aeslevel") >= 1)
179 me.currentServerEncrypt = _(
"Requested (will encrypt)");
181 me.currentServerEncrypt = _(
"Requested (won't encrypt)");
184 if(
cvar(
"crypto_aeslevel") <= 0)
185 me.currentServerEncrypt = _(
"Required (can't connect)");
187 me.currentServerEncrypt = _(
"Required (will encrypt)");
190 me.infoTab.encryptLabel.setText(me.infoTab.encryptLabel, me.currentServerEncrypt);
193 s = crypto_getidfp(me.currentServerCName);
194 if (!s) { s = _(
"N/A"); }
195 me.currentServerID =
strzone(s);
196 me.infoTab.idLabel.setText(me.infoTab.idLabel, me.currentServerID);
198 s = crypto_getkeyfp(me.currentServerCName);
199 if (!s) { s = _(
"N/A"); }
200 me.currentServerKey =
strzone(s);
201 me.infoTab.keyLabel.setText(me.infoTab.keyLabel, me.currentServerKey);
204 me.currentServerStatsStatus =
strzone(me.currentServerStatsStatus);
205 me.infoTab.statsLabel.setText(me.infoTab.statsLabel, me.currentServerStatsStatus);
217 me.TD(me, me.rows - 2, me.columns, mc);
219 me.gotoRC(me, me.rows - 1, 0);
222 e.onClickEntity = me;
229 e.onClickEntity = me;
234 localcmd(
"connect ", me.currentServerCName,
"\n");
string MapInfo_Type_ToText(Gametype t)
void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
const int SERVERFLAG_PLAYERSTATS
const int SERVERFLAG_PLAYERSTATS_CUSTOM
Gametype MapInfo_Type_FromString(string gtype, bool dowarn)
void Join_Click(entity btn, entity me)
entity makeXonoticServerToSTab()
#define tokenizebyseparator
entity makeXonoticServerInfoTab()
entity makeXonoticTabController(float theRows)
void XonoticServerInfoDialog_fill(entity me)