[INACTIVE] bShot 2.4 - autocorrects the chest/sign wipe bug by from a backup of data [1000]

Discussion in 'Inactive/Unsupported Plugins' started by codename_B, Jul 28, 2011.

  1. Offline

    codename_B

    bShot
    autocorrects the chest/sign wipe bug from a backup of data

    Code:
    System.out.println("[bShot] Be proud, be tall, bShot.");
    
    Download 2.4

    Features:
    • stores a backup of all chest and sign data in memory.
    • only operates when chunks load/unload so zero performance impact on the average server.
    • persistant data stored in chunks.hmap in the server root. DO NOT DELETE THIS FILE!
    How to use:
    • drop into plugins/
    • leave running in the background
    • don't delete chunks.hmap - this is where all the raw data is stored when you stop your server!
    Changelog:
    • 31/07/2011 - 2.2 - fixed unexpected NPE
    • 01/08/2011 - 2.3 - fixed another bout of unexpected NPE's - stupid unserializable CraftBukkit objects
    • 01/08/2011 - 2.4 - added extra anti-NPE protection and increased performance
     
  2. Offline

    poiNt_3D

    Great! But what actually happens when you stop the server? My server have a random crashes sometimes.
     
  3. Offline

    codename_B

    Nothing major - its just that the tileEntity data is cached in memory - so obviously if you shut the server down it's not going to be able to check next time the tileEntity data is loaded
     
  4. Offline

    poiNt_3D

    I think, you need to add something about chests and signs in the topic title, for people who use search.
     
  5. Offline

    codename_B

    done.
     
  6. Offline

    MikeA

    I'll check it out - if this works, great. Chests and signs usually wipe an area every few days.. very annoying when it's right in the middle of a town on my server.

    If I have any problems I'll make sure to post them here.

    Every time someone tried to open a chest it would disconnect them with "Internal Error" or whatever.

    I took the plugin off, and now 80% of the chests on my server are wiped.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  7. Offline

    codename_B

    Oh dear - that's not so good :S

    I will look into this ASAP

    It would help if you had some stacktraces for me
     
  8. Offline

    tyzoid

    If you don't know what a stacktrace is, it is the error message from bukkit that looks like this:
    Sample StackTrace from my server log (open)

    Code:
    2011-07-27 18:20:08 [SEVERE] Could not pass event ENTITY_DEATH to WolfSpawn
    java.lang.NoSuchMethodError: net.minecraft.server.EntityWolf.v()Ljava/lang/String;
    	at com.jynxdaddy.wolfspawn.WolfListener.onEntityDeath(WolfListener.java:45)
    	at org.bukkit.plugin.java.JavaPluginLoader$59.execute(JavaPluginLoader.java:656)
    	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:332)
    	at net.minecraft.server.EntityLiving.q(EntityLiving.java:467)
    	at net.minecraft.server.EntityLiving.die(EntityLiving.java:447)
    	at net.minecraft.server.EntityLiving.damageEntity(EntityLiving.java:391)
    	at net.minecraft.server.EntityWolf.damageEntity(EntityWolf.java:245)
    	at net.minecraft.server.EntityWolf.a(EntityWolf.java:346)
    	at net.minecraft.server.EntityCreature.c_(EntityCreature.java:64)
    	at net.minecraft.server.EntityWolf.c_(EntityWolf.java:92)
    	at net.minecraft.server.EntityLiving.v(EntityLiving.java:685)
    	at net.minecraft.server.EntityWolf.v(EntityWolf.java:133)
    	at net.minecraft.server.EntityLiving.m_(EntityLiving.java:218)
    	at net.minecraft.server.EntityWolf.m_(EntityWolf.java:161)
    	at net.minecraft.server.World.entityJoinedWorld(World.java:1198)
    	at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:48)
    	at net.minecraft.server.World.playerJoinedWorld(World.java:1180)
    	at net.minecraft.server.World.cleanUp(World.java:1104)
    	at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:447)
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
    	at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
     
  9. Offline

    MikeA

    This happens every time someone opens a chest - they get disconnected with internal error. Hope you can fix it. Like I said, this wiped over half of my servers chests :confused: Hopefully you can fix it, good luck and thanks. :cool:


    Code:
    2011-07-28 23:58:50 [WARNING] Failed to handle packet: java.lang.NullPointerException
    java.lang.NullPointerException
        at net.minecraft.server.InventoryLargeChest.getSize(InventoryLargeChest.java:26)
        at net.minecraft.server.EntityPlayer.a(EntityPlayer.java:376)
        at net.minecraft.server.BlockChest.interact(SourceFile:154)
        at net.minecraft.server.ItemInWorldManager.interact(ItemInWorldManager.java:219)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:553)
        at net.minecraft.server.Packet15Place.a(SourceFile:57)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:85)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
     
  10. Offline

    EdFake

    It looks like the plugin crashes when the user opens an empty chest, causing the null exception, may want to check it out. (surround it with a try/catch)

    @tyzoid That is another plugin generating that error, to be specific, jynxdaddy's wolf spawn plugin, Check that up with him
     
  11. Offline

    TerraPlay

    He just wanted to show Mikeambrose3 what a stacktrace is.
     
  12. Offline

    EdFake

    ah, my apologies.
     
  13. Offline

    codename_B

    Progress so far; chests are being saved- signs are being saved. Are furnaces that important or shall I release it as is?
     
    Vision likes this.
  14. Offline

    poiNt_3D

    Furnaces would be great, if you don't mind.
     
  15. Offline

    Khalysto

    So is this dead or what? It may be broken now but are you working toward a fix?

    =Khalysto=
     
  16. Offline

    DrBowe

    See:
     
  17. Offline

    Vision

    Chests and signs are more important than furnaces - Release this as soon as possible please. You have so many desperate server owners waiting for this.
     
  18. Offline

    codename_B

    Released with chest+sign protection.
     
    Vision likes this.
  19. Offline

    Vision

    I'm now using this on #1032. If the bug occours again or the plugin causes problems, I'll let you know.

    If it works, I love you.

    EDIT:
    Code:
    19:51:05 [SEVERE] Could not pass event CHUNK_LOAD to bShot
    java.lang.NullPointerException
            at com.ubempire.bshot.ChunkSave.onChunkLoad(Bshot.java:52)
            at org.bukkit.plugin.java.JavaPluginLoader$47.execute(JavaPluginLoader.java:570)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
            at net.minecraft.server.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:90)
            at net.minecraft.server.PlayerInstance.<init>(PlayerInstance.java:31)
            at net.minecraft.server.PlayerManager.a(PlayerManager.java:45)
            at net.minecraft.server.PlayerManager.movePlayer(PlayerManager.java:141)
            at net.minecraft.server.ServerConfigurationManager.d(ServerConfigurationManager.java:138)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:363)
            at net.minecraft.server.Packet10Flying.a(SourceFile:126)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:85)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
     
  20. Offline

    poiNt_3D

    I have the same error.
     
  21. Offline

    codename_B

    Oh damnit what?! :(

    Let me look into this - download link offline for now

    I'm having issues with storing the data in a persistant method - other than that all is well. Bear with me here!

    Fixed - it's all working 100% now! With offline storage too!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  22. Will test, you are hero if it works reliably ;)
     
  23. Offline

    codename_B

    Fixed. With persistance after server restarts. YVW.

    Thanks ;) I've tested this extensively - so I'll be super annoyed if it doesn't work.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  24. Offline

    Vision

    Been running this some hour now on a server with ca 25 players online; I have yet to see a chest/sign being wiped.

    Oh, and by the way, since it seems to be working, click here.

    EDIT:
    http://www2.skoftenmedia.com/images/gifdump/99/21.gif
     
  25. Offline

    codename_B

    Awwwww

    EDIT: are you using the latest version? If not - it's time to update.
     
  26. Offline

    ledhead900

    Testing v2.2 now.
    Going to replace most troubled area's signs and see what happens over course of abour 3 days.
     
  27. Offline

    IRS

    I'll get my friend to give this a shot. We have been having a very irritating time of our spawn buildings signs just inexplicably wiping often. It gets annoying especially since its around 30-40 signs wiping almost 1x a day...
     
  28. Seeing a lot of these:

    Code:
    2011-08-01 03:30:11 [SEVERE] Could not pass event CHUNK_LOAD to bShot
    java.lang.NullPointerException
            at org.bukkit.craftbukkit.block.CraftSign.setLine(CraftSign.java:28)
            at com.ubempire.bshot.ChunkSave.onChunkLoad(Bshot.java:117)
            at org.bukkit.plugin.java.JavaPluginLoader$47.execute(JavaPluginLoader.java:570)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
            at net.minecraft.server.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:90)
            at org.bukkit.craftbukkit.CraftWorld.getChunkAt(CraftWorld.java:96)
            at org.bukkit.craftbukkit.CraftWorld.getBlockAt(CraftWorld.java:64)
            at org.bukkit.craftbukkit.block.CraftBlock.getRelative(CraftBlock.java:121)
            at org.bukkit.event.block.BlockFromToEvent.getToBlock(BlockFromToEvent.java:39)
            at com.sk89q.worldguard.bukkit.WorldGuardBlockListener.onBlockFromTo(WorldGuardBlockListener.java:212)
            at org.bukkit.plugin.java.JavaPluginLoader$30.execute(JavaPluginLoader.java:448)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:338)
            at net.minecraft.server.BlockFlowing.a(BlockFlowing.java:134)
            at net.minecraft.server.World.j(World.java:1951)
            at net.minecraft.server.World.doTick(World.java:1723)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:441)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
     
  29. Offline

    codename_B

    Oho? Looks like sign lines can be "null". Sorry, that was an unexpected one. This was the offending line.
    Code:
                    for(int i=0; i<lines.length; i++)
                    {
                    String line = lines[i];
                    sign.setLine(i, line);
                    }
    
    This has been changed to - and uploaded, along with a couple of other null checks. Could you check this out for me and report back?
    Code:
    for(int i=0; i<lines.length; i++)
                    {
                    String line = lines[i];
                    if(line != null)
                    sign.setLine(i, line);
                    }
    
     
  30. Something else now:

    Code:
    10:15:01 [INFO] [bShot] Be sure, be gone, bShot.
    10:15:01 [SEVERE] java.io.NotSerializableException: org.bukkit.craftbukkit.inventory.CraftItemStack
    10:15:01 [SEVERE]       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1180)
    10:15:01 [SEVERE]       at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1362)
    10:15:01 [SEVERE]       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1170)
    10:15:01 [SEVERE]       at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
    10:15:01 [SEVERE]       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
    10:15:01 [SEVERE]       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
    10:15:01 [SEVERE]       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
    10:15:01 [SEVERE]       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
    10:15:01 [SEVERE]       at java.util.HashMap.writeObject(HashMap.java:1179)
    10:15:01 [SEVERE]       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    10:15:01 [SEVERE]       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    10:15:01 [SEVERE]       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    10:15:01 [SEVERE]       at java.lang.reflect.Method.invoke(Method.java:601)
    10:15:01 [SEVERE]       at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:962)
    10:15:01 [SEVERE]       at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
    10:15:01 [SEVERE]       at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
    10:15:01 [SEVERE]       at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
    10:15:01 [SEVERE]       at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
    10:15:01 [SEVERE]       at com.ubempire.bshot.Bshot.onDisable(Bshot.java:38)
    10:15:01 [SEVERE]       at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:128)
    10:15:01 [SEVERE]       at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:899)
    10:15:01 [SEVERE]       at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:294)
    10:15:01 [SEVERE]       at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:287)
    10:15:01 [SEVERE]       at org.bukkit.craftbukkit.CraftServer.disablePlugins(CraftServer.java:157)
    10:15:01 [SEVERE]       at net.minecraft.server.MinecraftServer.stop(MinecraftServer.java:312)
    10:15:01 [SEVERE]       at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:391)
    10:15:01 [SEVERE]       at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
    Happened on shutdown.
     

Share This Page