diff --git a/conf/conf-example-strict.ini b/conf/conf-example-strict.ini index e350148..70fc8bb 100644 --- a/conf/conf-example-strict.ini +++ b/conf/conf-example-strict.ini @@ -72,14 +72,14 @@ OffSet = 3 #--------------------------------------------- # Custom Ban / Kick Messages # Keywords -# PLAYER_NAME = Player Name -# SERVER_NAME = Server Name -# LOG_FILE = Log File -# DATE_TIME = Date + Time - -Ban Message = DATE_TIME: PLAYER_NAME on SERVER_NAME -Kick Message = DATE_TIME: PLAYER_NAME on SERVER_NAME -Report Message = Player Name: PLAYER_NAME, Server: SERVER_NAME, Date: DATE_TIME:, Logfile: LOG_FILE +# $PLAYER_NAME = Player Name +# $SERVER_NAME = Server Name +# $LOG_FILE = Log File +# $DATE_TIME = Date + Time + +Ban Message = $DATE_TIME: $PLAYER_NAME on $SERVER_NAME +Kick Message = $DATE_TIME: $PLAYER_NAME on $SERVER_NAME +Report Message = Player Name: $PLAYER_NAME, Server: $SERVER_NAME, Date: $DATE_TIME:, Logfile: $LOG_FILE [Server 1] diff --git a/conf/conf-example.ini b/conf/conf-example.ini index 7408e19..50d5d68 100644 --- a/conf/conf-example.ini +++ b/conf/conf-example.ini @@ -73,14 +73,14 @@ OffSet = 3 #--------------------------------------------- # Custom Ban / Kick Messages # Keywords -# PLAYER_NAME = Player Name -# SERVER_NAME = Server Name -# LOG_FILE = Log File -# DATE_TIME = Date + Time - -Ban Message = DATE_TIME: PLAYER_NAME on SERVER_NAME -Kick Message = DATE_TIME: PLAYER_NAME on SERVER_NAME -Report Message = Player Name: PLAYER_NAME, Server: SERVER_NAME, Date: DATE_TIME:, Logfile: LOG_FILE +# $PLAYER_NAME = Player Name +# $SERVER_NAME = Server Name +# $LOG_FILE = Log File +# $DATE_TIME = Date + Time + +Ban Message = $DATE_TIME: $PLAYER_NAME on $SERVER_NAME +Kick Message = $DATE_TIME: $PLAYER_NAME on $SERVER_NAME +Report Message = Player Name: $PLAYER_NAME, Server: $SERVER_NAME, Date: $DATE_TIME:, Logfile: $LOG_FILE [Server 1] diff --git a/modules/bans.py b/modules/bans.py index 3aea809..a46c4ac 100644 --- a/modules/bans.py +++ b/modules/bans.py @@ -146,12 +146,12 @@ def checkBans(self): self.saveBanInfo() def formatMessage(self, template, player_name, server_name, log_file, date_time, guid, ip): - tmp = template.replace("LOG_FILE", log_file) - tmp = tmp.replace("DATE_TIME", date_time) - tmp = tmp.replace("SERVER_NAME", server_name) - tmp = tmp.replace("PLAYER_NAME", player_name) - tmp = tmp.replace("GUID", guid) - tmp = tmp.replace("IP", ip) + tmp = template.replace("$LOG_FILE", log_file) + tmp = tmp.replace("$DATE_TIME", date_time) + tmp = tmp.replace("$SERVER_NAME", server_name) + tmp = tmp.replace("$PLAYER_NAME", player_name) + tmp = tmp.replace("$GUID", guid) + tmp = tmp.replace("$IP", ip) return tmp def addBan(self, unique_id, info, logname, ban_template, report_template, time): #{ID,Reason} diff --git a/modules/logs_battleye.py b/modules/logs_battleye.py index 02f6bf8..cc973ee 100644 --- a/modules/logs_battleye.py +++ b/modules/logs_battleye.py @@ -170,10 +170,10 @@ def scan_battleye_logs(self, x): sys.exit() def kick_ban_msg(self, template, player_name, server_name, log_file, date_time): - tmp = string.replace(template, "PLAYER_NAME", player_name) - tmp = string.replace(tmp, "SERVER_NAME", server_name) - tmp = string.replace(tmp, "LOG_FILE", log_file) - tmp = string.replace(tmp, "DATE_TIME", date_time) + tmp = string.replace(template, "$PLAYER_NAME", player_name) + tmp = string.replace(tmp, "$SERVER_NAME", server_name) + tmp = string.replace(tmp, "$LOG_FILE", log_file) + tmp = string.replace(tmp, "$DATE_TIME", date_time) return tmp def update_bans(self, logname, data, time="-1", update=False):