diff --git a/code/__DEFINES/server_tools.dm b/code/__DEFINES/server_tools.dm
new file mode 100644
index 0000000000..f8d1c316d8
--- /dev/null
+++ b/code/__DEFINES/server_tools.dm
@@ -0,0 +1,27 @@
+#define REBOOT_MODE_NORMAL 0
+#define REBOOT_MODE_HARD 1
+#define REBOOT_MODE_SHUTDOWN 2
+
+#define IRC_STATUS_THROTTLE 50
+
+//keep these in sync with TGS3
+#define SERVICE_WORLD_PARAM "server_service"
+#define SERVICE_PR_TEST_JSON "..\\..\\prtestjob.json"
+
+#define SERVICE_CMD_HARD_REBOOT "hard_reboot"
+#define SERVICE_CMD_GRACEFUL_SHUTDOWN "graceful_shutdown"
+#define SERVICE_CMD_WORLD_ANNOUNCE "world_announce"
+#define SERVICE_CMD_IRC_STATUS "irc_status"
+#define SERVICE_CMD_ADMIN_MSG "adminmsg"
+#define SERVICE_CMD_NAME_CHECK "namecheck"
+#define SERVICE_CMD_ADMIN_WHO "adminwho"
+
+//#define SERVICE_CMD_PARAM_KEY //defined in __compile_options.dm
+#define SERVICE_CMD_PARAM_COMMAND "command"
+#define SERVICE_CMD_PARAM_MESSAGE "message"
+#define SERVICE_CMD_PARAM_TARGET "target"
+#define SERVICE_CMD_PARAM_SENDER "sender"
+
+#define SERVICE_REQUEST_KILL_PROCESS "killme"
+#define SERVICE_REQUEST_IRC_BROADCAST "irc"
+#define SERVICE_REQUEST_IRC_ADMIN_CHANNEL_MESSAGE "send2irc"
diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm
index 28a0dc7889..966a3a519a 100644
--- a/code/__HELPERS/unsorted.dm
+++ b/code/__HELPERS/unsorted.dm
@@ -1344,7 +1344,7 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
//kevinz000 if you touch this I will hunt you down
GLOBAL_VAR_INIT(valid_HTTPSGet, FALSE)
GLOBAL_PROTECT(valid_HTTPSGet)
-/proc/HTTPSGet(url)
+/proc/HTTPSGet(url) //tgs2 support
if(findtext(url, "\""))
GLOB.valid_HTTPSGet = FALSE
diff --git a/code/_compile_options.dm b/code/_compile_options.dm
index 85a353371e..d98be1311e 100644
--- a/code/_compile_options.dm
+++ b/code/_compile_options.dm
@@ -35,7 +35,7 @@
//MINOR TWEAKS/MISC
#define AGE_MIN 17 //youngest a character can be
#define AGE_MAX 85 //oldest a character can be
-#define WIZARD_AGE_MIN 30 //youngest a wizard can be
+#define WIZARD_AGE_MIN 30 //youngest a wizard can be
#define SHOES_SLOWDOWN 0 //How much shoes slow you down by default. Negative values speed you up
#define POCKET_STRIP_DELAY 40 //time taken (in deciseconds) to search somebody's pockets
#define DOOR_CRUSH_DAMAGE 15 //the amount of damage that airlocks deal when they crush you
@@ -62,14 +62,12 @@
#endif
//Update this whenever you need to take advantage of more recent byond features
-#define MIN_COMPILER_VERSION 511
+#define MIN_COMPILER_VERSION 511
#if DM_VERSION < MIN_COMPILER_VERSION
//Don't forget to update this part
#error Your version of BYOND is too out-of-date to compile this project. Go to byond.com/download and update.
-#error You need version 511 or higher
+#error You need version 511 or higher
#endif
-#ifndef SERVERTOOLS
-#define SERVERTOOLS 0
-#endif
+#define SERVICE_CMD_PARAM_KEY "serviceCommsKey"
diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm
index f36b606b30..714979e24c 100644
--- a/code/controllers/configuration.dm
+++ b/code/controllers/configuration.dm
@@ -263,6 +263,8 @@
var/mice_roundstart = 10 // how many wire chewing rodents spawn at roundstart.
+ var/irc_announce_new_game = FALSE
+
/datum/configuration/New()
gamemode_cache = typecacheof(/datum/game_mode,TRUE)
for(var/T in gamemode_cache)
@@ -427,7 +429,7 @@
popup_admin_pm = 1
if("allow_holidays")
allow_holidays = 1
- if("useircbot")
+ if("useircbot") //tgs2 support
useircbot = 1
if("ticklag")
var/ticklag = text2num(value)
@@ -540,6 +542,8 @@
error_silence_time = text2num(value)
if("error_msg_delay")
error_msg_delay = text2num(value)
+ if("irc_announce_new_game")
+ irc_announce_new_game = TRUE
else
GLOB.config_error_log << "Unknown setting in configuration: '[name]'"
diff --git a/code/datums/helper_datums/getrev.dm b/code/datums/helper_datums/getrev.dm
index 2e95629d30..ffb5627c6f 100644
--- a/code/datums/helper_datums/getrev.dm
+++ b/code/datums/helper_datums/getrev.dm
@@ -1,37 +1,44 @@
/datum/getrev
- var/originmastercommit
+ var/originmastercommit
var/commit
var/list/testmerge = list()
- var/has_pr_details = FALSE //example data in a testmerge entry when this is true: https://api.github.com/repositories/3234987/pulls/22586
+ var/has_pr_details = FALSE //tgs2 support
var/date
/datum/getrev/New()
- if(SERVERTOOLS && fexists("..\\prtestjob.lk"))
+ if(fexists(SERVICE_PR_TEST_JSON))
+ testmerge = json_decode(file2text(SERVICE_PR_TEST_JSON))
+ else if(!world.RunningService() && fexists("../prtestjob.lk")) //tgs2 support
var/list/tmp = world.file2list("..\\prtestjob.lk")
for(var/I in tmp)
if(I)
testmerge |= I
-
+
log_world("Running /tg/ revision:")
- var/list/logs = world.file2list(".git/logs/HEAD")
- if(logs)
- logs = splittext(logs[logs.len - 1], " ")
- date = unix2date(text2num(logs[5]))
- commit = logs[2]
- log_world("[date]")
- logs = world.file2list(".git/logs/refs/remotes/origin/master")
- if(logs)
- originmastercommit = splittext(logs[logs.len - 1], " ")[2]
-
+ var/list/logs = world.file2list(".git/logs/HEAD")
+ if(logs)
+ logs = splittext(logs[logs.len - 1], " ")
+ date = unix2date(text2num(logs[5]))
+ commit = logs[2]
+ log_world("[date]")
+ logs = world.file2list(".git/logs/refs/remotes/origin/master")
+ if(logs)
+ originmastercommit = splittext(logs[logs.len - 1], " ")[2]
+
if(testmerge.len)
log_world(commit)
for(var/line in testmerge)
if(line)
- log_world("Test merge active of PR #[line]")
- SSblackbox.add_details("testmerged_prs","[line]")
- log_world("Based off origin/master commit [originmastercommit]")
+ if(world.RunningService())
+ var/tmcommit = testmerge[line]["commit"]
+ log_world("Test merge active of PR #[line] commit [tmcommit]")
+ SSblackbox.add_details("testmerged_prs","[line]|[tmcommit]")
+ else //tgs2 support
+ log_world("Test merge active of PR #[line]")
+ SSblackbox.add_details("testmerged_prs","[line]")
+ log_world("Based off origin/master commit [originmastercommit]")
else
- log_world(originmastercommit)
+ log_world(originmastercommit)
/datum/getrev/proc/DownloadPRDetails()
if(!config.githubrepoid)
@@ -66,8 +73,11 @@
return ""
. = header ? "The following pull requests are currently test merged:
" : ""
for(var/line in testmerge)
- var/details = ""
- if(has_pr_details)
+ var/cm = testmerge[line]["commit"]
+ var/details
+ if(world.RunningService())
+ details = ": '" + html_encode(testmerge[line]["title"]) + "' by " + html_encode(testmerge[line]["author"]) + " at commit " + html_encode(copytext(cm, 1, min(length(cm), 7)))
+ else if(has_pr_details) //tgs2 support
details = ": '" + html_encode(testmerge[line]["title"]) + "' by " + html_encode(testmerge[line]["user"]["login"])
. += "#[line][details]
"
@@ -76,14 +86,14 @@
set name = "Show Server Revision"
set desc = "Check the current server code revision"
- if(GLOB.revdata.originmastercommit)
+ if(GLOB.revdata.originmastercommit)
to_chat(src, "Server revision compiled on: [GLOB.revdata.date]")
- var/prefix = ""
+ var/prefix = ""
if(GLOB.revdata.testmerge.len)
to_chat(src, GLOB.revdata.GetTestMergeInfo())
- prefix = "Based off origin/master commit: "
- var/pc = GLOB.revdata.originmastercommit
- to_chat(src, "[prefix][copytext(pc, 1, min(length(pc), 7))]")
+ prefix = "Based off origin/master commit: "
+ var/pc = GLOB.revdata.originmastercommit
+ to_chat(src, "[prefix][copytext(pc, 1, min(length(pc), 7))]")
else
to_chat(src, "Revision unknown")
to_chat(src, "Current Infomational Settings:")
@@ -94,7 +104,7 @@
to_chat(src, "Enforce Continuous Rounds: [config.continuous.len] of [config.modes.len] roundtypes")
to_chat(src, "Allow Midround Antagonists: [config.midround_antag.len] of [config.modes.len] roundtypes")
if(config.show_game_type_odds)
- if(SSticker.IsRoundInProgress())
+ if(SSticker.IsRoundInProgress())
var/prob_sum = 0
var/current_odds_differ = FALSE
var/list/probs = list()
@@ -110,13 +120,13 @@
probs[ctag] = 1
prob_sum += config.probabilities[ctag]
if(current_odds_differ)
- to_chat(src, "Game Mode Odds for current round:")
+ to_chat(src, "Game Mode Odds for current round:")
for(var/ctag in probs)
if(config.probabilities[ctag] > 0)
var/percentage = round(config.probabilities[ctag] / prob_sum * 100, 0.1)
to_chat(src, "[ctag] [percentage]%")
- to_chat(src, "All Game Mode Odds:")
+ to_chat(src, "All Game Mode Odds:")
var/sum = 0
for(var/ctag in config.probabilities)
sum += config.probabilities[ctag]
diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm
index cca58f90f3..a1f98cb89f 100644
--- a/code/modules/admin/admin.dm
+++ b/code/modules/admin/admin.dm
@@ -421,6 +421,8 @@
return
var/list/options = list("Regular Restart", "Hard Restart (No Delay/Feeback Reason)", "Hardest Restart (No actions, just reboot)")
+ if(world.RunningService())
+ options += "Service Restart (Force restart DD)";
var result = input(usr, "Select reboot method", "World Reboot", options[1]) as null|anything in options
if(result)
SSblackbox.add_details("admin_verb","Reboot World") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -433,6 +435,9 @@
if("Hardest Restart (No actions, just reboot)")
world.Reboot(fast_track = TRUE)
+ if("Service Restart (Force restart DD)")
+ GLOB.reboot_mode = REBOOT_MODE_HARD
+ world.ServiceReboot()
/datum/admins/proc/end_round()
set category = "Server"
diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm
index 8e9abff81c..ecd8209044 100644
--- a/code/modules/admin/verbs/adminhelp.dm
+++ b/code/modules/admin/verbs/adminhelp.dm
@@ -183,7 +183,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
to_chat(C, "PM to-Admins: [name]")
//send it to irc if nobody is on and tell us how many were on
- var/admin_number_present = send2irc_adminless_only(initiator_ckey, name)
+ var/admin_number_present = send2irc_adminless_only("#[id] [initiator_ckey]", name)
log_admin_private("Ticket #[id]: [key_name(initiator)]: [name] - heard by [admin_number_present] non-AFK admins who have +BAN.")
if(admin_number_present <= 0)
to_chat(C, "No active admins are online, your adminhelp was sent to the admin irc.")
@@ -431,9 +431,9 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
/obj/effect/statclick/ahelp
var/datum/admin_help/ahelp_datum
-/obj/effect/statclick/ahelp/Initialize(mapload, datum/admin_help/AH)
+/obj/effect/statclick/ahelp/Initialize(mapload, datum/admin_help/AH)
ahelp_datum = AH
- . = ..()
+ . = ..()
/obj/effect/statclick/ahelp/update()
return ..(ahelp_datum.name)
@@ -479,7 +479,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
current_ticket.MessageNoRecipient(msg)
current_ticket.TimeoutVerb()
return
- else
+ else
to_chat(usr, "Ticket not found, creating new one...")
else
current_ticket.AddInteraction("[key_name_admin(usr)] opened a new ticket.")
@@ -567,9 +567,10 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
/proc/send2irc(msg,msg2)
- if(config.useircbot)
+ if(world.RunningService())
+ world.ExportService("[SERVICE_REQUEST_IRC_ADMIN_CHANNEL_MESSAGE] [msg] | [msg2]")
+ else if(config.useircbot)
shell("python nudge.py [msg] [msg2]")
- return
/proc/send2otherserver(source,msg,type = "Ahelp")
if(config.cross_allowed)
@@ -591,7 +592,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
admin_keys += "[C][C.holder.fakekey ? "(Stealth)" : ""][C.is_afk() ? "(AFK)" : ""]"
for(var/admin in admin_keys)
- if(LAZYLEN(message) > 1)
+ if(LAZYLEN(message) > 1)
message += ", [admin]"
else
message += "[admin]"
diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm
index eb3e24265c..fa906640de 100644
--- a/code/modules/admin/verbs/adminpm.dm
+++ b/code/modules/admin/verbs/adminpm.dm
@@ -11,7 +11,7 @@
if( !ismob(M) || !M.client )
return
cmd_admin_pm(M.client,null)
- SSblackbox.add_details("admin_verb","Admin PM Mob") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+ SSblackbox.add_details("admin_verb","Admin PM Mob") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
//shows a list of clients we could send PMs to, then forwards our choice to cmd_admin_pm
/client/proc/cmd_admin_pm_panel()
@@ -33,7 +33,7 @@
targets["(No Mob) - [T]"] = T
var/target = input(src,"To whom shall we send a message?","Admin PM",null) as null|anything in sortList(targets)
cmd_admin_pm(targets[target],null)
- SSblackbox.add_details("admin_verb","Admin PM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+ SSblackbox.add_details("admin_verb","Admin PM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_ahelp_reply(whom)
if(prefs.muted & MUTE_ADMINHELP)
@@ -59,11 +59,11 @@
if (!msg)
message_admins("[key_name_admin(src)] has cancelled their reply to [key_name(C, 0, 0)]'s admin help.")
return
- cmd_admin_pm(whom, msg, AH)
+ cmd_admin_pm(whom, msg)
//takes input from cmd_admin_pm_context, cmd_admin_pm_panel or /client/Topic and sends them a PM.
//Fetching a message if needed. src is the sender and C is the target client
-/client/proc/cmd_admin_pm(whom, msg, datum/admin_help/AH)
+/client/proc/cmd_admin_pm(whom, msg)
if(prefs.muted & MUTE_ADMINHELP)
to_chat(src, "Error: Admin-PM: You are unable to use admin PM-s (muted).")
return
@@ -103,7 +103,7 @@
if(!recipient)
if(holder)
to_chat(src, "Error: Admin-PM: Client not found.")
- to_chat(src, msg)
+ to_chat(src, msg)
else
current_ticket.MessageNoRecipient(msg)
return
@@ -144,9 +144,9 @@
if(irc)
to_chat(src, "PM to-Admins: [rawmsg]")
- admin_ticket_log(src, "Reply PM from-[key_name(src, TRUE, TRUE)] to IRC: [keywordparsedmsg]")
+ var/datum/admin_help/AH = admin_ticket_log(src, "Reply PM from-[key_name(src, TRUE, TRUE)] to IRC: [keywordparsedmsg]")
ircreplyamount--
- send2irc("Reply: [ckey]",rawmsg)
+ send2irc("[AH ? "#[AH.id] " : ""]Reply: [ckey]", rawmsg)
else
if(recipient.holder)
if(holder) //both are admins
@@ -221,42 +221,44 @@
var/datum/admin_help/ticket = C ? C.current_ticket : GLOB.ahelp_tickets.CKey2ActiveTicket(target)
var/compliant_msg = trim(lowertext(msg))
- var/unhandled = FALSE
var/irc_tagged = "[sender](IRC)"
- switch(compliant_msg)
- if("ticket close")
- if(ticket)
- ticket.Close(irc_tagged)
- return "Ticket #[ticket.id] successfully closed"
- if("ticket resolve")
- if(ticket)
- ticket.Resolve(irc_tagged)
- return "Ticket #[ticket.id] successfully resolved"
- if("ticket ic")
- if(ticket)
- ticket.ICIssue(irc_tagged)
- return "Ticket #[ticket.id] successfully marked as IC issue"
- if("ticket reject")
- if(ticket)
- ticket.Reject(irc_tagged)
- return "Ticket #[ticket.id] successfully rejected"
- else
- unhandled = TRUE
- if(!unhandled)
- return "Ticket could not be found"
+ var/list/splits = splittext(compliant_msg, " ")
+ if(splits.len && splits[1] == "ticket")
+ if(splits.len < 2)
+ return "Usage: ticket "
+ switch(splits[2])
+ if("close")
+ if(ticket)
+ ticket.Close(irc_tagged)
+ return "Ticket #[ticket.id] successfully closed"
+ if("resolve")
+ if(ticket)
+ ticket.Resolve(irc_tagged)
+ return "Ticket #[ticket.id] successfully resolved"
+ if("icissue")
+ if(ticket)
+ ticket.ICIssue(irc_tagged)
+ return "Ticket #[ticket.id] successfully marked as IC issue"
+ if("reject")
+ if(ticket)
+ ticket.Reject(irc_tagged)
+ return "Ticket #[ticket.id] successfully rejected"
+ else
+ return "Usage: ticket "
+ return "Error: Ticket could not be found"
var/static/stealthkey
var/adminname = config.showircname ? irc_tagged : "Administrator"
if(!C)
- return "No client"
+ return "Error: No client"
if(!stealthkey)
stealthkey = GenIrcStealthKey()
msg = sanitize(copytext(msg,1,MAX_MESSAGE_LEN))
if(!msg)
- return "No message"
+ return "Error: No message"
message_admins("IRC message from [sender] to [key_name_admin(C)] : [msg]")
log_admin_private("IRC PM: [sender] -> [key_name(C)] : [msg]")
diff --git a/code/modules/server_tools/nudge.py b/code/modules/server_tools/nudge.py
new file mode 100644
index 0000000000..3d94ccdad7
--- /dev/null
+++ b/code/modules/server_tools/nudge.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python3
+import sys
+import pickle
+import socket
+
+
+def pack():
+ data = sys.argv[1]
+
+ nudge(str.encode(data))
+
+
+def nudge(data):
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ with open('config/server_to_tool_bridge_port.txt', 'r') as myfile:
+ portstr=myfile.read().replace('\n', '').strip()
+ s.connect(("localhost", int(portstr)))
+ s.send(data)
+ s.close()
+
+if __name__ == "__main__" and len(sys.argv) > 1:
+ pack()
diff --git a/code/modules/server_tools/server_tools.dm b/code/modules/server_tools/server_tools.dm
new file mode 100644
index 0000000000..0594ee810f
--- /dev/null
+++ b/code/modules/server_tools/server_tools.dm
@@ -0,0 +1,79 @@
+GLOBAL_VAR_INIT(reboot_mode, REBOOT_MODE_NORMAL) //if the world should request the service to kill it at reboot
+GLOBAL_PROTECT(reboot_mode)
+
+/world/proc/RunningService()
+ return params[SERVICE_WORLD_PARAM]
+
+/world/proc/ExportService(command)
+ return shell("python code/modules/server_tools/nudge.py \"[command]\"") == 0
+
+/world/proc/IRCBroadcast(msg)
+ ExportService("[SERVICE_REQUEST_IRC_BROADCAST] [msg]")
+
+//called at the exact moment the world is supposed to reboot
+/world/proc/ServiceReboot()
+ switch(GLOB.reboot_mode)
+ if(REBOOT_MODE_HARD)
+ to_chat(src, "Hard reboot triggered, you will automatically reconnect...")
+ log_world("Sending shutdown request!");
+ sleep(1) //flush the buffers
+ ExportService(SERVICE_REQUEST_KILL_PROCESS)
+ if(REBOOT_MODE_SHUTDOWN)
+ to_chat(src, "The server is shutting down...")
+ log_world("Deleting world")
+ qdel(src)
+
+/world/proc/ServiceCommand(list/params)
+ var/sCK = RunningService()
+ var/their_sCK = params[SERVICE_CMD_PARAM_KEY]
+
+ if(!their_sCK || their_sCK != sCK)
+ return "Invalid comms key!";
+
+ var/command = params[SERVICE_CMD_PARAM_COMMAND]
+ if(!command)
+ return "No command!"
+
+ var/static/last_irc_status = 0
+ switch(command)
+ if(SERVICE_CMD_HARD_REBOOT)
+ if(GLOB.reboot_mode != REBOOT_MODE_HARD)
+ GLOB.reboot_mode = REBOOT_MODE_HARD
+ log_world("Hard reboot requested by service")
+ message_admins("The world will hard reboot at the end of the game. Requested by service.")
+ SSblackbox.set_val("service_hard_restart", TRUE)
+ if(SERVICE_CMD_GRACEFUL_SHUTDOWN)
+ if(GLOB.reboot_mode != REBOOT_MODE_SHUTDOWN)
+ GLOB.reboot_mode = REBOOT_MODE_SHUTDOWN
+ log_world("Shutdown requested by service")
+ message_admins("The world will shutdown at the end of the game. Requested by service.")
+ SSblackbox.set_val("service_shutdown", TRUE)
+ if(SERVICE_CMD_WORLD_ANNOUNCE)
+ var/msg = params["message"]
+ if(!istext(msg) || !msg)
+ return "No message set!"
+ to_chat(src, "[html_encode(msg)]")
+ return "SUCCESS"
+ if(SERVICE_CMD_IRC_STATUS)
+ 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
+
+ if(SERVICE_CMD_ADMIN_MSG)
+ return IrcPm(params[SERVICE_CMD_PARAM_TARGET], params[SERVICE_CMD_PARAM_MESSAGE], params[SERVICE_CMD_PARAM_SENDER])
+
+ if(SERVICE_CMD_NAME_CHECK)
+ log_admin("IRC Name Check: [params[SERVICE_CMD_PARAM_SENDER]] on [params[SERVICE_CMD_PARAM_TARGET]]")
+ message_admins("IRC name checking on [params[SERVICE_CMD_PARAM_TARGET]] from [params[SERVICE_CMD_PARAM_SENDER]]")
+ return keywords_lookup(params[SERVICE_CMD_PARAM_TARGET], 1)
+ if(SERVICE_CMD_ADMIN_WHO)
+ return ircadminwho()
+ else
+ return "Unknown command: [command]"
+
diff --git a/code/world.dm b/code/world.dm
index 43401b0c42..eb0079ddca 100644
--- a/code/world.dm
+++ b/code/world.dm
@@ -28,7 +28,8 @@
SetupLogs()
- GLOB.revdata.DownloadPRDetails()
+ if(!RunningService()) //tgs2 support
+ GLOB.revdata.DownloadPRDetails()
load_motd()
load_admins()
@@ -40,7 +41,8 @@
GLOB.timezoneOffset = text2num(time2text(0,"hh")) * 36000
- Master.Initialize(10, FALSE)
+ if(config.irc_announce_new_game)
+ IRCBroadcast("New round starting on [SSmapping.config.map_name]!")
/world/proc/SetupExternalRSC()
#if (PRELOAD_RSC == 0)
@@ -88,14 +90,15 @@
if(GLOB.round_id)
log_game("Round ID: [GLOB.round_id]")
-#define IRC_STATUS_THROTTLE 50
+
/world/Topic(T, addr, master, key)
if(config && config.log_world_topic)
GLOB.world_game_log << "TOPIC: \"[T]\", from:[addr], master:[master], key:[key]"
var/list/input = params2list(T)
+ if(input[SERVICE_CMD_PARAM_KEY])
+ return ServiceCommand(input)
var/key_valid = (global.comms_allowed && input["key"] == global.comms_key)
- var/static/last_irc_status = 0
if("ping" in input)
var/x = 1
@@ -110,8 +113,9 @@
n++
return n
- else if("ircstatus" in input)
- if(world.time - last_irc_status < IRC_STATUS_THROTTLE)
+ else if("ircstatus" in input) //tgs2 support
+ var/static/last_irc_status = 0
+ if(world.time - last_irc_status < 50)
return
var/list/adm = get_admin_counts()
var/list/allmins = adm["total"]
@@ -179,20 +183,20 @@
if(input["crossmessage"] == "News_Report")
minor_announce(input["message"], "Breaking Update From [input["message_sender"]]")
- else if("adminmsg" in input)
+ else if("adminmsg" in input) //tgs2 support
if(!key_valid)
return "Bad Key"
else
return IrcPm(input["adminmsg"],input["msg"],input["sender"])
- else if("namecheck" in input)
+ else if("namecheck" in input) //tgs2 support
if(!key_valid)
return "Bad Key"
else
log_admin("IRC Name Check: [input["sender"]] on [input["namecheck"]]")
message_admins("IRC name checking on [input["namecheck"]] from [input["sender"]]")
return keywords_lookup(input["namecheck"],1)
- else if("adminwho" in input)
+ else if("adminwho" in input) //tgs2 support
if(!key_valid)
return "Bad Key"
else
@@ -218,6 +222,7 @@
C.AnnouncePR(final_composed)
/world/Reboot(reason = 0, fast_track = FALSE)
+ ServiceReboot() //handles alternative actions if necessary
if (reason || fast_track) //special reboot, do none of the normal stuff
if (usr)
log_admin("[key_name(usr)] Has requested an immediate world restart via client side debugging tools")
diff --git a/tgstation.dme b/tgstation.dme
index 2e2f6c5e7e..c224e60ddc 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -60,6 +60,7 @@
#include "code\__DEFINES\robots.dm"
#include "code\__DEFINES\role_preferences.dm"
#include "code\__DEFINES\say.dm"
+#include "code\__DEFINES\server_tools.dm"
#include "code\__DEFINES\shuttles.dm"
#include "code\__DEFINES\sight.dm"
#include "code\__DEFINES\sound.dm"
@@ -2043,6 +2044,7 @@
#include "code\modules\ruins\objects_and_mobs\sin_ruins.dm"
#include "code\modules\security_levels\keycard_authentication.dm"
#include "code\modules\security_levels\security_levels.dm"
+#include "code\modules\server_tools\server_tools.dm"
#include "code\modules\shuttle\arrivals.dm"
#include "code\modules\shuttle\assault_pod.dm"
#include "code\modules\shuttle\computer.dm"