[Request] Assert visibility protocol (in reverse)
Can you add as well the reverse? assertVisibility? I say this because I am planning on making tons of pvp related toggles. All are based from dynmap being configured to hide all players (as in a pvp server players get paranoid when they have an eye in the sky always watching them, you don't want to be a dot on a map). So from everyone being hidden then I can make them be shown under special circumstances that can be advantageous to the pvp experience i.e.:
Show players that are out in the open at night time (not just mobs you have to be afraid of when you go out at night) Show players for 5 minutes after they have killed someone (you can have your revenge if you act quick) Show players for 20 minutes after they killed someone X blocks near spawn (may deter spawn camping) Show players for one minute after they hit someone (pvp activity will be visible on the map) Show players that have armor and weapons on their inventory (means you want to pvp) Show players that don't have full health (an added incentive to always carry food) Show players with KDR above X (looking for trouble? trouble will find you) Show players that have opted-in with /clan toggle show (this toggles showing but doesn't hide you if another rule has you showing) Show players that have certain enchanted items in their procession (could balance out certain OP items)
- Players will be able to hide themselves by going underground or by sneaking no matter if the other options have them showing
Thus being able to assert visibility would lend itself perfectly to servers who are configured with hidden players as default.
This doesn't play well with the invisibility assert AND the configuration setting. The existing protocol is unambiguous - your visible unless one or more assertions say you aren't - the problem with visibility assertions is that they make the situation ambiguous: if 1 guy asserts that someone should be invisible, and another asserts that they should be visible, which applies? Further, we want to be sure that admins who opt to be hidden stay hidden, independent of what another plugin might assert.
I see what you mean. Indeed the whole system is set up under the assumption that player visibility is the preferred default state and then based on certain events plugins can reverse their visibility. This idea works only for build servers where pvp is disabled. Once you bring pvp into the mix, this system becomes a hindrance, people don't want everyone who might kill them to be checking out their whereabouts. Players complain, and the layer is removed. Which is why the majority of pvp enabled servers out there (which is most of them) who have dynmap on their production servers have the player layer removed completely offering only the map to be viewed publicly. They don't do this on a whim, they do this because dynmap's player layer is no built with them in mind, it provides too much information which upsets their server's careful balance. I know, because I've had to do this on my own server sacredlabyrinth.net, which is why i'm stepping in trying to modify the Players layer behaviors to fit in with how players actually play so I can actually use it and players wont balk at the idea of it existing.
To this end I propose another solution, maybe have two modes to the player layer. The current one which is visible-by-default, with its current set of assertions. And a way to reverse it, through a config setting, which would make it "hidden-by-default" with a separate set of assertions. Each mode would only act on its specific set of assertions. Plugins would have to choose which set to work with depending on what their plugin does and how which mode it is built to work in.
Otherwise I will just have to manage the player's visibility internally in my plugin by setting the players visibility state explicitly rather than using assertions, which will work for my purposes with the downside of it not being as compatible with other dynmap plugins.
That might be a way to go - the PVP style consideration is a good one. Maybe we go with the notion of assertions being opposite to the configured state for a given player (if a player is set to be hidden, configuration-wise, then only assertions of visibility are relevant; if the player is set to be visible, configuration-wise, then only assertions of invisibility apply). That would be coherent, I think - its unambiguous, and I believe would do what we need. In that case, 'assertPlayerInvisibile()' means 'make him invisibile if he's configured to be visible, otherwise ignore assertion'; 'assertPlayerVisible()' would mean 'make him visible if he's configured to be hidden, otherwise ignore assertion'. What do you think?
That makes sense. Makes a lot of sense. So one would set the player's visibility with setPlayerVisibility(), for example I set the player to false, then the assertions for assertPlayerInvisible would kick in? and if i set the player to true, then the assertions for assertPlayerVisible would kick in? I like it.
OK - cool - its in the current 0.32 code base :) Please give it a look - I'm still doing some testing there.
Delivered in 0.32
Indeed. Thanks!