iChun / Morph

My entry for ModJam #2.
GNU Lesser General Public License v3.0
154 stars 183 forks source link

Too many morphs leads to playerdata bloating, causing other crashes #629

Closed WesCook closed 7 years ago

WesCook commented 10 years ago

There's an issue right now where if you have Father Toast's Special Mobs installed, all mobs are randomized (height, health, etc). This means every kill results in a unique morph. I assume the same is true of similar mods so I won't single them out, but it leads to very large morph lists. This isn't the bug I'm reporting though.

Having very large morph lists means large player files. Once a player file reaches a certain size, other mods (such as Sync) will crash catastrophically when they try and send the player file.

minecraft 1 7 10-000112

There's a packet limit in Forge and it will crash the client, and in the case of Sync prevents anyone from connecting to the server. It seems the only fix is to delete the region file and playerdata when using a dedicated server. With a SSP world (singleplayer), I found there was no fix - the problem seemed rooted in the level.dat file. Perhaps that's where Morphs are saved in SP?

After I trimmed my player.dat file of Morph data, it was reduced from 36KB > 15KB and I could use Sync shells again.

I know the solution in this case is to simply disable Morph or Special Mobs (or add a blacklist) and that's fine. This bug was extremely difficult to track down though, and can lead to serious server crashes if one is not careful. My suggestion would be to add some sort of additional check in Morph where if the player file is above a certain size (32K I believe), stop saving new morphs and alert the player or console that they need to trim their morphs.

Thank you.

WesCook commented 10 years ago

Oh, and if anybody happens upon this page and wants to know how to blacklist Special Mobs. Set this in the config:

S:blacklistedMobs=toast.specialMobs.entity.cavespider.EntityBabyCaveSpider, toast.specialMobs.entity.cavespider.EntityFlyingCaveSpider, toast.specialMobs.entity.cavespider.EntityMotherCaveSpider, toast.specialMobs.entity.cavespider.EntityToughCaveSpider, toast.specialMobs.entity.cavespider.EntityWebCaveSpider, toast.specialMobs.entity.cavespider.EntityWitchCaveSpider, toast.specialMobs.entity.cavespider.Entity_SpecialCaveSpider, toast.specialMobs.entity.creeper.EntityArmorCreeper, toast.specialMobs.entity.creeper.EntityDarkCreeper, toast.specialMobs.entity.creeper.EntityDeathCreeper, toast.specialMobs.entity.creeper.EntityDirtCreeper, toast.specialMobs.entity.creeper.EntityDoomCreeper, toast.specialMobs.entity.creeper.EntityDrowningCreeper, toast.specialMobs.entity.creeper.EntityEnderCreeper, toast.specialMobs.entity.creeper.EntityFireCreeper, toast.specialMobs.entity.creeper.EntityJumpingCreeper, toast.specialMobs.entity.creeper.EntityLightningCreeper, toast.specialMobs.entity.creeper.EntityMiniCreeper, toast.specialMobs.entity.creeper.EntitySplittingCreeper, toast.specialMobs.entity.creeper.Entity_SpecialCreeper, toast.specialMobs.entity.enderman.EntityBlindingEnderman, toast.specialMobs.entity.enderman.EntityCursedEnderman, toast.specialMobs.entity.enderman.EntityIcyEnderman, toast.specialMobs.entity.enderman.EntityLightningEnderman, toast.specialMobs.entity.enderman.EntityMiniEnderman, toast.specialMobs.entity.enderman.EntityMirageEnderman, toast.specialMobs.entity.enderman.EntityThiefEnderman, toast.specialMobs.entity.enderman.Entity_SpecialEnderman, toast.specialMobs.entity.ghast.EntityBabyGhast, toast.specialMobs.entity.ghast.EntityFaintGhast, toast.specialMobs.entity.ghast.EntityFighterGhast, toast.specialMobs.entity.ghast.EntityKingGhast, toast.specialMobs.entity.ghast.EntityMeleeGhast, toast.specialMobs.entity.ghast.EntityMiniGhast, toast.specialMobs.entity.ghast.EntityMountGhast, toast.specialMobs.entity.ghast.EntityQueenGhast, toast.specialMobs.entity.ghast.EntityUnholyGhast, toast.specialMobs.entity.ghast.Entity_SpecialGhast, toast.specialMobs.entity.pigzombie.EntityBrutishPigZombie, toast.specialMobs.entity.pigzombie.EntityFishingPigZombie, toast.specialMobs.entity.pigzombie.EntityGiantPigZombie, toast.specialMobs.entity.pigzombie.EntityHungryPigZombie, toast.specialMobs.entity.pigzombie.EntityPlaguePigZombie, toast.specialMobs.entity.pigzombie.EntityVampirePigZombie, toast.specialMobs.entity.pigzombie.Entity_SpecialPigZombie, toast.specialMobs.entity.silverfish.EntityBlindingSilverfish, toast.specialMobs.entity.silverfish.EntityFishingSilverfish, toast.specialMobs.entity.silverfish.EntityFlyingSilverfish, toast.specialMobs.entity.silverfish.EntityPoisonSilverfish, toast.specialMobs.entity.silverfish.EntityToughSilverfish, toast.specialMobs.entity.silverfish.Entity_SpecialSilverfish, toast.specialMobs.entity.skeleton.EntityBrutishSkeleton, toast.specialMobs.entity.skeleton.EntityFireSkeleton, toast.specialMobs.entity.skeleton.EntityGatlingSkeleton, toast.specialMobs.entity.skeleton.EntityGiantSkeleton, toast.specialMobs.entity.skeleton.EntityPoisonSkeleton, toast.specialMobs.entity.skeleton.EntitySniperSkeleton, toast.specialMobs.entity.skeleton.EntitySpitfireSkeleton, toast.specialMobs.entity.skeleton.EntityThiefSkeleton, toast.specialMobs.entity.skeleton.Entity_SpecialSkeleton, toast.specialMobs.entity.spider.EntityBabySpider, toast.specialMobs.entity.spider.EntityDesertSpider, toast.specialMobs.entity.spider.EntityFlyingSpider, toast.specialMobs.entity.spider.EntityGhostSpider, toast.specialMobs.entity.spider.EntityGiantSpider, toast.specialMobs.entity.spider.EntityHungrySpider, toast.specialMobs.entity.spider.EntityMotherSpider, toast.specialMobs.entity.spider.EntityPaleSpider, toast.specialMobs.entity.spider.EntityPoisonSpider, toast.specialMobs.entity.spider.EntitySmallSpider, toast.specialMobs.entity.spider.EntityToughSpider, toast.specialMobs.entity.spider.EntityWebSpider, toast.specialMobs.entity.spider.EntityWitchSpider, toast.specialMobs.entity.spider.Entity_SpecialSpider, toast.specialMobs.entity.zombie.EntityBrutishZombie, toast.specialMobs.entity.zombie.EntityFireZombie, toast.specialMobs.entity.zombie.EntityFishingZombie, toast.specialMobs.entity.zombie.EntityGiantZombie, toast.specialMobs.entity.zombie.EntityHungryZombie, toast.specialMobs.entity.zombie.EntityPlagueZombie, toast.specialMobs.entity.zombie.Entity_SpecialZombie
iChun commented 10 years ago

Can you upload the bloated player dat files for debugging? On 27 Oct 2014 01:34, "Wes Cook" notifications@github.com wrote:

Oh, and if anybody happens upon this page and wants to know how to blacklist Special Mobs. Set this in the config:

S:blacklistedMobs=toast.specialMobs.entity.cavespider.EntityBabyCaveSpider, toast.specialMobs.entity.cavespider.EntityFlyingCaveSpider, toast.specialMobs.entity.cavespider.EntityMotherCaveSpider, toast.specialMobs.entity.cavespider.EntityToughCaveSpider, toast.specialMobs.entity.cavespider.EntityWebCaveSpider, toast.specialMobs.entity.cavespider.EntityWitchCaveSpider, toast.specialMobs.entity.cavespider.Entity_SpecialCaveSpider, toast.specialMobs.entity.creeper.EntityArmorCreeper, toast.specialMobs.entity.creeper.EntityDarkCreeper, toast.specialMobs.entity.creeper.EntityDeathCreeper, toast.specialMobs.entity.creeper.EntityDirtCreeper, toast.specialMobs.entity.creeper.EntityDoomCreeper, toast.specialMobs.entity.creeper.EntityDrowningCreeper, toast.specialMobs.entity.creeper.EntityEnderCreeper, toast.specialMobs.entity.creeper.EntityFireCreeper, toast.specialMobs.entity.creeper.EntityJumpingCreeper, toast.specialMobs.entity.creeper.EntityLightningCreeper, toast.specialMobs.e ntity.cr eeper.EntityMiniCreeper, toast.specialMobs.entity.creeper.EntitySplittingCreeper, toast.specialMobs.entity.creeper.Entity_SpecialCreeper, toast.specialMobs.entity.enderman.EntityBlindingEnderman, toast.specialMobs.entity.enderman.EntityCursedEnderman, toast.specialMobs.entity.enderman.EntityIcyEnderman, toast.specialMobs.entity.enderman.EntityLightningEnderman, toast.specialMobs.entity.enderman.EntityMiniEnderman, toast.specialMobs.entity.enderman.EntityMirageEnderman, toast.specialMobs.entity.enderman.EntityThiefEnderman, toast.specialMobs.entity.enderman.Entity_SpecialEnderman, toast.specialMobs.entity.ghast.EntityBabyGhast, toast.specialMobs.entity.ghast.EntityFaintGhast, toast.specialMobs.entity.ghast.EntityFighterGhast, toast.specialMobs.entity.ghast.EntityKingGhast, toast.specialMobs.entity.ghast.EntityMeleeGhast, toast.specialMobs.entity.ghast.EntityMiniGhast, toast.specialMobs.entity.ghast.EntityMountGhast, toast.specialMobs.entity.ghast.EntityQueenGhast, toast.speci alMobs.e ntity.ghast.EntityUnholyGhast, toast.specialMobs.entity.ghast.Entity_SpecialGhast, toast.specialMobs.entity.pigzombie.EntityBrutishPigZombie, toast.specialMobs.entity.pigzombie.EntityFishingPigZombie, toast.specialMobs.entity.pigzombie.EntityGiantPigZombie, toast.specialMobs.entity.pigzombie.EntityHungryPigZombie, toast.specialMobs.entity.pigzombie.EntityPlaguePigZombie, toast.specialMobs.entity.pigzombie.EntityVampirePigZombie, toast.specialMobs.entity.pigzombie.Entity_SpecialPigZombie, toast.specialMobs.entity.silverfish.EntityBlindingSilverfish, toast.specialMobs.entity.silverfish.EntityFishingSilverfish, toast.specialMobs.entity.silverfish.EntityFlyingSilverfish, toast.specialMobs.entity.silverfish.EntityPoisonSilverfish, toast.specialMobs.entity.silverfish.EntityToughSilverfish, toast.specialMobs.entity.silverfish.Entity_SpecialSilverfish, toast.specialMobs.entity.skeleton.EntityBrutishSkeleton, toast.specialMobs.entity.skeleton.EntityFireSkeleton, toast.specialMobs.ent ity.skel eton.EntityGatlingSkeleton, toast.specialMobs.entity.skeleton.EntityGiantSkeleton, toast.specialMobs.entity.skeleton.EntityPoisonSkeleton, toast.specialMobs.entity.skeleton.EntitySniperSkeleton, toast.specialMobs.entity.skeleton.EntitySpitfireSkeleton, toast.specialMobs.entity.skeleton.EntityThiefSkeleton, toast.specialMobs.entity.skeleton.Entity_SpecialSkeleton, toast.specialMobs.entity.spider.EntityBabySpider, toast.specialMobs.entity.spider.EntityDesertSpider, toast.specialMobs.entity.spider.EntityFlyingSpider, toast.specialMobs.entity.spider.EntityGhostSpider, toast.specialMobs.entity.spider.EntityGiantSpider, toast.specialMobs.entity.spider.EntityHungrySpider, toast.specialMobs.entity.spider.EntityMotherSpider, toast.specialMobs.entity.spider.EntityPaleSpider, toast.specialMobs.entity.spider.EntityPoisonSpider, toast.specialMobs.entity.spider.EntitySmallSpider, toast.specialMobs.entity.spider.EntityToughSpider, toast.specialMobs.entity.spider.EntityWebSpider, toast.spec ialMobs. entity.spider.EntityWitchSpider, toast.specialMobs.entity.spider.Entity_SpecialSpider, toast.specialMobs.entity.zombie.EntityBrutishZombie, toast.specialMobs.entity.zombie.EntityFireZombie, toast.specialMobs.entity.zombie.EntityFishingZombie, toast.specialMobs.entity.zombie.EntityGiantZombie, toast.specialMobs.entity.zombie.EntityHungryZombie, toast.specialMobs.entity.zombie.EntityPlagueZombie, toast.specialMobs.entity.zombie.Entity_SpecialZombie

— Reply to this email directly or view it on GitHub https://github.com/iChun/Morph/issues/629#issuecomment-60541760.

WesCook commented 10 years ago

Can do. Here's two examples with cleaned and bloated versions.

https://cloudup.com/csJUSk0nqKW

WesCook commented 10 years ago

Upon further inspection, I've learned that deleting mobs from the Morph UI does not always delete them from the player.dat. One player on my server had thousands of entries (due to the SpecialMobs conflict mentioned above), even after clearing his entire list in the UI. So in cases like that you may need to clear them out with an NBT editor.

Possibly unrelated, but I and another player couldn't remove one of the Morphs from our lists, even with an NBT editor. They were giant Hungry Spiders from Special Mobs.

spider

Not reporting this as a bug as it's probably PEBKAC, but just putting it out there.


edit: Think I figured out why. It seems the Spider's "stomach" data is too large (which is also why it was so large). Here's a pastebin: http://pastebin.com/raw.php?i=NZ9TS5fS

Player data is d56-.dat from the zip if you want to take a look yourself. This is turning into a separate bug report though, so I'll leave it. I'll just say for anyone else that I fixed it by removing the Morph mod, deleting the whole Morph section via an NBT editor, then reinstalling Morph.

iChun commented 10 years ago

Unfortunately for this issue I'll probably not fix the bloating immediately, I'll see what I can do about deleting not actually deleting the morph for 0.9.2, it's probably because the tag isn't removed when saved, but you might have to join the world with 0.9.2, then relog, before it can be deleted properly.

If you see the referenced issue from earlier, I'll be working on to fixing this, but it'll be for 1.8, I'm planning a bit of an overhaul for 1.8 and it'll be then I'll be doing it.

ghost commented 9 years ago

i can confirm this as an issue still in april 2015 but instead of crashes the server started tick lagging whenever a player with over 500 morphs droped items(im assuming the larger player files means larger load fir the server whenever a player does somthing) using nbt explorer i deledeted every players morph and each of the player dat file sizes went from 100kb - 8kb and fixed my tick lag i am black listing the special mobs morphs THANK YOU SquareWheel i did a NEI dump and could not find father toasts entities they were not there :C only run in to this with special mobs

iChun commented 9 years ago

I'll be working on fixing this with a variants system in 1.8

On Wed, Apr 29, 2015 at 6:43 PM, dpsman917 notifications@github.com wrote:

i can confirm this as an issue still in april 2015 but instead of crashes the server started tick lagging whenever a player with over 500 morphs droped items(im assuming the larger player files means larger load fir the server whenever a player does somthing) using nbt explorer i deledeted every players morph and each of the player dat file sizes went from 100kb - 8kb and fixed my tick lag i am black listing the special mobs morphs THANK YOU SquareWheel i did a NEI dump and could not find father toasts entities they were not there :C only run in to this with special mobs

— Reply to this email directly or view it on GitHub https://github.com/iChun/Morph/issues/629#issuecomment-97515654.

ghost commented 9 years ago

Awesome thank you for your fast reply!!

Defiancey commented 9 years ago

Hey dpsman917 can you explain how you blacklisted special mobs? I want to use that and Lycanite's Mobs but its giving me too many mobs.

iChun commented 7 years ago

It only took 3 years but it's done now. I can finally close this! :)

ghost commented 7 years ago

Woooooo thank you ichun!!!!!

On Nov 15, 2017 5:25 PM, "iChun" notifications@github.com wrote:

It only took 3 years but it's done now. I can finally close this! :)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/iChun/Morph/issues/629#issuecomment-344785321, or mute the thread https://github.com/notifications/unsubscribe-auth/AJsWwqG-sRuTd_LYhh3LVvbTMNuJWlGqks5s248jgaJpZM4CzDmX .