Ban/unban, note/unnote, kick to webhook

This commit is contained in:
Aronai Sieyes
2020-01-15 21:26:56 -05:00
parent 7169e2869c
commit fec8571d65
5 changed files with 20 additions and 5 deletions

View File

@@ -52,3 +52,16 @@
if(sender)
query_string += "&from=[url_encode(sender)]"
world.Export("[config.chat_webhook_url]?[query_string]")
/proc/admin_action_message(var/admin = "INVALID", var/user = "INVALID", var/action = "INVALID", var/reason = "INVALID", var/time = "INVALID")
if (!config.chat_webhook_url || !action)
return
spawn(0)
var/query_string = "type=adminaction"
query_string += "&key=[url_encode(config.chat_webhook_key)]"
query_string += "&admin=[url_encode(admin)]"
query_string += "&user=[url_encode(user)]"
query_string += "&action=[url_encode(action)]"
query_string += "&reason=[url_encode(reason)]"
query_string += "&time=[url_encode(time)]"
world.Export("[config.chat_webhook_url]?[query_string]")

View File

@@ -119,6 +119,7 @@ var/savefile/Banlist
Banlist["temp"] << temp
if (temp)
Banlist["minutes"] << bantimestamp
admin_action_message(bannedby, ckey, "banned", reason, temp ? minutes : -1) //VOREStation Add
return 1
/proc/RemoveBan(foldername)
@@ -147,7 +148,7 @@ var/savefile/Banlist
Banlist.cd = "/base"
Banlist.dir.Remove(A)
continue
admin_action_message(usr.key, key, "unbanned", "\[Unban\]", 0) //VOREStation Add
return 1
/proc/GetExp(minutes as num)

View File

@@ -154,7 +154,7 @@ var/savefile/Banlistjob
Banlistjob["temp"] << temp
if (temp)
Banlistjob["minutes"] << bantimestamp
admin_action_message(bannedby, ckey, "jobbanned-"+rank, reason, temp ? minutes : -1) //VOREStation Add
return 1
/proc/RemoveBanjob(foldername)
@@ -185,7 +185,7 @@ var/savefile/Banlistjob
Banlistjob.cd = "/base"
Banlistjob.dir.Remove(A)
continue
admin_action_message(usr.key, key, "unjobbanned-"+rank, "\[Unban\]", 0) //VOREStation Add
return 1
/proc/GetBanExpjob(minutes as num)

View File

@@ -105,7 +105,7 @@ datum/admins/proc/notes_gethtml(var/ckey)
message_admins("<font color='blue'>[key_name_admin(user)] has edited [key]'s notes.</font>")
log_admin("[key_name(user)] has edited [key]'s notes.")
admin_action_message(user.key, key, "added note on", note, 0) //VOREStation Add
del(info) // savefile, so NOT qdel
//Updating list of keys with notes on them
@@ -130,7 +130,7 @@ datum/admins/proc/notes_gethtml(var/ckey)
message_admins("<font color='blue'>[key_name_admin(usr)] deleted one of [key]'s notes.</font>")
log_admin("[key_name(usr)] deleted one of [key]'s notes.")
admin_action_message(usr.key, key, "deleted note on", "\[Note gone\]", 0) //VOREStation Add
qdel(info)
/proc/show_player_info_irc(var/key as text)

View File

@@ -827,6 +827,7 @@
log_admin("[key_name(usr)] booted [key_name(M)] for reason: '[reason]'.")
message_admins("<font color='blue'>[key_name_admin(usr)] booted [key_name_admin(M)] for reason '[reason]'.</font>", 1)
//M.client = null
admin_action_message(usr.key, M.key, "kicked", reason, 0) //VOREStation Add
qdel(M.client)
else if(href_list["removejobban"])