]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/main.qc
Remove unnecessary client global shortmapname
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / main.qc
index 22f0438f411fd76aa4dda07953d3e09c3f1345ef..1dba6aa9675efb01ccd9e21fe059cf6a4e90f0ed 100644 (file)
@@ -129,7 +129,6 @@ void CSQC_Init()
        {
                get_mi_min_max_texcoords(1); // try the CLEVER way first
                minimapname = strcat("gfx/", mi_shortname, "_radar");
-               shortmapname = mi_shortname;
 
                if (precache_pic(minimapname) == "")
                {
@@ -1420,21 +1419,43 @@ bool net_handle_ServerWelcome()
        }
 
        strcpy(hostname, ReadString());
-
        string hostversion = ReadString();
        bool version_mismatch = ReadByte();
        bool version_check = ReadByte();
-       string ver = GetVersionMessage(hostversion, version_mismatch, version_check);
-
+       srv_minplayers = ReadByte();
+       srv_maxplayers = ReadByte();
        string modifications = translate_modifications(ReadString());
        string weaponarena_list = translate_weaponarena(ReadString());
        string cache_mutatormsg = ReadString();
        string motd = ReadString();
 
-       string msg = "";
-       msg = strcat(msg, ver);
+       string msg = GetVersionMessage(hostversion, version_mismatch, version_check);
+
        msg = strcat(msg, "^8\n\n", strcat(_("Gametype:"), " ^1", MapInfo_Type_ToText(gametype)), "^8\n");
 
+       msg = strcat(msg, "^8\n", _("Map:"), " ^2");
+       if (world.message == "")
+               msg = strcat(msg, mi_shortname, "^8\n");
+       else
+       {
+               int i = strstrofs(world.message, " by ", 0); // matches _MapInfo_Generate()
+               string longname = i >= 0 ? substring(world.message, 0, i) : world.message;
+               msg = strcat(msg, (strcasecmp(longname, mi_shortname) ? strcat(mi_shortname, " ^7// ^2") : ""), longname, "^8\n");
+       }
+
+       if (srv_minplayers || srv_maxplayers)
+       {
+               msg = strcat(msg, "^8\n", _("This match supports"), " ^5");
+               if (srv_minplayers == srv_maxplayers)
+                       msg = strcat(msg, sprintf(_("%d players"), srv_maxplayers), "^8\n");
+               else if (srv_minplayers && srv_maxplayers)
+                       msg = strcat(msg, sprintf(_("%d to %d players"), srv_minplayers, srv_maxplayers), "^8\n");
+               else if (srv_maxplayers)
+                       msg = strcat(msg, sprintf(_("%d players maximum"), srv_maxplayers), "^8\n");
+               else
+                       msg = strcat(msg, sprintf(_("%d players minimum"), srv_minplayers), "^8\n");
+       }
+
        modifications = cons_mid(modifications, ", ", weaponarena_list);
        if(modifications != "")
                msg = strcat(msg, "^8\n", _("Active modifications:"), " ^3", modifications, "^8\n");