This commit is contained in:
Ty Sayers 2015-03-15 13:00:23 -04:00
commit cec6cf9b2d
3 changed files with 15 additions and 4 deletions

View File

@ -17,15 +17,13 @@ public final class DBPool
BasicDataSource source = new BasicDataSource(); BasicDataSource source = new BasicDataSource();
source.addConnectionProperty("autoReconnect", "true"); source.addConnectionProperty("autoReconnect", "true");
source.addConnectionProperty("allowMultiQueries", "true"); source.addConnectionProperty("allowMultiQueries", "true");
source.setDefaultAutoCommit(true);
source.setEnableAutoCommitOnReturn(true);
source.setDefaultTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED); source.setDefaultTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
source.setDriverClassName("com.mysql.jdbc.Driver"); source.setDriverClassName("com.mysql.jdbc.Driver");
source.setUrl(url); source.setUrl(url);
source.setUsername(username); source.setUsername(username);
source.setPassword(password); source.setPassword(password);
source.setMaxTotal(3); source.setMaxTotal(4);
source.setMaxIdle(3); source.setMaxIdle(4);
source.setTimeBetweenEvictionRunsMillis(180 * 1000); source.setTimeBetweenEvictionRunsMillis(180 * 1000);
source.setSoftMinEvictableIdleTimeMillis(180 * 1000); source.setSoftMinEvictableIdleTimeMillis(180 * 1000);

View File

@ -81,6 +81,7 @@ public class FriendManager extends MiniDbClientPlugin<FriendData>
if (event.getType() != UpdateType.SLOW || Bukkit.getOnlinePlayers().size() == 0) if (event.getType() != UpdateType.SLOW || Bukkit.getOnlinePlayers().size() == 0)
return; return;
/*
final Player[] onlinePlayers = UtilServer.getPlayers(); final Player[] onlinePlayers = UtilServer.getPlayers();
Bukkit.getServer().getScheduler().runTaskAsynchronously(_plugin, new Runnable() Bukkit.getServer().getScheduler().runTaskAsynchronously(_plugin, new Runnable()
@ -108,10 +109,13 @@ public class FriendManager extends MiniDbClientPlugin<FriendData>
}); });
} }
}); });
*/
} }
public void addFriend(final Player caller, final String name) 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)) if (caller.getName().equalsIgnoreCase(name))
{ {
caller.sendMessage(F.main(getName(), ChatColor.GRAY + "You cannot add yourself as a friend")); caller.sendMessage(F.main(getName(), ChatColor.GRAY + "You cannot add yourself as a friend"));
@ -214,10 +218,13 @@ public class FriendManager extends MiniDbClientPlugin<FriendData>
}); });
} }
}); });
*/
} }
public void removeFriend(final Player caller, final String name) 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() Bukkit.getServer().getScheduler().runTaskAsynchronously(getPlugin(), new Runnable()
{ {
public void run() public void run()
@ -247,10 +254,13 @@ public class FriendManager extends MiniDbClientPlugin<FriendData>
}); });
} }
}); });
*/
} }
public void showFriends(Player caller) 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 isStaff = ClientManager.Get(caller).GetRank().Has(Rank.HELPER);
boolean gotAFriend = false; boolean gotAFriend = false;
List<FriendStatus> friendStatuses = Get(caller).getFriends(); List<FriendStatus> friendStatuses = Get(caller).getFriends();
@ -383,6 +393,7 @@ public class FriendManager extends MiniDbClientPlugin<FriendData>
message.add(C.cAqua + C.Strike + "======================"); message.add(C.cAqua + C.Strike + "======================");
message.sendToPlayer(caller); message.sendToPlayer(caller);
*/
} }
public boolean isFriends(Player player, String friend) public boolean isFriends(Player player, String friend)

View File

@ -61,6 +61,7 @@ public class LeaderboardManager extends MiniPlugin
*/ */
public boolean onStatEvent(final Player player, final StatType type, final int gamemode, final int value) public boolean onStatEvent(final Player player, final StatType type, final int gamemode, final int value)
{ {
/*
// Asynchronously make DB call to insert stat event. // Asynchronously make DB call to insert stat event.
Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), new Runnable() Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), new Runnable()
{ {
@ -69,6 +70,7 @@ public class LeaderboardManager extends MiniPlugin
_statEvents.insertStatEvent(player.getName(), gamemode, _serverGroup, type.getTypeId(), value); _statEvents.insertStatEvent(player.getName(), gamemode, _serverGroup, type.getTypeId(), value);
} }
}); });
*/
return true; return true;
} }