Giter VIP home page Giter VIP logo

evilfactory / luacsforbarotrauma Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fakefishgames/barotrauma

76.0 76.0 19.0 1.73 GB

Modification for Barotrauma that improves modding support.

Home Page: http://www.barotraumagame.com/

C# 61.62% Makefile 0.82% HLSL 0.22% Shell 1.11% Rich Text Format 0.10% Batchfile 0.01% HTML 0.11% C 27.93% C++ 6.10% Python 0.14% Processing 0.06% Perl 0.33% Assembly 0.74% CMake 0.11% M4 0.10% CSS 0.23% Lua 0.24% PowerShell 0.01% JavaScript 0.01%
barotrauma barotrauma-modding barotrauma-mods

luacsforbarotrauma's Introduction

Hello 👋

⚡ Student ⚡ .NET ⚡ Unity ⚡ Unreal Engine

luacsforbarotrauma's People

Contributors

3e849f2e5c avatar avikav avatar bluetheking avatar chesse20 avatar cintique avatar clasticm avatar crystalwarrior avatar dependabot[bot] avatar evilfactory avatar faerdan avatar github-actions[bot] avatar headswe avatar idekenterprises avatar itchyowl avatar juanjp600 avatar kampfkarren avatar maplewheels avatar mc-oofert avatar nilanthanimosus avatar notpeelz avatar oiltanker avatar qowyn avatar regalis11 avatar rokvach avatar shoter avatar tbn-maplewheels avatar terragen avatar tsunder avatar ursinewalrus avatar zhu-rengong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

luacsforbarotrauma's Issues

lua and cs do not follow the same rules of starting

The starting process of the lua script:

  1. Enabled Packages: lua files in the Autorun folder
  2. Local Packages & All Packages: lua files in the ForcedAutorun folder

cs script:
Only Enabled Packages: lua files in the Mod folder

client's enabled packages will be set to the same as the server and ignore the config in settings, assume i let mod force to run in the mutliplayer, lua files should be placed under the ForcedAutorun folder, but as for cs files, they can't.

Suggestion
Perhaps an additional search path should be added for the cs script loader to ensure that the unenabled mod enforce running some cs files.

item.equip and item.unequip hooks are inconsistent with each other.

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

The item.equip hook triggers on clothing equip, but the item.unequip hook does not.
For example, equipping an outfit or headgear will call item.equip, but taking them off does not call item.unequip.

Reproduction steps

  1. Write an item.equip and item.unequip hook.
Hook.Add("item.equip", "test1", function(item, character)
	print("Item Equipped")
end)

Hook.Add("item.unequip", "test2", function(item, character)
	print("Item Unequipped")
end)
  1. Load into a game and equip/unequip any clothing or headgear.
  2. Observe that "Item Equipped" is the only message appearing in console.
    3b. ("Item Unequipped" message will still appear for unequipping an item from your hands, eg. Captain's Revolver)

Bug prevalence

Happens every time I play

Version

v1.0.21.0

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

Husk transformation causes much more lags in luatrauma than in base game

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

10 simultaneously transforming patients
in luatrauma:
20240906054104_1
In base game
20240906054651_1

Reproduction steps

  • Take this mod
  • open any sub anywhere, e.g. "A test chamber" in sub editor
  • triggerevent "husk lag"

it will spawn 10 patients with 99% husk infection on main sub

Or

just give random people 100% husk infection

Bug prevalence

Happens every time I play

Single player or multiplayer?

Single player

-

No response

Version

luatrauma v1.5.9.2 (Summer Update Hotfix 2)

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

HideAndDisable function does not work when ran server-side.

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

limb.HideAndDisable and character.AnimController.HideAndDisable only works in singleplayer.
Upsettingly, unless I'm just stupid, I get the feeling this is probably an upstream issue. 😞

Reproduction steps

  1. Write a script utilizing a .HideAndDisable function, eg:
Hook.Add("item.equip", "a", function(item, character)
	local huskAppendages = {}
        for limb in character.AnimController.Limbs do
            if string.find(tostring(limb.Name), "Huskappendage %d+") then
                table.insert(huskAppendages, limb)
            end
        end
	for limb in huskAppendages do 
                -- (Enable one of these at a time to test them, obviously)
		limb.HideAndDisable(0, false)
		-- character.AnimController.HideAndDisable(limb.type, 0, false)
	end
end)
  1. Make a sub in the editor. (In this case you might want husk genes and a splicer so you're not racing it.)
  2. With client Lua enabled, test.
    3a. Give yourself husk with giveaffliction huskinfection 74.
    3b. Wait for the husk appendage to appear.
    3c. (Optional) Insert the husk genes, so you don't seize and die.
    3d. Equip any item.
  3. Observe that the appendage disappears.
  4. Quit out of the sub builder and host a server, repeating the above steps.
    5a. If needed: enablecheats, spawnitem geneticmaterialhusk cursor, spawnitem genesplicer cursor
  5. Observe that the appendage does not disappear.

Bug prevalence

Happens every time I play

Single player or multiplayer?

Multiplayer hosted from the in-game menu (= using a listen server)

-

No response

Version

v1.1.19.3 (Treacherous Tides Hotfix 2)

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

Finding specific components with signalReceived

I'm attempting to create a signal component that needs to store information specific to itself. I am using the signalReceived.myComponent hook, but to my understanding local variables are not persistent between calls. I've made a working version of what I want using global variables, but that limits me to a single active component due to interference.

I've looked though all of the examples and documentation to try to find a solution but I struggle to make sense of a lot of it since I'm very rusty with Lua. Is there an existing way to achieve this? If not, would it be possible to add a parameter to signalReceived.myComponent that outputs the specific component which received the signal that triggered the hook?

Doors/Hatches lagging + lagging the circuits connected to them?

  • [+] I have searched the issue tracker to check if the issue has already been reported.

Description
Doors lagging when are connected to auto-close circuit + animation of closing/opening also is lagging.
Circuitry lag: the delay component is set to 2 seconds, have to wait +- 10 sec for it to close.

Steps To Reproduce

  1. Open game.
  2. Select a sub to test with.
  3. Test it in sub editor, make sure doors work ok.
  4. Exit sub editor.
  5. Repeat steps 3-4, with the last time exiting in the main menu instead of editor.
  6. Host server (in-game), start with bots (I started with 2 (3 with fill option)).
  7. Maneuver sub, shoot guns, open/close doors etc. (should work fine at this moment).
  8. End mission, disconnect, enter sub editor, test sub.
  9. Doors should lag as described.

Version
Windows, latest default in steam, latest workshop mod version

Additional information
If bug not present I can demo in discord, just dm.

Barotrauma does not open after copying over patch.

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

I tried a manual install to get clientside lua on linux but it appears that it didnt work and now it doesn't open. I try to click start on steam and it syncs the cloud and then stops immediately.

Reproduction steps

  1. Install the patch for linux client
  2. Try to start the game

Bug prevalence

Happens every time I play

Version

0.18.15.0

-

No response

Which operating system did you encounter this bug on?

Linux

Relevant error messages and crash reports

No response

Please make searching of filelist.xml case insensivity for linux

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

In linux in time of initialization lua crashes if filelist.xml in mod folder was named as Filelist.xml
Issued for mods
2855733204
2908606449

Reproduction steps

  1. use linux dedicated barotrauma server
  2. load from workshop mods 2855733204 or 2908606449
  3. try to start dedicated barotrauma server
  4. see exception

Bug prevalence

Happens every time I play

Version

v1.0.8.0

-

No response

Which operating system did you encounter this bug on?

Linux

Relevant error messages and crash reports

[03/28/2023 18:59:36]
  Starting the server...
[03/28/2023 18:59:36]
  Using Lidgren networking. Manual port forwarding may be required. If players cannot connect to the server, you may want to use the in-game hosting menu (which uses SteamP2P networking and does not require port forwarding).
Lua! Version cf88aa4
Using LuaSetup.lua from the Barotrauma Lua/ folder.
[SV LUA ERROR] /home/steam/.steam/steamapps/common/Barotrauma Dedicated Server/Lua/ModLoader.lua:(128,12-59): Not a directory : '/home/steam/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2855733204/Filelist.xml': MoonSharp.Interpreter.NetRuntimeException: Not a directory : '/home/steam/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2855733204/Filelist.xml'
 ---> System.IO.IOException: Not a directory : '/home/steam/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2855733204/Filelist.xml'
   at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
   at System.IO.Enumeration.FileSystemEnumerator`1.Init()
   at System.IO.Enumeration.FileSystemEnumerator`1..ctor(String directory, Boolean isNormalized, EnumerationOptions options)
   at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
   at System.IO.Enumeration.FileSystemEnumerableFactory.UserEntries(String directory, String expression, EnumerationOptions options)
   at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
   at System.IO.Directory.GetFileSystemEntries(String path, String searchPattern, EnumerationOptions enumerationOptions)
   at System.IO.Directory.GetFileSystemEntries(String path)
   at Barotrauma.ToolBox.CorrectFilenameCase(String filename, Boolean& corrected, String directory) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Barotrauma/BarotraumaShared/SharedSource/Utils/ToolBox.cs:line 90
   at Barotrauma.ToolBox.CleanUpPathCrossPlatform(String path, Boolean correctFilenameCase, String directory) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Barotrauma/BarotraumaShared/SharedSource/Utils/ToolBox.cs:line 619
   at Barotrauma.ToolBox.CleanUpPath(String path) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Barotrauma/BarotraumaShared/SharedSource/Utils/ToolBox.cs:line 636
   at Barotrauma.LuaCsFile.<CanReadFromPath>g__getFullPath|0_0(String p) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsUtility.cs:line 20
   at Barotrauma.LuaCsFile.CanReadFromPath(String path) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsUtility.cs:line 22
   at Barotrauma.LuaCsFile.IsPathAllowedException(String path, Boolean write, LuaCsMessageOrigin origin) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsUtility.cs:line 98
   at Barotrauma.LuaCsFile.DirectoryExists(String path) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsUtility.cs:line 182
   at lambda_method16(Closure , Object , Object[] )
   at MoonSharp.Interpreter.Interop.MethodMemberDescriptor.Execute(Script script, Object obj, ScriptExecutionContext context, CallbackArguments args) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Libraries/moonsharp/MoonSharp.Interpreter/Interop/StandardDescriptors/ReflectionMemberDescriptors/MethodMemberDescriptor.cs:line 191
   at MoonSharp.Interpreter.Interop.OverloadedMethodMemberDescriptor.<>c__DisplayClass33_0.<GetCallback>b__0(ScriptExecutionContext context, CallbackArguments args) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Libraries/moonsharp/MoonSharp.Interpreter/Interop/StandardDescriptors/ReflectionMemberDescriptors/OverloadedMethodMemberDescriptor.cs:line 426
   at MoonSharp.Interpreter.CallbackFunction.Invoke(ScriptExecutionContext executionContext, IList`1 args, Boolean isMethodCall) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Libraries/moonsharp/MoonSharp.Interpreter/DataTypes/CallbackFunction.cs:line 58
   at MoonSharp.Interpreter.Execution.VM.Processor.Internal_ExecCall(Int32 argsCount, Int32 instructionPtr, CallbackFunction handler, CallbackFunction continuation, Boolean thisCall, String debugText, DynValue unwindHandler) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Libraries/moonsharp/MoonSharp.Interpreter/Execution/VM/Processor/Processor_InstructionLoop.cs:line 723
   at MoonSharp.Interpreter.Execution.VM.Processor.Processing_Loop(Int32 instructionPtr) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Libraries/moonsharp/MoonSharp.Interpreter/Execution/VM/Processor/Processor_InstructionLoop.cs:line 116
   --- End of inner exception stack trace ---
   at MoonSharp.Interpreter.Execution.VM.Processor.Processing_Loop(Int32 instructionPtr) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Libraries/moonsharp/MoonSharp.Interpreter/Execution/VM/Processor/Processor_InstructionLoop.cs:line 307
   at MoonSharp.Interpreter.Execution.VM.Processor.Call(DynValue function, DynValue[] args) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Libraries/moonsharp/MoonSharp.Interpreter/Execution/VM/Processor/Processor.cs:line 85
   at MoonSharp.Interpreter.Script.Call(DynValue function, DynValue[] args) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Libraries/moonsharp/MoonSharp.Interpreter/Script.cs:line 474
   at Barotrauma.LuaRequire.ExecuteModule(String moduleName, Table environment, DynValue& returnValue) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Lua/LuaRequire.cs:line 85
   at Barotrauma.LuaRequire.Require(String moduleName, Table globalContext) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Lua/LuaRequire.cs:line 103
   at lambda_method3(Closure , Object , Object[] )
   at MoonSharp.Interpreter.Interop.MethodMemberDescriptor.Execute(Script script, Object obj, ScriptExecutionContext context, CallbackArguments args) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Libraries/moonsharp/MoonSharp.Interpreter/Interop/StandardDescriptors/ReflectionMemberDescriptors/MethodMemberDescriptor.cs:line 191
   at MoonSharp.Interpreter.Interop.FunctionMemberDescriptorBase.<>c__DisplayClass29_0.<GetCallback>b__0(ScriptExecutionContext c, CallbackArguments a) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Libraries/moonsharp/MoonSharp.Interpreter/Interop/StandardDescriptors/MemberDescriptors/FunctionMemberDescriptorBase.cs:line 83
   at MoonSharp.Interpreter.CallbackFunction.Invoke(ScriptExecutionContext executionContext, IList`1 args, Boolean isMethodCall) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Libraries/moonsharp/MoonSharp.Interpreter/DataTypes/CallbackFunction.cs:line 58
   at MoonSharp.Interpreter.Execution.VM.Processor.Internal_ExecCall(Int32 argsCount, Int32 instructionPtr, CallbackFunction handler, CallbackFunction continuation, Boolean thisCall, String debugText, DynValue unwindHandler) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Libraries/moonsharp/MoonSharp.Interpreter/Execution/VM/Processor/Processor_InstructionLoop.cs:line 723
   at MoonSharp.Interpreter.Execution.VM.Processor.Processing_Loop(Int32 instructionPtr) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Libraries/moonsharp/MoonSharp.Interpreter/Execution/VM/Processor/Processor_InstructionLoop.cs:line 116
   at MoonSharp.Interpreter.Execution.VM.Processor.Call(DynValue function, DynValue[] args) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Libraries/moonsharp/MoonSharp.Interpreter/Execution/VM/Processor/Processor.cs:line 85
   at MoonSharp.Interpreter.Script.Call(DynValue function, DynValue[] args) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Libraries/moonsharp/MoonSharp.Interpreter/Script.cs:line 474
   at MoonSharp.Interpreter.Script.Call(Object function, Object[] args) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Libraries/moonsharp/MoonSharp.Interpreter/Script.cs:line 516
   at Barotrauma.LuaCsSetup.CallLuaFunction(Object function, Object[] args) in /home/runner/work/LuaCsForBarotrauma/LuaCsForBarotrauma/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsSe
                                                                                                        

[SV LUA ERROR] /home/steam/.steam/steamapps/common/Barotrauma Dedicated Server/Lua/ModLoader.lua:(128,12-59): Not a directory : '/home/steam/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2908606449/Filelist.xml': MoonSharp.Interpreter.NetRuntimeException: Not a directory : '/home/steam/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2908606449/Filelist.xml'
 ---> System.IO.IOException: Not a directory : '/home/steam/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2908606449/Filelist.xml'

Serverside LUA errors show mod pathing, potentially leaking private information

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

Errors in the debug console show the mod's pathing to the entire server in multiplayer. On windows servers hosted from the in-game menu, this means any workshop mods will show the name of the user. Which may contain real names. Mine for example, contains my full real name.

image
Name covered up... for obvious reasons.

Reproduction steps

Host a server from the in-game menu.
Cause a LUA error in the debug console.
Have another server member read the debug console.
They now know the host's windows username.

Bug prevalence

Happens every now and then

Single player or multiplayer?

Multiplayer hosted from the in-game menu (= using a listen server)

-

No response

Version

v1.1.19.3 (Treacherous Tides Hotfix 2)

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

System.InvalidOperationException: Cannot enter the same MoonSharp processor from two different threads

  • I have searched the issue tracker to check if the issue has already been reported.

Description
The Game crashes, not only the server, but also game.

Steps To Reproduce
Wearing a longrange radio from EK Armory and then trying to wear the Military Mk-I Hardsuit, while being in a shuttle.
Since the mod doesn't use lua, I am reporting it here.

Version
Windows
Lua! Version: fd0c3ba
Barotrauma: v0.17.12.0 rev fd0c3ba

Additional information
[SV LUA ERROR] System.InvalidOperationException: Cannot enter the same MoonSharp processor from two different threads : 4 and 5
at MoonSharp.Interpreter.Execution.VM.Processor.EnterProcessor()
at MoonSharp.Interpreter.Execution.VM.Processor.Call(DynValue function, DynValue[] args)
at Barotrauma.LuaCsSetup.CallLuaFunction(Object function, Object[] arguments)

Add support for loading scripts in the sub editor

It could be useful to allow loading scripts while editing (not playtesting) in the subeditor, as some mods might want to patch/inject sub-editor specific code.
However this could possibly break existing mods that don't expect to be loaded in a sub editor environment.

Some error on console, but there appears to be no impact.

  • I have searched the issue tracker to check if the issue has already been reported.

Description
This is what i see, when i host a server.
[CL LUA ERROR] System.Exception: Method 'Drop' with parameters 'False' not found in class 'Barotrauma.Item'
LUA LOADER: Only enabled mods will be executed. Lua/LuaSetup.lua
[CL LUA ERROR] Lua/LuaSetup.lua:(36,0-60): cannot access field GameSettings of userdata<Barotrauma.LuaGame>

Steps To Reproduce
using command "cl_reloadlua"

Version
lua version fb 159fd93 windows, clientside lua

Additional information

Any idea for implementing script to clr conversions for all gui event handlers?

#if CLIENT
            Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Function, typeof(GUIButton.OnClickedHandler), v =>
            {

                var function = v.Function;
                return (GUIButton.OnClickedHandler)((GUIButton a, object b) => new LuaResult(GameMain.Lua.CallFunction(function, a, b)).Bool());
            });

            Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Function, typeof(GUITextBlock.TextGetterHandler), v =>
            {
                var function = v.Function;
                return (GUITextBlock.TextGetterHandler)(() => new LuaResult(GameMain.Lua.CallFunction(function, new object[] {})).String());
            });

            Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Function, typeof(GUITextBox.OnTextChangedHandler), v =>
            {
                var function = v.Function;
                return (GUITextBox.OnTextChangedHandler)((GUITextBox a, string b) => new LuaResult(GameMain.Lua.CallFunction(function, a, b)).Bool());
            });

            Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Function, typeof(GUITextBox.OnEnterHandler), v =>
            {
                var function = v.Function;
                return (GUITextBox.OnEnterHandler)((GUITextBox a, string b) => new LuaResult(GameMain.Lua.CallFunction(function, a, b)).Bool());
            });

            Script.GlobalOptions.CustomConverters.SetScriptToClrCustomConversion(DataType.Function, typeof(GUITickBox.OnSelectedHandler), v =>
            {
                var function = v.Function;
                return (GUITickBox.OnSelectedHandler)((GUITickBox a) => new LuaResult(GameMain.Lua.CallFunction(function, a)).Bool());
            });

#endif

There are only 5 conversions now, is there a way to get more?

image
(GHC8TELOORD`9B(7VJM5

Server wont start using dedicated lua server

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

Trying to start a server ends up in a file not found error

Reproduction steps

  1. Try to start server using dedicated server executable

Bug prevalence

Happens every time I play

Version

Other

-

Using 0.18.15.0 build with lua from this repo

Which operating system did you encounter this bug on?

Linux

Relevant error messages and crash reports

Barotrauma Client crash report (generated on 08/17/2022 15:07:22)


Barotrauma seems to have crashed. Sorry for the inconvenience! 


0222435A485FA40E56BEE1E7CEB05961


Game version 0.18.15.0 (ReleaseLinux, branch master, revision d73a8ac)
Graphics mode: 2560x1080 (Fullscreen)
VSync ON
Language: English
Selected content packages: Vanilla, Barotronics - The Turret Collection, Hazardous Reactors + advanced medecin/neurotrauma patch, Hazardous Reactors, Let Them All In, EK | Gunnery, Genes+ Revived and Expanded, Enhanced Armaments Neurotrauma Patch, Neurotrauma Cybernetics, NT Surgery Plus, Neurotrauma, DynamicEuropa, Improved Husks, Barotraumatic Xanmonsters1 Fixes, Barotraumatic Undersea Horrors Fixes, BaroTraumatic, Enhanced Armaments, New Wrecks For Barotrauma (With sellable wrecks), EK | Utility, Submarine Weapon Sound Makeover, ExtendedMonsters [Spawner Edition], #5-16 TITAN, MGE Posters, Lua For Barotrauma, EK | Dockyard, Performance Fix, ES Guppy
Level seed: no level loaded
Loaded submarine: None
Selected screen: Barotrauma.MainMenuScreen


System info:
    Operating system: Unix 5.19.1.1 64 bit
    GPU name: 
    Display mode: {Width:2560 Height:1080 Format:Color AspectRatio:2.3703704}
    GPU status: Normal


Exception: ChildServerRelay readTask did not run to completion: status was WaitingForActivation. (System.Exception)
Target site: Int32 ReadIncomingMsgs()
Stack trace: 
   at Barotrauma.Networking.ChildServerRelay.ReadIncomingMsgs() in <DEV>/Barotrauma/BarotraumaShared/SharedSource/Networking/ChildServerRelay.cs:line 141
   at Barotrauma.Networking.ChildServerRelay.<UpdateRead>g__readBytes|40_0(Span`1 readTo) in <DEV>/Barotrauma/BarotraumaShared/SharedSource/Networking/ChildServerRelay.cs:line 172
   at Barotrauma.Networking.ChildServerRelay.UpdateRead() in <DEV>/Barotrauma/BarotraumaShared/SharedSource/Networking/ChildServerRelay.cs:line 183
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ThreadHelper.ThreadStart()


Last debug messages:
[08/17/2022 15:07:22] Exiting...
[08/17/2022 15:07:07] Failed to start server {No such file or directory}
   at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Barotrauma.Networking.ChildServerRelay.Start(ProcessStartInfo processInfo) in <DEV>/Barotrauma/BarotraumaClient/ClientSource/Networking/ChildServerRelay.cs:line 29
   at Barotrauma.MainMenuScreen.StartServer() in <DEV>/Barotrauma/BarotraumaClient/ClientSource/Screens/MainMenuScreen.cs:line 934
[08/17/2022 15:07:07] Failed to start ChildServerRelay Process. File: .//home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2559634234/Binary/DedicatedServer.exe, arguments: -name "Server" -public False -playstyle Casual -banafterwrongpassword False -karmaenabled True -maxplayers 10 -nopassword -steamid 76561198872612173 -ownerkey 211832184 -pipes 250 254
[08/17/2022 15:06:31] Loading texture from stream failed! {Error loading texture data from stream: unknown image type    at MonoGame.Utilities.ImageReader.Read(Stream stream, Int32& x, Int32& y, Int32& comp, Int32 req_comp) in G:\Repositories\Barotrauma\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Utilities\Imaging\ImageReader.cs:line 56
   at Microsoft.Xna.Framework.Graphics.Texture2D.TextureDataFromStream(Stream stream, Int32& width, Int32& height, Int32& channels) in G:\Repositories\Barotrauma\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Graphics\Texture2D.cs:line 313}
   at Microsoft.Xna.Framework.Graphics.Texture2D.TextureDataFromStream(Stream stream, Int32& width, Int32& height, Int32& channels) in G:\Repositories\Barotrauma\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Graphics\Texture2D.cs:line 313
   at Barotrauma.TextureLoader.FromStream(Stream stream, String path, Boolean compress, Boolean mipmap) in <DEV>/Barotrauma/BarotraumaClient/ClientSource/Utils/TextureLoader.cs:line 241

Inner exception: unknown image type
   at MonoGame.Utilities.ImageReader.Read(Stream stream, Int32& x, Int32& y, Int32& comp, Int32 req_comp) in G:\Repositories\Barotrauma\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Utilities\Imaging\ImageReader.cs:line 56
   at Microsoft.Xna.Framework.Graphics.Texture2D.TextureDataFromStream(Stream stream, Int32& width, Int32& height, Int32& channels) in G:\Repositories\Barotrauma\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Graphics\Texture2D.cs:line 313
[08/17/2022 15:06:05] WARNING: /home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2197353935/randomevents_campaign.xml: All root EventSets should have an identifier
[08/17/2022 15:06:05] WARNING: /home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2197353935/randomevents_campaign.xml: All root EventSets should have an identifier
[08/17/2022 15:06:05] WARNING: /home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2197353935/randomevents_campaign.xml: All root EventSets should have an identifier
[08/17/2022 15:06:05] WARNING: /home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2197353935/randomevents_campaign.xml: All root EventSets should have an identifier
[08/17/2022 15:06:05] WARNING: /home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2197353935/randomevents_campaign.xml: All root EventSets should have an identifier
[08/17/2022 15:06:05] WARNING: /home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2197353935/randomevents_campaign.xml: All root EventSets should have an identifier
[08/17/2022 15:06:05] WARNING: /home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2197353935/randomevents_campaign.xml: All root EventSets should have an identifier
[08/17/2022 15:06:05] WARNING: /home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2197353935/randomevents_campaign.xml: All root EventSets should have an identifier
[08/17/2022 15:06:05] WARNING: /home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2197353935/randomevents_campaign.xml: All root EventSets should have an identifier
[08/17/2022 15:06:05] WARNING: /home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2197353935/randomevents_campaign.xml: All root EventSets should have an identifier
[08/17/2022 15:06:05] WARNING: /home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2197353935/randomevents_campaign.xml: All root EventSets should have an identifier
[08/17/2022 15:06:05] WARNING: /home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2197353935/randomevents_campaign.xml: All root EventSets should have an identifier
[08/17/2022 15:05:53] Overriding an affliction or a buff with the identifier 'huskinfection' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2085783214/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'combatstimulant' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'implacable' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'concussion' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'radiationsickness' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'drunk' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'invertcontrols' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'chemwithdrawal' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'chemaddiction' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'opiatewithdrawal' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'opiateoverdose' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'opiateaddiction' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'burn' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'explosiondamage' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'organdamage' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'gunshotwound' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'bitewounds' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'lacerations' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'blunttrauma' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'internaldamage' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'bleedingnonstop' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'bleeding' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'sufforinpoisoning' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'cyanidepoisoning' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'morbusinepoisoning' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'bloodloss' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:51] Overriding an affliction or a buff with the identifier 'oxygenlow' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2776270649/Xml/Afflictions.xml'
[08/17/2022 15:05:48] Overriding an affliction or a buff with the identifier 'nausea' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2547888957/Content/Items/Medical/Afflictions.xml'
[08/17/2022 15:05:48] Duplicate affliction: 'burningrod' defined in Affliction of '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2547888957/Content/Items/Medical/Afflictions.xml'
[08/17/2022 15:05:48] Duplicate affliction: 'criticalrod_burn_emitter' defined in Affliction of '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2547888957/Content/Items/Medical/Afflictions.xml'
[08/17/2022 15:05:48] Duplicate affliction: 'burn_emitter_rod' defined in Affliction of '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2547888957/Content/Items/Medical/Afflictions.xml'
[08/17/2022 15:05:48] Duplicate affliction: 'burn_emitter' defined in Affliction of '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2547888957/Content/Items/Medical/Afflictions.xml'
[08/17/2022 15:05:48] Overriding an affliction or a buff with the identifier 'radiationsickness' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2547888957/Content/Items/Medical/Afflictions.xml'
[08/17/2022 15:05:48] Duplicate affliction: 'dnadamage' defined in Affliction of '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2547888957/Content/Items/Medical/Afflictions.xml'
[08/17/2022 15:05:48] Overriding an affliction or a buff with the identifier 'radiationsickness' using the file '/home/ianl/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2655920928/afflictionpatch.xml'
[08/17/2022 15:05:28] Attempting to open ALC device "Built-in Audio Analog Stereo"
[08/17/2022 15:05:26] Logged in as Meganium97 (SteamID STEAM_1:1:456173222)

Nullref exception in ClientWriteLobby

after joining a lua-server, if round has already started, the game can't normally load net lobby screen until round ended:
8{ U 6SMOGTW6_RX)T_Q0MA

The server console will pop up constantly:

Failed to write a network message for the client "zhurengong"! {Object reference not set to an instance of an object.}
   at Barotrauma.Networking.GameServer.ClientWriteLobby(Client c) in <DEV>\Barotrauma\BarotraumaServer\ServerSource\Networking\GameServer.cs:line 1849
   at Barotrauma.Networking.GameServer.ClientWrite(Client c) in <DEV>\Barotrauma\BarotraumaServer\ServerSource\Networking\GameServer.cs:line 0
   at Barotrauma.Networking.GameServer.Update(Single deltaTime) in <DEV>\Barotrauma\BarotraumaServer\ServerSource\Networking\GameServer.cs:line 615

Joining other lua servers will meet the same problem.

Unidentified lighting bug

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

LUA client and server cause a strange interaction somewhere that causes extremely odd lighting effects. It seems like it would be related to performance fix, but it was previously fixed by reinstalling ALL LUAcs mods. Now it happens in vanilla, though this only seems to be in effect after i did a manual installation for dedicated server.

General lights are disabled when nearby large quantities of lights, but lighting effects return when entering a darker area.
I have tried verifying game files, reinstalling client and server, and manually unsubscribing from the workshop pages.

weirdly, this bug only seems to affect me and my client

luacs.bug.mp4

Reproduction steps

  1. Install LUAcs
  2. ???
  3. Open a map with a large number of lights nearby
  4. Observe odd behavior

Bug prevalence

Happens every time I play

Single player or multiplayer?

Happens in both single player and multiplayer

-

No response

Version

v1.2.8.0 (Winter Update hotfix 2)

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

Seems LFB cause the large clientpermissions.xml, on the extensive repetition of commands.

  • I have searched the issue tracker to check if the issue has already been reported.

Description
we can see FakeFishGames#8962 and FakeFishGames#8933, the server seems all use LFB, and this also happen on my linux server with LFB installed. but i'm not 100% sure, seems server without LFB works good.

Steps To Reproduce
(not sure) join a DedicatedServer with LFB, and give you some command. quit and join several times, see how the xml file expands.

Version
0.17.12.0 linux with LFB DedicatedServer [LUA] Lua! Version 5db4be7

Additional information
I uploaded my file to help you.
clientpermissions.zip

LuaCs isn't initialized when using the "quickstart" command to start a game

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

Happens when using a C# mod. I haven't checked whether this happens for lua specifically as well, but I'm assuming it does, because there's no init-message in the debug console. I found one mention about looking into quickstar in #40, and something related having been fixed in unstable, but I wasn't able to find what code change that referred to exactly.

Reproduction steps

  1. Enable any C# mod.
  2. Use the quickstart command in the main menu.

Bug prevalence

Happens every time I play

Version

0.20.15.0

-

No response

Which operating system did you encounter this bug on?

MacOS

Relevant error messages and crash reports

No response

Can't create issues

Barotrauma "new issue" button is redirecting you to baro discussions
So does "new issue" button in luatrauma repo
BaroDev (wide)

TimeoutThreshold settings

Hello, is it posible to move "TimeoutThreshold" parameter to the settings file? Some my friends are having trouble logging in the dive, because the game freezes while loading and server kick them. I think this will help others who have the same issue.
Thank you in advance!

Barotrauama disconnects on map change

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

Upon map change, Barotrauma will desync and disconnect clients. Both host and client are using the same mods

Reproduction steps

  1. start a multiplayer campaign
  2. trigger a map change
  3. client will be disconnected
  4. to fix, client will have to restart game to be able to reconnect, as server will reject reconnects

Bug prevalence

Happens every time I play

Version

0.17.15.0

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

Mysterious harmony patch having the function pointer changed after first run?

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

Patches for some reason have their function pointer changed when launching a debug build directly from the exe? And it only seems to have happen with a single person? And it somehow fixes itself after patching it again? (reloadlua)

Reproduction steps

There's no reproduction steps, other than enabling a Lua mod that patches some method and testing if it works for the first patch, and that never happens.

Bug prevalence

Happens every now and then

Version

0.18.12.0

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

Manual installation on Mac OS is error prone

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

When installing the mod via this tutorial on mac os ventura, copying the mod files into the game folder corrupts the game and it will crash on launch.

Reason:
On mac os, because Apple ThiNKs DifFeReNtlY, pasting a folder with the same name as an existing folder will not merge them. Instead, the new folder will replace the existing folder.

Therefore, I needed to copy the Effects manually into the lowest folder.

I don't think mods caused this, since the Content folder was full at the start and basically empty at the end (only Effects folder)

Reproduction steps

  1. Install game
  2. Paste mod files
  3. Select "replace" and "apply to all" checkbox
  4. Launch game (will crash)

Bug prevalence

Just once

Version

v1.0.21.0

-

No response

Which operating system did you encounter this bug on?

MacOS

Relevant error messages and crash reports

Barotrauma Client crash report (generated on 07/08/2023 16:53:30)

Barotrauma seems to have crashed. Sorry for the inconvenience! 

A2FB4D0B2331CB3A827C58811BB9F1F8

Game version 1.0.21.0 (ReleaseMac, branch master, revision 6b149e0)
Graphics mode: 1920x1080 (BorderlessWindowed)
VSync OFF
Language: English
Selected content packages: None
Level seed: no level loaded
Loaded submarine: None
Selected screen: None
SteamManager initialized

System info:
    Operating system: Unix 13.4.1 64 bit
    GPU name: 
    Display mode: {Width:1920 Height:1080 Format:Color AspectRatio:1.7777778}
    GPU status: Normal

Exception: Could not find file '/Users/ciriousjoker/Library/Application Support/Steam/steamapps/common/Barotrauma/Barotrauma.app/Contents/MacOS/Content/Effects/waterbump.png'. (System.IO.FileNotFoundException)
Target site: Void ThrowExceptionForIoErrno(ErrorInfo, System.String, Boolean, System.Func`2[Interop+ErrorInfo,Interop+ErrorInfo])
Stack trace: 
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
   at System.IO.File.Open(String path, FileMode mode, FileAccess access, FileShare share)
   at Barotrauma.IO.File.Open(String path, FileMode mode, FileAccess access, Nullable`1 share) in <DEV>/Barotrauma/BarotraumaShared/SharedSource/Utils/SafeIO.cs:line 410
   at Barotrauma.IO.File.OpenRead(String path) in <DEV>/Barotrauma/BarotraumaShared/SharedSource/Utils/SafeIO.cs:line 415
   at Barotrauma.TextureLoader.FromFile(String path, Boolean compress, Boolean mipmap) in <DEV>/Barotrauma/BarotraumaClient/ClientSource/Utils/TextureLoader.cs:line 193
   at Barotrauma.WaterRenderer..ctor(GraphicsDevice graphicsDevice) in <DEV>/Barotrauma/BarotraumaClient/ClientSource/Map/Levels/WaterRenderer.cs:line 71
   at Barotrauma.GameMain.LoadContent() in <DEV>/Barotrauma/BarotraumaClient/ClientSource/GameMain.cs:line 407
   at Microsoft.Xna.Framework.Game.Initialize() in <DEV>/Libraries/MonoGame.Framework/Src/MonoGame.Framework/Game.cs:line 551
   at Barotrauma.GameMain.Initialize() in <DEV>/Barotrauma/BarotraumaClient/ClientSource/GameMain.cs:line 375
   at Microsoft.Xna.Framework.Game.DoInitialize() in <DEV>/Libraries/MonoGame.Framework/Src/MonoGame.Framework/Game.cs:line 678
   at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior) in <DEV>/Libraries/MonoGame.Framework/Src/MonoGame.Framework/Game.cs:line 381
   at Microsoft.Xna.Framework.Game.Run() in <DEV>/Libraries/MonoGame.Framework/Src/MonoGame.Framework/Game.cs:line 367
   at Barotrauma.Program.Main(String[] args) in <DEV>/Barotrauma/BarotraumaClient/ClientSource/Program.cs:line 58

Last debug messages:
[07/08/2023 16:53:29] Logged in as CiriousJoker (SteamID STEAM_1:0:57289487)

Use `GetDerivedNonAbstract` for `CharacterAbilityGroup::ConstructCondition`

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

In the current implementation it uses conditionType = Type.GetType("Barotrauma.Abilities." + type + "", false, true); to find the type of AbilityCondition. However, this is very hard coded and makes extending AbilityConditions, for example adding own new types of AbilityConditions, extremely hard. This is also not consistent with other places like AfflictionPrefab and ItemComponent, where both uses ReflectionUtils.GetDerivedNonAbstract. You may search "GetDerivedNonAbstract" to verify its usages. Given that lua for baro modifies this method to also include modded assemblies with the purposes of making the game more extendable, AbilityCondition should also be constructed using this method.

Therefore the change I propose to change the hard coded Type.GetType line to ReflectionUtils.GetDerivedNonAbstract<AbilityCondition>().First() (or smth like this). This should not change XML behaviors as all vanilla AbilityConditions are subclasses of AbilityCondition with the benefit of making creating new ones way more easier.

Reproduction steps

Problem described above.

Bug prevalence

Just once

Single player or multiplayer?

Single player

-

No response

Version

v1.2.8.0 (Winter Update hotfix 2)

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

How to get the subs field reference of NetLobbyScreen?

There is a trick to force all players to update the lobby, looks like:

    client.LastRecvLobbyUpdate = 0
    Networking.ClientWriteLobby(client)
    client.LastRecvLobbyUpdate = Game.NetLobbyScreen.LastUpdateID

the purpose is to add a new submarine in a multiplayer campaign, and it works.
But I cannot remove the submarine from the listbox in the lobby.
Because a field named 'subs' from Barotrauma.NetLobbyScreen in WindowsServer is Private:
private List<SubmarineInfo> subs;
And no method can reference it.
I don't know how to get it, Is there any way to solve it?

Question regarding C# mods and classes added by LuaCs

Now this is potentially a really stupid question, but to create a C# mod for LuaCs, is it actually necessary to actively use any of the classes LuaCs provides for mods to use?
I only realized it after I was basically finished with writing my first proper C# mod for the game that it didn't use LuaCs classes like ACsMod. As far as I can tell, that mod is fully functional on both client and server. So I'm basically wondering if there's something I'm missing.

Quoting the LuaCs docs:

The main star of the show is Barotrauma::ACsMod class. It is what all your mods will use to hook game methods, and execute custom code.

I originally took this to mean any C# mod was basically bound to using ACsMod, but now I'm wondering if that should be taken more literally, and less-invasive mods will get by just fine without it.

Link to mod repo in case anybody want's to see how it's implemented or what the mod does (readme etc. is included).

In this mod I just implemented another ItemComponent in the same way builtin ones are, and implemented in XML that new component in also newly created items. This seems to work; LuaCs loads the code, and the game will use its content using the exact same functionality it uses vanilla content.
This shouldn't be taken as a complaint. On the contrary, being able to do it like that is downright lovely. Just looking whether somebody is able to shed a little light on the matter.

Looking to extend/abstract this

Hey there, amazing work on this mod. I've been playing Barotrauma since legacy and it's very exciting to see someone working on integrating scripting capabilities into the game.

I was wondering if you would be alright with me forking this project and abstracting away some of the Lua specific bits to add support for other languages, particularly Typescript (which is my daily driver).

Moonsharp overload resolution cache corruption

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

Code to reproduce the problem, calling it two times in a row seems to cause the overload cache to become corrupted resulting in the wrong method being called.

function test()
    Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.GetItemPrefab("combatdivingsuit"), Vector2(0, 0), nil, nil, function (item)
        Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.GetItemPrefab("oxygenitetank"), item.OwnInventory)
    end)
    Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.GetItemPrefab("oxygenitetank"), Vector2(0, 0))

    Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.GetItemPrefab("oxygenitetank"), Client.ClientList[1].Character.Inventory, nil, nil, function (item)
    end)
end

    Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.Prefabs["sonarbeacon"], Vector2(0, 0), nil, nil, function(item)
        Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.Prefabs["batterycell"], item.OwnInventory, nil, nil, function(bat)
            bat.Indestructible = true

            local interface = item.GetComponentString("CustomInterface")

            interface.customInterfaceElementList[1].State = true
            interface.customInterfaceElementList[2].Signal = "Last known pirate position"

            item.CreateServerEvent(interface, interface)

        end)
    end)

    local inv = Character.CharacterList[1].Inventory

    for i = 1, 4, 1 do
        Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.GetItemPrefab("shotgun"), inv, nil, nil, function (item)
            for i = 1, 6, 1 do
                Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.GetItemPrefab("shotgunshell"), item.OwnInventory)
            end
        end)
    end

    Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.GetItemPrefab("pirateclothes"), inv, nil, nil, function (item)

    end)

    Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.GetItemPrefab("pucs"), inv, nil, nil, function (item)
        Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.GetItemPrefab("combatstimulantsyringe"), item.OwnInventory)
        Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.GetItemPrefab("oxygenitetank"), item.OwnInventory)
    end)

    Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.GetItemPrefab("combatdivingsuit"), inv, nil, nil, function (item)
        Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.GetItemPrefab("combatstimulantsyringe"), item.OwnInventory)
        Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.GetItemPrefab("oxygenitetank"), item.OwnInventory)
    end)

    Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.GetItemPrefab("revolver"), inv, nil, nil, function (item)
        for i = 1, 6, 1 do
            Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.GetItemPrefab("revolverround"), item.OwnInventory)
        end
    end)

    for i = 1, 4, 1 do
        Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.GetItemPrefab("oxygenitetank"), inv)
    end
end

Reproduction steps

No response

Bug prevalence

Happens regularly

Version

0.18.15.0

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

JsonTableConverter is good

lua itself doesn't recognize some unicode sequences like \u6211\u6212\u6213\u1362\u1462\u1562 <=> 我戒戓።ᑢᕢ, for example:

local result = string.gsub("我戒戓።ᑢᕢ", '[%z\1-\31\\"]', function (c)
    return "\\" .. string.format("u%04x", c:byte())
end)
print(result)

-- output:
-- \u003f\u003f\u003f

the output wasn't what we expected, so lua's pure json library (such as json.lua by rxi) doesn't work well due to single-byte constraints for string functions.

However, I found a better Json tool named JsonTableConverter at MoonSharp that (de)serialization between table and json is done entirely in C#, doesn't produce this problem, and its performance is about 15 times higher than the pure lua json library, but we need to manually escape "\/"

of course we can also use JsonTableConverter directly via LuaUserData, but it seems a little weird to use MoonSharp to register a type under MoonSharp.

Lua Install for Mac - Steam and Permissions issues

Hello,

Thanks for the work on Lua for Baro, it's great stuff. I have no issues at all on my Windows but getting a fair bit of small troubles on my Mac (laptop for when I'm away from my main pc). I have an issue with steam not being picked-up. Not sure where to find the steam client.so binary in my steam install, however.

Guide states for Linux machines: "Sometimes you will get steam initialization errors, most of the time it's because it's missing the linux64/steamclient.so binary, so you can just copy the binary from your steam installation over to the folder and it should work."

Screenshot of steam issue: https://cdn.discordapp.com/attachments/614212649571581973/1015948603396730912/Screenshot_2022-09-04_at_12.36.38_PM.png

I also had a tedious however solvable issue with Mac flagging every single executable as dangerous and requiring manual allowance - if there's a way to automate that, would be nice to include it in the guide. It's very streamlined for linux and windows users but it does skip a few steps for Mac users (e.g. 2 Contents folders within the barotrauma.app, I copied both but bit of a gamble).

Screenshot of permissions (verified each single file manually, about 50 total? Probably a bit more. All executables and dlls basically. https://cdn.discordapp.com/attachments/614212649571581973/1015947969666756608/Screenshot_2022-09-04_at_12.18.56_PM.png

Anything else you need please let me know.

Hiding usernames in error logs doesn't work

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

Username is visible despite "Hide Usernames In Error Logs" being enabled.
image

Reproduction steps

1, Encounter an error.
2. Read the error.

Bug prevalence

Happens every time I play

Single player or multiplayer?

Multiplayer hosted from the in-game menu (= using a listen server)

-

No response

Version

v1.2.7.0 (Winter Update hotfix)

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

Mods not requiring Server side are not showing up in the server mod's list

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

This is a replica of an issue just opened on Regalis11 repo for barotrauma. Ref link is down after this opening message. Please check his reply for further testing.


We need someone else to further investigate this to be sure it's not just a problem I'm running into with my configuration.
This is the docker image I've been using, built by myself using another as a starting point: https://github.com/theCrius/barotrauma-docker

I've been running a dedicated server for several months now, since the release of the mod's refactor in Barotrauma really.

The behaviour that I keep seeing consistently is this:

  • If a mod requires it to be installed server side to be able to function on a dedicated server, it will show up and work as expected (provided the mod doesn't have bugs itself). With working as intended I mean that it shows up in the server's mods' list and who connect can download it from the server if not already subscribed to the mod.

  • If a mod does not requires to be installed on the server, even if installed (mod's file in the right directory and config_player.xml edited to include it) it will not show up in the server's mods' list.

Now this second case would be fine as if a mod's not requiring a server side, doesn't matter if it's visible or not.
However, unfortunately, when connecting to a server, the clients are forced to have the exact same list of mods running which means that mods that are meant to work just client's side will be disabled as they are not in the server's mods' list.

Reproduction steps

Bug prevalence

Happens every time I play

Version

0.18.15.0

-

No response

Which operating system did you encounter this bug on?

Linux

Relevant error messages and crash reports

No response

afflictionUpdate hook does not support singleplayer.

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

I'm attempting to write a hook using afflictionUpdate, and primarily code in the sub editor. However, the hook doesn't work here as the submarine editor is considered singleplayer, and the hook appears to only be called on the server.

Reproduction steps

  1. Create a new lua hook using afflictionUpdate
Hook.Add("afflictionUpdate", "experiment", function(affliction, characterHealth, limb)
    print("Affliction Update: ", affliction.Identifier)
end)
  1. Save and load into submarine editor or singleplayer.
  2. Use a command to apply an affliction to yourself, eg. giveaffliction vigor 100 <charactername>.
  3. Observe that nothing appears in the console.
  4. Exit, then host a multiplayer game.
  5. Repeat step 3.
  6. Observe that the message appears in the console.

Bug prevalence

Happens every time I play

Version

v1.0.21.0

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

After updating on the workshop, opening the server will crash

There are four servers on our side that cannot open the dedicatedserver.
T@`C E~7Q%I{$GI ~OOH2 6
The server process has closed unexpectedly. A crash report (servercrashreport.log) may have been generated in the game's root directory.

Servercrashreport.log is not generated

Can't install on linux: `tried to register a type that doesn't exist Barotrauma.AITrigger`

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

Note, I was able to easily install Lua for Barotrauma a couple of months ago, but can no longer. None of the other mods load correctly because of the error: tried to register a type that doesn't exist Barotrauma.AITrigger

To prevent weird issues, I completely reinstalled barotrauma, only enabled this mod, and followed the install instructions for the Windows version. There were no errors during the installation. After opening a new vanilla lobby to test if it installed correctly, I get the following error:

Screenshot from 2023-10-01 13-03-50

Following the common troubleshooting listed on the workshop page didn't resolve the issue for me.

Reproduction steps

  1. Launch the freshly installed barotrauma
  2. Enable the Lua for Barotrauma Linux mod
  3. Host a server using the modded executable
  4. In the server, run install_cl_lua
  5. Restart
  6. Open a vanilla lobby
  7. See error message listed.

Bug prevalence

Happens every time I play

Version

Other

-

v1.0.20.1

Which operating system did you encounter this bug on?

Linux

Relevant error messages and crash reports

The last crash report was made in May 2023, so it's not even relevant.

Hook "think" is called twice per tick.

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

GameMain.LuaCs.Update();
GameMain.LuaCs.Hook.Call("think", new object[] { });

public void Update()
{
Timer?.Update();
Steam?.Update();
Hook?.Call("think");
}

Reproduction steps

No response

Bug prevalence

Happens every now and then

Version

0.20.15.0

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

Server restart drops all custom command permissions

The server is loading it's settings and thus client permissions inside the GameServer constructor, but the lua setup script runs after that. This causes all command permissions of commands added by lua to be lost, since they have to be defined before loading the client permission file.

Installation logic may have ignored certain dlls.

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

A friend of mine was having problem with game with client side lua installed.

Crash log suggests dll not being copied:

Barotrauma Client crash report (generated on 10/08/2022 10:37:48)


Barotrauma seems to have crashed. Sorry for the inconvenience! 


997CD079A4CCAE85B2B8B09434C7386D


Game version 0.19.11.0 (ReleaseWindows, branch master, revision 8fef89a255)
Graphics mode: 1842x1036 (BorderlessWindowed)
VSync ON
Language: Simplified Chinese
Selected content packages: Vanilla, Lua For Barotrauma, [BOS]Backpack, [BOS]Wrecks, [BOS]Beacons, [BOS]Map, project shipwrecks, Beacons Extended, 高难狩猎, 天赋增强[CN/EN/RU/FRN], Material IO, llangmod
Level seed: no level loaded
Loaded submarine: None
Selected screen: Barotrauma.MainMenuScreen
SteamManager initialized


System info:
    Operating system: Microsoft Windows NT 10.0.19043.0 64 bit
    GPU name: NVIDIA GeForce RTX 2060 SUPER
    Display mode: {Width:1842 Height:1036 Format:Color AspectRatio:1.7779922}
    GPU status: Normal


Exception: Could not load file or assembly 'System.Net.Quic, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. 系统找不到指定的文件。 (System.IO.FileNotFoundException)
Target site: System.Object _CreateCaObject(System.Reflection.RuntimeModule, System.RuntimeType, System.IRuntimeMethodInfo, Byte**, Byte*, Int32*)
Stack trace: 
   at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, RuntimeType type, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
   at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder`1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1 derivedAttributes)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeMethodInfo method, RuntimeType caType, Boolean inherit)
   at System.Reflection.RuntimeMethodInfo.GetCustomAttributes(Type attributeType, Boolean inherit)
   at System.Attribute.GetCustomAttributes(MemberInfo element, Type attributeType, Boolean inherit)
   at System.Reflection.CustomAttributeExtensions.GetCustomAttributes[T](MemberInfo element, Boolean inherit)
   at System.Diagnostics.StackTrace.TryResolveStateMachineMethod(MethodBase& method, Type& declaringType)
   at System.Diagnostics.StackTrace.ToString(TraceFormat traceFormat, StringBuilder sb)
   at System.Diagnostics.StackTrace.ToString(TraceFormat traceFormat)
   at System.Exception.get_StackTrace()
   at System.Exception.ToString()
   at System.Exception.ToString()
   at Barotrauma.GameAnalyticsManager.CheckResponse(IRestResponse response)
   at Barotrauma.GameAnalyticsManager.<>c.<InitIfConsented>b__15_1(Task t)
   at Barotrauma.TaskPool.<>c__DisplayClass6_0.<Add>b__0(Task t, Object obj)
   at Barotrauma.TaskPool.Update()
   at Barotrauma.GameMain.Update(GameTime gameTime)
   at Microsoft.Xna.Framework.Game.DoUpdate(GameTime gameTime) in C:\Users\joona\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 656
   at Microsoft.Xna.Framework.Game.Tick() in C:\Users\joona\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 500
   at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop() in C:\Users\joona\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\SDL\SDLGamePlatform.cs:line 92
   at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior) in C:\Users\joona\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 397
   at Microsoft.Xna.Framework.Game.Run() in C:\Users\joona\Documents\Barotrauma-development\Libraries\MonoGame.Framework\Src\MonoGame.Framework\Game.cs:line 367
   at Barotrauma.Program.Main(String[] args)


Last debug messages:
[10/08/2022 10:37:11] Overriding an affliction or a buff with the identifier 'watchersgaze' using the file 'C:/Users/Hans/AppData/Local/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2867579260/Content/preg/pregherpes.xml'
[10/08/2022 10:37:11] Overriding an affliction or a buff with the identifier 'nausea' using the file 'C:/Users/Hans/AppData/Local/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2867579260/Content/Afflictions.xml'
[10/08/2022 10:37:11] Overriding an affliction or a buff with the identifier 'concussion' using the file 'C:/Users/Hans/AppData/Local/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2867579260/Content/Afflictions.xml'
[10/08/2022 10:36:45] Attempting to open ALC device "OpenAL Soft on 扬声器 (7.1 Surround Sound)"
[10/08/2022 10:36:44] Logged in as laowang114514 (SteamID STEAM_1:1:495350136)

系统找不到指定的文件 is chinese localization of The system cannot find the file specified.

Reproduction steps

Play the game with lua? (Need more communication with friend)

Bug prevalence

Happens every now and then

Version

0.19.11.0

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

No response

Self hosting server on Linux leads to crash

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

Using Linux, when starting a server from the in game GUI, after choosing the LuaForBarotrauma server file and pressing start, the program will hang, render an error then crash.

Reproduction steps

  1. Use a linux distribution
  2. Manually install this mod
  3. Launch game using native files, not via proton
  4. Open Host Server GUI
  5. Select the appropriate server file
  6. Start the server

Bug prevalence

Happens every time I play

Version

0.20.16.1

-

No response

Which operating system did you encounter this bug on?

Linux

Relevant error messages and crash reports

Barotrauma Client crash report (generated on 01/02/2023 00:25:53)

Barotrauma seems to have crashed. Sorry for the inconvenience! 

226A6D882E929D5C38BEA37A5220B34D

Game version 0.20.16.1 (ReleaseLinux, branch master, revision 5807900)
Graphics mode: 1920x1080 (BorderlessWindowed)
VSync ON
Language: English
Selected content packages: Vanilla, Lua For Barotrauma, Lua Linker, EK | Utility, EK | Dockyard, EK | Gunnery, EK | Armory, Zubtrauma (Dialog Only), Combinable Ammo Revived (NOW WORKS WITH ALL AMMO), BaroCraftables+, Movable and Sellable Wrecks, New Wrecks For Barotrauma (With sellable wrecks), Basic1, EK Berith Mk-IV, EK Nurse Shark Mk-VI, Bambara EK, EK Marauder Mk-VII, EK Gladius Mk-II, EK_Crystal, EK Kira Mk-V
Level seed: no level loaded
Loaded submarine: None
Selected screen: Barotrauma.MainMenuScreen
SteamManager initialized

System info:
    Operating system: Unix 6.1.1.1 64 bit
    GPU name: 
    Display mode: {Width:1920 Height:1080 Format:Color AspectRatio:1.7777778}
    GPU status: Normal

Exception: ChildServerRelay readTask did not run to completion: status was WaitingForActivation. (System.Exception)
Target site: Barotrauma.Option`1[System.Int32] ReadIncomingMsgs()
Stack trace: 
   at Barotrauma.Networking.ChildServerRelay.ReadIncomingMsgs() in <DEV>/Barotrauma/BarotraumaShared/SharedSource/Networking/ChildServerRelay.cs:line 155
   at Barotrauma.Networking.ChildServerRelay.<UpdateRead>g__readBytes|43_0(Span`1 readTo) in <DEV>/Barotrauma/BarotraumaShared/SharedSource/Networking/ChildServerRelay.cs:line 183
   at Barotrauma.Networking.ChildServerRelay.UpdateRead() in <DEV>/Barotrauma/BarotraumaShared/SharedSource/Networking/ChildServerRelay.cs:line 175

Last debug messages:
[01/02/2023 00:25:53] Exiting...
[01/02/2023 00:25:38] Failed to start server {An error occurred trying to start process './/home/m/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2559634234/Binary/DedicatedServer.exe' with working directory '/home/m/Drives/HUGE/SteamLibrary/steamapps/common/Barotrauma'. No such file or directory}
   at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Barotrauma.Networking.ChildServerRelay.Start(ProcessStartInfo processInfo) in <DEV>/Barotrauma/BarotraumaClient/ClientSource/Networking/ChildServerRelay.cs:line 32
   at Barotrauma.MainMenuScreen.StartServer() in <DEV>/Barotrauma/BarotraumaClient/ClientSource/Screens/MainMenuScreen.cs:line 945
[01/02/2023 00:25:38] Failed to start ChildServerRelay Process. File: .//home/m/.local/share/Daedalic Entertainment GmbH/Barotrauma/WorkshopMods/Installed/2559634234/Binary/DedicatedServer.exe, arguments: -name [removed] -public True -playstyle Casual -banafterwrongpassword False -karmaenabled False -maxplayers 16 -password [removed] -steamid [removed] -ownerkey [removed] -pipes 265 268
[01/02/2023 00:17:13] Attempting to open ALC device "Easy Effects Sink"

Some classes when registered cause errors in the moonsharp side

LuaUserData.RegisterType('Barotrauma.HumanoidAnimController')

This causes to throw the following error:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.ArgumentException: Multiple members named CurrentGroundedParams are being added to type Barotrauma.HumanoidAnimController and one or more of these members do not support overloads.
   at MoonSharp.Interpreter.Interop.BasicDescriptors.DispatchingUserDataDescriptor.AddMemberTo(Dictionary`2 members, String name, IMemberDescriptor desc)
   at MoonSharp.Interpreter.Interop.StandardUserDataDescriptor.FillMemberList()
   at MoonSharp.Interpreter.Interop.StandardUserDataDescriptor..ctor(Type type, InteropAccessMode accessMode, String friendlyName)
   at MoonSharp.Interpreter.Interop.UserDataRegistries.TypeDescriptorRegistry.RegisterType_Impl(Type type, InteropAccessMode accessMode, String friendlyName, IUserDataDescriptor descriptor)
   at MoonSharp.Interpreter.UserData.RegisterType[T](InteropAccessMode accessMode, String friendlyName)

Start server error after manual installation of luamod

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

94V7MRMN)5XA%O 8K6@8
Start server error after manual installation of luamod
Unable to connect to the game server

Reproduction steps

94V7MRMN)5XA%O 8K6@8
Start server error after manual installation of luamod

Bug prevalence

Happens every time I play

Version

0.17.15.0

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

Coroutine Barotrauma.Networking.GameServer+<StartServer>d_54 threw an exception: InitCameSerer returned false (0,46593,27015,0,NoAuthentication,"1.0.0.0")
  at Steamworks.SteamServer.Init(AppId appid, SteamServerInit init,Boolean asyncCalbacks)inE:\Barotrauma-development \Libraries Facepunch.Steamworks\SteamServer.cs:line 93
  at Barotrauma.Steam.SteamManager.CreateServer GameServer server,Poolean isPublic) in<DEP>/Barotrauma/BarotraumaServer/ServerSource/Steam/SteamManager.cs:line 23
  at Barotrauma.Networking.GameServer.StartServer Boolean isPublic)+MoveNext ( in 〈DEV>/Barotrauma/BarotraumaServer/ServerSource/Networking/GameServer.cs:line 201
  at Barotrauma.CoroutineManager.PerformCoroutineStep(CoroutineHandle handle) in DEV>/ Barotrauma/BarotraumaShared/SharedSource/CoroutineManager.cs:line 196
  at Barotrauma.CoroutineManager.IsDone(CoroutineHandle handle) in DEV>/Barotrauma/BarotraumaShared/SharedSource/CoroutineManager.cs :line 229

LuaCs isnt compaibile with linux?

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

Issue is about LuaCs
Oiltanker said i should report it. He says path masks are part of an issue.

Reproduction steps

  1. Start a dedicated server with MCM for example. Server must be Linux

Bug prevalence

Happens every time I play

Version

Other

-

newest

Which operating system did you encounter this bug on?

Linux

Relevant error messages and crash reports

[05/25/2022 19:13:24]                                                                                                                                                                                                                          [SV CS ERROR] All C# sources must belong to <mod_folder>/CSharp/*
  Offending sources:
    /home/masonmg1/Steam/steamapps/common/Barotrauma Dedicated Server/LocalMods/2775613786/CSharp/Shared/McmMod.cs
    /home/masonmg1/Steam/steamapps/common/Barotrauma Dedicated Server/LocalMods/2775613786/CSharp/Server/McmConfig.cs
    /home/masonmg1/Steam/steamapps/common/Barotrauma Dedicated Server/LocalMods/2775613786/CSharp/Server/McmMod.cs
    /home/masonmg1/Steam/steamapps/common/Barotrauma Dedicated Server/LocalMods/2775613786/CSharp/Server/McmSession.cs
    /home/masonmg1/Steam/steamapps/common/Barotrauma Dedicated Server/LocalMods/2775613786/CSharp/Server/McmControl.cs
    /home/masonmg1/Steam/steamapps/common/Barotrauma Dedicated Server/LocalMods/2775613786/CSharp/Server/McmSave.cs
    /home/masonmg1/Steam/steamapps/common/Barotrauma Dedicated Server/LocalMods/2775613786/CSharp/Server/McmChat.cs
    /home/masonmg1/Steam/steamapps/common/Barotrauma Dedicated Server/LocalMods/2775613786/CSharp/Client/McmMod.cs

Patching Character.ApplyAttack causes a System.ExecutionEngineException

Harmony is likely corrupting the method, but not sure why, steamworks seems to crash when the patched hook is called, so probably something has gone horribly wrong.

Hook.HookMethod("Barotrauma.Character", "ApplyAttack", function(instance, ptable)
      print("test")
end)

i have no idea why this happens, so help is appreciated.

Adding a hook inside a hook call causes a crash

Disclaimers

  • I have searched the issue tracker to check if the issue has already been reported.
  • My issue happened while using mods.

What happened?

Hook.Add("think", "test", function()
      Hook.Add("think", "test2", function() end)
end)

Reproduction steps

No response

Bug prevalence

Happens every time I play

Version

0.18.15.0

-

No response

Which operating system did you encounter this bug on?

Windows

Relevant error messages and crash reports

Exception: Collection was modified; enumeration operation may not execute. (System.InvalidOperationException)
Target site: Void ThrowInvalidOperationException_InvalidOperation_EnumFailedVersion()
Stack trace: 
   at System.Collections.Generic.Dictionary`2.Enumerator.MoveNext()
   at Barotrauma.LuaCsHook.Call[T](String name, Object[] args)
   at Barotrauma.GameMain.Run()
   at Barotrauma.Program.Main(String[] args)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.