Spigot JDynmapGriefPrevention 2.5.1

GriefPrevention Addon with Dynmap Support (if available)

  1. Hey, PirateCraft: thanks a lot for your post that bothered me a lot again! My claims update now in 6 seconds again. I need to clean up the mess now and I also think of seperating the plugin into 2 versions (old/new GP format). I hope at the weekend I can upload a new version without performance issues (and crashes hopefully). As I managed to convert all my old claims and player files to work with the newest servers I am able to test that thoroughly before I release this again.
    • Like Like x 1
  2. Superb, if you wish for further testing, I don't mind sending you my GriefPrevention data to test on! (mysql).
    I have not been able to use any of the GP dynmap plugins, from what I can see there are three, The one by mikeprimm works, but it runs at 20,000% in my timings report! This is just insane!

    I come from a web development background so I have some ideas to try and make this smoother, At present a Div is created for each and every Claim, so if I have 4000-5000 claims that is an insane amount of Div's to load! How about we take another approach? Could there not be a better way of using HTML5/CSS3 to draw a canvas of these claims?
  3. After a lot of rewriting, trial & error and optimization I guess I've found a suitable solution now which looks very promising.


    The expensive stuff will be done asynchronously and only the update of the claims on the dynmap will be done in a sync task (due to ConcurrentModificationExceptions with dynmap tasks which happened sometimes).
    So please stay tuned. I need to clean up the code and do some further testing and I think I will release the new approach tomorrow night or the day after tommorow.

    @PirateCraft: yes, moving the map around performs very badly. I've changed infowindow and admininfowindow and deleted all <div>s and other tags...these are not needed at all as it seems. But it's the same as before in my Firefox. If I open the map in InternetExplorer (which I normally don't use) everything works much smoother. I guess it's the way Firefox renders objects on the page...which does not seem to be the best one.
    #43 jahangir13, Feb 17, 2015
    Last edited: Feb 17, 2015
    • Like Like x 1
  4. This is fantastic news! I will stay tuned! I am infact also using Firefox.
    After posting the message previously, I did so some research and firefox seems to not be able to handle thousands of Divs very well, giving choppy feedback.

    There is a dynmap api avalible, maybe theres another method to draw these plots on the map? Maybe with access to the render engine there could be a way to "paint/draw" a new layer of images that represent the claims instead of using Divs, the issue with this would be displaying the claim information, this would still then need a way of clicking that area for detailed information.
  5. I am not sure what actually paints the popup window. I guess that is automatically done by the dynmap API. I just add the text to the popups...but yes, in the older versions with <div>-tags around each section like owners, builders,....
    But as I wrote above. If I delete all these texts the popup looks the same but does not speed up movin the map.

    I will/can ask Mikeprimm from Dynmap if there is a better way maybe. But as I've copied his Dynmap-Griefprevention plugin initially, I think that he is aware of the best way to paint these things as he developed dynmap ;) Don't know...maybe in a newer version of dynmap there is something new he did not already use in his Dynmap-GP plugin which does not get updated often.
  6. @PirateCraft: I followed this and enabling the new cache backend via about:config seems to help a lot.
    I can now move my map around without waiting X seconds before something happens. Let me know if this is just a subjective feeling or by chance or really helps ,)

    Comments do not sound nice..but as soon as I switched that one on (0-->1) I can scroll in/out and move my map around with just a bit of noticable impact.
  7. jahangir13 updated JDynmapGriefPrevention with a new update entry:

    Reworked uuid version 2.0 released

    Read the rest of this update entry...
  8. I will upload a new version tomorrow. Using a code optimizer tool which told me to change if (xyz == false) to if (!xyz) I forgot the '!'.
    So the wrong claims are added to the wrong layer. If both dynmap layers are switched on you should still see all the claims. It's not a good idea trying to make it too well, I guess.
  9. Thats a Nice Plugin, i think that is perfect to grief other...
  10. ?
    • Agree Agree x 1
  11. I said that plugin is nice...
  12. #52 jahangir13, Feb 19, 2015
    Last edited: Feb 20, 2015
  13. For anybody using/trying this I would be very happy if you could switch on the config option 'debug: true' at the end of the config to let the plugin update the claims 1,2,3 times and send me the output out of the server log. Optimization only makes sence if you know the real use-case, so any numbers I can collect will help me to understand where optimizations might be meaningful.

    Option can be switched on while server is running in the config and will be reloaded via /jdgp reload. Of yourse this can be switched off the same way after getting this information (first time loads/executes a bit slower...so 1st and 2nd execution would be helpful).

    Output looks like this:
    JDGP: ---------------------------------------------
    JDGP: UpdateClaims Start
    JDGP: Async: Load Offline Players List : 80 ms
    JDGP: Async: Build Offline Players Map : 16 ms
    JDGP: Async: Handle Parent Claims : 910 ms
    JDGP: Async: Handle SubDivision Claims : 154 ms
    JDGP: Async: Update Claims Time Total : 1163 ms
    JDGP: UpdateClaims Stop
    JDGP: --------------------------------
    JDGP: Number of OfflinePlayers: 21288
    JDGP: Number of Owners : 2759
    JDGP: Number of Builders : 2152
    JDGP: # of Builders Days Calc : 1299
    JDGP: Number of Containers : 329
    JDGP: Number of Accessors : 42
    JDGP: Number of Managers : 121
    JDGP: Config absenceDayLimit : 40
    JDGP: --------------------------------
    JDGP: Sync: Update Claims on Dynmap : 100 ms
    JDGP: 2759 claims processed (Par:2236/Sub:523).
    JDGP: ---------------------------------------------
  14. Okay... I retested the lastest version with the latest versions of spigot 1.8 and griefprevention today and it worked well.


    I prefer thinne lines and lower opacity on the claims .

    Here is what I use on the real server.

    # Options for appearance of normal user claims (default: red rectangles)
    strokeColor: '#BB2222'
    strokeOpacity: 0.3
    strokeWeight: 2
    fillColor: '#222222'
    fillOpacity: 0.20

  15. Can you please add an option to not output "[JDynmapGriefPrevention] Claims updated" to console?
  16. jahangir13 updated JDynmapGriefPrevention with a new update entry:

    Version 2.2 released

    Read the rest of this update entry...
  17. Thank you for the update an config option! Also thank you for your hard work on this plugin!
  18. Yes, thanks, I saw your request. I was wondering that someone complains about knowing that an update took place. But ok ,) There are so many messages in the console nobody needs, so a config option makes some sense.

    (And I'm always happy to get any hints, ideas or feedback.)
  19. Hint: If you want to see player skins of the owners in the claim popup you can use a infowindow like this in the config

    Example Code in Config:
    infowindow: '
    <tr><th colspan=3 align=center><strong>= User Claim =</strong><br><br></th>
    <tr><td><strong>ID: </strong>%claimid%</td><td rowspan=13></td><td rowspan=13 align=left><img src=https://minotar.net/body/%owner%/100.png></td></tr>
    <tr> <td><strong>W</strong>:%cwidth%<strong>H</strong>:%cheight%<strong>S</strong>:%csize%</td></tr>
    <tr> <td>/tppos %coords%<br><br></td></tr>

    <tr> <td><strong>Main Owner</strong></td></tr>
    <tr> <td>%owner% (%ownerdays%)<br><br></td></tr>

    <tr> <td><strong>Sub Owners</strong></td></tr>
    <tr> <td>%managers%<br><br></td></tr>

    <tr> <td><strong>Builders</strong></td></tr>
    <tr> <td>%builders%<br><br></td></tr>

    <tr> <td><strong>Containers only</strong></td></tr>
    <tr> <td>%containers%<br><br></td></tr>

    <tr> <td><strong>Can enter zone</strong></td></tr>
    <tr> <td>%accessors%<br><br></td></tr>
    ' # don't delete this '

    Picture of the Popup:

    This is the external start page: https://minotar.net/

    The url in the infowindows can also be changed if you e.g. only want to show the owners head of the skin.

    With many claims this does not work very well as the skins are loaded from an external web page and navigating in the page is a bit laggy. Maybe the images can be saved to and loaded from the plugins folder and only loaded from the web page for new players not already stored locally. Need to try something here if there is some interest of you for this. But I don't have an idea how to recognize if a player changes his skin...maybe with a command to update the png for this player (or all from time to time as an admin command).

    Also the popup sometimes is not big enough and needs a second click. Maybe I find a solution for this. Just click once again to show it correctly.

    Will add this example to the config for the next version.
    #59 jahangir13, Feb 28, 2015
    Last edited: Mar 8, 2015
  20. I did this for a very long time with my Claims, I had my info box customized so it would also link the player to their stats page!
    Dynmap already keeps a cache of all images of player heads, so it might be better to load the players head directly from the dynmap folder that already caches them.