Zaggy1024 / LC_OpenBodyCams

An open-source mod for Lethal Company to add a body/head camera that is displayed on the bottom right monitor in the ship, with the goal of appearing almost identical to the player's actual perspective while providing good performance.
https://thunderstore.io/c/lethal-company/p/Zaggy1024/OpenBodyCams/
MIT License
10 stars 1 forks source link

error when loading multiplayer lobby with MoreCompany cosmetics equipped #26

Closed JusteLoneWolf closed 7 months ago

JusteLoneWolf commented 7 months ago

Hey when i join a game i have a issue, the game is freezing and bepinex console spam this image

I have this modpack https://thunderstore.io/c/lethal-company/p/JusteLoneWolf/LethalBonneCompany/ is 2.0.2

Edit: it's cause with cosmitics with MoreCompany

Zaggy1024 commented 7 months ago

If you're able to reproduce the problem, could you get logs according to the instructions here? That should allow me to fix the issue quite quickly.

JusteLoneWolf commented 7 months ago

Unfortunately I can no longer reproduce it, sorry. I could try it probably in the evening or tomorrow.

JusteLoneWolf commented 7 months ago

I come back to you to give you news, I tested 1 and several items and various cosmetics, and the error does not occur at all (with just more company and bodycam, and with all the mod pack), sorry not to be able to give you more details on this bug passenger.

Zaggy1024 commented 7 months ago

No worries, let me know if you have this happen again and figure out anything specific that might be triggering it.

JusteLoneWolf commented 7 months ago

Don't worry, I'll let you know !

apeng0907 commented 7 months ago

When playing multiplayer games with more than three players, when the following players join, players other than the homeowner will randomly experience a screen freeze, just like the screen image pauses. But in reality, you can hear the sound, others can see you moving, but your entire screen is fixed. When he exits and re-enters the game, joining the room will also cause other non console player cards to appear. After I delete this mod, it never appears again

Zaggy1024 commented 7 months ago

@apeng0907

When playing multiplayer games with more than three players, when the following players join, players other than the homeowner will randomly experience a screen freeze, just like the screen image pauses. But in reality, you can hear the sound, others can see you moving, but your entire screen is fixed. When he exits and re-enters the game, joining the room will also cause other non console player cards to appear. After I delete this mod, it never appears again

This is most likely a compatibility issue with another mod (or multiple), unless there are other factors causing it to happen to you.

If you're able to reproduce that issue with the first option mentioned here enabled, and get me the logs here as it describes, I should be able to figure out what's going wrong.

Otherwise, I'll probably need both logs and a profile code to be able to reproduce it on my end and fix the issue.

Zaggy1024 commented 7 months ago

Managed to reproduce what I believe to be this issue in a play session, I pushed out version 1.2.9 with a fix for that, please report back with logs if you encounter this incompatibility with MoreCompany again.

DiFFoZ commented 7 months ago

Looks like is still not fixed:

[Warning:OpenBodyCams] In 0 seconds, GunHolsterCosmetic(Clone) will be destroyed while it is referenced by a body cam.
[Warning:OpenBodyCams]   at OpenBodyCams.Patches.PatchModelDestructionDebugging.DestroyingObject (UnityEngine.Object obj, System.Single t) [0x00000] in <50548e335bdb4d2fa1a78e660ec5c947>:IL_0000 
  at MonoMod.Utils.DynamicMethodDefinition.NativeDetour_Wrapper<UnityEngine.Object::Destroy>?1 (UnityEngine.Object , System.Single ) [0x00000] in <6733e342b5b549bba815373898724469>:IL_0000 
  at UnityEngine.Object.Destroy (UnityEngine.Object obj) [0x00000] in <e27997765c1848b09d8073e5d642717a>:IL_0000 
  at MoreCompany.Cosmetics.CosmeticApplication.ClearCosmetics () [0x00019] in <eb37ec296e9c481db43d6bdfdda816e8>:IL_0019 
  at MoreCompany.ClientReceiveMessagePatch.DMD<MoreCompany.ClientReceiveMessagePatch::HandleDataMessage> (System.String& ) [0x00000] in <eb37ec296e9c481db43d6bdfdda816e8>:IL_0000 
  at MoreCompany.ClientReceiveMessagePatch.Prefix (HUDManager& __instance, System.String& chatMessage, System.Int32 playerId) [0x00084] in <eb37ec296e9c481db43d6bdfdda816e8>:IL_0084 
  at HUDManager.DMD<HUDManager::AddPlayerChatMessageClientRpc> (HUDManager , System.String , System.Int32 ) [0x00000] in <af9b1eec498a45aebd42601d6ab85015>:IL_0000 
  at HUDManager.__rpc_handler_168728662 (Unity.Netcode.NetworkBehaviour target, Unity.Netcode.FastBufferReader reader, Unity.Netcode.__RpcParams rpcParams) [0x00000] in <af9b1eec498a45aebd42601d6ab85015>:IL_0000 
  at Unity.Netcode.RpcMessageHelpers.Handle (Unity.Netcode.NetworkContext& context, Unity.Netcode.RpcMetadata& metadata, Unity.Netcode.FastBufferReader& payload, Unity.Netcode.__RpcParams& rpcParams) [0x00000] in <895801699cfc4b4ab52267f31e2a4998>:IL_0000 
  at Unity.Netcode.ClientRpcMessage.Handle (Unity.Netcode.NetworkContext& context) [0x00000] in <895801699cfc4b4ab52267f31e2a4998>:IL_0000 
  at Unity.Netcode.NetworkMessageManager.ReceiveMessage[T] (Unity.Netcode.FastBufferReader reader, Unity.Netcode.NetworkContext& context, Unity.Netcode.NetworkMessageManager manager) [0x00000] in <895801699cfc4b4ab52267f31e2a4998>:IL_0000 
  at Unity.Netcode.NetworkMessageManager.HandleMessage (Unity.Netcode.NetworkMessageHeader& header, Unity.Netcode.FastBufferReader reader, System.UInt64 senderId, System.Single timestamp, System.Int32 serializedHeaderSize) [0x00000] in <895801699cfc4b4ab52267f31e2a4998>:IL_0000 
  at Unity.Netcode.NetworkMessageManager.ProcessIncomingMessageQueue () [0x00000] in <895801699cfc4b4ab52267f31e2a4998>:IL_0000 
  at Unity.Netcode.NetworkManager.NetworkUpdate (Unity.Netcode.NetworkUpdateStage updateStage) [0x00000] in <895801699cfc4b4ab52267f31e2a4998>:IL_0000 
  at Unity.Netcode.NetworkUpdateLoop.RunNetworkUpdateStage (Unity.Netcode.NetworkUpdateStage updateStage) [0x00000] in <895801699cfc4b4ab52267f31e2a4998>:IL_0000 
  at Unity.Netcode.NetworkUpdateLoop+NetworkEarlyUpdate+<>c.<CreateLoopSystem>b__0_0 () [0x00000] in <895801699cfc4b4ab52267f31e2a4998>:IL_0000 
Zaggy1024 commented 7 months ago

Looks like is still not fixed:

[Warning:OpenBodyCams] In 0 seconds, GunHolsterCosmetic(Clone) will be destroyed while it is referenced by a body cam.
[Warning:OpenBodyCams]   at OpenBodyCams.Patches.PatchModelDestructionDebugging.DestroyingObject (UnityEngine.Object obj, System.Single t) [0x00000] in <50548e335bdb4d2fa1a78e660ec5c947>:IL_0000 
  at MonoMod.Utils.DynamicMethodDefinition.NativeDetour_Wrapper<UnityEngine.Object::Destroy>?1 (UnityEngine.Object , System.Single ) [0x00000] in <6733e342b5b549bba815373898724469>:IL_0000 
  at UnityEngine.Object.Destroy (UnityEngine.Object obj) [0x00000] in <e27997765c1848b09d8073e5d642717a>:IL_0000 
  at MoreCompany.Cosmetics.CosmeticApplication.ClearCosmetics () [0x00019] in <eb37ec296e9c481db43d6bdfdda816e8>:IL_0019 
  at MoreCompany.ClientReceiveMessagePatch.DMD<MoreCompany.ClientReceiveMessagePatch::HandleDataMessage> (System.String& ) [0x00000] in <eb37ec296e9c481db43d6bdfdda816e8>:IL_0000 
  at MoreCompany.ClientReceiveMessagePatch.Prefix (HUDManager& __instance, System.String& chatMessage, System.Int32 playerId) [0x00084] in <eb37ec296e9c481db43d6bdfdda816e8>:IL_0084 
  at HUDManager.DMD<HUDManager::AddPlayerChatMessageClientRpc> (HUDManager , System.String , System.Int32 ) [0x00000] in <af9b1eec498a45aebd42601d6ab85015>:IL_0000 
  ...

Note that with ReferencedObjectDestructionDetectionEnabled enabled, you'll get a message when the cosmetics will be destroyed, regardless of whether the cosmetics will be updated after.

If you have the BruteForcePreventFreezes option enabled, then you should see a A cosmetic attached to [name] has been destroyed, re-collecting cosmetics. If you have it disabled, then there will likely be error spam and perhaps a screen freeze. If neither of these happen, then there is no problem.

apeng0907 commented 7 months ago

Thank you very much for your reply

Zaggy1024 commented 7 months ago

Closing this out since the latest update 1.3.0 made some improvements to MoreCompany compatibility and this hasn't been reproduced in a while. Feel free to comment here if you still have troubles when joining a lobby with MoreCompany and I'll reopen it.