diff --git a/code/modules/admin/chat_commands.dm b/code/modules/admin/chat_commands.dm index bab74300f5..0ac743fa3f 100644 --- a/code/modules/admin/chat_commands.dm +++ b/code/modules/admin/chat_commands.dm @@ -19,7 +19,7 @@ /datum/tgs_chat_command/irccheck name = "check" - help_text = "Gets the playercount, gamemode, and address of the server" + help_text = "Gets the playercount, round info, and address of the server" var/last_irc_check = 0 /datum/tgs_chat_command/irccheck/Run(datum/tgs_chat_user/sender, params) @@ -28,8 +28,9 @@ 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]; Round [SSticker.HasRoundStarted() ? (SSticker.IsRoundInProgress() ? "Active" : "Finishing") : "Starting"] -- [server ? server : "[world.internet_address]:[world.port]"]" + return "[GLOB.round_id ? "Round #[GLOB.round_id]: " : ""][GLOB.clients.len] players on [SSmapping.config.map_name]; Round [SSticker.HasRoundStarted() ? (SSticker.IsRoundInProgress() ? "Active for [DisplayTimeText(world.time - SSticker.round_start_time, 1)]" : "Finishing") : "Starting"] -- [server ? server : "[world.internet_address]:[world.port]"]" //CIT CHANGE obfuscates the gamemode for TGS bot commands on discord by removing Mode:[GLOB.master_mode] + //sandstorm change, says how long the round has been on for /datum/tgs_chat_command/ahelp name = "ahelp" help_text = " |list>>" diff --git a/sandcode/code/modules/tgs/chat_commands.dm b/sandcode/code/modules/tgs/chat_commands.dm new file mode 100644 index 0000000000..f47b74107c --- /dev/null +++ b/sandcode/code/modules/tgs/chat_commands.dm @@ -0,0 +1,25 @@ +/datum/tgs_chat_command/who + name = "who" + help_text = "Lists everyone currently on the server" + admin_only = FALSE + +/datum/tgs_chat_command/who/Run(datum/tgs_chat_user/sender, params) + return tgswho() + +/datum/tgs_chat_command/awho + name = "awho" + help_text = "Lists everyone + sneaky admins currently on the server" + admin_only = TRUE + +/datum/tgs_chat_command/awho/Run(datum/tgs_chat_user/sender, params) + return tgsadminwho() + +/datum/tgs_chat_command/restart + name = "restart" + help_text = "Forces a restart on the server" + admin_only = TRUE + +/datum/tgs_chat_command/restart/Run(datum/tgs_chat_user/sender) + to_chat(world, "Server restart - Initialized by [sender.friendly_name]") + send2irc("Server", "[sender.friendly_name] forced a restart.") + return world.TgsEndProcess() diff --git a/sandcode/code/modules/tgs/custom_procs.dm b/sandcode/code/modules/tgs/custom_procs.dm new file mode 100644 index 0000000000..4d4cdbe8b2 --- /dev/null +++ b/sandcode/code/modules/tgs/custom_procs.dm @@ -0,0 +1,41 @@ +/proc/tgswho() + var/list/message = list("Players: \n") + var/list/player_keys = list() + for(var/player in GLOB.clients) + var/client/C = player + player_keys += "[C.holder.fakekey ? "[C.holder.fakekey]" : "[C]"]" + + for(var/verified_player in player_keys) + message += "- [verified_player]\n" + + return jointext(message, "") + +/proc/tgsadminwho() + var/list/full_message = list("Connected clients: \n") + var/list/message = list("Players: \n") + var/list/message_admin = list("Admins: \n") + var/list/player_keys = list() + var/list/admin_keys = list() + for(var/player in GLOB.clients) + var/client/C = player + player_keys += "[C]" + + for(var/verified_player in player_keys) + message += "- [verified_player]\n" + + for(var/adm in GLOB.admins) + var/client/C = adm + admin_keys += "[C.holder.fakekey ? "[C] disguised as [C.holder.fakekey]" : "[C]"]" + + for(var/verified_admin in admin_keys) + message_admin += "- [verified_admin]\n" + + if(message_admin) + var/finished_admin_message = "[jointext(message_admin, "")]" + full_message += finished_admin_message + + if(message) + var/finished_message = "[jointext(message, "")]" + full_message += finished_message + + return jointext(full_message, "") diff --git a/tgstation.dme b/tgstation.dme index 2b0eb304de..4b2733ef16 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3744,6 +3744,8 @@ #include "sandcode\code\modules\telescience\telepad.dm" #include "sandcode\code\modules\telescience\telesci.dm" #include "sandcode\code\modules\telescience\telesci_computer.dm" +#include "sandcode\code\modules\tgs\chat_commands.dm" +#include "sandcode\code\modules\tgs\custom_procs.dm" #include "sandcode\code\modules\uplink\uplink_items.dm" #include "sandcode\code\modules\uplink\uplink_roles.dm" #include "sandcode\tools\Redirector\textprocs.dm"