Shops?

Discussion in 'News / Server Information' started by Aqua, Apr 15, 2016.

  1. Aqua

    Aqua Overseer

    Joined:
    Jun 22, 2011
    Messages:
    1,249
    Likes Received:
    457
    As you all noticed the shops have been closed for a few days because of laggy situations.
    Today I have more information about the issue and what happens next. If you are not interested in the technical details you can go read the bottom of the post for the conclusion.
    Details:
    It appeared in the accountholder factory class the plugin would first try to obtain a user via using their ingame uuid and comparing that to offline players. If this case would throw an error it would simply loop ALL OfflinePlayer files untill it would find the correct file.
    Considering we have over 15000 unique player files this can take a while. This action was done every time the money would have to be accessed.
    When I did a few benchmark tests it appeared these few lines of code could take up to 450ms per action (almost half a second, and the server needs to run at 20 tick per second, so actions can take a max of 1/20th of a second, or 50 ms, not to cause lag).
    The fix:
    I modified the accountholder class and all commands to use player names, which are then run through my UUID fetcher, every time an action has to be done, my UUID fetcher will check if it already has the UUID and return this (which I can easily get OfflinePlayer from), or otherwise get the UUID from Mojang and stores it in the cache. (Your UUIDs are stored in cache automatically once you log in, to speed it up even more)

    Conclusion:
    Shops are now open again and we will see how it goes the next few days. If you find any bugs or issues please post them in here so I can take a look at a possible fix.

    Have fun!
     
    • Like Like x 4
    • Winner Winner x 4
    • Informative Informative x 3
    • Useful Useful x 1
  2. Death_Witch

    Death_Witch Survival Staff

    Joined:
    Dec 31, 2012
    Messages:
    741
    Likes Received:
    69
    Thank you Aqua for your time.
     
    • Agree Agree x 3
  3. HazelRain

    HazelRain Active Member

    Joined:
    Feb 9, 2014
    Messages:
    618
    Likes Received:
    150
    You are amazing Aqua!!! Thank you so so much.
     
  4. Shoganeko

    Shoganeko Member

    Joined:
    May 24, 2015
    Messages:
    49
    Likes Received:
    20
    thank you senpai Aqua
     
  5. Kenny

    Kenny Well Known Member

    Joined:
    Mar 19, 2012
    Messages:
    960
    Likes Received:
    317
    should also mention that players need to remake their vaults for the balances to show correctly
     
  6. exe5

    exe5 New Member

    Joined:
    Aug 1, 2015
    Messages:
    7
    Likes Received:
    4
    aqua is da best, i havent had any problems yet :D
     
  7. June

    June Active Member

    Joined:
    Feb 23, 2013
    Messages:
    227
    Likes Received:
    33
    Aqua you are a freakin LEGEND. I can't thank you enough for your hard work!
     
    • Agree Agree x 2
  8. kyrstin861

    kyrstin861 New Member

    Joined:
    Feb 7, 2016
    Messages:
    19
    Likes Received:
    2
    Thank you so much
     
  9. Sahib

    Sahib Member

    Joined:
    May 10, 2015
    Messages:
    61
    Likes Received:
    82
    Wait, so you're telling me that you took the plugin, decompiled it, added your own class to it, recompiled it, and put it back into the server, without anything happening? That's possible? Shouldn't that be disallowed by the plugin license or something?
     
  10. Kenny

    Kenny Well Known Member

    Joined:
    Mar 19, 2012
    Messages:
    960
    Likes Received:
    317
    its not like he's redist'd it anywhere lol
     
  11. Sahib

    Sahib Member

    Joined:
    May 10, 2015
    Messages:
    61
    Likes Received:
    82
    i've seen some licenses that forbid plain old modification, even if you don't redist it
     
  12. Kenny

    Kenny Well Known Member

    Joined:
    Mar 19, 2012
    Messages:
    960
    Likes Received:
    317
    how would they know though? it comes down to if they can prove it
     
  13. Sahib

    Sahib Member

    Joined:
    May 10, 2015
    Messages:
    61
    Likes Received:
    82
    they'll be able to see this post, which is public
     
  14. Kenny

    Kenny Well Known Member

    Joined:
    Mar 19, 2012
    Messages:
    960
    Likes Received:
    317
    this wouldnt be define-able proof though.
     
  15. BC519

    BC519 Active Member

    Joined:
    Aug 4, 2011
    Messages:
    300
    Likes Received:
    136
    I don't think that it matters. Java is easy to deconstruct and rewrite. Change a few word, do some Java hocus pokus and walla, you have a completely "custom" plugin
     
    • Agree Agree x 1
  16. Sahib

    Sahib Member

    Joined:
    May 10, 2015
    Messages:
    61
    Likes Received:
    82
    yeah, i lost the source code for one of my projects, got it back in no time with a decompiler
     

Share This Page