Fix metrics, I hope.

By: md_5 <md_5@live.com.au>
This commit is contained in:
Spigot 2013-02-24 13:51:58 +11:00
parent 006da500e9
commit 19823834ea
2 changed files with 8 additions and 8 deletions

View file

@ -1,4 +1,4 @@
From 2f462a8b4cf8db8ad8b18e93707fafecfe20a1e2 Mon Sep 17 00:00:00 2001 From 25d1e688c5485b2e23a52c56f2c49ec36eb55883 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au> From: md_5 <md_5@live.com.au>
Date: Sat, 23 Feb 2013 08:58:35 +1100 Date: Sat, 23 Feb 2013 08:58:35 +1100
Subject: [PATCH] Metrics. Rewrite the Metrics system to be closer to the Subject: [PATCH] Metrics. Rewrite the Metrics system to be closer to the
@ -11,7 +11,7 @@ Subject: [PATCH] Metrics. Rewrite the Metrics system to be closer to the
create mode 100644 src/main/java/org/spigotmc/Metrics.java create mode 100644 src/main/java/org/spigotmc/Metrics.java
diff --git a/src/main/java/org/bukkit/craftbukkit/Spigot.java b/src/main/java/org/bukkit/craftbukkit/Spigot.java diff --git a/src/main/java/org/bukkit/craftbukkit/Spigot.java b/src/main/java/org/bukkit/craftbukkit/Spigot.java
index dafbbc7..8c3cda5 100644 index dafbbc7..ced4bd4 100644
--- a/src/main/java/org/bukkit/craftbukkit/Spigot.java --- a/src/main/java/org/bukkit/craftbukkit/Spigot.java
+++ b/src/main/java/org/bukkit/craftbukkit/Spigot.java +++ b/src/main/java/org/bukkit/craftbukkit/Spigot.java
@@ -1,13 +1,19 @@ @@ -1,13 +1,19 @@
@ -39,7 +39,7 @@ index dafbbc7..8c3cda5 100644
tabPing = configuration.getBoolean("settings.tab-ping", tabPing); tabPing = configuration.getBoolean("settings.tab-ping", tabPing);
+ +
+ if (metrics != null) { + if (metrics == null) {
+ try { + try {
+ metrics = new Metrics(); + metrics = new Metrics();
+ metrics.start(); + metrics.start();
@ -52,7 +52,7 @@ index dafbbc7..8c3cda5 100644
/** /**
diff --git a/src/main/java/org/spigotmc/Metrics.java b/src/main/java/org/spigotmc/Metrics.java diff --git a/src/main/java/org/spigotmc/Metrics.java b/src/main/java/org/spigotmc/Metrics.java
new file mode 100644 new file mode 100644
index 0000000..085df9f index 0000000..f1690a2
--- /dev/null --- /dev/null
+++ b/src/main/java/org/spigotmc/Metrics.java +++ b/src/main/java/org/spigotmc/Metrics.java
@@ -0,0 +1,645 @@ @@ -0,0 +1,645 @@
@ -404,7 +404,7 @@ index 0000000..085df9f
+ // Server software specific section + // Server software specific section
+ String pluginName = "Spigot"; + String pluginName = "Spigot";
+ boolean onlineMode = Bukkit.getServer().getOnlineMode(); // TRUE if online mode is enabled + boolean onlineMode = Bukkit.getServer().getOnlineMode(); // TRUE if online mode is enabled
+ String pluginVersion = (Metrics.class.getPackage() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown"; + String pluginVersion = (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown";
+ String serverVersion = Bukkit.getVersion(); + String serverVersion = Bukkit.getVersion();
+ int playersOnline = Bukkit.getServer().getOnlinePlayers().length; + int playersOnline = Bukkit.getServer().getOnlinePlayers().length;
+ +

View file

@ -1,4 +1,4 @@
From 6ef28f7cbf0936ddb73d5ae8fde5e9b043070e74 Mon Sep 17 00:00:00 2001 From 48cf8759487754486c207f668ea1f04163f93f26 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au> From: md_5 <md_5@live.com.au>
Date: Thu, 14 Feb 2013 17:32:20 +1100 Date: Thu, 14 Feb 2013 17:32:20 +1100
Subject: [PATCH] Netty Subject: [PATCH] Netty
@ -222,7 +222,7 @@ index 58d30eb..e4e5049 100644
// CraftBukkit end // CraftBukkit end
this.pendingConnection = pendingconnection; this.pendingConnection = pendingconnection;
diff --git a/src/main/java/org/bukkit/craftbukkit/Spigot.java b/src/main/java/org/bukkit/craftbukkit/Spigot.java diff --git a/src/main/java/org/bukkit/craftbukkit/Spigot.java b/src/main/java/org/bukkit/craftbukkit/Spigot.java
index 5a96c86..eb02e56 100644 index 15acc97..dbc3e48 100644
--- a/src/main/java/org/bukkit/craftbukkit/Spigot.java --- a/src/main/java/org/bukkit/craftbukkit/Spigot.java
+++ b/src/main/java/org/bukkit/craftbukkit/Spigot.java +++ b/src/main/java/org/bukkit/craftbukkit/Spigot.java
@@ -18,6 +18,8 @@ public class Spigot { @@ -18,6 +18,8 @@ public class Spigot {
@ -244,7 +244,7 @@ index 5a96c86..eb02e56 100644
+ server.getLogger().severe("[Warning] You have opted not to use Netty, in the future this option may be removed!"); + server.getLogger().severe("[Warning] You have opted not to use Netty, in the future this option may be removed!");
+ } + }
+ +
if (metrics != null) { if (metrics == null) {
try { try {
metrics = new Metrics(); metrics = new Metrics();
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java