Remove legacy bansystem and add WARN punish type
This commit is contained in:
@@ -12,14 +12,23 @@ func Export(Punishments:Array[Punishment],file:String) -> void:
|
||||
continue
|
||||
content += "NAME: " + punishment.username + "\n"
|
||||
content += "UID: " + punishment.uid + "\n"
|
||||
content += "PUNISHMENT: " + ("MUTE" if punishment.what_punishment ==
|
||||
punishment.punishment_types.MUTE else "BAN") + "\n"
|
||||
content += "PUNISHMENT: " + (get_punish_type(punishment)) + "\n"
|
||||
content += "REASON: " + punishment.punish_reason + "\n"
|
||||
content += "END_DATE: " + str(punishment.punish_end) + "\n"
|
||||
content += "L!ListEnd\n"
|
||||
|
||||
fileaccess.store_string(content)
|
||||
|
||||
func get_punish_type(punishment:Punishment):
|
||||
match punishment.what_punishment:
|
||||
Punishment.punishment_types.BAN:
|
||||
return "BAN"
|
||||
Punishment.punishment_types.MUTE:
|
||||
return "MUTE"
|
||||
Punishment.punishment_types.WARN:
|
||||
return "WARN"
|
||||
|
||||
# DEPRECATED
|
||||
func Exportv1(Punishments:Array[Punishment],file:String) -> void:
|
||||
var fileaccess:FileAccess = FileAccess.open(file,FileAccess.WRITE)
|
||||
if !fileaccess:
|
||||
|
||||
Reference in New Issue
Block a user