mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-22 12:29:46 +01:00
NTSL2++ sucessor to NTSL2+ (#9321)
This drastcly is meant to rework DM and Daemon code to allow further expansion and replacement of custom engine with JavaScript language based engine. Daemon PR - Aurorastation/ByondInterpretedLanguage#7 Forums topic for discussion - https://forums.aurorastation.org/topic/14570-ntsl2-and-its-future/ Superseeds #8817
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
Datum representing program state on deamon and exposing apropriate procs to DM.
|
||||
*/
|
||||
/datum/ntsl2_program/
|
||||
var/id = 0
|
||||
var/name = "Base NTSL2++ program"
|
||||
var/list/ready_tasks = list()
|
||||
|
||||
|
||||
/datum/ntsl2_program/New()
|
||||
..()
|
||||
|
||||
/datum/ntsl2_program/proc/is_ready()
|
||||
return !!id
|
||||
|
||||
/datum/ntsl2_program/proc/kill()
|
||||
if(is_ready())
|
||||
SSntsl2.send_task("remove", list(id = id))
|
||||
SSntsl2.handle_termination(src)
|
||||
qdel(src)
|
||||
|
||||
/datum/ntsl2_program/proc/execute(var/script, var/mob/user)
|
||||
if(!is_ready())
|
||||
ready_tasks += CALLBACK(src, .proc/execute, script, user)
|
||||
return FALSE // We are not ready to run code
|
||||
log_ntsl("[user.name]/[user.key] uploaded script to [src] : [script]", SEVERITY_NOTICE, user.ckey)
|
||||
return SSntsl2.send_task("execute", list(id = id, code = script), program = src)
|
||||
Reference in New Issue
Block a user