]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'Mario/ipv6_gamelog' into 'master'
authorMario <mario.mario@y7mail.com>
Tue, 21 Jan 2020 15:29:02 +0000 (15:29 +0000)
committerMario <mario.mario@y7mail.com>
Tue, 21 Jan 2020 15:29:02 +0000 (15:29 +0000)
Merge branch Mario/ipv6_gamelog (S merge request)

See merge request xonotic/xonotic-data.pk3dir!765

qcsrc/server/autocvars.qh
qcsrc/server/client.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/miscfunctions.qh
xonotic-server.cfg

index 8213aaddec322cb0cf4f547b058c9c90adf3d72e..6aa798afb9b8b823f6363a914cde396fb165d55f 100644 (file)
@@ -301,6 +301,7 @@ int autocvar_sv_eventlog_files_counter;
 string autocvar_sv_eventlog_files_nameprefix;
 string autocvar_sv_eventlog_files_namesuffix;
 bool autocvar_sv_eventlog_files_timestamps;
+bool autocvar_sv_eventlog_ipv6_delimiter = false;
 float autocvar_sv_friction_on_land;
 var float autocvar_sv_friction_slick = 0.5;
 float autocvar_sv_gameplayfix_q2airaccelerate = 1;
index d79c630f206524489dba97099434b7c7320f2049..e0c13548cfa0d961496b801b4322acff44ffe142 100644 (file)
@@ -1108,7 +1108,7 @@ void ClientConnect(entity this)
                CS(this).allowed_timeouts = autocvar_sv_timeout_number;
 
        if (autocvar_sv_eventlog)
-               GameLogEcho(strcat(":join:", ftos(this.playerid), ":", ftos(etof(this)), ":", ((IS_REAL_CLIENT(this)) ? this.netaddress : "bot"), ":", playername(this, false)));
+               GameLogEcho(strcat(":join:", ftos(this.playerid), ":", ftos(etof(this)), ":", ((IS_REAL_CLIENT(this)) ? GameLog_ProcessIP(this.netaddress) : "bot"), ":", playername(this, false)));
 
        CS(this).just_joined = true;  // stop spamming the eventlog with additional lines when the client connects
 
index 7f852782c18f1b49c04fd8c05eb07b5041d4695a..6e2bbb8d7cd3c8a52868f9d3456c6b17d789db04 100644 (file)
@@ -84,6 +84,13 @@ void dedicated_print(string input)
        if (server_is_dedicated) print(input);
 }
 
+string GameLog_ProcessIP(string s)
+{
+       if(!autocvar_sv_eventlog_ipv6_delimiter)
+               return s;
+       return strreplace(":", "_", s);
+}
+
 void GameLogEcho(string s)
 {
     string fn;
index a67920f77cded186ff513164a378851a8787025c..aa2f026e6d5c734388d9a18dbf126eeb7c50f7d2 100644 (file)
@@ -74,6 +74,8 @@ string formatmessage(entity this, string msg);
 /** print(), but only print if the server is not local */
 void dedicated_print(string input);
 
+string GameLog_ProcessIP(string s);
+
 void GameLogEcho(string s);
 
 void GameLogInit();
index c7f12c46f61b8b6990a778937975f36aad7195df..87ab27076a7fd4890686383f52029a0986e09edd 100644 (file)
@@ -314,6 +314,7 @@ set sv_eventlog_files_timestamps 1 "include timestamps in the log file names"
 set sv_eventlog_files_counter 0 "internal counter cvar, do not modify"
 set sv_eventlog_files_nameprefix xonotic "prefix of individual log file names"
 set sv_eventlog_files_namesuffix .log "suffix of individual log file names"
+set sv_eventlog_ipv6_delimiter 0 "use a _ delimiter for IPV6 IPs, so that they can be easily detected in scripts"
 
 set nextmap "" "override the maplist when switching to the next map"
 set lastlevel "" "for singleplayer use, shows the menu once the match has ended"