summaryrefslogtreecommitdiff
path: root/src/net_query.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/net_query.c')
-rw-r--r--src/net_query.c56
1 files changed, 37 insertions, 19 deletions
diff --git a/src/net_query.c b/src/net_query.c
index 0262791b..26bcf26a 100644
--- a/src/net_query.c
+++ b/src/net_query.c
@@ -22,8 +22,10 @@
// Querying servers to find their current status.
//
+#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
+#include <string.h>
#include "i_system.h"
#include "i_timer.h"
@@ -526,10 +528,14 @@ static void NET_Query_QueryLoop(net_query_callback_t callback, void *user_data)
void NET_Query_Init(void)
{
- query_context = NET_NewContext();
- NET_AddModule(query_context, &net_sdl_module);
- net_sdl_module.InitClient();
+ if (query_context == NULL)
+ {
+ query_context = NET_NewContext();
+ NET_AddModule(query_context, &net_sdl_module);
+ net_sdl_module.InitClient();
+ }
+ free(targets);
targets = NULL;
num_targets = 0;
@@ -640,23 +646,35 @@ static void formatted_printf(int wide, char *s, ...)
static char *GameDescription(GameMode_t mode, GameMission_t mission)
{
- switch (mode)
- {
- case shareware:
- return "shareware";
- case registered:
- return "registered";
- case retail:
- return "ultimate";
- case commercial:
- if (mission == doom2)
- return "doom2";
- else if (mission == pack_tnt)
- return "tnt";
- else if (mission == pack_plut)
- return "plutonia";
+ switch (mission)
+ {
+ case doom:
+ if (mode == shareware)
+ return "swdoom";
+ else if (mode == registered)
+ return "regdoom";
+ else if (mode == retail)
+ return "ultdoom";
+ else
+ return "doom";
+ case doom2:
+ return "doom2";
+ case pack_tnt:
+ return "tnt";
+ case pack_plut:
+ return "plutonia";
+ case pack_chex:
+ return "chex";
+ case pack_hacx:
+ return "hacx";
+ case heretic:
+ return "heretic";
+ case hexen:
+ return "hexen";
+ case strife:
+ return "strife";
default:
- return "unknown";
+ return "?";
}
}