From eb7ae833b4bdcd8152956e5df1820d3797e4f72a Mon Sep 17 00:00:00 2001 From: Evil Factory <36804725+evilfactory@users.noreply.github.com> Date: Wed, 28 Jul 2021 15:15:51 -0300 Subject: [PATCH] workshop --- .../ServerSource/Lua/LuaSetup.cs | 20 +++++++++++++++---- .../ServerSource/Networking/RespawnManager.cs | 3 +++ .../BarotraumaServer/ServerSource/Program.cs | 4 ++++ 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaSetup.cs b/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaSetup.cs index 3badd55a2..36df53f54 100644 --- a/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaSetup.cs +++ b/Barotrauma/BarotraumaServer/ServerSource/Lua/LuaSetup.cs @@ -112,7 +112,9 @@ namespace Barotrauma UserData.RegisterType(); UserData.RegisterType(); UserData.RegisterType(); - + UserData.RegisterType(); + UserData.RegisterType(); + lua = new Script(CoreModules.Preset_SoftSandbox | CoreModules.LoadMethods); @@ -142,12 +144,22 @@ namespace Barotrauma lua.Globals["PositionType"] = UserData.CreateStatic(); lua.Globals["JobPrefab"] = UserData.CreateStatic(); lua.Globals["TraitorMessageType"] = UserData.CreateStatic(); + lua.Globals["CauseOfDeathType"] = UserData.CreateStatic(); + lua.Globals["Affliction"] = UserData.CreateStatic(); - foreach (string d in Directory.GetDirectories("Lua")) + foreach (string d in Directory.GetDirectories("Mods")) { - if (Directory.Exists(d + "/autorun")) + if (Directory.Exists(d + "/Lua/Autorun")) { - luaScriptLoader.RunFolder(d + "/autorun"); + luaScriptLoader.RunFolder(d + "/Lua/Autorun"); + } + + if (Directory.Exists(d + "/LuaRaw")) + { + foreach (string d2 in Directory.GetDirectories(d + "/LuaRaw")) + { + luaScriptLoader.RunFolder(d2 + "/Autorun"); + } } } diff --git a/Barotrauma/BarotraumaServer/ServerSource/Networking/RespawnManager.cs b/Barotrauma/BarotraumaServer/ServerSource/Networking/RespawnManager.cs index c97654058..bf65dc135 100644 --- a/Barotrauma/BarotraumaServer/ServerSource/Networking/RespawnManager.cs +++ b/Barotrauma/BarotraumaServer/ServerSource/Networking/RespawnManager.cs @@ -20,6 +20,9 @@ namespace Barotrauma.Networking MultiPlayerCampaign campaign = GameMain.GameSession.GameMode as MultiPlayerCampaign; foreach (Client c in networkMember.ConnectedClients) { + if (GameMain.Lua.game.overrideRespawnSub) + continue; + if (!c.InGame) { continue; } if (c.SpectateOnly && (GameMain.Server.ServerSettings.AllowSpectating || GameMain.Server.OwnerConnection == c.Connection)) { continue; } if (c.Character != null && !c.Character.IsDead) { continue; } diff --git a/Barotrauma/BarotraumaServer/ServerSource/Program.cs b/Barotrauma/BarotraumaServer/ServerSource/Program.cs index 03bbb4e15..4704aaca4 100644 --- a/Barotrauma/BarotraumaServer/ServerSource/Program.cs +++ b/Barotrauma/BarotraumaServer/ServerSource/Program.cs @@ -53,6 +53,10 @@ namespace Barotrauma string executableDir = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location); Directory.SetCurrentDirectory(executableDir); + + if (File.Exists("filelist.xml")) + Directory.SetCurrentDirectory(executableDir + "/../.."); // sweet + Game = new GameMain(args); Game.Run();