Shopkeepers

Shopkeepers

2M Downloads

''Sign'' Shopkeepers Are broken

blablubbabcDEV opened this issue ยท 22 comments

commented

Migrated from: https://dev.bukkit.org/projects/shopkeepers/issues/204

Originally posted by MasterMithrandir (Dec 14, 2013):

That's basically it At least on the 1.6.2 version (I will be testing again on te newest 1.6.4 beta versions) Sign shops break when the SERVER RESTARTS, making it posible for non owner players to steal contents from the sign shop chest.

commented

Originally commented by MasterMithrandir (Jan 15, 2014):

No one else has this problem? They still don't work :l

commented

Originally commented by MasterMithrandir (Feb 21, 2014):

Ok, blablubbabc, I made the same test as you and got the same results.
Sign shops seem to work well when restarting in my localhost server. But I couldn't try opening them with an other account, as I would need a hacked client for an offline player to join and check it.
So aparently, the only place where these sign shops break, is in my main server. I've been usign Shopkeepers for quite a few versions now... Could It help to show my config? I don't think there are any error messages on console... Maybe a list with my plugins? Could it be a compatibility issue with Factions or World guard maybe?

commented

Originally commented by blablubbabc (Feb 21, 2014):

[at]MasterMithrandir:
Well, you could try to figure out if it's an issue with the saving (check if the shop gets added to the save.yml), or if it is an issue with the protection (maybe some plugin is undoing the chest protection).

commented

Originally commented by MasterMithrandir (Feb 22, 2014):

I will be checking what you said.
Allthough I noticed the shop ceses to function, but If it is destroyed, it still counts as an existent shop...

        Edited Feb 22, 2014
commented

Originally commented by blablubbabc (Jan 17, 2014):

The shops seem to stay active for me as long as it was properly saved to file.. They should be saved to file at least when you shutdown the server (without crashing it), and every once and a while or even instantly on shop creation depending on your settings.
Even if I crash the server without triggering a save-all to save the shop sign in the world, the shop is still "active" and as soon as I place the sign at the shops location I can use it again.
Signs did not disappear for me if I triggered a save-all and stopped the server normally via the /stop command.
Quote:making it posible for non owner players to steal contents from the sign shop chest

I wasn't able to test that (yet), but as the shop is loading fine for me, I would assume that interaction with the shop chest are still blocked as well (as long as you don't have permission to bypass that protection..).
Could you maybe also try to test and reproduce this on a fresh (craftbukkit) server with only Shopkeepers running?

commented

Originally commented by MasterMithrandir (Feb 20, 2014):

I will try to test it. But why would this be happening if the config is set like this?
save-instantly: true

commented

Originally commented by blablubbabc (Mar 20, 2014):

Well, that's very strange.. The debug mode should print additional information into the log whenever a player interacts with a shop.. maybe it displays additional useful information..
Also did you make sure that the player you are testing with doesn't have the permission to bypass the protections (or any other related permissions)?

commented

Originally commented by MasterMithrandir (Mar 20, 2014):

Turned debug mode on. reloaded the plugin and the chest was working, tried with different account, still worked, one pf my mods tried and it was working.
Turned debug mode off. shop still works trying with any account.
I'm sure it will stop working again randomly at some point, when it does I'll check what debug mode says when I click the shop in non working mode lol.

commented

Originally commented by MasterMithrandir (Mar 20, 2014):

Allright, this is all I can figure out about this issue:

  1. Sign Shop is created
  2. I check the save file, and the shop is saved correctly
  3. The server restarts
  4. No errors appear on console refering to the sign shop I created
  5. I check the sign shop with the player I created it with, and it weirdly seem's to be working oO (this chest was created inside a faction territory)
  6. I login with another player and try the same, but the shop is no longer working (The whole shop, not just the protection). Strange.
  7. Check for errors on console, None.
  8. I check the save file:
    '29':
    name: Test
    world: MithrandirCraft7
    x: 2676
    y: 64
    z: -523
    object: block
    type: player
    owner: mithrandir
    chestx: 2676
    chesty: 64
    chestz: -524
    forhire: false
    costs: {}

Everything seem's fine... so why isn't the shop working?
8.I log back in with Mithrandir (whith whoom I created the shop), The shop definetly isn't working.
This definetly looks like a compatibility issue, I guess the only thing I can do is remove plugins untill I find the cause?
I must also add, this doesn't just happen on a faction claimed territory, it will also happen anywhere else.

        Edited Mar 20, 2014
commented

Originally commented by blablubbabc (Mar 20, 2014):

[at]MasterMithrandir:
With "not working" you mean the sign doesn't open the gui anymore and the shop chest can be opened?
What other protection plugins are you using / or plugins which could deny or allow interaction / block breaking etc.?
What is the debug output (turn debug on in the config) for the shop sign and chest clicking? Is the sign in the world still at the correct position (the position it was saved in the save file)?
Sign shops are enabled in the config? The players you test this with don't have the admin or bypass or '*' permission / are not op?
It is first working for you, then you test the same with another player, the gui doesn't open and the chest is unprotected, and then it also doesn't work for your original player anymore as well? Did you break the chest during your testings or only opened it?
Well, I currently can only randomly guess to find out what exactly could be the conflicting part, in order to find out which sort of plugin could cause that..

commented

Originally commented by MasterMithrandir (Mar 20, 2014):

[at]blablubbabc:
Not working: Yes, that is exactly what I mean. Allthough the chest still exists on the save file, the gui does not appear, + the chest can be opened by anyone.
Other protection plugins: I must say that I tried all the plugins on my server on localhost, + shopkeepers, and I did not get the same error... it might be something really specific like a configuration from another plugin or something. These are all protection related plugins that may be conflicting:

  • Authme (Has some chest shop related configurations, and is allways giving trouble with many other things)
  • Factions
  • WorldGuard
  • WorldGuardCustomFlags
    I don't think it would be anything else, but I can send you my whole plugin list on a PM
    Debug: I'm not familiar with debuging functions, do they mess anything up? If not, I will be trying that very shortly
    The sign is definetly at the same save position.
    Sign shops are enabled, all players can create a sign shop... wouldn't seem to have anything to do with them breaking.
    I tested it with other player accounts, some of my mod's also invervened. Allthough not many players know how to use sign shops, If they do, they usually complain about them breaking and occupying their only shop creation slot.
    The chest can be both opened and broken when the shop ceses to function.
    PD: Really strange, the chest shop seem's to function ocasionally on my first login, when I change player, the chest shop isn't working, and when I switch back to my original player it still isn't.
    Still investigating. I saw you loged in to my server, If you wish to take a look at something please tell me.
commented

Originally commented by MasterMithrandir (Mar 23, 2014):

I get the debug message indicating 1 shop was loaded on the chunk. Exactly the shop I'm testing with. But this was when the shop was working.
I will wait for it to stop working randomly again, and then check if the debug message saying it loaded appears.
Edit: Is it posible that sign shops may be breaking due to chunk unloading with this command?: /lagg unloadchunks (I have it scheduled every 15 min)

        Edited Mar 23, 2014
commented

Originally commented by MasterMithrandir (Mar 23, 2014):

The sign shop unloaded when I got far from it:
[Server] INFO Unloading 1 shopkeepers in chunk 167,-33

After a few minutes, (The lagg comand I mentioned hadn't been executed) I got close to it again, and this message appeared:
[Server] INFO Loading 1 shopkeepers in chunk 167,-33

But the shop isn't working. I try to right click the sign, no messages appear saying ''Opening trade window''
I also tried as you said, clicking around it, nothing...
Reloaded the plugin: Shop starts working. So it aparently breaks when it unloads?

commented

Originally commented by MasterMithrandir (Mar 23, 2014):

Something is stoping the sign shop from loading after unloading.

        Edited Mar 23, 2014
commented

Originally commented by MasterMithrandir (Mar 21, 2014):

Right, so I checked if there where any debug messages when interacting with a broken sign shop, but none appear.
Next step, I will be removing plugins untill I find a posible cause, but it's going to be hard, as the shop works when it pleases, and it may confuse me :S
Is there no way you could bypass any protections that may be causing this?

commented

Originally commented by blablubbabc (Mar 22, 2014):

[at]MasterMithrandir:
Do you at some point get the debug message that the shopkeeper in the chunk the sign shop is located in was loaded?
If not try to reload the plugin: this should load all shopkeepers in all loaded chunks as well, so if you receive that message you know that the shop is active.
If you sign shops are now enabled in the config you should get a debug message in the console when you click the sign, even if it gets cancelled by some other plugin. If the shop was loaded and sign shops are enabled but you don't get that debug message -> make sure that you are really clicking the right block by comparing coordinates, maybe try clicking the blocks around just to see if the issue lays there somehow.
I don't think some other plugin would block those debug messages..
So if you don't get the debug message then the shop was somehow marked as "inactive", which shouldn't be the case if the chunk is loaded and the shop wasn't removed and is still listed in the save-file after doing another reload after the shop breaks.

commented

Originally commented by blablubbabc (Mar 23, 2014):

[at]MasterMithrandir:
I currently don't have the time to test this more myself, but from looking at the code I assume this should be a problem for all servers on which ChunkUnloadEvents are called (however, in many cases various settings of craftbukkit or plugins can cause that chunks are not unloaded, or at least no calling this event.. so depending on those factors the sign shop deacivating might not be a issue, but other things might be then..)
I will test this and upload a fixed version at the end of the week.

        Edited Mar 23, 2014
commented

Originally commented by MasterMithrandir (Mar 23, 2014):

Great thanks.

commented

Originally commented by blablubbabc (Mar 25, 2014):

Check out v1.17.2, as soon as it gets approved.

commented

Originally commented by blablubbabc (Mar 23, 2014):

[at]MasterMithrandir:
Okay, I think I have found the issue: it does indeed unload the sign shop on chunk unloads but doesn't reactivate them on chunk load.

commented

Originally commented by MasterMithrandir (Mar 23, 2014):

[at]blablubbabc:
Thats right... The shop unloads, and when it has to load, a debug message says it loaded, but it doesn't. I think this is something that is only happening on my server due to campatibility issues.
Or maybe It's happening everywhere? Well, in any case, can you do something about it or do I have to determine if another plugin might be causing this?

        Edited Mar 23, 2014
commented

Originally commented by MasterMithrandir (Mar 25, 2014):

Looks like you fixed it!

If this issue was to reappear, or more bugs emerge, I'll be reporting. Thank you.