aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-03-09 09:48:45 -0500
committerMichael <[email protected]>2017-03-09 09:48:51 -0500
commit8db3a2e11c6cc58adb2b62fbce1c1f63426b674c (patch)
treeb733c3308a15cab72191936cd2edf64a15b809bc
parenta9d7195f1e631a88386cf58dd1e33e36cba28a69 (diff)
downloadshiftos_thereturn-8db3a2e11c6cc58adb2b62fbce1c1f63426b674c.tar.gz
shiftos_thereturn-8db3a2e11c6cc58adb2b62fbce1c1f63426b674c.tar.bz2
shiftos_thereturn-8db3a2e11c6cc58adb2b62fbce1c1f63426b674c.zip
Server-side scripts now get ran.
-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);