Merge pull request #10473 from deathride58/serverhopsanity
[s] adds a basic sanity check to server_hop
This commit is contained in:
+15
-15
@@ -25,16 +25,16 @@
|
||||
var/key_valid
|
||||
var/require_comms_key = FALSE
|
||||
|
||||
/datum/world_topic/proc/TryRun(list/input)
|
||||
/datum/world_topic/proc/TryRun(list/input, addr)
|
||||
key_valid = config && (CONFIG_GET(string/comms_key) == input["key"])
|
||||
if(require_comms_key && !key_valid)
|
||||
return "Bad Key"
|
||||
input -= "key"
|
||||
. = Run(input)
|
||||
. = Run(input, addr)
|
||||
if(islist(.))
|
||||
. = list2params(.)
|
||||
|
||||
/datum/world_topic/proc/Run(list/input)
|
||||
/datum/world_topic/proc/Run(list/input, addr)
|
||||
CRASH("Run() not implemented for [type]!")
|
||||
|
||||
// TOPICS
|
||||
@@ -43,7 +43,7 @@
|
||||
keyword = "ping"
|
||||
log = FALSE
|
||||
|
||||
/datum/world_topic/ping/Run(list/input)
|
||||
/datum/world_topic/ping/Run(list/input, addr)
|
||||
. = 0
|
||||
for (var/client/C in GLOB.clients)
|
||||
++.
|
||||
@@ -52,7 +52,7 @@
|
||||
keyword = "playing"
|
||||
log = FALSE
|
||||
|
||||
/datum/world_topic/playing/Run(list/input)
|
||||
/datum/world_topic/playing/Run(list/input, addr)
|
||||
return GLOB.player_list.len
|
||||
|
||||
/datum/world_topic/pr_announce
|
||||
@@ -60,7 +60,7 @@
|
||||
require_comms_key = TRUE
|
||||
var/static/list/PRcounts = list() //PR id -> number of times announced this round
|
||||
|
||||
/datum/world_topic/pr_announce/Run(list/input)
|
||||
/datum/world_topic/pr_announce/Run(list/input, addr)
|
||||
var/list/payload = json_decode(input["payload"])
|
||||
var/id = "[payload["pull_request"]["id"]]"
|
||||
if(!PRcounts[id])
|
||||
@@ -78,14 +78,14 @@
|
||||
keyword = "Ahelp"
|
||||
require_comms_key = TRUE
|
||||
|
||||
/datum/world_topic/ahelp_relay/Run(list/input)
|
||||
/datum/world_topic/ahelp_relay/Run(list/input, addr)
|
||||
relay_msg_admins("<span class='adminnotice'><b><font color=red>HELP: </font> [input["source"]] [input["message_sender"]]: [input["message"]]</b></span>")
|
||||
|
||||
/datum/world_topic/comms_console
|
||||
keyword = "Comms_Console"
|
||||
require_comms_key = TRUE
|
||||
|
||||
/datum/world_topic/comms_console/Run(list/input)
|
||||
/datum/world_topic/comms_console/Run(list/input, addr)
|
||||
minor_announce(input["message"], "Incoming message from [input["message_sender"]]")
|
||||
for(var/obj/machinery/computer/communications/CM in GLOB.machines)
|
||||
CM.overrideCooldown()
|
||||
@@ -94,17 +94,17 @@
|
||||
keyword = "News_Report"
|
||||
require_comms_key = TRUE
|
||||
|
||||
/datum/world_topic/news_report/Run(list/input)
|
||||
/datum/world_topic/news_report/Run(list/input, addr)
|
||||
minor_announce(input["message"], "Breaking Update From [input["message_sender"]]")
|
||||
|
||||
/datum/world_topic/server_hop
|
||||
keyword = "server_hop"
|
||||
|
||||
/datum/world_topic/server_hop/Run(list/input)
|
||||
/datum/world_topic/server_hop/Run(list/input, addr)
|
||||
var/expected_key = input[keyword]
|
||||
for(var/mob/dead/observer/O in GLOB.player_list)
|
||||
if(O.key == expected_key)
|
||||
if(O.client)
|
||||
if(O.client?.address == addr)
|
||||
new /obj/screen/splash(O.client, TRUE)
|
||||
break
|
||||
|
||||
@@ -112,14 +112,14 @@
|
||||
keyword = "adminmsg"
|
||||
require_comms_key = TRUE
|
||||
|
||||
/datum/world_topic/adminmsg/Run(list/input)
|
||||
/datum/world_topic/adminmsg/Run(list/input, addr)
|
||||
return IrcPm(input[keyword], input["msg"], input["sender"])
|
||||
|
||||
/datum/world_topic/namecheck
|
||||
keyword = "namecheck"
|
||||
require_comms_key = TRUE
|
||||
|
||||
/datum/world_topic/namecheck/Run(list/input)
|
||||
/datum/world_topic/namecheck/Run(list/input, addr)
|
||||
//Oh this is a hack, someone refactor the functionality out of the chat command PLS
|
||||
var/datum/tgs_chat_command/namecheck/NC = new
|
||||
var/datum/tgs_chat_user/user = new
|
||||
@@ -131,13 +131,13 @@
|
||||
keyword = "adminwho"
|
||||
require_comms_key = TRUE
|
||||
|
||||
/datum/world_topic/adminwho/Run(list/input)
|
||||
/datum/world_topic/adminwho/Run(list/input, addr)
|
||||
return ircadminwho()
|
||||
|
||||
/datum/world_topic/status
|
||||
keyword = "status"
|
||||
|
||||
/datum/world_topic/status/Run(list/input)
|
||||
/datum/world_topic/status/Run(list/input, addr)
|
||||
. = list()
|
||||
.["version"] = GLOB.game_version
|
||||
.["mode"] = "hidden" //CIT CHANGE - hides the gamemode in topic() calls to prevent meta'ing the gamemode
|
||||
|
||||
+1
-1
@@ -159,7 +159,7 @@ GLOBAL_VAR(restart_counter)
|
||||
return
|
||||
|
||||
handler = new handler()
|
||||
return handler.TryRun(input)
|
||||
return handler.TryRun(input, addr)
|
||||
|
||||
/world/proc/AnnouncePR(announcement, list/payload)
|
||||
var/static/list/PRcounts = list() //PR id -> number of times announced this round
|
||||
|
||||
Reference in New Issue
Block a user