mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 06:29:23 +01:00
Adds format=json support to world/topic (#50446)
random fact: the original game banners from erro used a custom url decoder. It wasn't until a year or two in to me being host that i caught on and fixed this.
This commit is contained in:
@@ -27,11 +27,16 @@
|
||||
|
||||
/datum/world_topic/proc/TryRun(list/input)
|
||||
key_valid = config && (CONFIG_GET(string/comms_key) == input["key"])
|
||||
if(require_comms_key && !key_valid)
|
||||
return "Bad Key"
|
||||
input -= "key"
|
||||
. = Run(input)
|
||||
if(islist(.))
|
||||
if(require_comms_key && !key_valid)
|
||||
. = "Bad Key"
|
||||
if (input["format"] == "json")
|
||||
. = list("error" = .)
|
||||
else
|
||||
. = Run(input)
|
||||
if (input["format"] == "json")
|
||||
. = json_encode(.)
|
||||
else if(islist(.))
|
||||
. = list2params(.)
|
||||
|
||||
/datum/world_topic/proc/Run(list/input)
|
||||
|
||||
Reference in New Issue
Block a user