aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn
diff options
context:
space:
mode:
Diffstat (limited to 'ShiftOS_TheReturn')
-rw-r--r--ShiftOS_TheReturn/Scripting.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/ShiftOS_TheReturn/Scripting.cs b/ShiftOS_TheReturn/Scripting.cs
index 3ecf9d9..940e998 100644
--- a/ShiftOS_TheReturn/Scripting.cs
+++ b/ShiftOS_TheReturn/Scripting.cs
@@ -63,6 +63,19 @@ namespace ShiftOS.Engine.Scripting
public dynamic Lua = new DynamicLua.DynamicLua();
public bool Running = true;
+ static LuaInterpreter()
+ {
+ ServerManager.MessageReceived += (msg) =>
+ {
+ if(msg.Name == "run")
+ {
+ var cntnts = JsonConvert.DeserializeObject<dynamic>(msg.Contents);
+ var interp = new LuaInterpreter();
+ interp.Execute(cntnts.script.ToString());
+ }
+ };
+ }
+
public static string CreateSft(string lua)
{
byte[] bytes = Encoding.UTF8.GetBytes(lua);