Blood Magic

Blood Magic

90M Downloads

[1.8] Right-click with Division Sigil Crashes Client on SMP

Kris1432 opened this issue ยท 19 comments

commented

All in the title;

Version: BloodMagic-1.8.9-2.0.0-1.jar
Forge: 1675

edit: forgot to add the log: http://pastebin.com/mJkeNTEC

commented

This is odd, because on the server I play this does not happen.

commented

yes, and another user on my server doesn't have that issue either...

commented

Potential config conflict? Happened to be repeatedly last month.

commented

I commented on the commit. It's a good attempt at fixing the symptoms but I don't think it hits the core and it might not work.

commented

Well we don't know if it works if nobody tries it. I am unable to reproduce locally, so I can't tell. If you want, feel free to use the latest build here to check. http://tehnut.info/jenkins/job/BloodMagic/job/1.8.8-dev/

commented

kk I will try it out tonight when im home...(if the weather doesn't crash my internet..). Here is why I don't think it will work or at best will only fix a symptom and not the underlying bug.

There are two options here (since I cannot live debug I don't know which is true):
A) player is null when it gets to isFakePlayer

  • The fix will now return false. This means that any time the player object is null it will not crash the isFakePlayer check but the player object being null is a much bigger issue. It should never BE null at this point and putting the null check in there only covers up the main issue (why is the player null?).

B) player is correctly an EntityPlayer object and is not null but when calling getUsernameFromPlayer(player) it returns null causing the regex to fail

  • If this is the case your fix will not work at all as it will bypass the player != null check and once again crash on the regex. I believe this is the more likely of the two scenarios as getting a player objects username to return null is much more believable then the player object itself being null. All speculation of course.

So in best case we have covered up the main issue by snuffing out one of its symptoms, worst case scenario it will simply keep crashing. I would suggest trying to figure out which scenario is the case and find out why we are getting null back in the first place.

If one of you wants to give me a crash course in setting up a development environment at home (using windows 10 but could easily set up a VM with ubuntu or some other linux server) and give me a quick 101 on how to debug the code in it I would be more than happy to.

Also, if you want the IP to my server with the issue so you can see it happen I would be more than happy to provide it to you privately.

P.S. your jenkins still claims its for 1.8.8 ;) but now im just being Ornery ;)

commented

One thing I know is that this crash does not happen on ForgeCraft 1. Everybody seems to be happily using it there just fine. So my guess is that some other mod is causing an issue. When Way gets back I can get my hands on a FC1 modlist and compare the differences with FTB Unstable then do the super fun binary search of which mod could be the culprit.

commented

Sounds like fun. Please let me know if I can help. I would love to learn what I need to do to do so. I don't know Java but its pretty similar to PHP and I have been doing that for over 10 years. The biggest hurdle for me is trying to set up a dev environment and learning how to debug it since PHP is not a compiled language and im still a bit hazy on all of that.

My goal is to not only report bugs but track them down and submit fixes. I guess i shall do some more google searching. Problem I come into the most is that most of the tutorials are dated as updates to forge and minecraft come out so rapidly.

commented

Well, that was a fun issue to find. @Blue64, you weren't too far off the mark. We use the Forge UsernameCache to perform a UUID lookup so offline players with the same username as an online player (IE: auth'ed TehNut having eb21559e-bb22-46f2-897b-71eee2d5c09b vs un-auth'ed TehNut having 2ec627b4-782c-33b9-8668-a9992029ca8) can use the same LP network. Don't have internet at the moment? You get to keep all your progress. Changed your username via Mojang's site? You get to keep all your progress.

The problem here, however, is that usernamecache.json does not get generated until a world is loaded. Meaning that if a client starts up a pack and logs immediately into a server, they'll crash with that lookup as their client does not have that file to check and thus their name will return null. The server does have this file, which is why it does not crash.

As for a solution, there's 3 (simple) ways this can go:

  1. Forge can generate that file when the client is run with the current UUID and playername.
  2. We can generate that file when the client is run with the current UUID and playername.
  3. We can reorganize some checks so that this code is only run on the server.

Edit: Added a third solution.

commented

Because @TehNut is a meany-pants: ec7676a

commented

Please look here and see if this fixes the issue: http://tehnut.info/jenkins/job/BloodMagic/job/1.8.8-dev/141/

commented

So it looks like from your crash report that you are having the same issue as me. Blood Magic has a check to make sure that the person interacting is a real person and not a computercraft fake player. It gets the UUID of the player and then uses minecrafts UsernameCache to provide the correct username to check against. For SOME reason, the username retrieval returns null in certain situations which causes the regex check to work on a null value, thus causing the error.

@TehNut if you can figure out the "why" of this I would really like to hear what was happening. Developer curiosity.

commented

I like this fix....didn't get a chance to test last night but ill be home around 6pm EST tonight and ill let you know if someone hasn't already tested it.

commented

Tested and passed. I cheated it all in but it works beautifully @WayofTime you can feel free to close it ๐Ÿ‘

commented

Should have made a new comment. We didn't get notified about that edit.

commented

@TehNut glad I could help. I was reading and was totally thinking "gotta be something dealing with connection and files" lol sure enough y'all figured it out. And yea, Edits don't submit notifications, that's why I usually comment, then edit any double posts together ;P I been meaning to point that out to you since it was mentioned in the forge git tracker, but they closed the issue before I could hit post.

commented

The difference between your repeated comments and the one that would have happened here is that yours were all within an hour. This one was in the span of a few days.

commented

Sorry about that. I'm not new to git but still a little fresh with github and using it to contribute etc. Thanks for the heads up @TehNut