From 31fcb5a1e26ed32eb69c8921ff99393ca305317a Mon Sep 17 00:00:00 2001 From: Evil Factory <36804725+evilfactory@users.noreply.github.com> Date: Fri, 1 Oct 2021 12:54:06 -0300 Subject: [PATCH] added more actions and moved lobby update to networking which makes more sense --- .../BarotraumaServer/ServerSource/Lua/LuaClasses.cs | 2 -- .../BarotraumaShared/SharedSource/Lua/LuaClasses.cs | 2 ++ .../SharedSource/Lua/LuaCustomConverters.cs | 10 ++++++---- .../BarotraumaShared/SharedSource/Lua/LuaSetup.cs | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaClasses.cs b/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaClasses.cs index 5f430a201..f622ad3b3 100644 --- a/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaClasses.cs +++ b/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaClasses.cs @@ -28,8 +28,6 @@ namespace Barotrauma public ServerSettings ServerSettings => GameMain.Server.ServerSettings; - public void ClientWriteLobby(Client client) => GameMain.Server.ClientWriteLobby(client); - public static void SendMessage(string msg, ChatMessageType? messageType = null, Client sender = null, Character character = null) { GameMain.Server.SendChatMessage(msg, messageType, sender, character); diff --git a/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaClasses.cs b/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaClasses.cs index 92a43f990..ef6c68d13 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaClasses.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaClasses.cs @@ -462,6 +462,8 @@ namespace Barotrauma } #if SERVER + public void ClientWriteLobby(Client client) => GameMain.Server.ClientWriteLobby(client); + public void Send(IWriteMessage netMessage, NetworkConnection connection = null, DeliveryMethod deliveryMethod = DeliveryMethod.Reliable) { if (connection == null) diff --git a/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaCustomConverters.cs b/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaCustomConverters.cs index 80b4794e6..71da4e977 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaCustomConverters.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaCustomConverters.cs @@ -12,11 +12,13 @@ namespace Barotrauma public static void RegisterAll() { - RegisterSimpleAction(); - RegisterSimpleAction(); + RegisterAction(); + RegisterAction(); + RegisterAction(); + RegisterAction(); } - public static void RegisterSimpleAction() + public static void RegisterAction() { Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Function, typeof(Action), v => { @@ -27,7 +29,7 @@ namespace Barotrauma - public static void RegisterSimpleAction() + public static void RegisterAction() { Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Function, typeof(Action), v => { diff --git a/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaSetup.cs b/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaSetup.cs index 8baa43914..bf48c2e4e 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaSetup.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/Lua/LuaSetup.cs @@ -338,7 +338,7 @@ namespace Barotrauma AddCallMetaMember(UserData.RegisterType()); AddCallMetaMember(UserData.RegisterType()); AddCallMetaMember(UserData.RegisterType()); - + #if SERVER #elif CLIENT