make script runner less drunk

This commit is contained in:
Michael VanOverbeek 2017-03-09 14:43:03 +00:00
parent abe535200b
commit a9d7195f1e

View file

@ -96,10 +96,11 @@ namespace ShiftOS.Server
{
Name = "run",
GUID = "Server",
Contents = $@"{{
script:""{File.ReadAllText($"scripts/{user}/{script}.lua").Replace("\"", "\\\"")}"",
args:""{sArgs}""
}}"
Contents = JsonConvert.SerializeObject(new
{
script = File.ReadAllText($"scripts/{user}/{script}.lua"),
args = sArgs
})
}));
}
else
@ -115,7 +116,7 @@ namespace ShiftOS.Server
{
Name = "Error",
GUID = "Server",
Contents = JsonConvert.SerializeObject(new MudException("Command parse error"))
Contents = JsonConvert.SerializeObject(new MudException("<script_runner> Script not found or script error detected."))
}));
}
catch
@ -182,8 +183,8 @@ namespace ShiftOS.Server
GUID = "server",
Contents = JsonConvert.SerializeObject(saveFile)
}));
return;
}
return;
}
}
foreach (var sve in Directory.GetFiles("saves"))
@ -199,8 +200,8 @@ namespace ShiftOS.Server
GUID = "server",
Contents = JsonConvert.SerializeObject(saveFile)
}));
return;
}
return;
}
}