From fcbac70deb7ae4a2d4f332503b88533dc85fd307 Mon Sep 17 00:00:00 2001 From: Jonathan Williams Date: Sun, 15 Mar 2015 04:47:53 -0700 Subject: [PATCH] Tweaked DB Pool settings, increased connections to 4. Disabled Friend and Leaderboard for now. --- .../src/mineplex/core/database/DBPool.java | 6 ++---- .../src/mineplex/core/friend/FriendManager.java | 11 +++++++++++ .../mineplex/core/leaderboard/LeaderboardManager.java | 2 ++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/database/DBPool.java b/Plugins/Mineplex.Core/src/mineplex/core/database/DBPool.java index 6eee793e9..bb78f0542 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/database/DBPool.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/database/DBPool.java @@ -17,15 +17,13 @@ public final class DBPool BasicDataSource source = new BasicDataSource(); source.addConnectionProperty("autoReconnect", "true"); source.addConnectionProperty("allowMultiQueries", "true"); - source.setDefaultAutoCommit(true); - source.setEnableAutoCommitOnReturn(true); source.setDefaultTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED); source.setDriverClassName("com.mysql.jdbc.Driver"); source.setUrl(url); source.setUsername(username); source.setPassword(password); - source.setMaxTotal(3); - source.setMaxIdle(3); + source.setMaxTotal(4); + source.setMaxIdle(4); source.setTimeBetweenEvictionRunsMillis(180 * 1000); source.setSoftMinEvictableIdleTimeMillis(180 * 1000); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java b/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java index fe6a0d892..94c86b65f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/friend/FriendManager.java @@ -81,6 +81,7 @@ public class FriendManager extends MiniDbClientPlugin if (event.getType() != UpdateType.SLOW || Bukkit.getOnlinePlayers().size() == 0) return; + /* final Player[] onlinePlayers = UtilServer.getPlayers(); Bukkit.getServer().getScheduler().runTaskAsynchronously(_plugin, new Runnable() @@ -108,10 +109,13 @@ public class FriendManager extends MiniDbClientPlugin }); } }); + */ } public void addFriend(final Player caller, final String name) { + caller.sendMessage(F.main(getName(), ChatColor.RED + "Friend is currently disabled.")); + /* if (caller.getName().equalsIgnoreCase(name)) { caller.sendMessage(F.main(getName(), ChatColor.GRAY + "You cannot add yourself as a friend")); @@ -214,10 +218,13 @@ public class FriendManager extends MiniDbClientPlugin }); } }); + */ } public void removeFriend(final Player caller, final String name) { + caller.sendMessage(F.main(getName(), ChatColor.RED + "Friend is currently disabled.")); + /* Bukkit.getServer().getScheduler().runTaskAsynchronously(getPlugin(), new Runnable() { public void run() @@ -247,10 +254,13 @@ public class FriendManager extends MiniDbClientPlugin }); } }); + */ } public void showFriends(Player caller) { + caller.sendMessage(F.main(getName(), ChatColor.RED + "Friend is currently disabled.")); + /* boolean isStaff = ClientManager.Get(caller).GetRank().Has(Rank.HELPER); boolean gotAFriend = false; List friendStatuses = Get(caller).getFriends(); @@ -383,6 +393,7 @@ public class FriendManager extends MiniDbClientPlugin message.add(C.cAqua + C.Strike + "======================"); message.sendToPlayer(caller); + */ } public boolean isFriends(Player player, String friend) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/leaderboard/LeaderboardManager.java b/Plugins/Mineplex.Core/src/mineplex/core/leaderboard/LeaderboardManager.java index 104ad5bda..1ca8b9bc6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/leaderboard/LeaderboardManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/leaderboard/LeaderboardManager.java @@ -61,6 +61,7 @@ public class LeaderboardManager extends MiniPlugin */ public boolean onStatEvent(final Player player, final StatType type, final int gamemode, final int value) { + /* // Asynchronously make DB call to insert stat event. Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), new Runnable() { @@ -69,6 +70,7 @@ public class LeaderboardManager extends MiniPlugin _statEvents.insertStatEvent(player.getName(), gamemode, _serverGroup, type.getTypeId(), value); } }); + */ return true; }