fix banlist runtime not creating notes for server bans (#40458)

This commit is contained in:
Jordie
2018-09-25 19:26:21 +10:00
committed by yogstation13-bot
parent 6bf6bbd06a
commit 11de9a3854
2 changed files with 7 additions and 1 deletions

View File

@@ -101,7 +101,8 @@ GLOBAL_PROTECT(Banlist)
/proc/AddBan(key, computerid, reason, bannedby, temp, minutes, address) /proc/AddBan(key, computerid, reason, bannedby, temp, minutes, address)
if(!CONFIG_GET(flag/ban_legacy_system))
return
var/bantimestamp var/bantimestamp
var/ban_ckey = ckey(key) var/ban_ckey = ckey(key)
if (temp) if (temp)
@@ -124,12 +125,15 @@ GLOBAL_PROTECT(Banlist)
WRITE_FILE(GLOB.Banlist["roundid"], GLOB.round_id) WRITE_FILE(GLOB.Banlist["roundid"], GLOB.round_id)
if (temp) if (temp)
WRITE_FILE(GLOB.Banlist["minutes"], bantimestamp) WRITE_FILE(GLOB.Banlist["minutes"], bantimestamp)
<<<<<<< HEAD
if(!temp) if(!temp)
//create_message("note", key, bannedby, "Permanently banned - [reason]", null, null, 0, 0, null, 0, 0) //yogs start //create_message("note", key, bannedby, "Permanently banned - [reason]", null, null, 0, 0, null, 0, 0) //yogs start
create_message("note", key, bannedby, "Permanently banned - [reason]", null, null, 0, 0, null, 0) create_message("note", key, bannedby, "Permanently banned - [reason]", null, null, 0, 0, null, 0)
else else
//create_message("note", key, bannedby, "Banned for [minutes] minutes - [reason]", null, null, 0, 0, null, 0, 0) //create_message("note", key, bannedby, "Banned for [minutes] minutes - [reason]", null, null, 0, 0, null, 0, 0)
create_message("note", key, bannedby, "Banned for [minutes] minutes - [reason]", null, null, 0, 0, null, 0) //yogs end create_message("note", key, bannedby, "Banned for [minutes] minutes - [reason]", null, null, 0, 0, null, 0) //yogs end
=======
>>>>>>> 6bc51275fb... fix banlist runtime not creating notes for server bans (#40458)
return 1 return 1
/proc/RemoveBan(foldername) /proc/RemoveBan(foldername)

View File

@@ -1314,6 +1314,7 @@
to_chat(usr, "<span class='danger'>Failed to apply ban.</span>") to_chat(usr, "<span class='danger'>Failed to apply ban.</span>")
return return
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 1, mins) AddBan(M.ckey, M.computer_id, reason, usr.ckey, 1, mins)
create_message("note", ckey(M.ckey), usr.ckey, "Banned for [mins] minutes - [reason]", null, null, 0, 0, null, 0, 0)
ban_unban_log_save("[key_name(usr)] has banned [key_name(M)]. - Reason: [reason] - This will be removed in [mins] minutes.") ban_unban_log_save("[key_name(usr)] has banned [key_name(M)]. - Reason: [reason] - This will be removed in [mins] minutes.")
to_chat(M, "<span class='boldannounce'><BIG>You have been banned by [usr.client.key].\nReason: [reason]</BIG></span>") to_chat(M, "<span class='boldannounce'><BIG>You have been banned by [usr.client.key].\nReason: [reason]</BIG></span>")
to_chat(M, "<span class='danger'>This is a temporary ban, it will be removed in [mins] minutes. The round ID is [GLOB.round_id].</span>") to_chat(M, "<span class='danger'>This is a temporary ban, it will be removed in [mins] minutes. The round ID is [GLOB.round_id].</span>")
@@ -1340,6 +1341,7 @@
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0, M.lastKnownIP) AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0, M.lastKnownIP)
if("No") if("No")
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0) AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0)
create_message("note", ckey(M.ckey), usr.ckey, "Permanently banned - [reason]", null, null, 0, 0, null, 0, 0)
to_chat(M, "<span class='boldannounce'><BIG>You have been banned by [usr.client.key].\nReason: [reason]</BIG></span>") to_chat(M, "<span class='boldannounce'><BIG>You have been banned by [usr.client.key].\nReason: [reason]</BIG></span>")
to_chat(M, "<span class='danger'>This is a permanent ban. The round ID is [GLOB.round_id].</span>") to_chat(M, "<span class='danger'>This is a permanent ban. The round ID is [GLOB.round_id].</span>")
var/bran = CONFIG_GET(string/banappeals) var/bran = CONFIG_GET(string/banappeals)