Some more changes concerning ThoughtAsEffects.

This commit is contained in:
LevelX2 2014-08-09 11:48:40 +02:00
parent d1a8678086
commit 2ca945fabf
45 changed files with 3306 additions and 206 deletions

View file

@ -276,10 +276,10 @@ public class GameSession extends GameWatcher {
public void kill() {
if (game != null) {
logger.debug("GameSession.kill before player quit for game");
logger.debug("before game.quit playerId:" + playerId);
game.quit(playerId);
} else {
logger.error("GameSession.kill game object missing playerId: " + (playerId == null ? "[null]":playerId));
logger.error("game object missing playerId: " + (playerId == null ? "[null]":playerId));
}
}

View file

@ -77,7 +77,7 @@ public class GamesRoomImpl extends RoomImpl implements GamesRoom, Serializable {
try {
update();
} catch (Exception ex) {
logger.fatal("Games room update exception!", ex);
logger.fatal("Games room update exception! " + ex.toString(), ex);
}
}

View file

@ -56,16 +56,16 @@ public class ServerMessagesUtil {
private static final String SERVER_MSG_TXT_FILE = "server.msg.txt";
private static ScheduledExecutorService updateExecutor;
private List<String> messages = new ArrayList<String>();
private ReadWriteLock lock = new ReentrantReadWriteLock();
private final List<String> messages = new ArrayList<>();
private final ReadWriteLock lock = new ReentrantReadWriteLock();
private static String pathToExternalMessages = null;
private static boolean ignore = false;
private static long startDate;
private static AtomicInteger gamesStarted = new AtomicInteger(0);
private static AtomicInteger tournamentsStarted = new AtomicInteger(0);
private static final AtomicInteger gamesStarted = new AtomicInteger(0);
private static final AtomicInteger tournamentsStarted = new AtomicInteger(0);
static {
pathToExternalMessages = System.getProperty("messagesPath");
@ -97,7 +97,7 @@ public class ServerMessagesUtil {
private void reloadMessages() {
log.debug("Reading server messages...");
List<String> motdMessages = readFromFile();
List<String> newMessages = new ArrayList<String>();
List<String> newMessages = new ArrayList<>();
if (motdMessages != null) {
newMessages.addAll(motdMessages);
}
@ -154,14 +154,14 @@ public class ServerMessagesUtil {
return null;
}
Scanner scanner = new Scanner(is);
List<String> messages = new ArrayList<String>();
List<String> newMessages = new ArrayList<>();
while (scanner.hasNextLine()) {
String message = scanner.nextLine();
if (!message.trim().isEmpty()) {
messages.add(message.trim());
newMessages.add(message.trim());
}
}
return messages;
return newMessages;
}
private String getServerStatistics() {