mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 17:52:36 +00:00
[No GBP] World Topic tweaks. Scrutinize this heavily (#90244)
## About The Pull Request - In ``/datum/world_topic`` sets the variable ``require_comms_key = TRUE`` so any new world_topics handlers will need to be deliberately set otherwise. - Added some documentation to help educate any future contributors (especially on downstreams) the sensitivity of bad world.topic() code. - Sets the default config to log topic calls. (This should really be split into its own log file later) ## Why It's Good For The Game Lingering security education is a good thing to have. ## Changelog Not player facing
This commit is contained in:
@@ -23,7 +23,8 @@
|
|||||||
var/keyword
|
var/keyword
|
||||||
var/log = TRUE
|
var/log = TRUE
|
||||||
var/key_valid
|
var/key_valid
|
||||||
var/require_comms_key = FALSE
|
/// If the comms.txt config key is required. If you flip this to false, ensure the code is correct and the query you receive is legit.
|
||||||
|
var/require_comms_key = TRUE
|
||||||
|
|
||||||
/datum/world_topic/proc/TryRun(list/input)
|
/datum/world_topic/proc/TryRun(list/input)
|
||||||
key_valid = (CONFIG_GET(string/comms_key) == input["key"]) && CONFIG_GET(string/comms_key) && input["key"]
|
key_valid = (CONFIG_GET(string/comms_key) == input["key"]) && CONFIG_GET(string/comms_key) && input["key"]
|
||||||
@@ -42,12 +43,18 @@
|
|||||||
/datum/world_topic/proc/Run(list/input)
|
/datum/world_topic/proc/Run(list/input)
|
||||||
CRASH("Run() not implemented for [type]!")
|
CRASH("Run() not implemented for [type]!")
|
||||||
|
|
||||||
// TOPICS
|
/** TOPICS
|
||||||
|
* These are the handlers for world.Export() -> World.Topic() server communication.
|
||||||
|
* Double check to ensure any calls are correct and the query is legit.
|
||||||
|
* World.Topic() exploits can be very devastating since these can be called via a normal player connection without a client.
|
||||||
|
* https://secure.byond.com/docs/ref/index.html#/world/proc/Topic
|
||||||
|
*/
|
||||||
|
|
||||||
// If you modify the protocol for this, update tools/Tgstation.PRAnnouncer
|
// If you modify the protocol for this, update tools/Tgstation.PRAnnouncer
|
||||||
/datum/world_topic/ping
|
/datum/world_topic/ping
|
||||||
keyword = "ping"
|
keyword = "ping"
|
||||||
log = FALSE
|
log = FALSE
|
||||||
|
require_comms_key = FALSE
|
||||||
|
|
||||||
/datum/world_topic/ping/Run(list/input)
|
/datum/world_topic/ping/Run(list/input)
|
||||||
. = 0
|
. = 0
|
||||||
@@ -57,6 +64,7 @@
|
|||||||
/datum/world_topic/playing
|
/datum/world_topic/playing
|
||||||
keyword = "playing"
|
keyword = "playing"
|
||||||
log = FALSE
|
log = FALSE
|
||||||
|
require_comms_key = FALSE
|
||||||
|
|
||||||
/datum/world_topic/playing/Run(list/input)
|
/datum/world_topic/playing/Run(list/input)
|
||||||
return GLOB.player_list.len
|
return GLOB.player_list.len
|
||||||
@@ -64,7 +72,6 @@
|
|||||||
// If you modify the protocol for this, update tools/Tgstation.PRAnnouncer
|
// If you modify the protocol for this, update tools/Tgstation.PRAnnouncer
|
||||||
/datum/world_topic/pr_announce
|
/datum/world_topic/pr_announce
|
||||||
keyword = "announce"
|
keyword = "announce"
|
||||||
require_comms_key = TRUE
|
|
||||||
var/static/list/PRcounts = list() //PR id -> number of times announced this round
|
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)
|
||||||
@@ -83,14 +90,12 @@
|
|||||||
|
|
||||||
/datum/world_topic/ahelp_relay
|
/datum/world_topic/ahelp_relay
|
||||||
keyword = "Ahelp"
|
keyword = "Ahelp"
|
||||||
require_comms_key = TRUE
|
|
||||||
|
|
||||||
/datum/world_topic/ahelp_relay/Run(list/input)
|
/datum/world_topic/ahelp_relay/Run(list/input)
|
||||||
relay_msg_admins(span_adminnotice("<b><font color=red>HELP: </font> [input["source"]] [input["message_sender"]]: [input["message"]]</b>"))
|
relay_msg_admins(span_adminnotice("<b><font color=red>HELP: </font> [input["source"]] [input["message_sender"]]: [input["message"]]</b>"))
|
||||||
|
|
||||||
/datum/world_topic/comms_console
|
/datum/world_topic/comms_console
|
||||||
keyword = "Comms_Console"
|
keyword = "Comms_Console"
|
||||||
require_comms_key = TRUE
|
|
||||||
|
|
||||||
var/list/timers
|
var/list/timers
|
||||||
|
|
||||||
@@ -161,21 +166,18 @@
|
|||||||
|
|
||||||
/datum/world_topic/news_report
|
/datum/world_topic/news_report
|
||||||
keyword = "News_Report"
|
keyword = "News_Report"
|
||||||
require_comms_key = TRUE
|
|
||||||
|
|
||||||
/datum/world_topic/news_report/Run(list/input)
|
/datum/world_topic/news_report/Run(list/input)
|
||||||
minor_announce(input["message"], "Breaking Update From [input["message_sender"]]")
|
minor_announce(input["message"], "Breaking Update From [input["message_sender"]]")
|
||||||
|
|
||||||
/datum/world_topic/adminmsg
|
/datum/world_topic/adminmsg
|
||||||
keyword = "adminmsg"
|
keyword = "adminmsg"
|
||||||
require_comms_key = TRUE
|
|
||||||
|
|
||||||
/datum/world_topic/adminmsg/Run(list/input)
|
/datum/world_topic/adminmsg/Run(list/input)
|
||||||
return TgsPm(input[keyword], input["msg"], input["sender"])
|
return TgsPm(input[keyword], input["msg"], input["sender"])
|
||||||
|
|
||||||
/datum/world_topic/namecheck
|
/datum/world_topic/namecheck
|
||||||
keyword = "namecheck"
|
keyword = "namecheck"
|
||||||
require_comms_key = TRUE
|
|
||||||
|
|
||||||
/datum/world_topic/namecheck/Run(list/input)
|
/datum/world_topic/namecheck/Run(list/input)
|
||||||
log_admin("world/Topic Name Check: [input["sender"]] on [input["namecheck"]]")
|
log_admin("world/Topic Name Check: [input["sender"]] on [input["namecheck"]]")
|
||||||
@@ -185,13 +187,13 @@
|
|||||||
|
|
||||||
/datum/world_topic/adminwho
|
/datum/world_topic/adminwho
|
||||||
keyword = "adminwho"
|
keyword = "adminwho"
|
||||||
require_comms_key = TRUE
|
|
||||||
|
|
||||||
/datum/world_topic/adminwho/Run(list/input)
|
/datum/world_topic/adminwho/Run(list/input)
|
||||||
return tgsadminwho()
|
return tgsadminwho()
|
||||||
|
|
||||||
/datum/world_topic/status
|
/datum/world_topic/status
|
||||||
keyword = "status"
|
keyword = "status"
|
||||||
|
require_comms_key = FALSE
|
||||||
|
|
||||||
/datum/world_topic/status/Run(list/input)
|
/datum/world_topic/status/Run(list/input)
|
||||||
. = list()
|
. = list()
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ LOG_VOTE
|
|||||||
LOG_WHISPER
|
LOG_WHISPER
|
||||||
|
|
||||||
## log all world.Topic() calls
|
## log all world.Topic() calls
|
||||||
# LOG_WORLD_TOPIC
|
LOG_WORLD_TOPIC
|
||||||
|
|
||||||
## log manual target zone switching
|
## log manual target zone switching
|
||||||
LOG_ZONE_SWITCH
|
LOG_ZONE_SWITCH
|
||||||
|
|||||||
Reference in New Issue
Block a user