Merge branches 'develop' and 'feature/report-v2' of github.com:Mineplex-LLC/Minecraft-PC into feature/report-v2

This commit is contained in:
Keir Nellyer 2016-09-26 10:19:13 +01:00
commit f63561b05e
6 changed files with 35 additions and 14 deletions

View File

@ -113,8 +113,19 @@ public class AccountRepository extends MinecraftRepository
for (ILoginProcessor loginProcessor : loginProcessors)
{
loginProcessor.processLoginResultSet(name, uuid, finalId, statement.getResultSet());
statement.getMoreResults();
try
{
loginProcessor.processLoginResultSet(name, uuid, finalId, statement.getResultSet());
}
catch (Throwable t)
{
System.out.println("Error: ILoginProcessor raised an exception");
t.printStackTrace(System.out);
}
finally
{
statement.getMoreResults();
}
}
}

View File

@ -300,6 +300,10 @@ public class PlayerDisguiseManager extends MiniPlugin implements IPacketHandler
{
Player player = Bukkit.getPlayerExact(data.a().getName());
// Would be null during login, we don't care
// LoginListener -> PlayerList#a(NetworkManager, EntityPlayer)
// -> PlayerList#a(EntityPlayer, EntityPlayer, WorldServer) (Sends this packet)
// -> PlayerList#onPlayerJoin(EntityPlayer, String) (Populates Bukkit.getPlayerExact)
if (player != null)
{
if (isDisguised(player))
@ -313,10 +317,6 @@ public class PlayerDisguiseManager extends MiniPlugin implements IPacketHandler
((CraftPlayer) player).getHandle().playerConnection.networkManager.handle(custom);
}
}
else
{
System.out.println("Null player while sending PlayerInfoData: " + data.a().getName());
}
}
}
}

View File

@ -92,9 +92,9 @@ public class MavericksApprovedRepository
long approvedDate = set.getLong(2);
UUID approvedBy = UUID.fromString(set.getString(3));
boolean display = set.getBoolean(4);
Timestamp stamp = set.getTimestamp(1);
Timestamp stamp = set.getTimestamp(5);
Long firstDisplayed = null;
if(!set.wasNull() && stamp != null) stamp.getTime();
if(!set.wasNull() && stamp != null) firstDisplayed = stamp.getTime();
String theme = set.getString(6);

View File

@ -39,7 +39,7 @@ public class PlayWireManager extends MiniDbClientPlugin<PlayWireClientData>
@Override
public String getQuery(int accountId, String uuid, String name)
{
return "SELECT `redeemed` FROM `play_wire` WHERE `accountId`=" + accountId + ";";
return "SELECT `redeemed`, `streak` FROM `play_wire` WHERE `accountId`=" + accountId + ";";
}
public boolean canRedeem(Player player)

View File

@ -14,7 +14,7 @@ public class ServerInfo
public String Game;
public Rank HostRank = Rank.ALL;
public MinecraftServer Server;
public int getAvailableSlots()
{
return MaxPlayers - CurrentPlayers;
@ -22,6 +22,19 @@ public class ServerInfo
public boolean isDevServer()
{
return Name.contains("-Dev-");
try
{
int index = Name.lastIndexOf('-');
if (index != -1)
{
int id = Integer.parseInt(Name.substring(index + 1));
return id >= 777;
}
}
catch (NumberFormatException ex)
{
return false;
}
return false;
}
}

View File

@ -437,11 +437,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation
_gameLobbyManager.AddPlayerToScoreboards(onlinePlayer, gameTeam);
}
System.out.println("Handling player join " + playerName + " " + player.getName() + " " + GetGame());
if (GetGame() != null)
{
System.out.println(GetGame().IsAlive(player));
if (GetGame().IsAlive(player))
{
GetGame().GetScoreboard().setPlayerTeam(player, GetGame().GetTeam(player));