Dynamic Surroundings

Dynamic Surroundings

51M Downloads

NPE while connecting to server

kreezxil opened this issue · 21 comments

commented

Mod Version:
1.12.2-3.4.9.7

Forge Version:
14.23.2.2624

Link to crash log (if applicable):
https://gist.github.com/kreezxil/a4b4e37914c10ca6277bfd251798deb7

Description:
My player was trying to connect to the server, my other are not having the issue yet but I imagine soon will.

commented

the player in question has been trying to play with 12 year old computer and repeatedly tells me he has has to connect 3 times to finally actually stay in the game. But it is just him that reports that, none of my 100's of players report the issue. Your probably missing a simple null check in one those 4 places. At least i hope it's simple.

And congrats on the big bucks, I'm nipping at your toes, but I have loads more java and forge to learn.

commented

OK - this gives me something to go on. This error is a strange one, and I think it may be related to a tried connect/fail. The order of event bus registrations and object creation should not lead to this issue, so there is something coming in sideways throwing the whole build up/tear down process of the client thread into turmoil.

Essentially:

  • Create a global reference to my handler manager and store that.
  • Create an intialize all the handlers (EnvironStateHandler is such a handler).
  • Register the handlers with Forge event system.
  • Register the handler manager with the Forge event system.

What this call stack tells me is that all this creation stuff has happened because the handler manager is what drives the ticking within DS. And it is within that ticking where the EnvironStateHandler comes back to get a reference to the handler manager and it is null. See the first bullet. :\ This may take a bit to tease out what really is going on.

Luckily it is only happening for one person so it is something related to the timing/error handling on his system.

EDIT: Can I get a copy of his client side log with this error? It would give me an idea of the event sequence.

commented

It would be timing related, and it is a real strange one. :\ Right now this shouldn't happen, but it does. This is why I get paid the big bucks. :)

EDIT: Question - you said the player was "trying". Were they having some other sort of difficulty trying to connect when this happened, or was this a normal connect to server and this error popped up? How often does it occur?

commented

Thanks! I made a test jar with some tweaks and additional logging. Can you get him to drop it into his mod folder and test it? If the changes work he should not get a crash. I would like to get a copy of his logs using this JAR, even if there is no crash.

https://github.com/OreCruncher/DynamicSurroundings/releases/tag/1.12.2-3.4.9.8T5

commented

ok, he has the same issue with this version. His updated logs.

https://1drv.ms/u/s!AuyXOq5tWTK7ibh9V0Md57V84RJT9g

commented

If its the same issue the logs don't reflect that. From the logs it appears there are a bunch of connect/disconnects because the server closed the connection. From what you said previous your player has always had connection problems and logs show that. Just how big of a potato is the players computer? It seems like it is struggling to keep up.

commented
commented
commented

Ok, I'm working on it. Maybe I can do something with VirtualBox and simulate a really old computer. I wonder if that is possible.

commented

got his logs, it's a one drive link, https://1drv.ms/u/s!AuyXOq5tWTK7ibh8j4QeHLCG4swpWA

He started in SSP before joining my server. the latest ones, probably last 10 should be all him playing on the server.

commented

I made some changes to the startup sequence of the mod. They will be in the next release posted to CurseForge. It should address situations where the startup timing/sequence is weird.

commented
commented

Pushed v3.4.9.8 to CurseForge. Let me know if things improve.

commented
commented

https://pastebin.com/QaEcSVEh This is the full log.

As for the version, 1.12.2-3.4.9.8

commented

Related but not the same. What appears to be happening is that the client is starting to receive entity capability data for entities because the server detects that player came in range of a mob and it needs to send the initial update. Forge is starting to give me indigestion with startup sequences. :\

commented

@OreCruncher PacketWeatherUpdate.PacketHandler#onMessage needs to schedule a task to perform its duty, the code tries to access the player which may not exist yet since the packets which would do that spawning are in the task queue.

commented

What you point out is a different problem. The Network.postEvent() is the one that figures out what side to queue it on. The problem I see is that EnvironState.getWorld() just above the "if" relies on the player entity which may not be initialized.

EDIT: I'm going to create a new issue for these.

commented

Yep, that's what I was referring to.

commented

Is this connected to this in any way? I cannot seem to connect to my own server, and I saw this on the client-end logs:

https://pastebin.com/UbdBuP70

commented

It could be. What version are you using?