summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2010-12-02 20:32:52 +0000
committerSimon Howard2010-12-02 20:32:52 +0000
commit59d2ed0f2de6b2156142c87d48b0f55fa56b2acf (patch)
treeb8ae0246344e28064a7cd1767089f780df87e912
parentb11030cbfee0d4d4a46673001992e94abc146c8c (diff)
downloadchocolate-doom-59d2ed0f2de6b2156142c87d48b0f55fa56b2acf.tar.gz
chocolate-doom-59d2ed0f2de6b2156142c87d48b0f55fa56b2acf.tar.bz2
chocolate-doom-59d2ed0f2de6b2156142c87d48b0f55fa56b2acf.zip
Add -servername parameter to allow the owner to change the name returned
in response to queries (thanks AlexMax). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2185
-rw-r--r--src/net_server.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/net_server.c b/src/net_server.c
index 7b67ea56..43584170 100644
--- a/src/net_server.c
+++ b/src/net_server.c
@@ -1079,6 +1079,7 @@ void NET_SV_SendQueryResponse(net_addr_t *addr)
{
net_packet_t *reply;
net_querydata_t querydata;
+ int p;
// Version
@@ -1098,9 +1099,22 @@ void NET_SV_SendQueryResponse(net_addr_t *addr)
querydata.gamemode = sv_gamemode;
querydata.gamemission = sv_gamemission;
- // Server description. This is currently hard-coded.
+ //!
+ // @arg <name>
+ //
+ // When starting a network server, specify a name for the server.
+ //
- querydata.description = "Chocolate Doom server";
+ p = M_CheckParm("-servername");
+
+ if (p > 0 && p + 1 < myargc)
+ {
+ querydata.description = myargv[p + 1];
+ }
+ else
+ {
+ querydata.description = "Unnamed server";
+ }
// Send it and we're done.