]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/client.qc
Display map author in Welcome message, add more author fallback paths
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / client.qc
index c1ee3aceb39780f2b3ede953fd45ff0aac798c60..1d62feffa2858ea3bbc689fa8da8b1059f3a215a 100644 (file)
@@ -1041,16 +1041,31 @@ void ClientPreConnect(entity this)
 // also note that they aren't all registered mutators, e.g. jetpack, low gravity
 void SendWelcomeMessage(entity this, int msg_type)
 {
-       WriteByte(msg_type, boolean(autocvar_g_campaign));
        if (boolean(autocvar_g_campaign))
        {
+               WriteByte(msg_type, 1);
                WriteByte(msg_type, Campaign_GetLevelNum());
                return;
        }
+
+       int flags = 0;
+       if (CS(this).version_mismatch)
+               flags |= 2;
+       if (CS(this).version < autocvar_gameversion)
+               flags |= 4;
+       MapInfo_Get_ByName(mi_shortname, 0, NULL);
+       if (MapInfo_Map_author != "")
+               flags |= 8;
+       WriteByte(msg_type, flags);
+
        WriteString(msg_type, autocvar_hostname);
        WriteString(msg_type, autocvar_g_xonoticversion);
-       WriteByte(msg_type, CS(this).version_mismatch);
-       WriteByte(msg_type, (CS(this).version < autocvar_gameversion));
+
+       WriteString(msg_type, MapInfo_Map_titlestring);
+       if (flags & 8)
+               WriteString(msg_type, MapInfo_Map_author);
+       MapInfo_ClearTemps();
+
        WriteByte(msg_type, autocvar_g_warmup > 1 ? autocvar_g_warmup : map_minplayers);
        WriteByte(msg_type, GetPlayerLimit());