Skip to content

Commit

Permalink
tidyup
Browse files Browse the repository at this point in the history
  • Loading branch information
harryob committed Feb 1, 2024
1 parent 7ff6042 commit d5add37
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 28 deletions.
1 change: 0 additions & 1 deletion code/modules/admin/player_panel/actions/punish.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
persistent_cid = player.last_known_cid
persistent_ip = player.last_known_ip


user.cmd_admin_do_stickyban(target.ckey, impacted_ckeys = list(target.ckey), impacted_cids = list(persistent_cid), impacted_ips = list(persistent_ip))

/datum/player_action/mute
Expand Down
34 changes: 7 additions & 27 deletions code/modules/admin/topic/topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -247,33 +247,6 @@
log_and_message_admins("[key_name_admin(owner)] has removed the permanent ban on [unban_player.ckey].")

else if(href_list["sticky"])
if(href_list["new_sticky"])
var/identifier = tgui_input_text(owner, "Name of the primary CKEY you are adding a stickyban to.", "BuildABan")
var/reason = tgui_input_text(owner, "What's the reason for the ban? This is shown internally, and not displayed in notes and ban messages.", "BuildABan")
var/message = tgui_input_text(owner, "What message should be given to the impacted users?", "BuildABan")

var/datum/entity/stickyban/new_sticky = SSstickyban.add_stickyban(identifier, reason, message, owner.player_data)

if(new_sticky)
var/list/impacted_ckeys = splittext(tgui_input_text(owner, "Which CKEYs should be impacted by this ban? Include the primary ckey, separated by semicolons.", "BuildABan", "player1;player2;player3"), ";")

for(var/ckey in impacted_ckeys)
SSstickyban.add_matched_ckey(new_sticky.id, ckey)

var/list/impacted_cids = splittext(tgui_input_text(owner, "Which CIDs should be impacted by this ban? Separate with semicolons.", "BuildABan", "12345678;87654321"), ";")
for(var/cid in impacted_cids)
SSstickyban.add_matched_cid(new_sticky.id, cid)

var/list/impacted_ips = splittext(tgui_input_text(owner, "Which IPs should be impacted by this ban? Separate with semicolons.", "BuildABan", "1.1.1.1;8.8.8.8"), ";")
for(var/ip in impacted_ips)
SSstickyban.add_matched_ip(new_sticky.id, ip)

log_admin("STICKYBAN: Identifier: [identifier] Reason: [reason] Message: [message] CKEYs: [english_list(impacted_ckeys)] IPs: [english_list(impacted_ips)] CIDs: [english_list(impacted_cids)]")

log_and_message_admins("[key_name_admin(owner)] has added a new stickyban with the identifier '[identifier]'.")

return

if(href_list["view_all_ckeys"])
var/list/datum/view_record/stickyban_matched_ckey/all_ckeys = DB_VIEW(/datum/view_record/stickyban_matched_ckey,
DB_COMP("linked_stickyban", DB_EQUALS, href_list["sticky"])
Expand Down Expand Up @@ -310,6 +283,13 @@
show_browser(owner, english_list(ips), "Stickyban IPs", "stickycips")
return

if(!check_rights_for(owner, R_BAN))
return

if(href_list["new_sticky"])
owner.cmd_admin_do_stickyban()
return

var/datum/entity/stickyban/sticky = DB_ENTITY(/datum/entity/stickyban, href_list["sticky"])
if(!sticky)
return
Expand Down

0 comments on commit d5add37

Please sign in to comment.