mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-29 07:59:01 +01:00
Rewrite API (#825)
he /world/Topic() API has been rewritten. General function: The API is initialized upon roundstart and generates a list of possible api requests from /code/datums/api.dm Once a request is made the following checks are performed: If a query parameter is set (the function that should be called) If the ip is ratelimited (or rate-limit-whitelisted) The query is authenticated against the db using ip, function and key If these checks pass, it is validated that the api command exists Then the api command is called, all supplied params are passed through Each API function returns 1 no matter if it failed or succeded Additional info is provided in the statuscode, response and data vars The statuscode, response and data are send back to the caller (through list2params) The data var is json encoded before sending it back This is not backward compatible to the current API Current API Clients need to be updated
This commit is contained in:
@@ -229,20 +229,20 @@ Allow admins to set players to be able to respawn/bypass 30 min wait, without th
|
||||
Ccomp's first proc.
|
||||
*/
|
||||
|
||||
/client/proc/get_ghosts(var/notify = 0,var/what = 2)
|
||||
proc/get_ghosts(var/notify = 0,var/what = 2, var/client/C = null)
|
||||
// what = 1, return ghosts ass list.
|
||||
// what = 2, return mob list
|
||||
|
||||
var/list/mobs = list()
|
||||
var/list/ghosts = list()
|
||||
var/list/sortmob = sortAtom(mob_list) // get the mob list.
|
||||
/var/any=0
|
||||
var/any=0
|
||||
for(var/mob/dead/observer/M in sortmob)
|
||||
mobs.Add(M) //filter it where it's only ghosts
|
||||
any = 1 //if no ghosts show up, any will just be 0
|
||||
if(!any)
|
||||
if(notify)
|
||||
src << "There doesn't appear to be any ghosts for you to select."
|
||||
if(notify && C)
|
||||
C << "There doesn't appear to be any ghosts for you to select."
|
||||
return
|
||||
|
||||
for(var/mob/M in mobs)
|
||||
@@ -260,7 +260,7 @@ Ccomp's first proc.
|
||||
set desc = "Let's the player bypass the 30 minute wait to respawn or allow them to re-enter their corpse."
|
||||
if(!holder)
|
||||
src << "Only administrators may use this command."
|
||||
var/list/ghosts= get_ghosts(1,1)
|
||||
var/list/ghosts = get_ghosts(1,1,src)
|
||||
|
||||
var/target = input("Please, select a ghost!", "COME BACK TO LIFE!", null, null) as null|anything in ghosts
|
||||
if(!target)
|
||||
|
||||
@@ -193,24 +193,23 @@ var/list/sent_faxes = list() //cache for faxes that have been sent by the admins
|
||||
if(department == "Unknown")
|
||||
return 0 //You can't send faxes to "Unknown"
|
||||
|
||||
if (!istype(incoming, /obj/item/weapon/paper) && !istype(incoming, /obj/item/weapon/photo) && !istype(incoming, /obj/item/weapon/paper_bundle))
|
||||
return 0
|
||||
|
||||
flick("faxreceive", src)
|
||||
playsound(loc, "sound/items/polaroid1.ogg", 50, 1)
|
||||
|
||||
// give the sprite some time to flick
|
||||
sleep(20)
|
||||
spawn(20)
|
||||
if (istype(incoming, /obj/item/weapon/paper))
|
||||
copy(incoming)
|
||||
else if (istype(incoming, /obj/item/weapon/photo))
|
||||
photocopy(incoming)
|
||||
else if (istype(incoming, /obj/item/weapon/paper_bundle))
|
||||
bundlecopy(incoming)
|
||||
do_pda_alerts()
|
||||
use_power(active_power_usage)
|
||||
|
||||
if (istype(incoming, /obj/item/weapon/paper))
|
||||
copy(incoming)
|
||||
else if (istype(incoming, /obj/item/weapon/photo))
|
||||
photocopy(incoming)
|
||||
else if (istype(incoming, /obj/item/weapon/paper_bundle))
|
||||
bundlecopy(incoming)
|
||||
else
|
||||
return 0
|
||||
|
||||
do_pda_alerts()
|
||||
|
||||
use_power(active_power_usage)
|
||||
return 1
|
||||
|
||||
/obj/machinery/photocopier/faxmachine/proc/send_admin_fax(var/mob/sender, var/destination)
|
||||
|
||||
Reference in New Issue
Block a user