aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Server
diff options
context:
space:
mode:
Diffstat (limited to 'ShiftOS.Server')
-rw-r--r--ShiftOS.Server/Core.cs15
1 files changed, 8 insertions, 7 deletions
diff --git a/ShiftOS.Server/Core.cs b/ShiftOS.Server/Core.cs
index 4ec421d..a602240 100644
--- a/ShiftOS.Server/Core.cs
+++ b/ShiftOS.Server/Core.cs
@@ -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;
}
}