Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client hangs at 15.79% when loading into server #3979

Closed
asineth0 opened this issue Jul 1, 2023 · 9 comments
Closed

Client hangs at 15.79% when loading into server #3979

asineth0 opened this issue Jul 1, 2023 · 9 comments
Labels
Should probably do eventually Will fix, but low priority.

Comments

@asineth0
Copy link

asineth0 commented Jul 1, 2023

Server IP: horizonrp.life
Server port: 28015

The client seems to just hang at 15.79% when trying to join the server. It will just sit there for hours and not do anything. I've attached what it seems to hang on from the Client.log file below. I have also attached the Client.log file entirely.

Only some people are having the issue when trying to join. I'm currently able to, but 2 of my staff members can't. We currently have a password on the server, can share if needed.

[2023-07-01 21:02:25] NullReferenceException: Object reference not set to an instance of an object
[2023-07-01 21:02:25] SDG.Unturned.ResourceSpawnpoint..ctor (System.Byte newType, System.UInt16 newID, System.Guid newGuid, UnityEngine.Vector3 newPoint, System.Boolean newGenerated, SDG.Unturned.NetId netId) (at <97242534d6e24fe7a638e008e68eac19>:0)
SDG.Unturned.ResourceSpawnpoint..ctor (System.UInt16 newID, System.Guid guid, UnityEngine.Vector3 newPoint, System.Boolean newGenerated, SDG.Unturned.NetId netId) (at <97242534d6e24fe7a638e008e68eac19>:0)
SDG.Unturned.LevelGround.loadTrees () (at <97242534d6e24fe7a638e008e68eac19>:0)
SDG.Unturned.LevelGround.load (System.UInt16 size) (at <97242534d6e24fe7a638e008e68eac19>:0)
SDG.Unturned.Level+<init>d__142.MoveNext () (at <97242534d6e24fe7a638e008e68eac19>:0)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <966ecbc21bec4138a5192b5e1b2dd41f>:0)

Client.log

@DanielWillett
Copy link

See if enabling/disabling SpeedTrees changes anything.

@asineth0
Copy link
Author

asineth0 commented Jul 2, 2023

That's seemingly it- it crashes using Basic Models but works if using SpeedTrees.

@DanielWillett
Copy link

image
this would be my guess... hard to say though without an IL offset. If it's your mod check all your forage-able bushes to make sure both the SpeedTree (Resource) and basic (Resource_Old) resource prefabs have a Forage object, or turn off foraging in the asset dat file.

@DiFFoZ
Copy link

DiFFoZ commented Jul 2, 2023

image this would be my guess... hard to say though without an IL offset. If it's your mod check all your forage-able bushes to make sure both the SpeedTree (Resource) and basic (Resource_Old) resource prefabs have a Forage object, or turn off foraging in the asset dat file.

NullReferenceException: Object reference not set to an instance of an object
  at SDG.Unturned.ResourceSpawnpoint..ctor (System.Byte newType, System.UInt16 newID, System.Guid newGuid, UnityEngine.Vector3 newPoint, System.Boolean newGenerated, SDG.Unturned.NetId netId) [0x003db] in <08e91a6d9e1d4bd5bf2e982fa4148205>:0 
  at SDG.Unturned.ResourceSpawnpoint..ctor (System.UInt16 newID, System.Guid guid, UnityEngine.Vector3 newPoint, System.Boolean newGenerated, SDG.Unturned.NetId netId) [0x00000] in <08e91a6d9e1d4bd5bf2e982fa4148205>:0 
  at SDG.Unturned.LevelGround.loadTrees () [0x001e8] in <08e91a6d9e1d4bd5bf2e982fa4148205>:0 
  at SDG.Unturned.LevelGround.load (System.UInt16 size) [0x00033] in <08e91a6d9e1d4bd5bf2e982fa4148205>:0 
  at SDG.Unturned.Level+<init>d__142.MoveNext () [0x0012a] in <08e91a6d9e1d4bd5bf2e982fa4148205>:0 
  at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00026] in <966ecbc21bec4138a5192b5e1b2dd41f>:0

The issue is not with Forage, it's with Auto_Skybox misconfigure, here is the fault code:

https://github.com/Unturned-Datamining/Unturned-Datamining/blob/ed690d271cbddd3d33e508b5a5043e0587c31396/Assembly-CSharp/SDG.Unturned/ResourceSpawnpoint.cs#L450

@SDGNelson
Copy link
Member

Thanks @DanielWillett and @DiFFoZ. I'll change that to not necessarily expect a MeshRenderer. If you don't mind me asking, what tool did you use to get the line number from (at <97242534d6e24fe7a638e008e68eac19>:0)?

@SDGNelson SDGNelson added the Should probably do eventually Will fix, but low priority. label Jul 4, 2023
@DiFFoZ
Copy link

DiFFoZ commented Jul 4, 2023

It's actually with IL offset:

at SDG.Unturned.ResourceSpawnpoint..ctor (System.Byte newType, System.UInt16 newID, System.Guid newGuid, UnityEngine.Vector3 newPoint, System.Boolean newGenerated, SDG.Unturned.NetId netId) [0x003db] in <08e91a6d9e1d4bd5bf2e982fa4148205>:0
                                                                                                                                                                                               ^^^^^^^ 

And IL offset is stored in square brackets, e.g. [0x00000].

Sadly Application.logMessageReceived event doesn't print IL offset to the stack trace string (maybe there is an option, not sure), but looking at Player.log it actually prints the IL offset.

After getting IL offset, you need to open Assembly-CSharp.dll in decompiler: DnSpy or ILSpy, I'll use ILSpy.
Drag and drop dll to decompiler and use Search to find the method that causes exception: resourceSpawnpoint inassembly:Assembly-CSharp
image
image

Now set display to IL with C# and then find IL_03db
image

And then analyze the IL around this instruction.
image

And looks like this method returns null, because after that calling set property it causes NullRef. exception

IL_03cb: callvirt instance !!0 [UnityEngine.CoreModule]UnityEngine.Component::GetComponent<class [UnityEngine.CoreModule]UnityEngine.MeshRenderer>()

@SDGNelson
Copy link
Member

Wow, that's awesome, thanks @DiFFoZ! I've now included this in the documentation with credit to your post here.

@asineth0
Copy link
Author

Resolved this myself by removing the Curated Resources mod by Loco on the workshop (https://steamcommunity.com/workshop/filedetails/?id=2941229986).
That was the mod that was causing the game to hang while loading in.

@LocoCZ
Copy link

LocoCZ commented Jul 13, 2023

Hello, I will try to look into this issue, however the error that would specify which tree is causing the issue would be really really appreciated. I've already spent more than 100 hours figuring out which trees are causing the issues, thought I fixed it but seems like I did not.

Here's an email that I sent to Nelson a few months ago which mentions this issue.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Should probably do eventually Will fix, but low priority.
Projects
None yet
Development

No branches or pull requests

5 participants