Hidendra / Plugin-Metrics

Metrics tools designed for minecraft plugins to gather statistical data
http://mcstats.org
85 stars 79 forks source link

Forge: isOptOut called on every tick, reloads config file on every tick #73

Closed LunNova closed 8 years ago

LunNova commented 8 years ago

https://github.com/Hidendra/Plugin-Metrics/blob/master/mods/forge/metrics/src/main/java/org/mcstats/Metrics.java#L193

isOptOut is called on every tick, resulting in a slow call to configuration.load().

This could be fixed by moving the isOptOut call after the interval check.

I don't get why isOptOut needs to be called repeatedly. Is it required to support opting out by editing the config file while the server is running?

stephan-gh commented 8 years ago

It's supposed to check if the user has opted-out in the meantime before attempting to contact MCStats. However, for that it would be enough to do that when that thread is started, so once every 15 minutes, not 20 times a second.