• R/O
  • SSH

zandronum-sandbox-stable: Commit


Commit MetaInfo

Revisión420ac83eb02fc7628d89024b75c11bfda25307f4 (tree)
Tiempo2022-10-07 12:22:08
AutorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

sv_hostname is now limited to a maximum length of 160 characters to avoid incredibly long server names.

Cambiar Resumen

Diferencia incremental

diff -r 0a9e697adf83 -r 420ac83eb02f docs/zandronum-history.txt
--- a/docs/zandronum-history.txt Thu Oct 06 08:18:14 2022 -0400
+++ b/docs/zandronum-history.txt Thu Oct 06 23:22:08 2022 -0400
@@ -93,7 +93,7 @@
9393 ! - The server now updates a spectator's lagging status to all clients and the mini lag icon on the scoreboard now shows for spectators. [Kaminsky]
9494 ! - By default, the join queue is no longer cleared between levels for all game modes like in duel. The old behaviour can be restored by enabling the new dmflag "sv_dontkeepjoinqueue" which also works in duel. [Kaminsky]
9595 ! - Unlagged now restores a player's old height when reconciling them. [Kaminsky]
96-! - sv_hostname is now cleaned up so that any unacceptable characters and trailing crap are removed. [Kaminsky]
96+! - sv_hostname is now cleaned up so that any unacceptable characters and trailing crap are removed. Also, it's now limited to a maximum length of 160 characters to avoid incredibly long server names. [Kaminsky]
9797 ! - The "fisting" medal is now only awarded if the player frags another player with a melee hitscan attack, or with a projectile or puff that awards the medal, as it should be. [Kaminsky]
9898 ! - The "spam" medal is now only awarded if the player frags another player with a projectile or puff that awards the medal, as it should be. [Kaminsky]
9999 ! - Blacklisted the connect, disconnect, reconnect, and restart CCMDs from ConsoleCommand. [Kaminsky]
diff -r 0a9e697adf83 -r 420ac83eb02f src/sv_main.h
--- a/src/sv_main.h Thu Oct 06 08:18:14 2022 -0400
+++ b/src/sv_main.h Thu Oct 06 23:22:08 2022 -0400
@@ -85,6 +85,9 @@
8585 // [AK] Maximum amount of gametics of recent commands from a client that we can store.
8686 #define MAX_RECENT_COMMANDS 15
8787
88+// [AK] Maximum amount of characters that can be put in sv_hostname.
89+#define MAX_HOSTNAME_LENGTH 160
90+
8891 // This is for the server console, but since we normally can't include that (win32 stuff),
8992 // we can just put it here.
9093 #define UDF_NAME 0x00000001
diff -r 0a9e697adf83 -r 420ac83eb02f src/sv_master.cpp
--- a/src/sv_master.cpp Thu Oct 06 08:18:14 2022 -0400
+++ b/src/sv_master.cpp Thu Oct 06 23:22:08 2022 -0400
@@ -774,6 +774,9 @@
774774 cleanedHostname += tempHostname[i];
775775 }
776776
777+ // [AK] Truncate incredibly long hostnames. Whatever limit that we allow should be more than enough.
778+ cleanedHostname.Truncate( MAX_HOSTNAME_LENGTH );
779+
777780 // [AK] Finally, remove any trailing crap from the cleaned hostname string.
778781 V_RemoveTrailingCrapFromFString( cleanedHostname );
779782
Show on old repository browser