suriyun-production / mmorpg-kit-docs

This is document for MMORPG KIT project (https://www.assetstore.unity3d.com/#!/content/110188?aid=1100lGeN)
https://suriyun-production.github.io/mmorpg-kit-docs
48 stars 11 forks source link

Unity crash when close Build with il2cpp #2380

Closed moepi2k closed 8 months ago

moepi2k commented 8 months ago

with unity 2022.3 when u build with il2cpp and run the game, the close, anyway if exit game ort alt+f4. the game crashs. i thought its unity bug so i made a report. this is the answer from unity ->

Joshua Peterson commented: Thanks for reporting this issue. The reason that the project won't close, is that a managed thread is in a blocking socket call to the operating system. Unity must wait for that thread to complete, but it seems that thread is waiting on a network message or another thread, so it is stuck. Specifically, I see the code in the Assets/UnityMultiplayerARPG/Core/LiteNetLibManager/Plugins/LiteNetLib/NetManager.Socket.cs file at line 279, making a call to Socket.Select. You're likely seeing a different behavior because we corrected a but in IL2CPP that would incorrectly not wait for threads to exit in some cases, which can lead to other problems. I'm surprised that this same issue does not happen for Mono, as it should also be waiting for this thread to exit. I suspect that the timing is different enough with the Mono scripting backend that this does not occur there. So unfortunately this is not a bug we can fix on the Unity side, rather it is expected behavior. Hopefully you can modify the code in this project to avoid that thread getting stuck in a blocking API call into the OS. Thanks again for submitting this issue. Please let me know if you have any other questions. Josh Peterson - .NET VM Team

seems something todo with litenetlib?

Niinra commented 8 months ago

How strange I have never received this type of crash or errors unless I forcibly closed Unity, one thing that once happened to me is that I canceled a build of my project and completely damaged my Unity that I had to reinstall it and it worked correctly

insthync commented 8 months ago

I made it stop both server and client on application quit, and seems like the issues gone, you may try it by pull the latest commits

insthync commented 8 months ago

If it still having an issues, you can reopen it.