diff --git a/.gitignore b/.gitignore
index 626bd858f..970fac184 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,6 +17,7 @@ update
Reference
/Plugins/.idea/workspace.xml
+/Plugins/.idea/tasks.xml
/Plugins/out
BungeeCord
/Plugins/Mineplex.Bungee.Mineplexer/*.gitignore
@@ -39,3 +40,14 @@ zBench
zMyst
zSotanna
zSotanna2
+/.recommenders/index/http___download_eclipse_org_recommenders_models_mars_/_0.fdt
+/.recommenders/index/http___download_eclipse_org_recommenders_models_mars_/_0.fdx
+/.recommenders/index/http___download_eclipse_org_recommenders_models_mars_/_0.fnm
+/.recommenders/index/http___download_eclipse_org_recommenders_models_mars_/_0.frq
+/.recommenders/index/http___download_eclipse_org_recommenders_models_mars_/_0.nrm
+/.recommenders/index/http___download_eclipse_org_recommenders_models_mars_/_0.prx
+/.recommenders/index/http___download_eclipse_org_recommenders_models_mars_/_0.tii
+/.recommenders/index/http___download_eclipse_org_recommenders_models_mars_/_0.tis
+/.recommenders/index/http___download_eclipse_org_recommenders_models_mars_/segments.gen
+/.recommenders/index/http___download_eclipse_org_recommenders_models_mars_/segments_1
+/.recommenders/index/http___download_eclipse_org_recommenders_models_mars_/write.lock
diff --git a/Plugins/.idea/artifacts/Mineplex_Hub_jar.xml b/Plugins/.idea/artifacts/Mineplex_Hub_jar.xml
index 150c21bc3..370ba8bd7 100644
--- a/Plugins/.idea/artifacts/Mineplex_Hub_jar.xml
+++ b/Plugins/.idea/artifacts/Mineplex_Hub_jar.xml
@@ -20,6 +20,7 @@
+
\ No newline at end of file
diff --git a/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml b/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml
index ca2ed67aa..619cdf3df 100644
--- a/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml
+++ b/Plugins/.idea/artifacts/Nautilus_Game_Arcade_jar.xml
@@ -19,6 +19,7 @@
+
\ No newline at end of file
diff --git a/Plugins/.idea/compiler.xml b/Plugins/.idea/compiler.xml
index bd35e0f52..37717d4dc 100644
--- a/Plugins/.idea/compiler.xml
+++ b/Plugins/.idea/compiler.xml
@@ -4,6 +4,7 @@
+
diff --git a/Plugins/.idea/modules.xml b/Plugins/.idea/modules.xml
index bcc0470f4..f7936ba2e 100644
--- a/Plugins/.idea/modules.xml
+++ b/Plugins/.idea/modules.xml
@@ -11,7 +11,6 @@
-
diff --git a/Plugins/BuildFiles/common.xml b/Plugins/BuildFiles/common.xml
index 5141a3cb9..3359861d8 100644
--- a/Plugins/BuildFiles/common.xml
+++ b/Plugins/BuildFiles/common.xml
@@ -86,6 +86,9 @@
+
+
+
@@ -152,6 +155,9 @@
+
+
+
@@ -198,6 +204,9 @@
+
+
+
@@ -234,6 +243,9 @@
+
+
+
diff --git a/Plugins/Libraries/Votifier.jar b/Plugins/Libraries/Votifier.jar
new file mode 100644
index 000000000..9751f180a
Binary files /dev/null and b/Plugins/Libraries/Votifier.jar differ
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 55427e477..443dc104b 100644
--- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/lobbyBalancer/LobbyBalancer.java
+++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/lobbyBalancer/LobbyBalancer.java
@@ -96,6 +96,8 @@ public class LobbyBalancer implements Listener, Runnable
if (timeSpentInLock > 50)
System.out.println("[==] TIMING [==] Locked loading servers for " + timeSpentInLock + "ms");
+
+ _lobbyIndex = 0;
}
}
}
diff --git a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java
index 8577a718e..75cf934cf 100644
--- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java
+++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/motd/MotdManager.java
@@ -54,12 +54,13 @@ public class MotdManager implements Listener, Runnable
Region.ALL, GlobalMotd.class, "globalMotd");
//String motdLine = "§f§l◄ §c§lMaintenance§f§l ►";
- String motdLine = "§f§l◄ §a§lCarl the Creeper§f§l ►";
+ //String motdLine = "§f§l◄ §a§lCarl the Creeper§f§l ►";
+ String motdLine = " §b§l◄§f§lNEW GAME§b§l► §f§l◄§b§lEVOLUTION§f§l► §b§l◄§f§lNEW GAME§b§l►";
//String motdLine = " §f§l◄ §a§lCarl the Creeper§f§l ▬ §c§l75% OFF SALE§f§l ►";
//String motdLine = " §d§lRank Sale §a§l40% Off");
//String motdLine = " §f§l◄§c§lMAINTENANCE§f§l►");
- updateMainMotd(" §b§l§m §8§l§m[ §r §9§lMineplex§r §f§lGames§r §8§l§m ]§b§l§m §r", motdLine);
+ updateMainMotd(" §b§l§m §8§l§m[ §r §9§lMineplex§r §f§lGames§r §8§l§m ]§b§l§m §r", motdLine);
System.out.println("Updated Bungee MOTD");
}
}
@@ -97,23 +98,7 @@ public class MotdManager implements Listener, Runnable
public void updateMainMotd(String headline, String motdLine)
{
List motdLines = new ArrayList();
- String colorStripped = ChatColor.stripColor(motdLine);
-
- if (colorStripped.trim().length() > 45)
- motdLine = motdLine.trim().substring(0, 45);
- else
- {
- String trimmed = colorStripped.trim();
- int count = trimmed.length();
- int marker = 0;
-
- while ((45 - count) / 2 * 1.55 > marker)
- {
- motdLine = " " + motdLine;
- marker++;
- }
- }
-
+
motdLines.add(motdLine);
_repository.addElement(new GlobalMotd("MainMotd", headline, motdLines));
diff --git a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerCount/PlayerCount.java b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerCount/PlayerCount.java
index 2543d2609..2b97f9b62 100644
--- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerCount/PlayerCount.java
+++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerCount/PlayerCount.java
@@ -24,7 +24,6 @@ public class PlayerCount implements Listener, Runnable
{
private DataRepository _repository;
private DataRepository _secondRepository;
- private UUID _uuid;
private Region _region;
private ListenerInfo _listenerInfo;
@@ -34,7 +33,6 @@ public class PlayerCount implements Listener, Runnable
public PlayerCount(Plugin plugin)
{
- _uuid = UUID.randomUUID();
_region = !new File("eu.dat").exists() ? Region.US : Region.EU;
_plugin = plugin;
@@ -86,7 +84,7 @@ public class PlayerCount implements Listener, Runnable
*/
private BungeeServer generateSnapshot()
{
- String name = _uuid.toString(); // Use random UUID for unique id name.
+ String name = _listenerInfo.getHost().getAddress().getHostAddress();
String host = _listenerInfo.getHost().getAddress().getHostAddress();
int port = _listenerInfo.getHost().getPort();
boolean connected = InternetStatus.isConnected();
diff --git a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerStats/PlayerStats.java b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerStats/PlayerStats.java
index c15651813..fcae65a57 100644
--- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerStats/PlayerStats.java
+++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerStats/PlayerStats.java
@@ -1,6 +1,5 @@
package mineplex.bungee.playerStats;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
@@ -17,9 +16,8 @@ import net.md_5.bungee.event.EventHandler;
public class PlayerStats implements Listener, Runnable
{
private Plugin _plugin;
- private PlayerStatsRepository _repository;
+ private PlayerStatsRepository _repository;
- private PlayerCache _playerCache = new PlayerCache();
private HashSet _retrievingPlayerInfo = new HashSet();
public PlayerStats(Plugin plugin)
@@ -52,7 +50,7 @@ public class PlayerStats implements Listener, Runnable
boolean addOrUpdatePlayer = false;
- playerInfo = _playerCache.getPlayer(uuid);
+ playerInfo = PlayerCache.getInstance().getPlayer(uuid);
if (playerInfo == null)
{
@@ -80,12 +78,11 @@ public class PlayerStats implements Listener, Runnable
}
else
playerInfo = updatedPlayerInfo;
-
- _playerCache.addPlayer(playerInfo);
}
playerInfo.setSessionId(_repository.updatePlayerStats(playerInfo.getId(), ipInfo.id));
- _playerCache.addPlayer(playerInfo);
+ playerInfo.updateLoginTime();
+ PlayerCache.getInstance().addPlayer(playerInfo);
}
finally
{
@@ -106,13 +103,13 @@ public class PlayerStats implements Listener, Runnable
PlayerInfo playerInfo = null;
- playerInfo = _playerCache.getPlayer(uuid);
+ playerInfo = PlayerCache.getInstance().getPlayer(uuid);
int timeout = 5;
while (playerInfo == null && _retrievingPlayerInfo.contains(uuid) && timeout <= 5)
{
- playerInfo = _playerCache.getPlayer(uuid);
+ playerInfo = PlayerCache.getInstance().getPlayer(uuid);
if (playerInfo != null)
break;
@@ -140,6 +137,6 @@ public class PlayerStats implements Listener, Runnable
@Override
public void run()
{
- _playerCache.clean();
+ PlayerCache.getInstance().clean();
}
}
diff --git a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerTracker/PlayerJoinHandler.java b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerTracker/PlayerJoinHandler.java
new file mode 100644
index 000000000..8e56dab88
--- /dev/null
+++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerTracker/PlayerJoinHandler.java
@@ -0,0 +1,27 @@
+package mineplex.bungee.playerTracker;
+
+import mineplex.serverdata.commands.CommandCallback;
+import mineplex.serverdata.commands.PlayerJoinCommand;
+import mineplex.serverdata.commands.ServerCommand;
+
+public class PlayerJoinHandler implements CommandCallback
+{
+ private PlayerTracker _playerTracker;
+
+ public PlayerJoinHandler(PlayerTracker playerTracker)
+ {
+ _playerTracker = playerTracker;
+ }
+
+ @SuppressWarnings("deprecation")
+ @Override
+ public void run(ServerCommand command)
+ {
+ if (command instanceof PlayerJoinCommand)
+ {
+ PlayerJoinCommand joinCommand = (PlayerJoinCommand)command;
+
+ _playerTracker.kickPlayerIfOnline(joinCommand.getUuid());
+ }
+ }
+}
diff --git a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerTracker/PlayerTracker.java b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerTracker/PlayerTracker.java
index 1b8117d04..707dc3eb8 100644
--- a/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerTracker/PlayerTracker.java
+++ b/Plugins/Mineplex.Bungee.Mineplexer/src/mineplex/bungee/playerTracker/PlayerTracker.java
@@ -1,19 +1,25 @@
package mineplex.bungee.playerTracker;
import java.io.File;
+import java.util.HashSet;
+import java.util.UUID;
+import java.util.concurrent.TimeUnit;
import mineplex.serverdata.Region;
+import mineplex.serverdata.commands.ServerCommandManager;
import mineplex.serverdata.data.DataRepository;
import mineplex.serverdata.data.PlayerStatus;
import mineplex.serverdata.redis.RedisDataRepository;
import mineplex.serverdata.servers.ServerManager;
+import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.PlayerDisconnectEvent;
+import net.md_5.bungee.api.event.PostLoginEvent;
import net.md_5.bungee.api.event.ServerConnectedEvent;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.event.EventHandler;
-public class PlayerTracker implements Listener
+public class PlayerTracker implements Listener, Runnable
{
// Default period before status expiry (8 hours)
private static final int DEFAULT_STATUS_TIMEOUT = 60 * 60 * 8;
@@ -21,6 +27,8 @@ public class PlayerTracker implements Listener
// Repository storing player status' across network.
private DataRepository _repository;
+ private HashSet _onlineUUIDs = new HashSet();
+
private Plugin _plugin;
public PlayerTracker(Plugin plugin)
@@ -28,11 +36,14 @@ public class PlayerTracker implements Listener
_plugin = plugin;
_plugin.getProxy().getPluginManager().registerListener(_plugin, this);
+ _plugin.getProxy().getScheduler().schedule(_plugin, this, 1L, 1L, TimeUnit.MINUTES);
Region region = !new File("eu.dat").exists() ? Region.US : Region.EU;
_repository = new RedisDataRepository(ServerManager.getMasterConnection(), ServerManager.getSlaveConnection(),
region, PlayerStatus.class, "playerStatus");
+ ServerCommandManager.getInstance().registerCommandType("PlayerJoinCommand", mineplex.serverdata.commands.PlayerJoinCommand.class, new PlayerJoinHandler(this));
+
System.out.println("Initialized PlayerTracker.");
}
@@ -59,5 +70,42 @@ public class PlayerTracker implements Listener
_repository.removeElement(event.getPlayer().getName().toLowerCase());
}
});
+
+ _onlineUUIDs.remove(event.getPlayer().getUniqueId());
+ }
+
+ @EventHandler
+ public void playerConnect(final PostLoginEvent event)
+ {
+ _onlineUUIDs.add(event.getPlayer().getUniqueId().toString());
+ }
+
+ @Override
+ public void run()
+ {
+ HashSet onlineUUIDs = new HashSet();
+
+ for (ProxiedPlayer player : _plugin.getProxy().getPlayers())
+ {
+ onlineUUIDs.add(player.getUniqueId().toString());
+ }
+
+ _onlineUUIDs = onlineUUIDs;
+ }
+
+ public boolean isPlayerOnline(String uuid)
+ {
+ return _onlineUUIDs.contains(uuid);
+ }
+
+ public void kickPlayerIfOnline(String uuid)
+ {
+ if (_onlineUUIDs.contains(uuid))
+ {
+ ProxiedPlayer player = _plugin.getProxy().getPlayer(UUID.fromString(uuid));
+
+ if (player != null)
+ player.disconnect("You have logged in from another location.");
+ }
}
}
diff --git a/Plugins/Mineplex.BungeeRotator/src/mineplex/bungee/BungeeRotator.java b/Plugins/Mineplex.BungeeRotator/src/mineplex/bungee/BungeeRotator.java
index 22be0d855..2dd88a8e3 100644
--- a/Plugins/Mineplex.BungeeRotator/src/mineplex/bungee/BungeeRotator.java
+++ b/Plugins/Mineplex.BungeeRotator/src/mineplex/bungee/BungeeRotator.java
@@ -141,7 +141,7 @@ public class BungeeRotator
else
euPlayers += server.getPlayerCount();
- System.out.println(server.getRegion().toString() + " " + server.getPublicAddress() + " " + server.getPlayerCount() + "/" + server.getPlayerCount());
+ System.out.println(server.getRegion().toString() + " " + server.getName() + " " + server.getPublicAddress() + " " + server.getPlayerCount() + "/" + server.getPlayerCount());
}
System.out.println("US Players : " + usPlayers);
@@ -247,6 +247,9 @@ public class BungeeRotator
new ApiDeleteCall("https://api.dnsmadeeasy.com/V2.0/dns/managed/", 962728, "/records?" + idBuilder.toString()).Execute();
log("Deleted " + recordsToDelete.size() + " records.");
}
+
+ _repository.clean();
+ _secondRepository.clean();
}
/*
diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java
index 8eba27eb1..8cab61a15 100644
--- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java
+++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java
@@ -8,6 +8,7 @@ import mineplex.core.common.util.UtilPlayer;
public enum Rank
{
+ //Staff
LT("LT", ChatColor.DARK_RED),
OWNER("Owner", ChatColor.DARK_RED),
DEVELOPER("Dev", ChatColor.RED),
@@ -21,11 +22,13 @@ public enum Rank
MEDIA("Media", ChatColor.BLUE),
EVENT("Event", ChatColor.WHITE),
-
- //Staff ^^
-
+
+ //Media
YOUTUBE("YouTube", ChatColor.RED),
+ YOUTUBE_SMALL("MooTube", ChatColor.DARK_PURPLE),
TWITCH("Twitch", ChatColor.DARK_PURPLE),
+
+ //Player
LEGEND("Legend", ChatColor.GREEN, true),
HERO("Hero", ChatColor.LIGHT_PURPLE, true),
ULTRA("Ultra", ChatColor.AQUA, true),
diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/lang/IntlString.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/lang/IntlString.java
new file mode 100644
index 000000000..fada15f15
--- /dev/null
+++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/lang/IntlString.java
@@ -0,0 +1,232 @@
+package mineplex.core.common.lang;
+
+import java.text.Format;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Locale;
+
+import org.bukkit.ChatColor;
+import org.bukkit.entity.Entity;
+import org.bukkit.entity.Player;
+
+public class IntlString
+{
+
+ public static IntlString[] toIntl(String... strings)
+ {
+ IntlString[] intl = new IntlString[strings.length];
+
+ for (int i = 0; i < strings.length; i++) {
+ final String string = strings[i];
+ intl[i] = new IntlString("")
+ {
+ public String tr(Locale locale)
+ {
+ return string;
+ }
+ };
+ }
+
+ return intl;
+ }
+
+ /**
+ * An empty {@link IntlString}.
+ */
+ public static final IntlString EMPTY = toIntl("")[0];
+
+ private final Argument key;
+ private final List> arguments = new ArrayList<>();
+
+ public IntlString(String key, ChatColor... styles)
+ {
+ this.key = new Argument<>(key, styles);
+ }
+
+ IntlString(String key, String style)
+ {
+ this.key = new Argument<>(key, style);
+ }
+
+ private IntlString arg(Argument