]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Get rid of 2 warnings, one in the client and the other in the dedicated server, print...
authorterencehill <piuntn@gmail.com>
Fri, 26 Jul 2024 16:55:45 +0000 (18:55 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 26 Jul 2024 21:47:23 +0000 (23:47 +0200)
* _def_detect_dedicated and the usage of ${qport ?} instead of ${qport} are meant to avoid this warning in the dedicated server: Could not expand $qport in alias _if_dedicated
* The new _detect_dedicated_ aliases are meant to avoid this warning in the client: Unknown command "_detect_dedicated_60106"

commands.cfg

index d0726bce596e5eeb86dddf360aca5950e70a6762..98676518533159d1eda4cb6626c45ff1b1c08eb4 100644 (file)
@@ -2,15 +2,27 @@
 //  Master config for managing various command aliases and settings
 // =================================================================
 
-// Execute commands based on whether it is dedicated a server or a client.
-alias "_detect_dedicated_$qport" "${* asis}"
+// create if_client and if_dedicated aliases that allow executing commands based on
+// whether it is a dedicated server or a client
+alias _def_detect_dedicated "alias _detect_dedicated_${qport ?} \"\""
+_def_detect_dedicated
+alias "_detect_dedicated_" "${* asis}"
+alias "_detect_dedicated_${qport ?}" "${* asis}"
 alias "_detect_dedicated_0" ""
-alias _if_dedicated "_detect_dedicated_$qport ${* asis}"
+alias _if_dedicated "_detect_dedicated_${qport ?} ${* asis}"
 alias if_client "${* asis}"
 alias if_dedicated "${* asis}"
 _if_dedicated alias if_client ""
 if_client alias if_dedicated ""
 
+// these aliases are now useless, remove them
+// NOTE for some reason _detect_dedicated_ no longer exists in dedicated
+unalias _def_detect_dedicated
+if_client unalias "_detect_dedicated_"
+unalias "_detect_dedicated_${qport ?}"
+unalias _detect_dedicated_0
+unalias _if_dedicated
+
 // for easy access by QC
 if_dedicated set is_dedicated 1
 if_client    set is_dedicated 0