mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 06:29:23 +01:00
[MIRROR] Refactors most spans into span procs (#6315)
* Refactors most spans into span procs * AA * a * AAAAAAAAAAAAAAAAAAAAAA * Update species.dm Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com> Co-authored-by: Gandalf <jzo123@hotmail.com>
This commit is contained in:
co-authored by
Watermelon914
Gandalf
parent
cd5dba4fbd
commit
7d1d0e1fad
@@ -377,7 +377,7 @@
|
||||
if(!check_rights(R_BAN))
|
||||
return
|
||||
if(!SSdbcore.Connect())
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>", confidential = TRUE)
|
||||
to_chat(usr, span_danger("Failed to establish database connection."), confidential = TRUE)
|
||||
return
|
||||
var/list/error_state = list()
|
||||
var/player_key
|
||||
@@ -493,7 +493,7 @@
|
||||
else
|
||||
error_state += "No ban type was selected."
|
||||
if(error_state.len)
|
||||
to_chat(usr, "<span class='danger'>Ban not [edit_id ? "edited" : "created"] because the following errors were present:\n[error_state.Join("\n")]</span>", confidential = TRUE)
|
||||
to_chat(usr, span_danger("Ban not [edit_id ? "edited" : "created"] because the following errors were present:\n[error_state.Join("\n")]"), confidential = TRUE)
|
||||
return
|
||||
if(edit_id)
|
||||
edit_ban(edit_id, player_key, ip_check, player_ip, cid_check, player_cid, use_last_connection, applies_to_admins, duration, interval, reason, global_ban, mirror_edit, old_key, old_ip, old_cid, old_applies, page, admin_key, changes) // SKYRAT EDIT CHANGE - MULTISERVER
|
||||
@@ -504,7 +504,7 @@
|
||||
if(!check_rights(R_BAN))
|
||||
return
|
||||
if(!SSdbcore.Connect())
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>", confidential = TRUE)
|
||||
to_chat(usr, span_danger("Failed to establish database connection."), confidential = TRUE)
|
||||
return
|
||||
var/player_ckey = ckey(player_key)
|
||||
if(player_ckey)
|
||||
@@ -551,7 +551,7 @@
|
||||
if(R_EVERYTHING && !(R_EVERYTHING & rank.can_edit_rights)) //edit rights are a more effective way to check hierarchical rank since many non-headmins have R_PERMISSIONS now
|
||||
max_adminbans = MAX_ADMINBANS_PER_HEADMIN
|
||||
if(adminban_count >= max_adminbans)
|
||||
to_chat(usr, "<span class='danger'>You've already logged [max_adminbans] admin ban(s) or more. Do not abuse this function!</span>", confidential = TRUE)
|
||||
to_chat(usr, span_danger("You've already logged [max_adminbans] admin ban(s) or more. Do not abuse this function!"), confidential = TRUE)
|
||||
qdel(query_check_adminban_count)
|
||||
return
|
||||
qdel(query_check_adminban_count)
|
||||
@@ -645,7 +645,7 @@
|
||||
if(!check_rights(R_BAN))
|
||||
return
|
||||
if(!SSdbcore.Connect())
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>", confidential = TRUE)
|
||||
to_chat(usr, span_danger("Failed to establish database connection."), confidential = TRUE)
|
||||
return
|
||||
var/datum/browser/unban_panel = new(usr, "unbanpanel", "Unbanning Panel", 850, 600)
|
||||
unban_panel.add_stylesheet("unbanpanelcss", 'html/admin/unbanpanel.css')
|
||||
@@ -787,7 +787,7 @@
|
||||
if(!check_rights(R_BAN))
|
||||
return
|
||||
if(!SSdbcore.Connect())
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>", confidential = TRUE)
|
||||
to_chat(usr, span_danger("Failed to establish database connection."), confidential = TRUE)
|
||||
return
|
||||
var/target = ban_target_string(player_key, player_ip, player_cid)
|
||||
if(tgui_alert(usr, "Please confirm unban of [target] from [role].", "Unban confirmation", list("Yes", "No")) == "No")
|
||||
@@ -812,18 +812,18 @@
|
||||
var/client/C = GLOB.directory[player_key]
|
||||
if(C)
|
||||
build_ban_cache(C)
|
||||
to_chat(C, "<span class='boldannounce'>[usr.client.key] has removed a ban from [role] for your key.</span>", confidential = TRUE)
|
||||
to_chat(C, span_boldannounce("[usr.client.key] has removed a ban from [role] for your key."), confidential = TRUE)
|
||||
for(var/client/i in GLOB.clients - C)
|
||||
if(i.address == player_ip || i.computer_id == player_cid)
|
||||
build_ban_cache(i)
|
||||
to_chat(i, "<span class='boldannounce'>[usr.client.key] has removed a ban from [role] for your IP or CID.</span>", confidential = TRUE)
|
||||
to_chat(i, span_boldannounce("[usr.client.key] has removed a ban from [role] for your IP or CID."), confidential = TRUE)
|
||||
unban_panel(player_key, admin_key, player_ip, player_cid, page)
|
||||
|
||||
/datum/admins/proc/edit_ban(ban_id, player_key, ip_check, player_ip, cid_check, player_cid, use_last_connection, applies_to_admins, duration, interval, reason, global_ban, mirror_edit, old_key, old_ip, old_cid, old_applies, admin_key, page, list/changes) // SKYRAT EDIT CHANGE - MULTISERVER
|
||||
if(!check_rights(R_BAN))
|
||||
return
|
||||
if(!SSdbcore.Connect())
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>", confidential = TRUE)
|
||||
to_chat(usr, span_danger("Failed to establish database connection."), confidential = TRUE)
|
||||
return
|
||||
var/player_ckey = ckey(player_key)
|
||||
var/bantime
|
||||
@@ -876,7 +876,7 @@
|
||||
if(R_EVERYTHING && !(R_EVERYTHING & rank.can_edit_rights)) //edit rights are a more effective way to check hierarchical rank since many non-headmins have R_PERMISSIONS now
|
||||
max_adminbans = MAX_ADMINBANS_PER_HEADMIN
|
||||
if(adminban_count >= max_adminbans)
|
||||
to_chat(usr, "<span class='danger'>You've already logged [max_adminbans] admin ban(s) or more. Do not abuse this function!</span>", confidential = TRUE)
|
||||
to_chat(usr, span_danger("You've already logged [max_adminbans] admin ban(s) or more. Do not abuse this function!"), confidential = TRUE)
|
||||
qdel(query_check_adminban_count)
|
||||
return
|
||||
qdel(query_check_adminban_count)
|
||||
@@ -946,18 +946,18 @@
|
||||
var/client/C = GLOB.directory[old_key]
|
||||
if(C)
|
||||
build_ban_cache(C)
|
||||
to_chat(C, "<span class='boldannounce'>[usr.client.key] has edited the [changes_keys_text] of a ban for your key.</span>", confidential = TRUE)
|
||||
to_chat(C, span_boldannounce("[usr.client.key] has edited the [changes_keys_text] of a ban for your key."), confidential = TRUE)
|
||||
for(var/client/i in GLOB.clients - C)
|
||||
if(i.address == old_ip || i.computer_id == old_cid)
|
||||
build_ban_cache(i)
|
||||
to_chat(i, "<span class='boldannounce'>[usr.client.key] has edited the [changes_keys_text] of a ban for your IP or CID.</span>", confidential = TRUE)
|
||||
to_chat(i, span_boldannounce("[usr.client.key] has edited the [changes_keys_text] of a ban for your IP or CID."), confidential = TRUE)
|
||||
unban_panel(player_key, null, null, null, page)
|
||||
|
||||
/datum/admins/proc/ban_log(ban_id)
|
||||
if(!check_rights(R_BAN))
|
||||
return
|
||||
if(!SSdbcore.Connect())
|
||||
to_chat(usr, "<span class='danger'>Failed to establish database connection.</span>", confidential = TRUE)
|
||||
to_chat(usr, span_danger("Failed to establish database connection."), confidential = TRUE)
|
||||
return
|
||||
var/datum/db_query/query_get_ban_edits = SSdbcore.NewQuery({"
|
||||
SELECT edits FROM [format_table_name("ban")] WHERE id = :ban_id
|
||||
|
||||
Reference in New Issue
Block a user