diff --git a/Plugins/Libraries/craftbukkit.jar b/Plugins/Libraries/craftbukkit.jar index cead2563b..239ca91d6 100644 Binary files a/Plugins/Libraries/craftbukkit.jar and b/Plugins/Libraries/craftbukkit.jar differ diff --git a/Plugins/Mineplex.Core/.project b/Plugins/Mineplex.Core/.project index 330f3ea33..693dd7cbc 100644 --- a/Plugins/Mineplex.Core/.project +++ b/Plugins/Mineplex.Core/.project @@ -10,6 +10,16 @@ + + org.eclipse.ui.externaltools.ExternalToolBuilder + auto,full,incremental, + + + LaunchConfigHandle + <project>/.externalToolBuilders/Core.launch + + + org.eclipse.jdt.core.javanature diff --git a/Plugins/Mineplex.Core/src/mineplex/core/monitor/LagMeter.java b/Plugins/Mineplex.Core/src/mineplex/core/monitor/LagMeter.java index d2e25c5f5..8a745c64a 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/monitor/LagMeter.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/monitor/LagMeter.java @@ -78,7 +78,6 @@ public class LagMeter extends MiniPlugin if (_count % 30 == 0) { _ticksPerSecondAverage = 30000D / (now - _lastAverage) * 20D; - _ticksPerSecond = 0; _lastAverage = now; } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ConfirmationPage.java b/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ConfirmationPage.java index 94a25a631..2e04646cd 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ConfirmationPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ConfirmationPage.java @@ -235,7 +235,7 @@ public class ConfirmationPage inetAddresses = netint.getInetAddresses(); for (InetAddress inetAddress : Collections.list(inetAddresses)) @@ -80,7 +80,14 @@ public class ServerStatusManager extends MiniPlugin try { - _repository = new ServerStatusRepository(plugin.getConfig().getString("serverstatus.name"), plugin.getConfig().getString("serverstatus.group"), address + ":" + _plugin.getServer().getPort(), event.getMaxPlayers()); + _repository = new ServerStatusRepository( + plugin.getConfig().getString("serverstatus.connectionurl"), + plugin.getConfig().getString("serverstatus.username"), + plugin.getConfig().getString("serverstatus.password"), + plugin.getConfig().getString("serverstatus.name"), + plugin.getConfig().getString("serverstatus.group"), + address + ":" + _plugin.getServer().getPort(), event.getMaxPlayers() + ); _repository.initialize(); } catch (Exception ex) @@ -89,22 +96,23 @@ public class ServerStatusManager extends MiniPlugin } } - private void loadServerTrackerValues() + private void setupConfigValues() { - FileConfiguration yamlConfig = new YamlConfiguration(); - File serverTrackerConfig = new File("plugins/ServerTracker/config.yml"); - - if (!serverTrackerConfig.exists()) - return; - try { - yamlConfig.load(serverTrackerConfig); - - GetPlugin().getConfig().addDefault("serverstatus.name", yamlConfig.get("servertracker.informations.name")); + GetPlugin().getConfig().addDefault("serverstatus.connectionurl", "jdbc:mysql://sql.mineplex.com:3306/ServerStatus"); + GetPlugin().getConfig().set("serverstatus.connectionurl", GetPlugin().getConfig().getString("serverstatus.connectionurl")); + + GetPlugin().getConfig().addDefault("serverstatus.username", "root"); + GetPlugin().getConfig().set("serverstatus.username", GetPlugin().getConfig().getString("serverstatus.username")); + + GetPlugin().getConfig().addDefault("serverstatus.password", "tAbechAk3wR7tuTh"); + GetPlugin().getConfig().set("serverstatus.password", GetPlugin().getConfig().getString("serverstatus.password")); + + GetPlugin().getConfig().addDefault("serverstatus.name", "TEST-1"); GetPlugin().getConfig().set("serverstatus.name", GetPlugin().getConfig().getString("serverstatus.name")); - GetPlugin().getConfig().addDefault("serverstatus.group", yamlConfig.get("servertracker.informations.group")); + GetPlugin().getConfig().addDefault("serverstatus.group", "Testing"); GetPlugin().getConfig().set("serverstatus.group", GetPlugin().getConfig().getString("serverstatus.group")); GetPlugin().saveConfig(); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/status/ServerStatusRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/status/ServerStatusRepository.java index e7803fe9b..768ad0f64 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/status/ServerStatusRepository.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/status/ServerStatusRepository.java @@ -11,9 +11,9 @@ import java.util.List; public class ServerStatusRepository { - private String _connectionString = "jdbc:mysql://sql.mineplex.com:3306/ServerStatus"; - private String _userName = "root"; - private String _password = "tAbechAk3wR7tuTh"; + private String _connectionString; + private String _userName; + private String _password; private static String CREATE_TABLE = "CREATE TABLE IF NOT EXISTS ServerStatus (id INT NOT NULL AUTO_INCREMENT, serverName VARCHAR(256), serverGroup VARCHAR(256), address VARCHAR(256), updated LONG, motd VARCHAR(256), players INT, maxPlayers INT, tps INT, ram INT, maxRam INT, PRIMARY KEY (id));"; private static String INSERT_PLAYER_COUNT = "INSERT INTO ServerStatus values(default, ?, ?, ?, now(), 'Configuring server.', ?, ?, 0, ?, ?);"; @@ -27,8 +27,11 @@ public class ServerStatusRepository private String _address; private int _maxPlayers = 0; - public ServerStatusRepository(String serverName, String serverGroup, String address, int maxPlayers) + public ServerStatusRepository(String connectionUrl, String username, String password, String serverName, String serverGroup, String address, int maxPlayers) { + _connectionString = connectionUrl; + _userName = username; + _password = password; _serverName = serverName; _serverGroup = serverGroup; _address = address; diff --git a/Plugins/Nautilus.Game.MineKart/src/nautilus/game/minekart/MineKart.java b/Plugins/Nautilus.Game.MineKart/src/nautilus/game/minekart/MineKart.java index b9f6ebff3..b786be06b 100644 --- a/Plugins/Nautilus.Game.MineKart/src/nautilus/game/minekart/MineKart.java +++ b/Plugins/Nautilus.Game.MineKart/src/nautilus/game/minekart/MineKart.java @@ -145,8 +145,6 @@ public class MineKart extends JavaPlugin implements INautilusPlugin, Listener new MemoryFix(this); - new ServerStatusManager(this, new LagMeter(this, _clientManager)); - getServer().getPluginManager().registerEvents(this, this); CreateFakeKarts();