diff options
| author | Michael <[email protected]> | 2017-03-09 09:48:45 -0500 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-03-09 09:48:51 -0500 |
| commit | 8db3a2e11c6cc58adb2b62fbce1c1f63426b674c (patch) | |
| tree | b733c3308a15cab72191936cd2edf64a15b809bc | |
| parent | a9d7195f1e631a88386cf58dd1e33e36cba28a69 (diff) | |
| download | shiftos_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.cs | 13 |
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); |
