diff --git a/Plugins/Mineplex.Core/src/mineplex/core/donation/repository/token/DonorToken.java b/Plugins/Mineplex.Core/src/mineplex/core/donation/repository/token/DonorToken.java index 15888736a..8eec45471 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/donation/repository/token/DonorToken.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/donation/repository/token/DonorToken.java @@ -8,5 +8,6 @@ public class DonorToken public boolean Donated; public List SalesPackages; public List UnknownSalesPackages; + public List Transactions; public int Coins; } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/donation/repository/token/TransactionToken.java b/Plugins/Mineplex.Core/src/mineplex/core/donation/repository/token/TransactionToken.java new file mode 100644 index 000000000..de01b62ef --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/donation/repository/token/TransactionToken.java @@ -0,0 +1,9 @@ +package mineplex.core.donation.repository.token; + +public class TransactionToken +{ + public long Date; + public String SalesPackageName; + public int Gems; + public int Coins; +} diff --git a/Plugins/Mineplex.DDoSProtectionSwitcher/src/mineplex/ddos/DDoSProtectionSwitcher.java b/Plugins/Mineplex.DDoSProtectionSwitcher/src/mineplex/ddos/DDoSProtectionSwitcher.java index af5042bc5..fd22fa8fa 100644 --- a/Plugins/Mineplex.DDoSProtectionSwitcher/src/mineplex/ddos/DDoSProtectionSwitcher.java +++ b/Plugins/Mineplex.DDoSProtectionSwitcher/src/mineplex/ddos/DDoSProtectionSwitcher.java @@ -45,8 +45,8 @@ public class DDoSProtectionSwitcher _repository = new DnsMadeEasyRepository(); DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); - while (true) - { + //while (true) + //{ if (_repository.switchToDDOSProt()) { System.out.println("Starting DDoS Protection Switch at " + dateFormat.format(new Date())); @@ -203,7 +203,7 @@ public class DDoSProtectionSwitcher { e.printStackTrace(); } - } + //} /* * // Switch off ddos protection for (DnsRecord record : records.data) { * if (record.type.equalsIgnoreCase("CNAME")) { if diff --git a/Plugins/Mineplex.DDoSProtectionSwitcher/src/mineplex/ddos/DnsMadeEasyRepository.java b/Plugins/Mineplex.DDoSProtectionSwitcher/src/mineplex/ddos/DnsMadeEasyRepository.java index f3d0edc77..2563df862 100644 --- a/Plugins/Mineplex.DDoSProtectionSwitcher/src/mineplex/ddos/DnsMadeEasyRepository.java +++ b/Plugins/Mineplex.DDoSProtectionSwitcher/src/mineplex/ddos/DnsMadeEasyRepository.java @@ -9,7 +9,8 @@ import java.text.SimpleDateFormat; public class DnsMadeEasyRepository { - private String _connectionString = "jdbc:mysql://db.mineplex.com:3306/BungeeServers?autoReconnect=true&failOverReadOnly=false&maxReconnects=10"; + // Yip Yip actual IP because if null route happens we can't resolve the HOSTNAME DERP FACE DEFEK7!!! -defek7 + private String _connectionString = "jdbc:mysql://10.35.74.133:3306/BungeeServers?autoReconnect=true&failOverReadOnly=false&maxReconnects=10"; private String _userName = "root"; private String _password = "tAbechAk3wR7tuTh"; @@ -119,6 +120,9 @@ public class DnsMadeEasyRepository } } - return countOffline >= 20; + //if (countOffline > 5) + System.out.println(countOffline + " offline bungees."); + + return true; } } diff --git a/Plugins/Mineplex.ServerMonitor/src/mineplex/servermonitor/ServerMonitor.java b/Plugins/Mineplex.ServerMonitor/src/mineplex/servermonitor/ServerMonitor.java index e15d4f4b1..6d9a2918f 100644 --- a/Plugins/Mineplex.ServerMonitor/src/mineplex/servermonitor/ServerMonitor.java +++ b/Plugins/Mineplex.ServerMonitor/src/mineplex/servermonitor/ServerMonitor.java @@ -76,7 +76,7 @@ public class ServerMonitor for (MinecraftServer deadServer : _repository.getDeadServers()) { - killServer(deadServer.getName(), deadServer.getPublicAddress(), true); + killServer(deadServer.getName(), deadServer.getPublicAddress(), "[KILLED] [DEAD] " + deadServer.getName() + ":" + deadServer.getPublicAddress(), true); } List dedicatedServers = new ArrayList(_repository.getDedicatedServers()); @@ -139,11 +139,9 @@ public class ServerMonitor iterator.remove(); else if (System.currentTimeMillis() - entry.getValue().getValue() > 20000) { - System.out.println("-=[SERVER STARTUP TOO SLOW]=- " + entry.getKey()); - String serverName = entry.getKey(); String serverAddress = entry.getValue().getKey(); - killServer(serverName, serverAddress, true); + killServer(serverName, serverAddress, "[KILLED] [SLOW-STARTUP] " + serverName + ":" + serverAddress, true); iterator.remove(); } } @@ -220,7 +218,6 @@ public class ServerMonitor private static void handleGroupChanges(List dedicatedServers, HashMap> serverTracker, ServerGroup serverGroup, boolean free) { int serverNum = 0; - //GroupStatusData groupStatus = groupStatusList.get(serverGroup.Name); int requiredTotal = serverGroup.getRequiredTotalServers(); int requiredJoinable = serverGroup.getRequiredJoinableServers(); int joinableServers = serverGroup.getJoinableCount(); @@ -231,8 +228,12 @@ public class ServerMonitor // Minimum 1500 slot bufferzone if (serverGroup.getName().equalsIgnoreCase("Lobby")) { - if (serverGroup.getMaxPlayerCount() - serverGroup.getPlayerCount() < 1500) - serversToAdd = requiredJoinable; + int availableSlots = serverGroup.getMaxPlayerCount() - serverGroup.getPlayerCount(); + + if (availableSlots < 1500) + serversToAdd = Math.max(1, (1500 / availableSlots) - serverGroup.getMaxPlayers()); + else if (serversToKill > 0) + serversToKill = Math.min(serversToKill, (availableSlots - 1500) / 80); } while (serversToAdd > 0) @@ -262,12 +263,12 @@ public class ServerMonitor { List emptyServers = new ArrayList(serverGroup.getEmptyServers()); MinecraftServer emptyServer = emptyServers.get(serversToKill - 1); - killServer(emptyServer); + killServer(emptyServer, "[KILLED] [EXCESS] " + emptyServer.getName() + ":" + emptyServer.getPublicAddress()); serversToKill--; } } - private static void killServer(final String serverName, final String serverAddress, final boolean announce) + private static void killServer(final String serverName, final String serverAddress, final String message, final boolean announce) { String cmd = "/home/mineplex/easyRemoteKillServer.sh"; @@ -291,7 +292,7 @@ public class ServerMonitor if (error) System.out.println("[" + serverName + ":" + serverAddress + "] Kill errored."); else - System.out.println("Sent kill command to " + serverAddress + " for " + serverName + " completed"); + System.out.println(message); } } }); @@ -366,9 +367,9 @@ public class ServerMonitor return bestServer; } - private static void killServer(final MinecraftServer serverToKill) + private static void killServer(final MinecraftServer serverToKill, String message) { - killServer(serverToKill.getName(), serverToKill.getPublicAddress(), true); + killServer(serverToKill.getName(), serverToKill.getPublicAddress(), message, true); } private static void startServer(final DedicatedServer serverSpace, final ServerGroup serverGroup, final int serverNum, final boolean free) diff --git a/Website/LOC.Core/LOC.Core.csproj b/Website/LOC.Core/LOC.Core.csproj index 3b92112f2..89d688b85 100644 --- a/Website/LOC.Core/LOC.Core.csproj +++ b/Website/LOC.Core/LOC.Core.csproj @@ -82,6 +82,7 @@ + diff --git a/Website/LOC.Core/Model/Sales/AccountTransaction.cs b/Website/LOC.Core/Model/Sales/AccountTransaction.cs index bf036eab2..01aacc663 100644 --- a/Website/LOC.Core/Model/Sales/AccountTransaction.cs +++ b/Website/LOC.Core/Model/Sales/AccountTransaction.cs @@ -6,6 +6,8 @@ public Account.Account Account { get; set; } + public long Date { get; set; } + public string SalesPackageName { get; set; } public int Gems { get; set; } diff --git a/Website/LOC.Core/Model/Sales/CoinTransaction.cs b/Website/LOC.Core/Model/Sales/CoinTransaction.cs index 273d375cb..03848b00f 100644 --- a/Website/LOC.Core/Model/Sales/CoinTransaction.cs +++ b/Website/LOC.Core/Model/Sales/CoinTransaction.cs @@ -6,6 +6,8 @@ public Account.Account Account { get; set; } + public long Date { get; set; } + public string Source { get; set; } public int Amount { get; set; } diff --git a/Website/LOC.Core/Model/Sales/GemTransaction.cs b/Website/LOC.Core/Model/Sales/GemTransaction.cs index b917705b7..7be893c7e 100644 --- a/Website/LOC.Core/Model/Sales/GemTransaction.cs +++ b/Website/LOC.Core/Model/Sales/GemTransaction.cs @@ -6,6 +6,8 @@ public Account.Account Account { get; set; } + public long Date { get; set; } + public string Source { get; set; } public int Amount { get; set; } diff --git a/Website/LOC.Core/Tokens/Client/AccountTransactionToken.cs b/Website/LOC.Core/Tokens/Client/AccountTransactionToken.cs new file mode 100644 index 000000000..afe1de694 --- /dev/null +++ b/Website/LOC.Core/Tokens/Client/AccountTransactionToken.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace LOC.Core.Tokens.Client +{ + public class AccountTransactionToken + { + public long Date { get; set; } + + public string SalesPackageName { get; set; } + + public int Gems { get; set; } + + public int Coins { get; set; } + + public AccountTransactionToken(Model.Sales.AccountTransaction transaction) + { + SalesPackageName = transaction.SalesPackageName; + Date = transaction.Date; + Gems = transaction.Gems; + Coins = transaction.Coins; + } + } +} diff --git a/Website/LOC.Core/Tokens/Client/ClientToken.cs b/Website/LOC.Core/Tokens/Client/ClientToken.cs index 00070d053..a73a187ee 100644 --- a/Website/LOC.Core/Tokens/Client/ClientToken.cs +++ b/Website/LOC.Core/Tokens/Client/ClientToken.cs @@ -42,6 +42,7 @@ Donated = account.Donated, SalesPackages = new List(), UnknownSalesPackages = new List(), + Transactions = new List(), CustomBuilds = new List(), Pets = new List(), PetNameTagCount = account.PetNameTagCount @@ -86,6 +87,7 @@ foreach (var transaction in account.AccountTransactions) { DonorToken.UnknownSalesPackages.Add(transaction.SalesPackageName); + DonorToken.Transactions.Add(new AccountTransactionToken(transaction)); } if (account.CustomBuilds == null) diff --git a/Website/LOC.Core/Tokens/Client/DonorToken.cs b/Website/LOC.Core/Tokens/Client/DonorToken.cs index e2c168907..4e636c181 100644 --- a/Website/LOC.Core/Tokens/Client/DonorToken.cs +++ b/Website/LOC.Core/Tokens/Client/DonorToken.cs @@ -9,6 +9,7 @@ public bool Donated { get; set; } public List SalesPackages { get; set; } public List UnknownSalesPackages { get; set; } + public List Transactions { get; set; } public List CustomBuilds { get; set; } public List Pets { get; set; } public int PetNameTagCount { get; set; } diff --git a/Website/LOC.Website.Common/Models/AccountAdministrator.cs b/Website/LOC.Website.Common/Models/AccountAdministrator.cs index 9d6952f01..2dd62d254 100644 --- a/Website/LOC.Website.Common/Models/AccountAdministrator.cs +++ b/Website/LOC.Website.Common/Models/AccountAdministrator.cs @@ -207,7 +207,8 @@ { Source = token.Source, Account = account, - Amount = token.Amount + Amount = token.Amount, + Date = (long)TimeUtil.GetCurrentMilliseconds() }; repository.Add(gemTransaction); @@ -238,7 +239,8 @@ { Source = token.Source, Account = account, - Amount = token.Amount + Amount = token.Amount, + Date = (long)TimeUtil.GetCurrentMilliseconds() }; repository.Add(coinTransaction); @@ -502,6 +504,7 @@ { Account = account, SalesPackageName = token.SalesPackageName, + Date = (long)TimeUtil.GetCurrentMilliseconds(), Gems = token.CoinPurchase ? 0 : token.Cost, Coins = token.CoinPurchase ? token.Cost : 0 }; diff --git a/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml b/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml index c039de9b0..cc154fa82 100644 --- a/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml +++ b/Website/LOC.Website.Web/LOC.Website.Web.Publish.xml @@ -1,6 +1,7 @@  + @@ -16,16 +17,19 @@ - + - + + + + @@ -39,26 +43,26 @@ - + - + + - - - + + @@ -69,25 +73,24 @@ - + + - - + + + - - - - + @@ -95,6 +98,8 @@ + + @@ -102,19 +107,19 @@ - + - + + - - + @@ -126,17 +131,18 @@ - + + - + + - - + @@ -147,23 +153,18 @@ - + - - - - + - - @@ -172,28 +173,28 @@ - - - + + - + - - + + - + + @@ -202,24 +203,23 @@ - - + + - + - + - + - @@ -227,49 +227,50 @@ - + - + + - - + + - + - + - - + + - - + + - - + + + - @@ -282,17 +283,13 @@ - - + - - - @@ -306,7 +303,6 @@ - @@ -314,8 +310,8 @@ + - @@ -325,6 +321,7 @@ + @@ -335,28 +332,30 @@ - - + - + + + - + + @@ -364,42 +363,43 @@ - - - + + + + - + + - - - + + - - + + @@ -410,27 +410,32 @@ - + - + + + + + + - - + + @@ -440,99 +445,95 @@ - + - - + - - - + - - + - - + + - - + + - + + - - + - + - - + - + - + - - + + - + - - + + - - + + - + + + - @@ -543,18 +544,16 @@ - + - + - - @@ -568,6 +567,7 @@ + @@ -575,18 +575,18 @@ + - - + - + @@ -597,72 +597,74 @@ - - - + - - + + + - + - - + + - + - - + + + + + - + - - + + - - + + @@ -673,129 +675,128 @@ - + - + + + + + + - - - - + + + - - + - + - - + - - - + - - + + - - + + - - - - + + + - + - + - - + - + - + - - + + - + - - + + - - + + - + + + - @@ -806,18 +807,16 @@ - + - + - - @@ -831,6 +830,7 @@ + @@ -838,8 +838,8 @@ + - @@ -848,8 +848,8 @@ - + @@ -860,30 +860,29 @@ - - - + - - + + + - + @@ -891,41 +890,44 @@ - + - - + + + + + - + - - + + - - + + @@ -936,120 +938,118 @@ - + - + + + + + + - - + - - + - + - - + - - - + - - + + - - + + - - - - + + + - + - - + - + - + - - + + - + - - + + - - + + - + \ No newline at end of file diff --git a/Website/LOCWebsite.suo b/Website/LOCWebsite.suo index ed2074901..f6e2c37e3 100644 Binary files a/Website/LOCWebsite.suo and b/Website/LOCWebsite.suo differ