]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/client.qc
Show a welcome window with MOTD on server connection
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / client.qc
index 8ae3df19380ab918478f3514035d0e0fc9a970c7..3d0fffe0a0a538f3f850d48b5a8d762e42fd89e0 100644 (file)
@@ -1055,10 +1055,9 @@ string getwelcomemessage(entity this)
                modifications = strcat(modifications, ", Jet pack");
        modifications = substring(modifications, 2, strlen(modifications) - 2);
 
-       string versionmessage = GetClientVersionMessage(this);
-       string s = strcat(versionmessage, "^8\n^8\nserver is ^9", autocvar_hostname, "^8\n");
+       string s = GetClientVersionMessage(this);
 
-       s = strcat(s, "^8\nmatch type is ^1", gamemode_name, "^8\n");
+       s = strcat(s, "^8\n\nmatch type is ^1", gamemode_name, "^8\n");
 
        if(modifications != "")
                s = strcat(s, "^8\nactive modifications: ^3", modifications, "^8\n");
@@ -1086,6 +1085,14 @@ string getwelcomemessage(entity this)
        return s;
 }
 
+void serverinfo_welcomemessage_send(entity this)
+{
+       msg_entity = this;
+       WriteHeader(MSG_ONE, TE_CSQC_SERVERINFO);
+       WriteString(MSG_ONE, autocvar_hostname);
+       WriteString(MSG_ONE, getwelcomemessage(this));
+}
+
 /**
 =============
 ClientConnect
@@ -1173,7 +1180,11 @@ void ClientConnect(entity this)
        CS(this).model_randomizer = random();
 
        if (IS_REAL_CLIENT(this))
+       {
+               if (!autocvar_g_campaign)
+                       serverinfo_welcomemessage_send(this);
                sv_notice_join(this);
+       }
 
        this.move_qcphysics = autocvar_sv_qcphysics;