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:
Karolis
2021-02-05 16:05:21 +02:00
committed by GitHub
parent 12bb01ad57
commit 607b0eeeb8
38 changed files with 762 additions and 557 deletions
@@ -486,7 +486,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
var/list/memory = list() // stored memory
var/rawcode = "" // the code to compile (raw text)
var/datum/TCS_Compiler/ntsl2/Compiler // the compiler that compiles and runs the code
var/datum/ntsl2_program/tcomm/Program // NTSL2++ datum responsible for script execution
var/autoruncode = 0 // 1 if the code is set to run every time a signal is picked up
var/encryption = "null" // encryption key: ie "password"
@@ -497,8 +497,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
/obj/machinery/telecomms/server/Initialize()
. = ..()
Compiler = new()
Compiler.Holder = src
Program = SSntsl2.new_program_tcomm(src)
server_radio = new()
/obj/machinery/telecomms/server/receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from)
@@ -574,30 +573,39 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
var/identifier = num2text( rand(-1000,1000) + world.time )
log.name = "data packet ([md5(identifier)])"
if(Compiler && autoruncode)
Compiler.Run(signal) // execute the code
if(istype(Program))
Program.process_message(signal, CALLBACK(src, .proc/program_receive_information, signal))
else
finish_receive_information(signal)
var/can_send = relay_information(signal, "/obj/machinery/telecomms/hub")
if(!can_send)
relay_information(signal, "/obj/machinery/telecomms/broadcaster")
/obj/machinery/telecomms/server/proc/program_receive_information(datum/signal/signal)
Program.retrieve_messages(CALLBACK(src, .proc/finish_receive_information, signal))
/obj/machinery/telecomms/server/proc/finish_receive_information(datum/signal/signal)
var/can_send = relay_information(signal, "/obj/machinery/telecomms/hub")
if(!can_send)
relay_information(signal, "/obj/machinery/telecomms/broadcaster")
/obj/machinery/telecomms/server/machinery_process()
. = ..()
if(Compiler)
Compiler.update_code()
if(istype(Program))
Program.retrieve_messages()
/*
/obj/machinery/telecomms/server/proc/setcode(var/t)
if(t)
if(istext(t))
rawcode = t
*/
/*
/obj/machinery/telecomms/server/proc/compile()
if(Compiler)
var/er = Compiler.Compile(rawcode)
if(istype(Compiler.running_code))
Compiler.running_code.S = src
return er
*/
/obj/machinery/telecomms/server/proc/update_logs()
// start deleting the very first log entry
@@ -628,3 +636,13 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
var/name = "data packet (#)"
var/garbage_collector = 1 // if set to 0, will not be garbage collected
var/input_type = "Speech File"
// NTSL2++ code
+1 -1
View File
@@ -12,7 +12,7 @@
dat = {"
<html>
<head></head>
<head><style>body {overflow: hidden;}</style></head>
<body>
<iframe width='100%' height='97%' src="[config.wikiurl][sub_page]&printable=yes&remove_links=1" frameborder="0" id="main_frame"></iframe>