Files
Aurora.3/code/modules/ntsl2/program.dm
William Lemon 4e365c0eaf NTSL2+ (#6256)
Warning! Big Scary Change!
NTSL2+ is a re-work of NTSL.
The goals of this rework are to remove worries regarding server load, and make it impossible for a malicious program to crash the server.
The result is an asynchronous daemon based interpreted language, called NTSL2+.

The Daemon in question can be found Here

Features:

Programming Language worth considering a programming language
Limit-able execution - Unable to hold the server up
Runs on Modular Computers
Shitty in-game networking.
Players can finally write their own laptop programs I cannot stress that enough.
2019-04-20 18:24:04 +03:00

44 lines
1.2 KiB
Plaintext

/datum/ntsl_program/
var/id = -1
var/name = "NTSL Program"
var/obj/machinery/telecomms/server/S = null
/datum/ntsl_program/New(var/my_id)
id = my_id
// Failsafe, kill any obsolete programs.
for(var/datum/ntsl_program/P in ntsl2.programs)
if(P.id == id)
P.kill()
..()
/datum/ntsl_program/proc/cycle(var/amount)
if(ntsl2.connected)
ntsl2.send(list(action = "execute", id = id, cycles = amount))
/datum/ntsl_program/proc/get_terminal()
return ntsl2.send(list(action = "get_buffered", id = id))
/datum/ntsl_program/proc/topic(var/message)
if(ntsl2.connected)
ntsl2.send(list(action = "topic", id = id, topic = message))
/datum/ntsl_program/proc/kill()
if(ntsl2.connected)
ntsl2.send(list(action = "remove", id = id))
ntsl2.programs -= src
qdel(src)
/datum/ntsl_program/proc/tc_message(var/datum/signal/signal)
if(ntsl2.connected)
ntsl2.send(list(action = "message", id = id, sig_ref = "\ref[signal]", signal = list2params(list(
content = html_decode(signal.data["message"]),
source = html_decode(signal.data["name"]),
job = html_decode(signal.data["job"]),
freq = signal.frequency,
pass = !(signal.data["reject"]),
language = signal.data["language"].name,
verb = signal.data["verb"]
))))