diff --git a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/lobbyBalancer/LobbyBalancer.java b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/lobbyBalancer/LobbyBalancer.java index 67d973d59..f4d6dd31c 100644 --- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/lobbyBalancer/LobbyBalancer.java +++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/lobbyBalancer/LobbyBalancer.java @@ -68,8 +68,6 @@ public class LobbyBalancer implements Listener, Runnable event.setTarget(_plugin.getProxy().getServerInfo(_sortedLobbies.get(_bestServerIndex).Name)); _playersSentToBestServer++; - - System.out.println("Spent " + (System.currentTimeMillis() - timeStart) + "ms selecting : " + _sortedLobbies.get(_bestServerIndex).Name + " for " + event.getPlayer().getName() + " Info [" + _bestServerIndex + ", " + _playersSentToBestServer + ", " + _maxPlayersToSendToBestServer + "]"); } } @@ -110,14 +108,5 @@ public class LobbyBalancer implements Listener, Runnable _bestServerIndex = 0; _maxPlayersToSendToBestServer = (_sortedLobbies.get(_bestServerIndex).MaxPlayers - _sortedLobbies.get(_bestServerIndex).Players) / 10; } - - System.out.println("Lobby balancer:"); - - - for (int i=0; i < _sortedLobbies.size(); i++) - { - ServerStatusData serverStatusData = _sortedLobbies.get(i); - System.out.println("#" + i + " " + serverStatusData.Name + " (" + serverStatusData.Players + "/" + serverStatusData.MaxPlayers + ")"); - } } } diff --git a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/lobbyBalancer/LobbyBalancerRepository.java b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/lobbyBalancer/LobbyBalancerRepository.java index ad18b7845..e54e555e4 100644 --- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/lobbyBalancer/LobbyBalancerRepository.java +++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/lobbyBalancer/LobbyBalancerRepository.java @@ -52,6 +52,7 @@ public class LobbyBalancerRepository public List retrieveServerStatuses() { Connection connection = null; + ResultSet resultSet = null; List serverData = new ArrayList(); try @@ -59,7 +60,7 @@ public class LobbyBalancerRepository connection = DriverManager.getConnection(_connectionString, _userName, _password); PreparedStatement preparedStatement = connection.prepareStatement(RETRIEVE_SERVER_STATUSES); - ResultSet resultSet = preparedStatement.executeQuery(); + resultSet = preparedStatement.executeQuery(); while (resultSet.next()) { @@ -83,6 +84,18 @@ public class LobbyBalancerRepository } finally { + if (resultSet != null) + { + try + { + resultSet.close(); + } + catch (SQLException e) + { + e.printStackTrace(); + } + } + if (connection != null) { try diff --git a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerCount/PlayerCountRepository.java b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerCount/PlayerCountRepository.java index d10cb2ab2..7fc885bc4 100644 --- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerCount/PlayerCountRepository.java +++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerCount/PlayerCountRepository.java @@ -32,6 +32,7 @@ public class PlayerCountRepository public void initialize() { Connection connection = null; + ResultSet resultSet = null; try { @@ -45,7 +46,7 @@ public class PlayerCountRepository // Retrieve id PreparedStatement preparedStatementRetrieve = connection.prepareStatement(RETRIEVE_ID); preparedStatementRetrieve.setString(1, _address); - ResultSet resultSet = preparedStatementRetrieve.executeQuery(); + resultSet = preparedStatementRetrieve.executeQuery(); while (resultSet.next()) { @@ -85,6 +86,18 @@ public class PlayerCountRepository } finally { + if (resultSet != null) + { + try + { + resultSet.close(); + } + catch (SQLException e) + { + e.printStackTrace(); + } + } + if (connection != null) { try @@ -149,13 +162,14 @@ public class PlayerCountRepository { Connection connection = null; PlayerTotalData playerData = new PlayerTotalData(); + ResultSet resultSet = null; try { connection = DriverManager.getConnection(_connectionString, _userName, _password); PreparedStatement preparedStatement = connection.prepareStatement(RETRIEVE_PLAYER_COUNT); - ResultSet resultSet = preparedStatement.executeQuery(); + resultSet = preparedStatement.executeQuery(); while (resultSet.next()) { @@ -170,6 +184,18 @@ public class PlayerCountRepository } finally { + if (resultSet != null) + { + try + { + resultSet.close(); + } + catch (SQLException e) + { + e.printStackTrace(); + } + } + if (connection != null) { try diff --git a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerTracker/PlayerTrackerRepository.java b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerTracker/PlayerTrackerRepository.java index 8e39c4f6d..56600bd88 100644 --- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerTracker/PlayerTrackerRepository.java +++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerTracker/PlayerTrackerRepository.java @@ -106,6 +106,7 @@ public class PlayerTrackerRepository public String retrievePlayerServer(String name) { Connection connection = null; + ResultSet resultSet = null; try { @@ -113,7 +114,7 @@ public class PlayerTrackerRepository PreparedStatement preparedStatement = connection.prepareStatement(RETRIEVE_PLAYER_SERVER); preparedStatement.setString(1, name); - ResultSet resultSet = preparedStatement.executeQuery(); + resultSet = preparedStatement.executeQuery(); while (resultSet.next()) { @@ -126,6 +127,18 @@ public class PlayerTrackerRepository } finally { + if (resultSet != null) + { + try + { + resultSet.close(); + } + catch (SQLException e) + { + e.printStackTrace(); + } + } + if (connection != null) { try diff --git a/Plugins/Mineplex.Core/src/mineplex/core/status/ServerStatusRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/status/ServerStatusRepository.java index 768ad0f64..a38c3cca7 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/status/ServerStatusRepository.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/status/ServerStatusRepository.java @@ -41,6 +41,7 @@ public class ServerStatusRepository public void initialize() { Connection connection = null; + ResultSet resultSet = null; try { @@ -54,7 +55,7 @@ public class ServerStatusRepository // Retrieve id PreparedStatement preparedStatementRetrieve = connection.prepareStatement(RETRIEVE_ID); preparedStatementRetrieve.setString(1, _address); - ResultSet resultSet = preparedStatementRetrieve.executeQuery(); + resultSet = preparedStatementRetrieve.executeQuery(); while (resultSet.next()) { @@ -98,6 +99,18 @@ public class ServerStatusRepository } finally { + if (resultSet != null) + { + try + { + resultSet.close(); + } + catch (SQLException e) + { + e.printStackTrace(); + } + } + if (connection != null) { try @@ -165,6 +178,7 @@ public class ServerStatusRepository public List retrieveServerStatuses() { Connection connection = null; + ResultSet resultSet = null; List serverData = new ArrayList(); try @@ -172,7 +186,7 @@ public class ServerStatusRepository connection = DriverManager.getConnection(_connectionString, _userName, _password); PreparedStatement preparedStatement = connection.prepareStatement(RETRIEVE_SERVER_STATUSES); - ResultSet resultSet = preparedStatement.executeQuery(); + resultSet = preparedStatement.executeQuery(); while (resultSet.next()) { @@ -192,6 +206,18 @@ public class ServerStatusRepository } finally { + if (resultSet != null) + { + try + { + resultSet.close(); + } + catch (SQLException e) + { + e.printStackTrace(); + } + } + if (connection != null) { try diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SuperSmash.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SuperSmash.java index d0ff80fb6..844be1416 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SuperSmash.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/SuperSmash.java @@ -62,7 +62,7 @@ public class SuperSmash extends SoloGame new KitSkySquid(manager), new KitWitherSkeleton(manager), //new KitWither(manager), - new KitWolf(manager), + //new KitWolf(manager), }, diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java index 672ce0816..c1830bc43 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameLobbyManager.java @@ -960,14 +960,34 @@ public class GameLobbyManager implements IPacketRunnable, Listener private String GetKitCustomName(Player player, Game game, LobbyEnt ent) { - if (!player.isOnline()) - return ent.GetKit().GetName(); - CoreClient client = Manager.GetClients().Get(player); Donor donor = Manager.GetDonation().Get(player.getName()); String entityName = ent.GetKit().GetName(); + if (!player.isOnline() || client == null || donor == null) + return entityName; + + if (client.GetRank() == null) + { + System.out.println("client rank is null"); + } + + if (game == null) + { + System.out.println("game is null"); + } + + if (Manager == null) + { + System.out.println("Manager is null"); + } + + if (Manager.GetServerConfig() == null) + { + System.out.println("Manager.GetServerConfig() is null"); + } + if (client.GetRank().Has(Rank.ULTRA) || donor.OwnsUnknownPackage(game.GetName() + " " + ent.GetKit().GetName()) || donor.OwnsUnknownPackage(Manager.GetServerConfig().ServerType + " ULTRA") || ent.GetKit().GetAvailability() == KitAvailability.Free) { entityName = ChatColor.GREEN + entityName; diff --git a/Plugins/Nautilus.Game.Core/src/nautilus/game/core/engine/GameEngine.java b/Plugins/Nautilus.Game.Core/src/nautilus/game/core/engine/GameEngine.java index 479bac91d..25a5a5bdb 100644 --- a/Plugins/Nautilus.Game.Core/src/nautilus/game/core/engine/GameEngine.java +++ b/Plugins/Nautilus.Game.Core/src/nautilus/game/core/engine/GameEngine.java @@ -1095,7 +1095,22 @@ public abstract class GameEngine, gamePlayer.StopTimePlay(); - //PendingPlayerRemoveMap.put(gamePlayer.getName(), System.currentTimeMillis() + LogoutPeriod * 1000); + boolean online = false; + + for (PlayerType otherPlayer : game.GetPlayers()) + { + if (gamePlayer == otherPlayer) + continue; + + if (otherPlayer.isOnline()) + { + online = true; + break; + } + } + + if (!online) + Plugin.getServer().shutdown(); } else { diff --git a/Website/LOC.Website.Web/Controllers/PlayerAccountController.cs b/Website/LOC.Website.Web/Controllers/PlayerAccountController.cs index 5f2a6b214..d0a0896ca 100644 --- a/Website/LOC.Website.Web/Controllers/PlayerAccountController.cs +++ b/Website/LOC.Website.Web/Controllers/PlayerAccountController.cs @@ -147,27 +147,6 @@ return Content(json, "application/json"); } - [HttpPost] - public ActionResult GemReward(GemRewardToken token) - { - var account = _accountAdministrator.GetAccountByName(token.Name); - account.Gems += token.Gems; - - var accountGemTransaction = new AccountGemTransaction - { - Account = account, - Earned = token.Earned, - Reason = token.Reason, - Source = token.Source - }; - - - _accountAdministrator.UpdateAccount(account); - - var json = JsonConvert.SerializeObject(token); - return Content(json, "application/json"); - } - [HttpPost] public ActionResult RankUpdate(RankUpdateToken token) { @@ -175,7 +154,6 @@ return Content(json, "application/json"); } - [HttpPost] public ActionResult PlayerVoted(string name) { diff --git a/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml b/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml index 4b2796cb2..337183661 100644 --- a/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml +++ b/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml @@ -1,12 +1,12 @@  - + @@ -19,18 +19,15 @@ - - + - - + - @@ -44,27 +41,25 @@ - + - - - + - - + + @@ -75,50 +70,52 @@ - - + - - + + + + - - - + + - + - + + + - + @@ -127,20 +124,20 @@ - + - - + - + + - + @@ -154,44 +151,49 @@ - + + + + + + - + + - + - - + - + + - @@ -201,7 +203,7 @@ - + @@ -209,65 +211,61 @@ - - + + - + - + - + + - + - + - - + - - + + - - + - + - + - - + + - - + + - - + - - + - @@ -283,29 +281,28 @@ - + + - - + - + - + - @@ -313,18 +310,19 @@ - + - + + - + @@ -335,20 +333,23 @@ + - + + - + + @@ -356,52 +357,49 @@ - + - - + + - - - - - - + - - + - + + + - + + @@ -412,33 +410,32 @@ - + - - - - + - - + - - - + + + + + + @@ -446,84 +443,87 @@ - + + - + - - + + - + - - + + - - + + - - + + + - + - + - + + - - + + - + - - + + - + - - - - - + + + + + - + \ No newline at end of file diff --git a/Website/LOCWebsite.suo b/Website/LOCWebsite.suo index d65e30e7d..5878bdd87 100644 Binary files a/Website/LOCWebsite.suo and b/Website/LOCWebsite.suo differ