Notify all chat rooms that server is going to restart.

This commit is contained in:
marcins78@gmail.com
2012-07-11 10:07:22 +00:00
parent 96c579f37d
commit 403f435e00
2 changed files with 6 additions and 0 deletions

View File

@@ -23,6 +23,11 @@ public class ChatServer extends AbstractServer {
return chatRoom;
}
public void sendSystemMessageToAllChatRooms(String message) {
for (ChatRoomMediator chatRoomMediator : _chatRooms.values())
chatRoomMediator.sendMessage("System", message, true);
}
public ChatRoomMediator getChatRoom(String name) {
return _chatRooms.get(name);
}

View File

@@ -75,6 +75,7 @@ public class HallServer extends AbstractServer {
if (shutdown) {
cancelWaitingTables();
cancelTournamentQueues();
_chatServer.sendSystemMessageToAllChatRooms("System is entering shutdown mode and will be restarted when all games are finished");
}
} finally {
_hallDataAccessLock.writeLock().unlock();