mirror of
https://github.com/MilkBowl/Vault.git
synced 2024-11-27 21:15:30 +01:00
trigger firstrun metric still.
This commit is contained in:
parent
53613cd0f9
commit
fb33f6af6d
@ -101,6 +101,8 @@ public class Metrics {
|
|||||||
|
|
||||||
private final String pluginVersion;
|
private final String pluginVersion;
|
||||||
|
|
||||||
|
private boolean firstRun = true;
|
||||||
|
|
||||||
public Metrics(String version) throws IOException {
|
public Metrics(String version) throws IOException {
|
||||||
this.pluginVersion = version;
|
this.pluginVersion = version;
|
||||||
|
|
||||||
@ -210,7 +212,8 @@ public class Metrics {
|
|||||||
plugin.getServer().getScheduler().scheduleAsyncRepeatingTask(plugin, new Runnable() {
|
plugin.getServer().getScheduler().scheduleAsyncRepeatingTask(plugin, new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
postPlugin(plugin, true);
|
postPlugin(plugin);
|
||||||
|
firstRun = false;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
//Ignore exceptions - otherwise we freak server admins out
|
//Ignore exceptions - otherwise we freak server admins out
|
||||||
}
|
}
|
||||||
@ -225,7 +228,7 @@ public class Metrics {
|
|||||||
*
|
*
|
||||||
* @param plugin
|
* @param plugin
|
||||||
*/
|
*/
|
||||||
private void postPlugin(Plugin plugin, boolean isPing) throws IOException {
|
private void postPlugin(Plugin plugin) throws IOException {
|
||||||
// Construct the post data
|
// Construct the post data
|
||||||
String response = "ERR No response";
|
String response = "ERR No response";
|
||||||
String data = encode("guid") + '=' + encode(guid)
|
String data = encode("guid") + '=' + encode(guid)
|
||||||
@ -235,7 +238,7 @@ public class Metrics {
|
|||||||
+ '&' + encode("revision") + '=' + encode(REVISION + "");
|
+ '&' + encode("revision") + '=' + encode(REVISION + "");
|
||||||
|
|
||||||
// If we're pinging, append it
|
// If we're pinging, append it
|
||||||
if (isPing) {
|
if (firstRun) {
|
||||||
data += '&' + encode("ping") + '=' + encode("true");
|
data += '&' + encode("ping") + '=' + encode("true");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user