mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
* [ADMIN] Chganges auth backend to use the forums instead of the DB * Remove dbranks flag * I'm dumb * re-promotes myself * Re-use datums, rather than continually re-making them * Delete the datum instead, easier to manage * Moved to an inhertiance based system for permissions management * Proccall protection and logging * Linter * Update config * Fixes pp I hope * Two letters made it do a bad, I am sad * Clears forums admins when reloading * Adds db support * Update config * Re-enables forum integration * No editing the funny datum * Allow me to do the funny during the test merge * Didn't commit the changes * Copying and pasting hard * Sanitize ckey * Var is unnecessary * Small debug log to debug dono chat * Fixes wrong proc call * Move log, will be a bit much, but is fine because its temporary * Made better log message * Fixed reload admins, added debug log to json_decode that was erroring * Expanded forums integration error handling * Fully protects funny lists
142 lines
5.8 KiB
Plaintext
142 lines
5.8 KiB
Plaintext
/proc/show_air_status_to(turf/target, mob/user)
|
|
var/datum/gas_mixture/env = target.return_air()
|
|
var/burning = FALSE
|
|
if(isopenturf(target))
|
|
var/turf/open/T = target
|
|
if(T.active_hotspot)
|
|
burning = TRUE
|
|
|
|
var/list/lines = list(span_adminnotice("[AREACOORD(target)]: [env.return_temperature()] K ([env.return_temperature() - T0C] C), [env.return_pressure()] kPa[(burning)?(", <font color='red'>burning</font>"):(null)]"))
|
|
for(var/id in env.get_gases())
|
|
var/moles = env.get_moles(id)
|
|
if (abs(moles) >= 0.00001)
|
|
lines += "[GLOB.meta_gas_info[id][META_GAS_NAME]]: [moles] mol"
|
|
to_chat(usr, lines.Join("\n"))
|
|
|
|
/client/proc/air_status(turf/target)
|
|
set category = "Misc.Server Debug"
|
|
set name = "Display Air Status"
|
|
|
|
if(!isturf(target))
|
|
return
|
|
show_air_status_to(target, usr)
|
|
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Air Status") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
|
|
|
/client/proc/fix_next_move()
|
|
set category = "Misc.Server Debug"
|
|
set name = "Unfreeze Everyone"
|
|
var/largest_move_time = 0
|
|
var/largest_click_time = 0
|
|
var/mob/largest_move_mob = null
|
|
var/mob/largest_click_mob = null
|
|
for(var/mob/M in world)
|
|
if(!M.client)
|
|
continue
|
|
if(M.next_move >= largest_move_time)
|
|
largest_move_mob = M
|
|
if(M.next_move > world.time)
|
|
largest_move_time = M.next_move - world.time
|
|
else
|
|
largest_move_time = 1
|
|
if(M.next_click >= largest_click_time)
|
|
largest_click_mob = M
|
|
if(M.next_click > world.time)
|
|
largest_click_time = M.next_click - world.time
|
|
else
|
|
largest_click_time = 0
|
|
log_admin("DEBUG: [key_name(M)] next_move = [M.next_move] lastDblClick = [M.next_click] world.time = [world.time]")
|
|
M.next_move = 1
|
|
M.next_click = 0
|
|
message_admins("[ADMIN_LOOKUPFLW(largest_move_mob)] had the largest move delay with [largest_move_time] frames / [DisplayTimeText(largest_move_time)]!")
|
|
message_admins("[ADMIN_LOOKUPFLW(largest_click_mob)] had the largest click delay with [largest_click_time] frames / [DisplayTimeText(largest_click_time)]!")
|
|
message_admins("world.time = [world.time]")
|
|
SSblackbox.record_feedback("tally", "admin_verb", 1, "Unfreeze Everyone") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
|
return
|
|
|
|
/client/proc/radio_report()
|
|
set category = "Misc.Server Debug"
|
|
set name = "Radio report"
|
|
|
|
var/output = "<HTML><HEAD><meta charset='UTF-8'></HEAD><BODY><b>Radio Report</b><hr>"
|
|
for (var/fq in SSradio.frequencies)
|
|
output += "<b>Freq: [fq]</b><br>"
|
|
var/datum/radio_frequency/fqs = SSradio.frequencies[fq]
|
|
if (!fqs)
|
|
output += " <b>ERROR</b><br>"
|
|
continue
|
|
for (var/filter in fqs.devices)
|
|
var/list/f = fqs.devices[filter]
|
|
if (!f)
|
|
output += " [filter]: ERROR<br>"
|
|
continue
|
|
output += " [filter]: [f.len]<br>"
|
|
for (var/device in f)
|
|
if (istype(device, /atom))
|
|
var/atom/A = device
|
|
output += " [device] ([AREACOORD(A)])<br>"
|
|
else
|
|
output += " [device]<br>"
|
|
|
|
output += "</BODY></HTML>"
|
|
usr << browse(output,"window=radioreport")
|
|
SSblackbox.record_feedback("tally", "admin_verb", 1, "Show Radio Report") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
|
|
|
/client/proc/reload_admins()
|
|
set name = "Reload Admins"
|
|
set category = "Server"
|
|
|
|
if(!src.holder)
|
|
return
|
|
|
|
var/confirm = alert(src, "Are you sure you want to reload all admins?", "Confirm", "Yes", "No")
|
|
if(confirm !="Yes")
|
|
return
|
|
|
|
GLOB.permissions.start()
|
|
SSblackbox.record_feedback("tally", "admin_verb", 1, "Reload All Admins") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
|
message_admins("[key_name_admin(usr)] manually reloaded admins")
|
|
|
|
/client/proc/reload_mentors()
|
|
set name = "Reload Mentors"
|
|
set category = "Server"
|
|
|
|
if(!src.holder)
|
|
return
|
|
|
|
var/confirm = alert(src, "Are you sure you want to reload all mentors?", "Confirm", "Yes", "No")
|
|
if(confirm !="Yes")
|
|
return
|
|
|
|
load_mentors()
|
|
SSblackbox.record_feedback("tally", "admin_verb", 1, "Reload All Mentors") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
|
message_admins("[key_name_admin(usr)] manually reloaded mentors")
|
|
|
|
|
|
/client/proc/toggle_cdn()
|
|
set name = "Toggle CDN"
|
|
set category = "Server"
|
|
var/static/admin_disabled_cdn_transport = null
|
|
if (alert(usr, "Are you sure you want to toggle the CDN asset transport?", "Confirm", "Yes", "No") != "Yes")
|
|
return
|
|
var/current_transport = CONFIG_GET(string/asset_transport)
|
|
if (!current_transport || current_transport == "simple")
|
|
if (admin_disabled_cdn_transport)
|
|
CONFIG_SET(string/asset_transport, admin_disabled_cdn_transport)
|
|
admin_disabled_cdn_transport = null
|
|
SSassets.OnConfigLoad()
|
|
message_admins("[key_name_admin(usr)] re-enabled the CDN asset transport")
|
|
log_admin("[key_name(usr)] re-enabled the CDN asset transport")
|
|
else
|
|
to_chat(usr, span_adminnotice("The CDN is not enabled!"))
|
|
if (alert(usr, "The CDN asset transport is not enabled! If you having issues with assets you can also try disabling filename mutations.", "The CDN asset transport is not enabled!", "Try disabling filename mutations", "Nevermind") == "Try disabling filename mutations")
|
|
SSassets.transport.dont_mutate_filenames = !SSassets.transport.dont_mutate_filenames
|
|
message_admins("[key_name_admin(usr)] [(SSassets.transport.dont_mutate_filenames ? "disabled" : "re-enabled")] asset filename transforms")
|
|
log_admin("[key_name(usr)] [(SSassets.transport.dont_mutate_filenames ? "disabled" : "re-enabled")] asset filename transforms")
|
|
else
|
|
admin_disabled_cdn_transport = current_transport
|
|
CONFIG_SET(string/asset_transport, "simple")
|
|
SSassets.OnConfigLoad()
|
|
SSassets.transport.dont_mutate_filenames = TRUE
|
|
message_admins("[key_name_admin(usr)] disabled the CDN asset transport")
|
|
log_admin("[key_name(usr)] disabled the CDN asset transport")
|