Files
Bubberstation/code/modules/admin/chat_commands.dm
Jordan Brown 62f788fbc6 Server tools API v3.1 (#31000)
* New API for service communication

* Safer this way

* Gives the game the ability to kill itself

* tick_lag

* Sanity check

* Updates comment

* Formalization of the server tools API

* Fixes, finishes, and cleanup

* Remove unecessary scoping

* Compile fixes

* Didn't Ctrl+S

* Reimplement chat commands

* Fixup

* Required parameters

* Fax

* Testing

* Fix ON_TOPIC

* The more defines the more better

* That's bass ackwards

* Fix tgs2

* Fuck it, call him pichael

* Do this

* No, we only use the modern methods now

* Remove tgs2 relay support

* Remove kebab

* Kill kill kill

* This is back baby

* Missed a GLOB

* Remove DownloadPRDetails()

* Cache custom commands by name

* Adds "notify" chat command

* Use the official API

* Fix API misuse

* Readme licensing memes

* Fix API

* Moves chat new game announcement to when the API is confirmed compatible

* Add TGS3.json

* Fix the input options

* Removes notify command
2017-09-29 16:19:50 +13:00

64 lines
2.5 KiB
Plaintext

#define IRC_STATUS_THROTTLE 5
/datum/server_tools_command/ircstatus
name = "status"
help_text = "Gets the admincount, playercount, gamemode, and true game mode of the server"
admin_only = TRUE
var/static/last_irc_status = 0
/datum/server_tools_command/ircstatus/Run(sender, params)
var/rtod = REALTIMEOFDAY
if(rtod - last_irc_status < IRC_STATUS_THROTTLE)
return
last_irc_status = rtod
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/server_tools_command/irccheck
name = "check"
help_text = "Gets the playercount, gamemode, and address of the server"
admin_only = TRUE
var/static/last_irc_check = 0
/datum/server_tools_command/irccheck/Run(sender, params)
var/rtod = REALTIMEOFDAY
if(rtod - last_irc_check < IRC_STATUS_THROTTLE)
return
last_irc_check = rtod
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/server_tools_command/ahelp
name = "ahelp"
help_text = "<ckey> <message|ticket <close|resolve|icissue|reject|reopen <ticket #>|list>>"
required_parameters = 2
admin_only = TRUE
/datum/server_tools_command/ahelp/Run(sender, params)
var/list/all_params = splittext(params, " ")
var/target = all_params[1]
all_params.Cut(1, 2)
return IrcPm(target, all_params.Join(" "), sender)
/datum/server_tools_command/namecheck
name = "namecheck"
help_text = "Returns info on the specified target"
required_parameters = 1
admin_only = TRUE
/datum/server_tools_command/namecheck/Run(sender, params)
log_admin("IRC Name Check: [sender] on [params]")
message_admins("IRC name checking on [params] from [sender]")
return keywords_lookup(params, 1)
/datum/server_tools_command/adminwho
name = "adminwho"
help_text = "Lists administrators currently on the server"
admin_only = TRUE
/datum/server_tools_command/adminwho/Run(sender, params)
return ircadminwho()