OMG THIS THING IS SO COMPLICATED MY BRAIN FIZZZLED...fixed some queuer issues.
Fixed bug with forcefield in hub. Fixed symbol for connecting to dbs in connection strings.
This commit is contained in:
parent
0d350da6c0
commit
c38e60456b
@ -114,7 +114,7 @@ public abstract class ShopPageBase<PluginType extends MiniPlugin, ShopType exten
|
||||
}
|
||||
else if (event.getRawSlot() != -999)
|
||||
{
|
||||
if (event.getInventory() == inventory && (inventory.getSize() <= event.getSlot() || inventory.getItem(event.getSlot()) != null))
|
||||
if (event.getInventory().getTitle() == inventory.getInventoryName() && (inventory.getSize() <= event.getSlot() || inventory.getItem(event.getSlot()) != null))
|
||||
{
|
||||
PlayDenySound(Player);
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ public class ServerStatusManager extends MiniPlugin
|
||||
{
|
||||
try
|
||||
{
|
||||
GetPlugin().getConfig().addDefault("serverstatus.connectionurl", "jdbc:mysql://db.mineplex.com:3306/ServerStatus&autoReconnect=true&failOverReadOnly=false&maxReconnects=10");
|
||||
GetPlugin().getConfig().addDefault("serverstatus.connectionurl", "jdbc:mysql://db.mineplex.com:3306/ServerStatus?autoReconnect=true&failOverReadOnly=false&maxReconnects=10");
|
||||
GetPlugin().getConfig().set("serverstatus.connectionurl", GetPlugin().getConfig().getString("serverstatus.connectionurl"));
|
||||
|
||||
GetPlugin().getConfig().addDefault("serverstatus.username", "root");
|
||||
|
@ -455,6 +455,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
_scoreboards.remove(event.getPlayer());
|
||||
|
||||
_portalTime.remove(event.getPlayer().getName());
|
||||
_forcefield.remove(event.getPlayer());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -1,13 +1,13 @@
|
||||
package mineplex.hub.queue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
@ -19,12 +19,12 @@ import mineplex.core.elo.EloManager;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import mineplex.hub.party.PartyManager;
|
||||
import mineplex.hub.queue.ui.QueueShop;
|
||||
|
||||
public class QueueManager extends MiniPlugin
|
||||
{
|
||||
private static Object _queueLock = new Object();
|
||||
private static Object _assignedLock = new Object();
|
||||
private static Object _queuePlayerListLock = new Object();
|
||||
|
||||
private EloManager _eloManager;
|
||||
private PartyManager _partyManager;
|
||||
@ -32,6 +32,8 @@ public class QueueManager extends MiniPlugin
|
||||
private NautHashMap<String, PlayerMatchStatus> _queuedPlayerMatchList = new NautHashMap<String, PlayerMatchStatus>();
|
||||
private NautHashMap<String, PlayerMatchStatus> _assignedPlayerMatchList = new NautHashMap<String, PlayerMatchStatus>();
|
||||
|
||||
private HashSet<String> _queueingPlayers = new HashSet<String>();
|
||||
|
||||
public QueueManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, EloManager eloManager, PartyManager partyManager)
|
||||
{
|
||||
super("Queue Manager", plugin);
|
||||
@ -47,7 +49,7 @@ public class QueueManager extends MiniPlugin
|
||||
{
|
||||
try
|
||||
{
|
||||
GetPlugin().getConfig().addDefault("queue.connectionurl", "jdbc:mysql://db.mineplex.com:3306/Queue&autoReconnect=true&failOverReadOnly=false&maxReconnects=10");
|
||||
GetPlugin().getConfig().addDefault("queue.connectionurl", "jdbc:mysql://db.mineplex.com:3306/Queue?autoReconnect=true&failOverReadOnly=false&maxReconnects=10");
|
||||
GetPlugin().getConfig().set("queue.connectionurl", GetPlugin().getConfig().getString("queue.connectionurl"));
|
||||
|
||||
GetPlugin().getConfig().addDefault("queue.us", true);
|
||||
@ -105,6 +107,30 @@ public class QueueManager extends MiniPlugin
|
||||
|
||||
public void queuePlayer(final String gameType, final Player...players)
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
|
||||
for (Player player : players)
|
||||
{
|
||||
stringBuilder.append(player.getName() + ", ");
|
||||
}
|
||||
|
||||
final String playerList = stringBuilder.toString().substring(0, stringBuilder.length() - 2);
|
||||
|
||||
// Prevent spamming it up.
|
||||
synchronized (_queuePlayerListLock)
|
||||
{
|
||||
for (Player player : players)
|
||||
{
|
||||
if (_queueingPlayers.contains(player.getName()))
|
||||
return;
|
||||
}
|
||||
|
||||
for (Player player : players)
|
||||
{
|
||||
_queueingPlayers.add(player.getName());
|
||||
}
|
||||
}
|
||||
|
||||
int eloCumulative = 0;
|
||||
|
||||
for (Player player : players)
|
||||
@ -118,21 +144,20 @@ public class QueueManager extends MiniPlugin
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
|
||||
for (Player player : players)
|
||||
{
|
||||
stringBuilder.append(player.getName() + ", ");
|
||||
}
|
||||
|
||||
String playerList = stringBuilder.toString().substring(0, stringBuilder.length() - 2);
|
||||
|
||||
PlayerMatchStatus matchStatus = _repository.addQueueRecord(playerList, players.length, gameType, elo);
|
||||
|
||||
synchronized (_queueLock)
|
||||
{
|
||||
_queuedPlayerMatchList.put(players[0].getName(), matchStatus);
|
||||
}
|
||||
|
||||
synchronized (_queuePlayerListLock)
|
||||
{
|
||||
for (Player player : players)
|
||||
{
|
||||
_queueingPlayers.remove(player.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -160,13 +185,13 @@ public class QueueManager extends MiniPlugin
|
||||
if (event.getType() != UpdateType.SEC)
|
||||
return;
|
||||
|
||||
final NautHashMap<String, PlayerMatchStatus> listCopy = new NautHashMap<String, PlayerMatchStatus>();
|
||||
final NautHashMap<String, PlayerMatchStatus> queuedPlayerMatchCopy = new NautHashMap<String, PlayerMatchStatus>();
|
||||
|
||||
synchronized (_queueLock)
|
||||
{
|
||||
for (Entry<String, PlayerMatchStatus> entry : _queuedPlayerMatchList.entrySet())
|
||||
{
|
||||
listCopy.put(entry.getKey(), entry.getValue());
|
||||
queuedPlayerMatchCopy.put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
@ -174,18 +199,18 @@ public class QueueManager extends MiniPlugin
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
for (Entry<String, PlayerMatchStatus> entry : listCopy.entrySet())
|
||||
for (Entry<String, PlayerMatchStatus> entry : queuedPlayerMatchCopy.entrySet())
|
||||
{
|
||||
entry.setValue(_repository.checkForAssignedMatch(entry.getValue().Id));
|
||||
}
|
||||
|
||||
for (String key : listCopy.keySet())
|
||||
for (String key : queuedPlayerMatchCopy.keySet())
|
||||
{
|
||||
if (listCopy.get(key).AssignedMatch != -1)
|
||||
if (queuedPlayerMatchCopy.get(key).AssignedMatch != -1)
|
||||
{
|
||||
synchronized (_assignedLock)
|
||||
{
|
||||
_assignedPlayerMatchList.put(key, listCopy.get(key));
|
||||
_assignedPlayerMatchList.put(key, queuedPlayerMatchCopy.get(key));
|
||||
}
|
||||
|
||||
synchronized (_queueLock)
|
||||
@ -193,18 +218,6 @@ public class QueueManager extends MiniPlugin
|
||||
_queuedPlayerMatchList.remove(key);
|
||||
}
|
||||
}
|
||||
if (_queuedPlayerMatchList.containsKey(key))
|
||||
{
|
||||
synchronized (_assignedLock)
|
||||
{
|
||||
_assignedPlayerMatchList.remove(key);
|
||||
}
|
||||
|
||||
synchronized (_queueLock)
|
||||
{
|
||||
_queuedPlayerMatchList.put(key, listCopy.get(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -226,7 +239,11 @@ public class QueueManager extends MiniPlugin
|
||||
{
|
||||
for (Entry<String, PlayerMatchStatus> entry : _assignedPlayerMatchList.entrySet())
|
||||
{
|
||||
assignedCopy.put(entry.getKey(), entry.getValue());
|
||||
boolean prompted = entry.getValue().Prompted;
|
||||
PlayerMatchStatus newStatus = _repository.checkForAssignedMatch(entry.getValue().Id);
|
||||
newStatus.Prompted = prompted;
|
||||
|
||||
assignedCopy.put(entry.getKey(), newStatus);
|
||||
}
|
||||
}
|
||||
|
||||
@ -236,7 +253,22 @@ public class QueueManager extends MiniPlugin
|
||||
}
|
||||
|
||||
for (String key : assignedCopy.keySet())
|
||||
{
|
||||
// {
|
||||
if (assignedCopy.get(key).AssignedMatch == -1)
|
||||
{
|
||||
synchronized (_assignedLock)
|
||||
{
|
||||
_assignedPlayerMatchList.remove(key);
|
||||
}
|
||||
|
||||
synchronized (_queueLock)
|
||||
{
|
||||
_queuedPlayerMatchList.put(key, assignedCopy.get(key));
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
synchronized (_assignedLock)
|
||||
{
|
||||
if (_assignedPlayerMatchList.containsKey(key))
|
||||
@ -287,6 +319,9 @@ public class QueueManager extends MiniPlugin
|
||||
matchStatus.State = accepted ? "Ready" : "Denied";
|
||||
|
||||
_repository.updateState(matchStatus);
|
||||
|
||||
if (!accepted)
|
||||
_repository.deleteQueueRecord(matchStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -17,10 +17,10 @@ public class QueueRepository
|
||||
|
||||
private boolean _us = true;
|
||||
|
||||
private static String CREATE_ELO_QUEUE_TABLE = "CREATE TABLE IF NOT EXISTS playerQueue (id INT NOT NULL AUTO_INCREMENT, playerList VARCHAR(256), gameType VARCHAR(256), playerCount INT, elo INT, state VARCHAR(256), time LONG, assignedMatch INT, US BOOLEAN NOT NULL DEFAULT '1', PRIMARY KEY (id));";
|
||||
private static String CREATE_ELO_QUEUE_TABLE = "CREATE TABLE IF NOT EXISTS playerQueue (id INT NOT NULL AUTO_INCREMENT, playerList VARCHAR(256), gameType VARCHAR(256), playerCount INT, elo INT, state VARCHAR(256), time LONG, assignedMatch INT, US BOOLEAN NOT NULL DEFAULT '1', PRIMARY KEY (id), UNIQUE INDEX name_gametype (playerList, gameType));";
|
||||
private static String SAVE_STATE_VALUE = "UPDATE playerQueue SET state = ? WHERE id = ?;";
|
||||
private static String DELETE_QUEUE_RECORD = "DELETE FROM playerQueue WHERE id = ?;";
|
||||
private static String INSERT_ACCOUNT = "INSERT INTO playerQueue (playerList, gameType, elo, state, time, playerCount, assignedMatch) VALUES (?, ?, ?, 'Awaiting Match', now(), ?, -1);";
|
||||
private static String INSERT_ACCOUNT = "INSERT INTO playerQueue (playerList, gameType, elo, state, time, playerCount, assignedMatch) VALUES (?, ?, ?, 'Awaiting Match', now(), ?, -1) ON DUPLICATE KEY UPDATE time=VALUES(time);";
|
||||
private static String RETRIEVE_MATCH_STATUS = "SELECT state, assignedMatch FROM playerQueue WHERE id = ?;";
|
||||
private static String RETRIEVE_OTHER_MATCH_STATUS = "SELECT state, playerCount FROM playerQueue WHERE assignedMatch = ? AND id != ? ORDER BY id DESC;";
|
||||
|
||||
|
@ -77,7 +77,7 @@ public class ServerManagerUpdater implements Listener
|
||||
if (event.getType() != UpdateType.FAST)
|
||||
return;
|
||||
|
||||
FilenameFilter statsFilter = new FilenameFilter()
|
||||
FilenameFilter statsFilter = new FilenameFilter()
|
||||
{
|
||||
public boolean accept(File paramFile, String paramString)
|
||||
{
|
||||
|
@ -1,33 +0,0 @@
|
||||
package mineplex.queuer;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class DynamicServerData
|
||||
{
|
||||
public String Name;
|
||||
public String Address;
|
||||
public int AvailableCPU = 32;
|
||||
public int AvailableRAM = 14000;
|
||||
|
||||
public HashMap<String, Integer> ServerGroupCount = new HashMap<String, Integer>();
|
||||
public boolean US;
|
||||
public String PrivateAddress;
|
||||
|
||||
public void setServerGroupCount(ServerGroupData groupData, int count)
|
||||
{
|
||||
if (ServerGroupCount.containsKey(groupData.Name))
|
||||
{
|
||||
AvailableCPU += groupData.RequiredCPU * ServerGroupCount.get(groupData.Name);
|
||||
AvailableRAM += groupData.RequiredRAM * ServerGroupCount.get(groupData.Name);
|
||||
}
|
||||
|
||||
ServerGroupCount.put(groupData.Name, count);
|
||||
AvailableCPU -= groupData.RequiredCPU * count;
|
||||
AvailableRAM -= groupData.RequiredRAM * count;
|
||||
}
|
||||
|
||||
public void printInfo()
|
||||
{
|
||||
System.out.println("DynamicServerData - Name:" + Name + " Address:" + Address + " RAM:" + AvailableRAM + " CPU:" + AvailableCPU);
|
||||
}
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
package mineplex.queuer;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
public class DynamicServerSorter implements Comparator<DynamicServerData>
|
||||
{
|
||||
@Override
|
||||
public int compare(DynamicServerData first, DynamicServerData second)
|
||||
{
|
||||
if (second.AvailableRAM <= 1024)
|
||||
return -1;
|
||||
|
||||
if (first.AvailableRAM <= 1024)
|
||||
return 1;
|
||||
|
||||
if (first.AvailableRAM > second.AvailableRAM)
|
||||
return -1;
|
||||
|
||||
if (second.AvailableRAM > first.AvailableRAM)
|
||||
return 1;
|
||||
|
||||
if (first.AvailableCPU > second.AvailableCPU)
|
||||
return -1;
|
||||
|
||||
if (second.AvailableCPU < first.AvailableCPU)
|
||||
return 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
@ -2,6 +2,8 @@ package mineplex.queuer;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
import repository.PlayerMatchStatus;
|
||||
|
||||
public class EloPlayerSorter implements Comparator<PlayerMatchStatus>
|
||||
{
|
||||
public int EloMark = -1;
|
||||
|
@ -1,6 +0,0 @@
|
||||
package mineplex.queuer;
|
||||
|
||||
public interface GenericRunnable<T>
|
||||
{
|
||||
void run(T t);
|
||||
}
|
@ -1,113 +0,0 @@
|
||||
package mineplex.queuer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class GroupStatusData
|
||||
{
|
||||
private int _serverNum = 0;
|
||||
private int _totalCount = 0;
|
||||
private int _joinableCount = 0;
|
||||
|
||||
public int Players;
|
||||
public int MaxPlayers;
|
||||
public int MaxServerNumber;
|
||||
|
||||
public List<ServerStatusData> EmptyServers = new ArrayList<ServerStatusData>();
|
||||
public List<ServerStatusData> KillServers = new ArrayList<ServerStatusData>();
|
||||
public HashMap<Integer, ServerStatusData> Servers = new HashMap<Integer, ServerStatusData>();
|
||||
|
||||
public void addServer(ServerStatusData serverStatusData)
|
||||
{
|
||||
if (Servers.containsKey(Integer.parseInt(serverStatusData.Name.split("-")[1])))
|
||||
{
|
||||
ServerStatusData existingServer = Servers.get(Integer.parseInt(serverStatusData.Name.split("-")[1]));
|
||||
int existingCount = existingServer.Players;
|
||||
int newCount = serverStatusData.Players;
|
||||
|
||||
if (newCount == 0 || newCount < existingCount)
|
||||
{
|
||||
KillServers.add(serverStatusData);
|
||||
return;
|
||||
}
|
||||
else if (existingCount == 0 || newCount > existingCount)
|
||||
{
|
||||
KillServers.add(existingServer);
|
||||
Players -= existingServer.Players;
|
||||
MaxPlayers -= existingServer.MaxPlayers;
|
||||
|
||||
if (existingServer.Motd != null && (existingServer.Motd.contains("Starting") || existingServer.Motd.contains("Recruiting") || existingServer.Motd.contains("Waiting") || existingServer.Motd.contains("Cup") || existingServer.Motd.isEmpty() || existingServer.Motd.equals("")))
|
||||
{
|
||||
if (existingServer.Players < existingServer.MaxPlayers)
|
||||
{
|
||||
// Lobby joinable checking
|
||||
if (existingServer.Motd.isEmpty() || existingServer.Motd.equals(""))
|
||||
{
|
||||
if (existingServer.Players / existingServer.MaxPlayers < 10)
|
||||
_joinableCount--;
|
||||
}
|
||||
else
|
||||
{
|
||||
_joinableCount--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Players += serverStatusData.Players;
|
||||
MaxPlayers += serverStatusData.MaxPlayers;
|
||||
|
||||
if (serverStatusData.Motd != null && (serverStatusData.Motd.contains("Starting") || serverStatusData.Motd.contains("Recruiting") || serverStatusData.Motd.contains("Waiting") || serverStatusData.Motd.contains("Cup") || serverStatusData.Motd.isEmpty() || serverStatusData.Motd.equals("")))
|
||||
{
|
||||
if (serverStatusData.Players < serverStatusData.MaxPlayers)
|
||||
{
|
||||
// Lobby joinable checking
|
||||
if (serverStatusData.Motd.isEmpty() || serverStatusData.Motd.equals(""))
|
||||
{
|
||||
if (serverStatusData.Players / serverStatusData.MaxPlayers < 10)
|
||||
_joinableCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
_joinableCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_totalCount++;
|
||||
|
||||
if (serverStatusData.Empty)
|
||||
{
|
||||
EmptyServers.add(serverStatusData);
|
||||
}
|
||||
|
||||
Servers.put(Integer.parseInt(serverStatusData.Name.split("-")[1]), serverStatusData);
|
||||
}
|
||||
|
||||
public int getTotalServers()
|
||||
{
|
||||
return _totalCount;
|
||||
}
|
||||
|
||||
public int getJoinableCount()
|
||||
{
|
||||
return _joinableCount;
|
||||
}
|
||||
|
||||
public int getNextServerNumber()
|
||||
{
|
||||
_serverNum++;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (!Servers.containsKey(_serverNum))
|
||||
{
|
||||
return _serverNum;
|
||||
}
|
||||
|
||||
_serverNum++;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,357 +0,0 @@
|
||||
package mineplex.queuer;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.conn.scheme.PlainSocketFactory;
|
||||
import org.apache.http.conn.scheme.Scheme;
|
||||
import org.apache.http.conn.scheme.SchemeRegistry;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.impl.conn.PoolingClientConnectionManager;
|
||||
import org.apache.http.message.BasicHeader;
|
||||
import org.apache.http.protocol.HTTP;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import mineplex.core.common.util.Callback;
|
||||
|
||||
public class JsonWebCall
|
||||
{
|
||||
private String _url;
|
||||
private PoolingClientConnectionManager _connectionManager;
|
||||
|
||||
public JsonWebCall(String url)
|
||||
{
|
||||
_url = url;
|
||||
|
||||
SchemeRegistry schemeRegistry = new SchemeRegistry();
|
||||
schemeRegistry.register(new Scheme("http", 80, PlainSocketFactory.getSocketFactory()));
|
||||
|
||||
_connectionManager = new PoolingClientConnectionManager(schemeRegistry);
|
||||
_connectionManager.setMaxTotal(200);
|
||||
_connectionManager.setDefaultMaxPerRoute(20);
|
||||
}
|
||||
|
||||
public String ExecuteReturnStream(Object argument)
|
||||
{
|
||||
HttpClient httpClient = new DefaultHttpClient(_connectionManager);
|
||||
InputStream in = null;
|
||||
String result = null;
|
||||
|
||||
try
|
||||
{
|
||||
HttpResponse response;
|
||||
|
||||
Gson gson = new Gson();
|
||||
HttpPost request = new HttpPost(_url);
|
||||
|
||||
if (argument != null)
|
||||
{
|
||||
StringEntity params = new StringEntity(gson.toJson(argument));
|
||||
params.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
|
||||
request.setEntity(params);
|
||||
}
|
||||
|
||||
response = httpClient.execute(request);
|
||||
|
||||
if (response != null)
|
||||
{
|
||||
in = response.getEntity().getContent();
|
||||
result = convertStreamToString(in);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.out.println("Error executing JsonWebCall: \n" + ex.getMessage());
|
||||
System.out.println("Result: \n" + result);
|
||||
|
||||
for (StackTraceElement trace : ex.getStackTrace())
|
||||
{
|
||||
System.out.println(trace);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
httpClient.getConnectionManager().shutdown();
|
||||
|
||||
if (in != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
in.close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
Execute((Object)null);
|
||||
}
|
||||
|
||||
public void Execute(Object argument)
|
||||
{
|
||||
HttpClient httpClient = new DefaultHttpClient(_connectionManager);
|
||||
InputStream in = null;
|
||||
|
||||
try
|
||||
{
|
||||
Gson gson = new Gson();
|
||||
HttpPost request = new HttpPost(_url);
|
||||
|
||||
if (argument != null)
|
||||
{
|
||||
StringEntity params = new StringEntity(gson.toJson(argument));
|
||||
params.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
|
||||
request.setEntity(params);
|
||||
}
|
||||
|
||||
httpClient.execute(request);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.out.println("JsonWebCall.Execute() Error:\n" + ex.getMessage());
|
||||
|
||||
for (StackTraceElement trace : ex.getStackTrace())
|
||||
{
|
||||
System.out.println(trace);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
httpClient.getConnectionManager().shutdown();
|
||||
|
||||
if (in != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
in.close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public <T> T Execute(Class<T> returnClass)
|
||||
{
|
||||
return Execute(returnClass, (Object)null);
|
||||
}
|
||||
|
||||
public <T> T Execute(Type returnType, Object argument)
|
||||
{
|
||||
HttpClient httpClient = new DefaultHttpClient(_connectionManager);
|
||||
InputStream in = null;
|
||||
T returnData = null;
|
||||
String result = null;
|
||||
|
||||
try
|
||||
{
|
||||
HttpResponse response;
|
||||
|
||||
Gson gson = new Gson();
|
||||
HttpPost request = new HttpPost(_url);
|
||||
|
||||
if (argument != null)
|
||||
{
|
||||
StringEntity params = new StringEntity(gson.toJson(argument));
|
||||
params.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
|
||||
request.setEntity(params);
|
||||
}
|
||||
|
||||
response = httpClient.execute(request);
|
||||
|
||||
if (response != null)
|
||||
{
|
||||
in = response.getEntity().getContent();
|
||||
|
||||
result = convertStreamToString(in);
|
||||
returnData = new Gson().fromJson(result, returnType);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.out.println("Error executing JsonWebCall: \n" + ex.getMessage());
|
||||
System.out.println("Result: \n" + result);
|
||||
|
||||
for (StackTraceElement trace : ex.getStackTrace())
|
||||
{
|
||||
System.out.println(trace);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
httpClient.getConnectionManager().shutdown();
|
||||
|
||||
if (in != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
in.close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return returnData;
|
||||
}
|
||||
|
||||
public <T> T Execute(Class<T> returnClass, Object argument)
|
||||
{
|
||||
HttpClient httpClient = new DefaultHttpClient(_connectionManager);
|
||||
InputStream in = null;
|
||||
T returnData = null;
|
||||
String result = null;
|
||||
|
||||
try
|
||||
{
|
||||
HttpResponse response;
|
||||
|
||||
Gson gson = new Gson();
|
||||
HttpPost request = new HttpPost(_url);
|
||||
|
||||
if (argument != null)
|
||||
{
|
||||
StringEntity params = new StringEntity(gson.toJson(argument));
|
||||
params.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
|
||||
request.setEntity(params);
|
||||
}
|
||||
|
||||
response = httpClient.execute(request);
|
||||
|
||||
if (response != null)
|
||||
{
|
||||
in = response.getEntity().getContent();
|
||||
|
||||
result = convertStreamToString(in);
|
||||
returnData = new Gson().fromJson(result, returnClass);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.out.println("Error executing JsonWebCall: \n" + ex.getMessage());
|
||||
System.out.println("Result: \n" + result);
|
||||
|
||||
for (StackTraceElement trace : ex.getStackTrace())
|
||||
{
|
||||
System.out.println(trace);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
httpClient.getConnectionManager().shutdown();
|
||||
|
||||
if (in != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
in.close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return returnData;
|
||||
}
|
||||
|
||||
public <T> void Execute(Class<T> callbackClass, Callback<T> callback)
|
||||
{
|
||||
Execute(callbackClass, callback, (Object)null);
|
||||
}
|
||||
|
||||
public <T> void Execute(Class<T> callbackClass, Callback<T> callback, Object argument)
|
||||
{
|
||||
HttpClient httpClient = new DefaultHttpClient(_connectionManager);
|
||||
InputStream in = null;
|
||||
String result = null;
|
||||
|
||||
try
|
||||
{
|
||||
HttpResponse response;
|
||||
|
||||
Gson gson = new Gson();
|
||||
HttpPost request = new HttpPost(_url);
|
||||
|
||||
if (argument != null)
|
||||
{
|
||||
StringEntity params = new StringEntity(gson.toJson(argument));
|
||||
params.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
|
||||
request.setEntity(params);
|
||||
}
|
||||
|
||||
response = httpClient.execute(request);
|
||||
|
||||
if (response != null && callback != null)
|
||||
{
|
||||
in = response.getEntity().getContent();
|
||||
|
||||
result = convertStreamToString(in);
|
||||
callback.run(new Gson().fromJson(result, callbackClass));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.out.println("Error executing JsonWebCall: \n" + ex.getMessage());
|
||||
System.out.println("Result: \n" + result);
|
||||
}
|
||||
finally
|
||||
{
|
||||
httpClient.getConnectionManager().shutdown();
|
||||
|
||||
if (in != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
in.close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected String convertStreamToString(InputStream is)
|
||||
{
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
String line = null;
|
||||
try {
|
||||
while ((line = reader.readLine()) != null) {
|
||||
sb.append(line + "\n");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
is.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
@ -3,11 +3,14 @@ package mineplex.queuer;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
|
||||
import repository.PlayerMatchStatus;
|
||||
|
||||
public class PlayerMatch
|
||||
{
|
||||
private HashMap<Integer, PlayerMatchStatus> _players = new HashMap<Integer, PlayerMatchStatus>();
|
||||
private int _playerCount = 0;
|
||||
|
||||
public boolean WaitingForInvites = false;
|
||||
public int MatchId = -1;
|
||||
public int Elo = 0;
|
||||
|
||||
|
@ -1,81 +0,0 @@
|
||||
package mineplex.queuer;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
public class ProcessRunner extends Thread
|
||||
{
|
||||
private ProcessBuilder _processBuilder;
|
||||
private Process _process;
|
||||
private GenericRunnable<Boolean> _runnable;
|
||||
|
||||
boolean _done = false;
|
||||
Boolean _error = false;
|
||||
|
||||
ProcessRunner(String[] args)
|
||||
{
|
||||
super("ProcessRunner " + args);
|
||||
_processBuilder = new ProcessBuilder(args);
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
try
|
||||
{
|
||||
_process = _processBuilder.start();
|
||||
_process.waitFor();
|
||||
|
||||
BufferedReader reader=new BufferedReader(new InputStreamReader(_process.getInputStream()));
|
||||
String line = reader.readLine();
|
||||
|
||||
while(line != null)
|
||||
{
|
||||
if (line.equals("255"))
|
||||
_error = true;
|
||||
|
||||
line=reader.readLine();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
finally
|
||||
{
|
||||
_done = true;
|
||||
|
||||
if (_runnable != null)
|
||||
_runnable.run(_error);
|
||||
}
|
||||
}
|
||||
|
||||
public void start(GenericRunnable<Boolean> runnable)
|
||||
{
|
||||
super.start();
|
||||
|
||||
_runnable = runnable;
|
||||
}
|
||||
|
||||
public int exitValue() throws IllegalStateException
|
||||
{
|
||||
if (_process != null)
|
||||
{
|
||||
return _process.exitValue();
|
||||
}
|
||||
|
||||
throw new IllegalStateException("Process not started yet");
|
||||
}
|
||||
|
||||
public boolean isDone()
|
||||
{
|
||||
return _done;
|
||||
}
|
||||
|
||||
public void abort()
|
||||
{
|
||||
if (!isDone())
|
||||
{
|
||||
_process.destroy();
|
||||
}
|
||||
}
|
||||
}
|
@ -7,6 +7,9 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import repository.PlayerMatchStatus;
|
||||
import repository.Repository;
|
||||
|
||||
public class Queuer
|
||||
{
|
||||
private static Repository _repository = new Repository();
|
||||
@ -31,10 +34,12 @@ public class Queuer
|
||||
matchId %= 1500;
|
||||
|
||||
List<Integer> assignedMatchIdChecked = new ArrayList<Integer>();
|
||||
List<PlayerMatchStatus> queueRecords = _repository.retrieveQueuedRecords();
|
||||
HashMap<Integer, PlayerMatchStatus> queueRecords = _repository.retrieveQueuedRecords();
|
||||
|
||||
int matchPlayerCount = 2;
|
||||
|
||||
System.out.println("Checking " + queueRecords.size() + " queues...");
|
||||
for (PlayerMatchStatus queueRecord : queueRecords)
|
||||
for (PlayerMatchStatus queueRecord : queueRecords.values())
|
||||
{
|
||||
Integer keyId = queueRecord.Id;
|
||||
|
||||
@ -85,14 +90,33 @@ public class Queuer
|
||||
else if (!assignedMatchIdChecked.contains(queueRecord.AssignedMatch))
|
||||
{
|
||||
System.out.println("Checking if match '" + queueRecord.AssignedMatch + "' is ready.");
|
||||
List<String> matchStatuses = _repository.getMatchStatuses(queueRecord.AssignedMatch);
|
||||
boolean matchReady = true;
|
||||
boolean matchDeny = false;
|
||||
|
||||
if (_repository.isMatchReady(queueRecord.AssignedMatch))
|
||||
for (String matchStatus : matchStatuses)
|
||||
{
|
||||
if (matchStatus.equalsIgnoreCase("Deny"))
|
||||
{
|
||||
matchDeny = true;
|
||||
matchReady = false;
|
||||
break;
|
||||
}
|
||||
else if (!matchStatus.equalsIgnoreCase("Ready"))
|
||||
matchReady = false;
|
||||
}
|
||||
|
||||
if (matchReady)
|
||||
{
|
||||
_repository.startMatch(queueRecord.AssignedMatch);
|
||||
_repository.deleteQueuesByAssignedMatch(queueRecord.AssignedMatch);
|
||||
|
||||
System.out.println("Starting match '" + queueRecord.AssignedMatch + "'");
|
||||
}
|
||||
else if (matchDeny)
|
||||
{
|
||||
_repository.removeAssignedMatch(queueRecord.AssignedMatch);
|
||||
}
|
||||
|
||||
assignedMatchIdChecked.add(queueRecord.AssignedMatch);
|
||||
}
|
||||
@ -105,7 +129,33 @@ public class Queuer
|
||||
{
|
||||
PlayerMatch match = matchIterator.next();
|
||||
|
||||
if (match.getPlayerCount() >= 4)
|
||||
// Don't give me crap about not using iterator...can't cuz of stupid thing.
|
||||
List<PlayerMatchStatus> matchStatusesToRemove = new ArrayList<PlayerMatchStatus>();
|
||||
|
||||
for (PlayerMatchStatus matchStatus : match.getPlayerRecords())
|
||||
{
|
||||
if (!queueRecords.containsKey(matchStatus.Id))
|
||||
{
|
||||
System.out.println("Removing matchStatus : " + matchStatus.Id);
|
||||
matchStatusesToRemove.add(matchStatus);
|
||||
|
||||
if (match.WaitingForInvites)
|
||||
{
|
||||
_repository.removeAssignedMatch(match.MatchId);
|
||||
match.WaitingForInvites = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (PlayerMatchStatus matchStatus : matchStatusesToRemove)
|
||||
{
|
||||
match.removePlayerRecord(matchStatus);
|
||||
}
|
||||
|
||||
if (match.WaitingForInvites)
|
||||
continue;
|
||||
|
||||
if (match.getPlayerCount() >= matchPlayerCount)
|
||||
{
|
||||
playerSorter.EloMark = match.Elo;
|
||||
|
||||
@ -120,7 +170,7 @@ public class Queuer
|
||||
{
|
||||
PlayerMatchStatus player = playerList.get(i);
|
||||
|
||||
if (playerCount + player.PlayerCount > 4)
|
||||
if (playerCount + player.PlayerCount > matchPlayerCount)
|
||||
{
|
||||
match.removePlayerRecord(player);
|
||||
playerPrepMatchMap.remove(player.Id);
|
||||
@ -132,7 +182,7 @@ public class Queuer
|
||||
playerCount += player.PlayerCount;
|
||||
}
|
||||
|
||||
if (playerCount == 4)
|
||||
if (playerCount == matchPlayerCount)
|
||||
{
|
||||
System.out.println("Sent match invites for '" + match.MatchId + "'");
|
||||
|
||||
@ -142,7 +192,7 @@ public class Queuer
|
||||
_repository.assignMatch(player.Id, match.MatchId);
|
||||
}
|
||||
|
||||
matchIterator.remove();
|
||||
match.WaitingForInvites = true;
|
||||
matchesMade += 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,17 +0,0 @@
|
||||
package mineplex.queuer;
|
||||
|
||||
public class ServerGroupData
|
||||
{
|
||||
public String Name;
|
||||
public String Prefix;
|
||||
public String ScriptName;
|
||||
public int RequiredRAM;
|
||||
public int RequiredCPU;
|
||||
public int RequiredTotalServers;
|
||||
public int RequiredJoinableServers;
|
||||
|
||||
public void printInfo()
|
||||
{
|
||||
System.out.println("ServerGroupData - Name:" + Name + " Prefix:" + Prefix + " ScriptName:" + ScriptName + " RAM:" + RequiredRAM + " CPU:" + RequiredCPU + " ReqTotal:" + RequiredTotalServers + " ReqJoin:" + RequiredJoinableServers);
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
package mineplex.queuer;
|
||||
|
||||
public class ServerStatusData
|
||||
{
|
||||
public String Name;
|
||||
public String Motd;
|
||||
public int Players;
|
||||
public int MaxPlayers;
|
||||
public String Address;
|
||||
public String PrivateAddress;
|
||||
public int Port;
|
||||
public boolean Empty = false;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
package mineplex.queuer;
|
||||
|
||||
public class ServerTargetData
|
||||
{
|
||||
public DynamicServerData DedicatedServer;
|
||||
public int ServerNumber;
|
||||
public String ServerGroup;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package mineplex.queuer;
|
||||
package repository;
|
||||
|
||||
public class PlayerMatchStatus
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
package mineplex.queuer;
|
||||
package repository;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
@ -8,14 +8,16 @@ import java.sql.SQLException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
public class Repository
|
||||
{
|
||||
private static Object _connectionLock = new Object();
|
||||
|
||||
private String _connectionString = "jdbc:mysql://db.mineplex.com:3306/Queue&autoReconnect=true&failOverReadOnly=false&maxReconnects=10";
|
||||
private String _serverStatusConnectionString = "jdbc:mysql://db.mineplex.com:3306/ServerStatus&autoReconnect=true&failOverReadOnly=false&maxReconnects=10";
|
||||
private String _connectionString = "jdbc:mysql://db.mineplex.com:3306/Queue?autoReconnect=true&failOverReadOnly=false&maxReconnects=10";
|
||||
private String _serverStatusConnectionString = "jdbc:mysql://db.mineplex.com:3306/ServerStatus?autoReconnect=true&failOverReadOnly=false&maxReconnects=10";
|
||||
private String _userName = "root";
|
||||
private String _password = "tAbechAk3wR7tuTh";
|
||||
|
||||
@ -28,6 +30,7 @@ public class Repository
|
||||
private static String CREATE_ELO_QUEUE_TABLE = "CREATE TABLE IF NOT EXISTS playerQueue (id INT NOT NULL AUTO_INCREMENT, playerList VARCHAR(256), gameType VARCHAR(256), elo INT, state VARCHAR(256), time LONG, assignedMatch INT, us BOOLEAN NOT NULL DEFAULT 'true', PRIMARY KEY (id));";
|
||||
private static String SAVE_STATE_VALUE = "UPDATE playerQueue SET state = ? WHERE id = ?;";
|
||||
private static String DELETE_QUEUE_RECORD = "DELETE FROM playerQueue WHERE assignedMatch = ?;";
|
||||
private static String RESET_MATCH_RECORDS = "UPDATE playerQueue SET assignedMatch = -1, state = 'Awaiting Match' WHERE assignedMatch = ?;";
|
||||
private static String RETRIEVE_QUEUE_RECORDS = "SELECT id, gameType, elo, playerCount, assignedMatch, time, us FROM playerQueue WHERE us = ?;";
|
||||
private static String RETRIEVE_MATCH_STATUS = "SELECT state, playerList FROM playerQueue WHERE assignedMatch = ?;";
|
||||
private static String UPDATE_MATCH_STATUS = "UPDATE playerQueue SET assignedMatch = ?, state = ? WHERE id = ?;";
|
||||
@ -208,11 +211,11 @@ public class Repository
|
||||
return matchStatus;
|
||||
}
|
||||
|
||||
public List<PlayerMatchStatus> retrieveQueuedRecords()
|
||||
public HashMap<Integer, PlayerMatchStatus> retrieveQueuedRecords()
|
||||
{
|
||||
ResultSet resultSet = null;
|
||||
PreparedStatement preparedStatement = null;
|
||||
List<PlayerMatchStatus> queueRecords = new ArrayList<PlayerMatchStatus>();
|
||||
HashMap<Integer, PlayerMatchStatus> queueRecords = new HashMap<Integer, PlayerMatchStatus>();
|
||||
|
||||
try
|
||||
{
|
||||
@ -239,7 +242,7 @@ public class Repository
|
||||
matchStatus.AssignedMatch = resultSet.getInt(5);
|
||||
matchStatus.QueuedStartTime = resultSet.getLong(6);
|
||||
|
||||
queueRecords.add(matchStatus);
|
||||
queueRecords.put(matchStatus.Id, matchStatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -277,11 +280,11 @@ public class Repository
|
||||
return queueRecords;
|
||||
}
|
||||
|
||||
public boolean isMatchReady(int assignedMatch)
|
||||
public List<String> getMatchStatuses(int assignedMatch)
|
||||
{
|
||||
ResultSet resultSet = null;
|
||||
PreparedStatement preparedStatement = null;
|
||||
boolean matchReady = true;
|
||||
List<String> matchStatuses = new ArrayList<String>();
|
||||
|
||||
try
|
||||
{
|
||||
@ -299,11 +302,7 @@ public class Repository
|
||||
|
||||
while (resultSet.next())
|
||||
{
|
||||
if (!resultSet.getString(1).equalsIgnoreCase("Ready"))
|
||||
{
|
||||
matchReady = false;
|
||||
break;
|
||||
}
|
||||
matchStatuses.add(resultSet.getString(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -338,7 +337,7 @@ public class Repository
|
||||
}
|
||||
}
|
||||
|
||||
return matchReady;
|
||||
return matchStatuses;
|
||||
}
|
||||
|
||||
public void deleteQueuesByAssignedMatch(int matchId)
|
||||
@ -504,7 +503,7 @@ public class Repository
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void assignMatch(int id, int matchId)
|
||||
{
|
||||
ResultSet resultSet = null;
|
||||
@ -521,7 +520,7 @@ public class Repository
|
||||
|
||||
preparedStatement = _connection.prepareStatement(UPDATE_MATCH_STATUS);
|
||||
preparedStatement.setInt(1, matchId);
|
||||
preparedStatement.setString(2, "Awaiting Reply");
|
||||
preparedStatement.setString(2, "Awaiting Confirmation");
|
||||
preparedStatement.setInt(3, id);
|
||||
|
||||
preparedStatement.executeUpdate();
|
||||
@ -558,4 +557,45 @@ public class Repository
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void removeAssignedMatch(int assignedMatch)
|
||||
{
|
||||
System.out.println("Resetting Records for " + assignedMatch);
|
||||
|
||||
PreparedStatement preparedStatement = null;
|
||||
|
||||
try
|
||||
{
|
||||
synchronized (_connectionLock)
|
||||
{
|
||||
if (_connection.isClosed())
|
||||
{
|
||||
_connection = DriverManager.getConnection(_connectionString, _userName, _password);
|
||||
}
|
||||
|
||||
preparedStatement = _connection.prepareStatement(RESET_MATCH_RECORDS);
|
||||
preparedStatement.setInt(1, assignedMatch);
|
||||
|
||||
preparedStatement.executeUpdate();
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
exception.printStackTrace();
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (preparedStatement != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
preparedStatement.close();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -13,7 +13,7 @@ import java.util.List;
|
||||
|
||||
public class Repository
|
||||
{
|
||||
private String _connectionString = "jdbc:mysql://db.mineplex.com:3306/ServerStatus&autoReconnect=true&failOverReadOnly=false&maxReconnects=10";
|
||||
private String _connectionString = "jdbc:mysql://db.mineplex.com:3306/ServerStatus?autoReconnect=true&failOverReadOnly=false&maxReconnects=10";
|
||||
private String _userName = "root";
|
||||
private String _password = "tAbechAk3wR7tuTh";
|
||||
private boolean _us = true;
|
||||
|
Loading…
Reference in New Issue
Block a user