%s | %s%s%s%s | %s | %s | %u", preurl,infourl, url, PREFIX_SECURE(server->secure), PREFIX_NEEDPASS(server->needpass), PREFIX_COOP(server->coop), hostname, server->gamedir, server->mapname, server->clients);
if (server->bots)
VFS_PRINTF(f, "+%ub", server->bots);
VFS_PRINTF(f, "/%u", server->maxclients);
@@ -853,7 +892,9 @@ vfsfile_t *SVM_GenerateIndex(const char *requesthost, const char *fname, const c
if (!strcmp(fname, "index.html"))
f = SVM_Generate_Gamelist(mimetype, query);
else if (!strncmp(fname, "server/", 7))
- f = SVM_Generate_Serverinfo(mimetype, fname+7, query);
+ f = SVM_Generate_AddrServerinfo(mimetype, requesthost, fname+7, query);
+ else if (!strncmp(fname, "room/", 5))
+ f = SVM_Generate_RoomServerinfo(mimetype, requesthost, fname+5, query);
else if (!strncmp(fname, "game/", 5))
f = SVM_Generate_Serverlist(mimetype, requesthost, fname+5, query);
else if (!strncmp(fname, "raw/", 4))
@@ -888,7 +929,7 @@ static svm_server_t *SVM_FindBrokerHost(const char *brokerid)
while (server)
{
if (server->brokerid) //don't report brokered servers by address.
- if (server->brokerid == brokerid)
+ if (!strcmp(server->brokerid, brokerid))
return server;
server = Hash_GetNextKey(&svm.serverhash, key, server);
}
@@ -955,6 +996,14 @@ void SVM_AddBrokerGame(const char *brokerid, const char *info)
server->protover = atoi(Info_ValueForKey(info, "protocol"));
server->maxclients = atoi(Info_ValueForKey(info, "maxclients"));
server->clients = atoi(Info_ValueForKey(info, "clients"));
+ server->secure = !!*Info_ValueForKey(info, "*fp");
+ server->needpass = atoi(Info_ValueForKey(info, "needpass"));
+ server->coop = atoi(Info_ValueForKey(info, "coop"));
+ if (!server->coop)
+ { //deathmatch 0 also means coop 1... servers that report neither are probably annoying DP servers that report nothing useful and should default to DM.
+ const char *v = Info_ValueForKey(info, "deathmatch");
+ server->coop = *v && !atoi(v);
+ }
Q_strncpyz(server->hostname, Info_ValueForKey(info, "hostname"), sizeof(server->hostname));
Q_strncpyz(server->gamedir, Info_ValueForKey(info, "modname"), sizeof(server->gamedir));
Q_strncpyz(server->mapname, Info_ValueForKey(info, "mapname"), sizeof(server->mapname));
@@ -963,6 +1012,8 @@ void SVM_AddBrokerGame(const char *brokerid, const char *info)
Q_strncpyz(server->version, Info_ValueForKey(info, "*version"), sizeof(server->version));
if (!*server->version)
Q_strncpyz(server->version, Info_ValueForKey(info, "ver"), sizeof(server->version));
+
+ Q_strncpyz(server->rules, info, sizeof(server->rules));
}
static svm_server_t *SVM_Heartbeat(const char *gamename, netadr_t *adr, int numclients, int numbots, int numspecs, double validuntil)
|