#Lag Machine
1 messages · Page 1 of 1 (latest)
alright lol
im just gonna show the blockbreakevent and then hopefully if thats fixed, i can apply it to the mobkill as well
gimme a moment while i organize everything into a paste
Im gonna look at that tomorrow
alright sounds good
here it is
everything is stored in a map, so im not sure where it could be causing so much delay
but is storing all that information inside of enums good?
omg im so dumb
i forgot i did add a database write recently
yeah and when i test just that individual bit, it's where all of the ms comes from, my issue here is that I am calling the addCoins method and its writing directly to db to update the coins. however I have other plugins that read from the same db and if I were to cache the players coins and update them on an autosave or whenever they leave the data wont be synched
I specifically have 1 other plugin that uses the players coins which is a shop plugin. So if the player were to have their coins cached inside of this plugin and then saved at a later time, the could potentially buy something in the shop, have money taken from them, but then their coins that are cached in this plugin would rollback the coins
ive gotten around this buy having my main economy plugin cache the players coins from a db on login and then have a console command be sent from my other plugins that want to alter a players coins and have the plugin where all the coins are cached update the cached values and then save on leave/autosave