diff --git a/Barotrauma/BarotraumaServer/ServerSource/Items/Components/Signal/CustomInterface.cs b/Barotrauma/BarotraumaServer/ServerSource/Items/Components/Signal/CustomInterface.cs index ae6f5b6ef..26d6322a0 100644 --- a/Barotrauma/BarotraumaServer/ServerSource/Items/Components/Signal/CustomInterface.cs +++ b/Barotrauma/BarotraumaServer/ServerSource/Items/Components/Signal/CustomInterface.cs @@ -5,6 +5,19 @@ namespace Barotrauma.Items.Components { partial class CustomInterface : ItemComponent, IClientSerializable, IServerSerializable { + public void UpdateClients() + { + + //notify all clients of the new state + GameMain.Server.CreateEntityEvent(item, new object[] + { + NetEntityEvent.Type.ComponentState, + item.GetComponentIndex(this) + }); + + item.CreateServerEvent(this); + } + public void ServerRead(ClientNetObject type, IReadMessage msg, Client c) { bool[] elementStates = new bool[customInterfaceElementList.Count]; diff --git a/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaSetup.cs b/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaSetup.cs index ad08ed3f7..6c49d2173 100644 --- a/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaSetup.cs +++ b/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaSetup.cs @@ -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)PrintMessageNoLog; + lua.Globals["dofile"] = (Func)DoFile; lua.Globals["loadfile"] = (Func)LoadFile; lua.Globals["require"] = (Func)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")) { diff --git a/Barotrauma/BarotraumaServer/ServerSource/Networking/GameServer.cs b/Barotrauma/BarotraumaServer/ServerSource/Networking/GameServer.cs index e086b9d8c..ba9baf42a 100644 --- a/Barotrauma/BarotraumaServer/ServerSource/Networking/GameServer.cs +++ b/Barotrauma/BarotraumaServer/ServerSource/Networking/GameServer.cs @@ -3842,6 +3842,8 @@ namespace Barotrauma.Networking { if (GameMain.Server == null || !GameMain.Server.ServerSettings.SaveServerLogs) { return; } + GameMain.Lua.hook.Call("serverLog", new object[] { line, messageType }); + GameMain.Server.ServerSettings.ServerLog.WriteLine(line, messageType); foreach (Client client in GameMain.Server.ConnectedClients)