]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Allow customising the delimiter of IPV6 IPs in the game log's join message, so script...
authorMario <mario.mario@y7mail.com>
Mon, 20 Jan 2020 02:32:16 +0000 (12:32 +1000)
committerMario <mario.mario@y7mail.com>
Mon, 20 Jan 2020 02:32:16 +0000 (12:32 +1000)
qcsrc/server/autocvars.qh
qcsrc/server/client.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/miscfunctions.qh
xonotic-server.cfg

index 8213aaddec322cb0cf4f547b058c9c90adf3d72e..fec6d9a46d6c66d179c9ce64c42d2081d9881fb6 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;
 string autocvar_sv_eventlog_files_nameprefix;
 string autocvar_sv_eventlog_files_namesuffix;
 bool autocvar_sv_eventlog_files_timestamps;
+string autocvar_sv_eventlog_ipv6_delimiter = ":";
 float autocvar_sv_friction_on_land;
 var float autocvar_sv_friction_slick = 0.5;
 float autocvar_sv_gameplayfix_q2airaccelerate = 1;
 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)
                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
 
 
        CS(this).just_joined = true;  // stop spamming the eventlog with additional lines when the client connects
 
index 7f852782c18f1b49c04fd8c05eb07b5041d4695a..fb0ef23538fb0a804534b335b2612d0f894b53b1 100644 (file)
@@ -84,6 +84,11 @@ void dedicated_print(string input)
        if (server_is_dedicated) print(input);
 }
 
        if (server_is_dedicated) print(input);
 }
 
+string GameLog_ProcessIP(string s)
+{
+       return strreplace(":", autocvar_sv_eventlog_ipv6_delimiter, s);
+}
+
 void GameLogEcho(string s)
 {
     string fn;
 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);
 
 /** 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();
 void GameLogEcho(string s);
 
 void GameLogInit();
index c7f12c46f61b8b6990a778937975f36aad7195df..63cff8f53c5e837a5df2795ca4498dbd8721f4ee 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_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 ":" "delimiter for IPV6 IPs, customisable to allow easier processing 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"
 
 set nextmap "" "override the maplist when switching to the next map"
 set lastlevel "" "for singleplayer use, shows the menu once the match has ended"