mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-01 12:31:32 +00:00
Done using this command sed -Ei 's/(\s*\S+)\s*\t+/\1 /g' code/**/*.dm We have countless examples in the codebase with this style gone wrong, and defines and such being on hideously different levels of indentation. Fixing this to keep the alignment involves tainting the blames of code your PR doesn't need to be touching at all. And ultimately, it's hideous. There are some files that this sed makes uglier. I can fix these when they are pointed out, but I believe this is ultimately for the greater good of readability. I'm more concerned with if any strings relied on this. Hi codeowners! Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
110 lines
4.2 KiB
Plaintext
110 lines
4.2 KiB
Plaintext
#define TGS_STATUS_THROTTLE 5
|
|
|
|
/datum/tgs_chat_command/tgsstatus
|
|
name = "status"
|
|
help_text = "Gets the admincount, playercount, gamemode, and true game mode of the server"
|
|
admin_only = TRUE
|
|
|
|
/datum/tgs_chat_command/tgsstatus/Run(datum/tgs_chat_user/sender, params)
|
|
var/list/adm = get_admin_counts()
|
|
var/list/allmins = adm["total"]
|
|
var/status = "Admins: [allmins.len] (Active: [english_list(adm["present"])] AFK: [english_list(adm["afk"])] Stealth: [english_list(adm["stealth"])] Skipped: [english_list(adm["noflags"])]). "
|
|
status += "Players: [GLOB.clients.len] (Active: [get_active_player_count(0,1,0)]). Mode: [SSticker.mode ? SSticker.mode.name : "Not started"]."
|
|
return status
|
|
|
|
/datum/tgs_chat_command/tgscheck
|
|
name = "check"
|
|
help_text = "Gets the playercount, gamemode, and address of the server"
|
|
|
|
/datum/tgs_chat_command/tgscheck/Run(datum/tgs_chat_user/sender, params)
|
|
var/server = CONFIG_GET(string/server)
|
|
return "[GLOB.round_id ? "Round #[GLOB.round_id]: " : ""][GLOB.clients.len] players on [SSmapping.config.map_name], Mode: [GLOB.master_mode]; Round [SSticker.HasRoundStarted() ? (SSticker.IsRoundInProgress() ? "Active" : "Finishing") : "Starting"] -- [server ? server : "[world.internet_address]:[world.port]"]"
|
|
|
|
/datum/tgs_chat_command/ahelp
|
|
name = "ahelp"
|
|
help_text = "<ckey|ticket #> <message|ticket <close|resolve|icissue|reject|reopen <ticket #>|list>>"
|
|
admin_only = TRUE
|
|
|
|
/datum/tgs_chat_command/ahelp/Run(datum/tgs_chat_user/sender, params)
|
|
var/list/all_params = splittext(params, " ")
|
|
if(all_params.len < 2)
|
|
return "Insufficient parameters"
|
|
var/target = all_params[1]
|
|
all_params.Cut(1, 2)
|
|
var/id = text2num(target)
|
|
if(id != null)
|
|
var/datum/admin_help/AH = GLOB.ahelp_tickets.TicketByID(id)
|
|
if(AH)
|
|
target = AH.initiator_ckey
|
|
else
|
|
return "Ticket #[id] not found!"
|
|
var/res = TgsPm(target, all_params.Join(" "), sender.friendly_name)
|
|
if(res != "Message Successful")
|
|
return res
|
|
|
|
/datum/tgs_chat_command/namecheck
|
|
name = "namecheck"
|
|
help_text = "Returns info on the specified target"
|
|
admin_only = TRUE
|
|
|
|
/datum/tgs_chat_command/namecheck/Run(datum/tgs_chat_user/sender, params)
|
|
params = trim(params)
|
|
if(!params)
|
|
return "Insufficient parameters"
|
|
log_admin("Chat Name Check: [sender.friendly_name] on [params]")
|
|
message_admins("Name checking [params] from [sender.friendly_name]")
|
|
return keywords_lookup(params, 1)
|
|
|
|
/datum/tgs_chat_command/adminwho
|
|
name = "adminwho"
|
|
help_text = "Lists administrators currently on the server"
|
|
admin_only = TRUE
|
|
|
|
/datum/tgs_chat_command/adminwho/Run(datum/tgs_chat_user/sender, params)
|
|
return tgsadminwho()
|
|
|
|
GLOBAL_LIST(round_end_notifiees)
|
|
|
|
/datum/tgs_chat_command/endnotify
|
|
name = "endnotify"
|
|
help_text = "Pings the invoker when the round ends"
|
|
admin_only = TRUE
|
|
|
|
/datum/tgs_chat_command/endnotify/Run(datum/tgs_chat_user/sender, params)
|
|
if(!SSticker.IsRoundInProgress() && SSticker.HasRoundStarted())
|
|
return "[sender.mention], the round has already ended!"
|
|
LAZYINITLIST(GLOB.round_end_notifiees)
|
|
GLOB.round_end_notifiees[sender.mention] = TRUE
|
|
return "I will notify [sender.mention] when the round ends."
|
|
|
|
/datum/tgs_chat_command/sdql
|
|
name = "sdql"
|
|
help_text = "Runs an SDQL query"
|
|
admin_only = TRUE
|
|
|
|
/datum/tgs_chat_command/sdql/Run(datum/tgs_chat_user/sender, params)
|
|
if(GLOB.AdminProcCaller)
|
|
return "Unable to run query, another admin proc call is in progress. Try again later."
|
|
GLOB.AdminProcCaller = "CHAT_[sender.friendly_name]" //_ won't show up in ckeys so it'll never match with a real admin
|
|
var/list/results = world.SDQL2_query(params, GLOB.AdminProcCaller, GLOB.AdminProcCaller)
|
|
GLOB.AdminProcCaller = null
|
|
if(!results)
|
|
return "Query produced no output"
|
|
var/list/text_res = results.Copy(1, 3)
|
|
var/list/refs = results.len > 3 ? results.Copy(4) : null
|
|
. = "[text_res.Join("\n")][refs ? "\nRefs: [refs.Join(" ")]" : ""]"
|
|
|
|
/datum/tgs_chat_command/reload_admins
|
|
name = "reload_admins"
|
|
help_text = "Forces the server to reload admins."
|
|
admin_only = TRUE
|
|
|
|
/datum/tgs_chat_command/reload_admins/Run(datum/tgs_chat_user/sender, params)
|
|
ReloadAsync()
|
|
log_admin("[sender.friendly_name] reloaded admins via chat command.")
|
|
return "Admins reloaded."
|
|
|
|
/datum/tgs_chat_command/reload_admins/proc/ReloadAsync()
|
|
set waitfor = FALSE
|
|
load_admins()
|