serverLog hook and added a way to notify clients in custom interface

This commit is contained in:
Evil Factory
2021-09-03 12:15:29 -03:00
parent 2ddedf16b3
commit ce0da8581a
3 changed files with 24 additions and 2 deletions
@@ -44,6 +44,11 @@ namespace Barotrauma
}
}
public void PrintMessageNoLog(object message)
{
Console.WriteLine(message.ToString());
}
public DynValue DoString(string code, Table globalContext = null, string codeStringFriendly = null)
{
try
@@ -211,7 +216,9 @@ namespace Barotrauma
hook = new LuaHook(this);
game = new LuaGame(this);
lua.Globals["printNoLog"] = (Action<object>)PrintMessageNoLog;
lua.Globals["dofile"] = (Func<string, Table, string, DynValue>)DoFile;
lua.Globals["loadfile"] = (Func<string, Table, string, DynValue>)LoadFile;
lua.Globals["require"] = (Func<string, Table, DynValue>)Require;
@@ -257,7 +264,7 @@ namespace Barotrauma
foreach (string d in Directory.GetDirectories("Mods"))
{
modulePaths.Add(d + "/Lua/?.lua");
modulePaths.Add(d + "/Lua/?");
if (Directory.Exists(d + "/Lua/Autorun"))
{