mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-01-22 18:02:16 +00:00
Server-side scripts now get ran.
This commit is contained in:
parent
a9d7195f1e
commit
8db3a2e11c
1 changed files with 13 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue