Staartvin / Autorank-2

Autorank is a Spigot/Bukkit plugin for automatically ranking players based on requirements
Other
56 stars 62 forks source link

Add multiplier and UpdateRealTimePlayedTask #727

Open HectorJuarezL opened 4 years ago

HectorJuarezL commented 4 years ago

Hello, when the ticks per second decrease in a server, the time added is wrong because instead of adding 5 minutes every 5 minutes, it adds 5 minutes every 10-15 minutes. As I said, it is only if the server has lag issues that is another problem but a solution I found for the correct adding of minutes is to store the time between every run of the task UpdateTimePlayedTask and then add the difference

I think this is one of the problems with time that other people have.

Staartvin commented 4 years ago

Seems like a good addition, but I'm unsure whether the TPS will stay below 20 for more than a few seconds, let alone a few minutes. Will this change anything significantly?

HectorJuarezL commented 4 years ago

Seems like a good addition, but I'm unsure whether the TPS will stay below 20 for more than a few seconds, let alone a few minutes. Will this change anything significantly?

The server where I used to play has TPS issues (because of the amount of people at home during contingence) and during half day it has like 10 TPS, so the time added is fewer than people's playing time. I've told admin about the problem and the solution but they don't know how to change the code so I did it by myself and shared the new compiled plugin with him but he doesn't trust in me.

As you said, in a good server TPS wouldn't be below 20 for a long time, but in a server with low requirements for the players they have, it does happen.

The math operation plus the current time call could be a charge for some servers than doesn't even have TPC issues, so a good idea could be adding a new updateTimePlayedTask class and set a new variable for choosing the way of adding time in the setttings file, so in the class "taskManager" there would be a condition for running the old update task or the update task I propposed. Having a condition that evaluates every time the updateTimePlayedTask is called could be a charge por the server, that's why I think create a new class is and better.

HectorJuarezL commented 4 years ago

Hi, I made some changes so server owners can choose if they want to compute the time elapsed or not between every update of updade played time task, as I said in the last comment. Another thing that I added, is a multiplier so people can get more time. It could be used if there is something special like an anniversary or a special day. This only works if the variable "use real time" in settings file is equals to true. The multiplier command is "/ar multiplier [value]"

Staartvin commented 4 years ago

I like the configurable option (although I would recall it to 'use more accurate timings', because real timing is a bit confusing.

Moreover, I don't like the idea of having two separate tasks for each timing. I would rather just have it in one single task and add time based on whether the admin wants realistic vs. static timings.

Also, I don't understand the multiplier command. What does it do? Is it meant for admins to give players more time 'per check'? So instead of getting 1 min for each minute played, they get X times 1 min per 1 minute player (X being the multiplier)?

HectorJuarezL commented 4 years ago

Also, I don't understand the multiplier command. What does it do? Is it meant for admins to give players more time 'per check'? So instead of getting 1 min for each minute played, they get X times 1 min per 1 minute player (X being the multiplier)?

The multiplier works like you said, if it's set to "2" it will add the interval time multiplied by 2, and if the "more accurate timing" setting is true, it will add the elapsed time multiplied by 2.