Some changes to client and server logging messages.

This commit is contained in:
LevelX2 2014-08-04 17:21:14 +02:00
parent fce95b2fde
commit 3aab091492
18 changed files with 110 additions and 83 deletions

View file

@ -4,11 +4,11 @@ log4j.rootLogger=info, console, logfile
#console log
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%-5p [%d{yyyy-MM-dd HH:mm [ss:SSS]}] %C{1}[%t]: %m%n
log4j.appender.console.layout.ConversionPattern=%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} %-90m =>[%t] %C{1}.%M %n
log4j.appender.console.Threshold=info
#file log
log4j.appender.logfile=org.apache.log4j.FileAppender
log4j.appender.logfile.File=mageserver.log
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=%-5p [%d{yyyy-MM-dd HH:mm [ss:SSS]}] %C{1}[%t]: %m%n
log4j.appender.logfile.layout.ConversionPattern=%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} %-90m =>[%t] %C{1}.%M %n

View file

@ -4,11 +4,11 @@ log4j.rootLogger=info, console, logfile
#console log
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%-5p [%d{yyyy-MM-dd HH:mm [ss:SSS]}] %C{1}[%t]: %m%n
log4j.appender.console.layout.ConversionPattern=%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} %-90m =>[%t] %C{1}.%M %n
log4j.appender.console.Threshold=info
#file log
log4j.appender.logfile=org.apache.log4j.FileAppender
log4j.appender.logfile.File=mageserver.log
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=%-5p [%d{yyyy-MM-dd HH:mm [ss:SSS]}] %C{1}[%t]: %m%n
log4j.appender.logfile.layout.ConversionPattern=%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} %-90m =>[%t] %C{1}.%M %n

View file

@ -1,3 +1,4 @@
#This configuration file is used for the client started from the IDE
#default levels
log4j.rootLogger=info, console, logfile
# Suppress SQL info messages
@ -9,15 +10,16 @@ log4j.logger.com.j256.ormlite=warn
#log4j.logger.mage.client.remote.CallbackClientImpl=debug
#log4j.logger.mage.client.remote.CallbackClientImpl=debug
#log4j.logger.mage.client.game.FeedbackPanel=debug
#log4j.logger.mage.client.game.FeedbackPanel=warn
#console log
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%-5p [%d{yyyy-MM-dd HH:mm [ss:SSS]}] %C{1}[%t]: %m%n
log4j.appender.console.layout.ConversionPattern=%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} %-90m =>[%t] %C{1}.%M %n
log4j.appender.console.Threshold=info
#file log
log4j.appender.logfile=org.apache.log4j.FileAppender
log4j.appender.logfile.File=mageclient.log
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=%-5p [%d{yyyy-MM-dd HH:mm [ss:SSS]}] %C{1}[%t]: %m%n
log4j.appender.logfile.layout.ConversionPattern=%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} %-90m =>[%t] %C{1}.%M %n

View file

@ -95,7 +95,7 @@ public class ComputerPlayer7 extends ComputerPlayer6 {
public boolean priority(Game game) {
if (lastLoggedTurn != game.getTurnNum()) {
lastLoggedTurn = game.getTurnNum();
logger.info(new StringBuilder("============================== ").append("Turn: ").append(game.getTurnNum()).append(" [").append(game.getPlayer(game.getActivePlayerId()).getName()).append("] ====================================================").toString());
logger.info(new StringBuilder("======================= ").append("Turn: ").append(game.getTurnNum()).append(" [").append(game.getPlayer(game.getActivePlayerId()).getName()).append("] =========================================").toString());
}
logState(game);
logger.debug("Priority -- Step: " + (game.getTurn().getStepType() + " ").substring(0,25) + " ActivePlayer-" + game.getPlayer(game.getActivePlayerId()).getName() + " PriorityPlayer-" + name);

View file

@ -1,15 +1,16 @@
#default levels
log4j.rootLogger=debug, console, logfile
log4j.logger.com.j256.ormlite=warn
log4j.logger.mage.player.ai=warn
#log4j.logger.mage.player.ai.ComputerPlayer6=debug
#console log
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%-5p [%d{yyyy-MM-dd HH:mm [ss:SSS]}] %C{1}[%t]: %m%n
log4j.appender.console.layout.ConversionPattern=%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} %-90m =>[%t] %C{1}.%M%n
log4j.appender.console.Threshold=info
#file log
log4j.appender.logfile=org.apache.log4j.FileAppender
log4j.appender.logfile.File=mageserver.log
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=%-5p [%d{yyyy-MM-dd HH:mm [ss:SSS]}] %C{1}[%t]: %m%n
log4j.appender.logfile.layout.ConversionPattern=%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} %-90m =>[%t] %C{1}.%M%n

View file

@ -1,14 +1,15 @@
#default levels
log4j.rootLogger=info, console, logfile
log4j.logger.com.j256.ormlite=warn
log4j.logger.mage.player.ai=warn
#console log
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%-5p [%d{yyyy-MM-dd HH:mm [ss:SSS]}] %C{1}[%t]: %m%n
log4j.appender.console.layout.ConversionPattern=%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} %-90m =>[%t] %C{1}.%M%n
log4j.appender.console.Threshold=info
#file log
log4j.appender.logfile=org.apache.log4j.FileAppender
log4j.appender.logfile.File=mageserver.log
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=%-5p [%d{yyyy-MM-dd HH:mm [ss:SSS]}] %C{1}[%t]: %m%n
log4j.appender.logfile.layout.ConversionPattern=%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} %-90m =>[%t] %C{1}.%M%n

View file

@ -65,7 +65,7 @@ public class ChatManager {
if (chatSessions.containsKey(chatId)) {
chatSessions.get(chatId).join(userId);
} else {
logger.debug("ChatManager:joinChat - chatId does not exist - chatId: " + chatId +" userId: " + userId);
logger.warn("User could not join chatId: " + chatId +" userId: " + userId);
}
}
@ -80,7 +80,7 @@ public class ChatManager {
if (chatId != null && chatSessions.containsKey(chatId)) {
chatSessions.remove(chatId);
} else {
logger.debug("ChatManager:destroy chat - chatId does not exist - chatId: " + chatId);
logger.warn("Chat to destroy does not exist - chatId: " + chatId);
}
}
@ -171,11 +171,9 @@ public class ChatManager {
}
public void removeUser(UUID userId, DisconnectReason reason) {
Logger.getLogger(ChatManager.class).debug("ChatManager: Remove user start - chatSessions: " + chatSessions.size());
for (ChatSession chat: chatSessions.values()) {
chat.kill(userId, reason);
}
Logger.getLogger(ChatManager.class).debug("ChatManager: Remove user end");
}
public ArrayList<ChatSession> getChatSessions() {

View file

@ -71,8 +71,7 @@ public class ChatSession {
if (userId != null && clients.containsKey(userId)) {
String userName = clients.get(userId);
clients.remove(userId);
logger.debug("ChatSession.kill chatSession: " + chatId + " userId: " + userId + " reason: " + (reason == null?"null":reason.toString())
+ " clients.size " + clients.size());
logger.debug(userName + (reason == null?"null":"(" + reason.toString() +")") + " removed from chatId " + chatId) ;
String message = null;
switch (reason) {
case Disconnected:
@ -82,15 +81,14 @@ public class ChatSession {
message = " has lost connection";
break;
default:
logger.debug(userName + " left chat " + chatId + " with reason: " + (reason == null ?"null":reason.toString()));
message = reason == null ? " left (unknown reason) ": " left (" + reason.toString() +")";
}
if (message != null) {
broadcast(null, new StringBuilder(userName).append(message).toString(), MessageColor.BLUE, true, MessageType.STATUS);
logger.debug(userName + " left chat with reason: " + message + " " + chatId);
}
}
} catch(Exception ex) {
logger.fatal("ChatSession.kill exception: " + ex.toString());
logger.fatal("exception: " + ex.toString());
}
}
@ -139,7 +137,7 @@ public class ChatSession {
user.fireCallback(new ClientCallback("chatMessage", chatId, new ChatMessage(username, msg, time, color, messageType, soundToPlay)));
}
else {
logger.debug("ChatSession.broadcast user not found - killed from chat session - userId: " + userId +" chatId: " +chatId);
logger.debug("user not found - killed from chat session - userId: " + userId +" chatId: " +chatId);
kill(userId, DisconnectReason.CleaningUp);
}
}

View file

@ -93,7 +93,6 @@ public class MageServerImpl implements MageServer {
LogServiceImpl.instance.log(LogKeys.KEY_WRONG_VERSION, userName, version.toString(), Main.getVersion().toString(), sessionId);
throw new MageVersionException(version, Main.getVersion());
}
logger.debug(new StringBuilder("RegisterClient - userName: ").append(userName).append(" sessionId = ").append(sessionId));
return SessionManager.getInstance().registerUser(sessionId, userName);
} catch (MageException ex) {
if (ex instanceof MageVersionException) {
@ -137,7 +136,12 @@ public class MageServerImpl implements MageServer {
public TableView execute() throws MageException {
UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId();
TableView table = GamesRoomManager.getInstance().getRoom(roomId).createTable(userId, options);
logger.debug("Table " + table.getTableId() + " created");
if (logger.isDebugEnabled()) {
User user = UserManager.getInstance().getUser(userId);
if (user != null) {
logger.debug(user.getName() + " created tableId: " + table.getTableId());
}
}
LogServiceImpl.instance.log(LogKeys.KEY_TABLE_CREATED, sessionId, userId.toString(), table.getTableId().toString());
return table;
}
@ -198,8 +202,12 @@ public class MageServerImpl implements MageServer {
@Override
public Boolean execute() throws MageException {
UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId();
logger.debug(name + " joins tableId: " + tableId);
if (userId == null) {
logger.fatal("Got no userId from sessionId" + sessionId + " tableId" + tableId);
return false;
}
boolean ret = GamesRoomManager.getInstance().getRoom(roomId).joinTable(userId, tableId, name, playerType, skill, deckList);
logger.debug("Session " + sessionId + " joined table " + tableId);
return ret;
}
});
@ -211,8 +219,17 @@ public class MageServerImpl implements MageServer {
@Override
public Boolean execute() throws MageException {
UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId();
if (logger.isDebugEnabled()) {
User user = UserManager.getInstance().getUser(userId);
if (user != null) {
logger.debug("join tourn. tableId: " + tableId + " " + user.getName());
}
}
if (userId == null) {
logger.fatal("Got no userId from sessionId" + sessionId + " tableId" + tableId);
return false;
}
boolean ret = GamesRoomManager.getInstance().getRoom(roomId).joinTournamentTable(userId, tableId, name, playerType, skill);
logger.debug("Session " + sessionId + " joined table " + tableId);
return ret;
}
});
@ -1004,9 +1021,6 @@ public class MageServerImpl implements MageServer {
protected void execute(final String actionName, final String sessionId, final Action action) throws MageException {
if (SessionManager.getInstance().isValidSession(sessionId)) {
try {
if (actionName.equals("joinChat")) {
logger.debug("MageServerImpl.execute sessionId: " + sessionId + " action: " + actionName);
}
callExecutor.execute(
new Runnable() {
@Override

View file

@ -217,7 +217,6 @@ public class Session {
}
public void kill(DisconnectReason reason) {
logger.debug("session removed for user " + userId + " - reason: " + reason.toString());
UserManager.getInstance().removeUser(userId, reason);
}

View file

@ -74,15 +74,18 @@ public class SessionManager {
if (session != null) {
String returnMessage = session.registerUser(userName);
if (returnMessage == null) {
LogServiceImpl.instance.log(LogKeys.KEY_USER_CONNECTED, userName, session.getHost(), sessionId);
logger.info(new StringBuilder("User: ").append(userName)
.append(" userId: ").append(session.getUserId())
.append(" connected from: ").append(session.getHost())
.append(" sessionId: ").append(sessionId));
return true;
LogServiceImpl.instance.log(LogKeys.KEY_USER_CONNECTED, userName, session.getHost(), sessionId);
logger.info(userName + " joined server");
logger.debug("- userId: " + session.getUserId());
logger.debug("- sessionId: " + sessionId);
logger.debug("- host: " + session.getHost());
return true;
} else {
logger.info(new StringBuilder("User not registered - ").append(returnMessage));
logger.debug(userName + " not registered: " + returnMessage);
}
} else {
logger.error(userName + " tried to join with no sessionId");
}
return false;
}

View file

@ -159,7 +159,7 @@ public class TableController {
}
User user = UserManager.getInstance().getUser(userId);
if (user == null) {
logger.fatal(new StringBuilder("couldn't get user ").append(name).append(" for join tornament userId = ").append(userId).toString());
logger.fatal(new StringBuilder("couldn't get user ").append(name).append(" for join tournament userId = ").append(userId).toString());
return false;
}
if (userPlayerMap.containsKey(userId) && playerType.equals("Human")){
@ -174,7 +174,7 @@ public class TableController {
}
tournament.addPlayer(player, seat.getPlayerType());
table.joinTable(player, seat);
logger.debug("player joined " + player.getId());
logger.trace("player " + player.getName() + " joined tableId: " + table.getId());
//only inform human players and add them to sessionPlayerMap
if (seat.getPlayer().isHuman()) {
user.addTable(player.getId(), table);
@ -243,14 +243,13 @@ public class TableController {
}
match.addPlayer(player, deck);
table.joinTable(player, seat);
logger.debug("player joined " + player.getId() + " " + player.getName());
logger.trace(player.getName() + " joined tableId: " + table.getId());
//only inform human players and add them to sessionPlayerMap
if (seat.getPlayer().isHuman()) {
user.addTable(player.getId(), table);
user.joinedTable(table.getRoomId(), table.getId(), false);
userPlayerMap.put(userId, player.getId());
}
return true;
}
@ -364,7 +363,7 @@ public class TableController {
player = PlayerFactory.getInstance().createPlayer(playerType, name, options.getRange(), skill);
}
if (player != null) {
logger.debug("Player created " + player.getId());
logger.trace("Player " + player.getName() + " created id: " + player.getId());
}
return player;
}
@ -466,14 +465,12 @@ public class TableController {
public synchronized void startMatch() {
if (table.getState() == TableState.STARTING) {
try {
String tableInfo;
if (table.isTournamentSubTable()) {
tableInfo = "Tournament tournamentId: " + table.getTournament().getId() + " - sub";
logger.info("Tourn. match started id:" + match.getId() + " tournId: " + table.getTournament().getId());
} else {
User user = UserManager.getInstance().getUser(userId);
tableInfo = "User (table controller) " + user.getName();
logger.info("MATCH started [" + match.getName() + "] " + match.getId() + "(" + user.getName() +")");
}
logger.info(new StringBuilder(tableInfo).append(" match started match Id: ").append(match.getId()));
match.startMatch();
startGame(null);
} catch (GameException ex) {
@ -501,8 +498,6 @@ public class TableController {
user.removeConstructing(match.getPlayer(entry.getValue()).getPlayer().getId());
GameManager.getInstance().joinGame(match.getGame().getId(), user.getId());
}
logger.info(new StringBuilder("User ").append(user.getName()).append(" game started - gameId ").append(match.getGame().getId()).append(" matchId ").append(match.getId()).append(" userId: ").append(user.getId()));
user.gameStarted(match.getGame().getId(), entry.getValue());
if (creator == null) {
creator = user.getName();
@ -514,7 +509,7 @@ public class TableController {
}
}
else {
logger.warn("Unable to find player " + entry.getKey());
logger.error("Unable to find player " + entry.getKey());
match.getPlayer(entry.getValue()).setQuit(true);
}
}
@ -531,6 +526,10 @@ public class TableController {
ServerMessagesUtil.getInstance().incGamesStarted();
// log about game started
logger.info("GAME started [" + match.getName() +"] "+ creator + " - " + opponent.toString());
logger.debug("- matchId: " + match.getId() + " [" + match.getName() + "]");
logger.debug("- gameId: " + match.getGame().getId());
logger.debug("- chatId: " + GameManager.getInstance().getChatId(match.getGame().getId()));
LogServiceImpl.instance.log(LogKeys.KEY_GAME_STARTED, String.valueOf(userPlayerMap.size()), creator, opponent.toString());
}
catch (Exception ex) {

View file

@ -28,6 +28,8 @@
package mage.server;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
@ -63,6 +65,7 @@ public class TableManager {
private static final TableManager INSTANCE = new TableManager();
private static final Logger logger = Logger.getLogger(TableManager.class);
private static final DateFormat formatter = new SimpleDateFormat("hh:mm:ss");
private final ConcurrentHashMap<UUID, TableController> controllers = new ConcurrentHashMap<>();
private final ConcurrentHashMap<UUID, Table> tables = new ConcurrentHashMap<>();
@ -341,7 +344,6 @@ public class TableManager {
public void removeTable(UUID tableId) {
if (tables.containsKey(tableId)) {
Table table = tables.get(tableId);
ChatManager.getInstance().destroyChatSession(controllers.get(tableId).getChatId());
controllers.remove(tableId);
tables.remove(tableId);
// If table is not finished, the table has to be removed completly (if finished it will be removed in GamesRoomImpl.Update())
@ -354,23 +356,27 @@ public class TableManager {
}
}
private void checkExpired() {
logger.debug("--- Table expire checking -----------------------------------------------------------------------");
public void debugServerState() {
logger.debug("--- Server state ----------------------------------------------");
Collection<User> users = UserManager.getInstance().getUsers();
logger.debug("------- Users: " + users.size() + " ------------------------");
logger.debug("--------User: " + users.size() + " [userId | since | name -----------------------");
for (User user :users) {
logger.debug(user.getName() + " SessionId: " + user.getSessionId() + " ConnectionTime: " + user.getConnectionTime());
logger.debug(user.getId() + " | " + formatter.format(user.getConnectionTime()) + " | " + user.getName() +" (" +user.getUserState().toString() +")");
}
ArrayList<ChatSession> chatSessions = ChatManager.getInstance().getChatSessions();
logger.debug("------- ChatSessions: " + chatSessions.size() + " ------------------------");
logger.debug("------- ChatSessions: " + chatSessions.size() + " ----------------------------------");
for (ChatSession chatSession: chatSessions) {
logger.debug(chatSession.getChatId() + " Clients: " + chatSession.getClients().values().toString());
logger.debug(chatSession.getChatId() + " " + chatSession.getClients().values().toString());
}
logger.debug("------- Tables: " + tables.size() + " ------------------------");
logger.debug("------- Tables: " + tables.size() + " --------------------------------------------");
for (Table table: tables.values()) {
logger.debug(table.getId() + " Name: [" + table.getName()+ "] StartTime: " + table.getStartTime());
logger.debug(table.getId() + " [" + table.getName()+ "] " + formatter.format(table.getStartTime()) +" (" + table.getState().toString() + ")");
}
logger.debug("--- Server state END ------------------------------------------");
}
private void checkExpired() {
debugServerState();
Date now = new Date();
List<UUID> toRemove = new ArrayList<>();
for (Table table : tables.values()) {
@ -398,5 +404,6 @@ public class TableManager {
logger.error(e);
}
}
}
}

View file

@ -120,14 +120,14 @@ public class User {
this.sessionId = sessionId;
if (sessionId.isEmpty()) {
userState = UserState.Disconnected;
logger.debug(new StringBuilder("User ").append(userName).append(" disconnected - userId = ").append(userId.toString()).toString());
logger.debug("Disconnected User " + userName + " id: " + userId);
} else if (userState == UserState.Created) {
userState = UserState.Connected;
logger.debug(new StringBuilder("User ").append(userName).append(" created - userId = ").append(userId.toString()).toString());
logger.debug("Created user " + userName + " id: " + userId);
} else {
userState = UserState.Reconnected;
reconnect();
logger.info(new StringBuilder("User ").append(userName).append(" reconnected - userId = ").append(userId.toString()).toString());
logger.info("Reconnected user " + userName + " id: " + userId);
}
}
@ -327,23 +327,23 @@ public class User {
}
public void kill(DisconnectReason reason) {
logger.debug("user.kill before game session " + gameSessions.size() );
logger.debug("game sessions: " + gameSessions.size() );
for (GameSession gameSession: gameSessions.values()) {
gameSession.kill();
}
logger.debug("user.kill before draft session " + draftSessions.size());
logger.debug("draft sessions " + draftSessions.size());
for (DraftSession draftSession: draftSessions.values()) {
draftSession.setKilled();
}
logger.debug("user.kill before tournament session " + tournamentSessions.size());
logger.debug("tournament sessions " + tournamentSessions.size());
for (TournamentSession tournamentSession: tournamentSessions.values()) {
tournamentSession.setKilled();
}
logger.debug("user.kill before tables " + tables.size());
logger.debug("tables " + tables.size());
for (Entry<UUID, Table> entry: tables.entrySet()) {
TableManager.getInstance().leaveTable(userId, entry.getValue().getId());
}
logger.debug("user.kill before chat remove user");
logger.debug("chat remove user");
ChatManager.getInstance().removeUser(userId, reason);
}
@ -396,22 +396,22 @@ public class User {
}
}
if (match > 0) {
sb.append("MP: ").append(match).append(" ");
sb.append("Match: ").append(match).append(" ");
}
if (sideboard > 0) {
sb.append("MS: ").append(sideboard).append(" ");
sb.append("Sideb: ").append(sideboard).append(" ");
}
if (draft > 0) {
sb.append("TD: ").append(draft).append(" ");
sb.append("Draft: ").append(draft).append(" ");
}
if (construct > 0) {
sb.append("TC: ").append(construct).append(" ");
sb.append("Const: ").append(construct).append(" ");
}
if (tournament > 0) {
sb.append("TP: ").append(tournament).append(" ");
sb.append("Tourn: ").append(tournament).append(" ");
}
if (watchedGames.size() > 0) {
sb.append("WA: ").append(watchedGames.size()).append(" ");
sb.append("Watch: ").append(watchedGames.size()).append(" ");
}
sb.append(disconnectInfo);
@ -433,4 +433,9 @@ public class User {
public void removeGameWatchInfo(UUID gameId) {
watchedGames.remove(gameId);
}
public UserState getUserState() {
return userState;
}
}

View file

@ -125,14 +125,11 @@ public class UserManager {
public void removeUser(UUID userId, DisconnectReason reason) {
User user = users.get(userId);
if (user != null) {
logger.debug(new StringBuilder("Remove user: ").append(user.getName())
.append(" userId: ").append(userId)
.append(" sessionId: ").append(user.getSessionId())
.append(" Reason: ").append(reason.toString()));
logger.debug(user.getName() + " " + reason.toString() + "userId: " + userId);
user.kill(reason);
users.remove(userId);
} else {
logger.warn(new StringBuilder("Trying to remove userId: ").append(userId).append(" but user does not exist."));
logger.warn(new StringBuilder("Trying to remove userId: ").append(userId).append(" but it does not exist."));
}
}

View file

@ -106,7 +106,7 @@ public class GameController implements GameCallback {
}
public void cleanUp() {
ChatManager.getInstance().destroyChatSession(chatId);
// nothing now
}
private void init() {

View file

@ -2,23 +2,26 @@
log4j.rootLogger=info, console, logfile
log4j.logger.com.j256.ormlite=warn
#log4j.logger.mage.player.ai=TRACE
log4j.logger.mage.player.ai=warn
#log4j.logger.mage.player.ai.ComputerPlayer6=debug
#log4j.logger.mage.player.ai.ComputerPlayer7=debug
#log4j.logger.mage.player.ai.GameStateEvaluator2=debug
#log4j.logger.mage.player.human=DEBUG, console, logfile
#log4j.additivity.mage.player.human=false
log4j.logger.mage.server=debug
#console log
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%-5p [%d{yyyy-MM-dd HH:mm [ss:SSS]}] %C{1}[%t]: %m%n
#log4j.appender.console.layout.ConversionPattern=%-5p [%d{yyyy-MM-dd HH:mm [ss:SSS]}] %C{1}[%t]: %m%n
log4j.appender.console.layout.ConversionPattern=%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} %-90m =>[%t] %C{1}.%M%n
log4j.appender.console.Threshold=DEBUG
#file log
log4j.appender.logfile=org.apache.log4j.FileAppender
log4j.appender.logfile.File=mageserver.log
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=%-5p [%d{yyyy-MM-dd HH:mm [ss:SSS]}] %C{1}[%t]: %m%n
log4j.appender.logfile.layout.ConversionPattern=%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} %-90m =>[%t] %C{1}.%M%n
#diagnostic log for game core classes
log4j.category.mage.server.game = INFO, diagfile

View file

@ -620,7 +620,7 @@ public abstract class GameImpl implements Game, Serializable {
}
if (gameOver(null)) {
winnerId = findWinnersAndLosers();
logger.info(new StringBuilder("Game with gameId ").append(this.getId()).append(" ended."));
logger.info("GAME ended gameId: " + this.getId());
}
}