private void gamesEnded(EntityManager manager, HttpServletRequest request,
			Game game, Result result, String currentUser) throws Exception {
		DB_Util.gameEnded(manager, game, result);
		String opponent = game.getWhite().equals(currentUser) ? game.getBlack(): game.getWhite();
		if (!TxtChessUtil.isAI_Game(game)) {
			TxtWebApiUtil.pushMessage(opponent, TxtChessUtil
					.createMoveNotificationMessage(TxtChessUtil
							.getHeaderStatus(result, game.getWhite(), game
									.getBlack(), game.getCurrentPlayer(),
									manager.find(ChessUser.class, opponent)
											.getUserName()), TxtChessUtil
							.getTxtChess(game.reCreateBoard(),
									manager.find(ChessUser.class, opponent)),
							""));
		}
		request.setAttribute(
				"__message",
				TxtChessUtil.getHeaderStatus(
						result,
						game.getWhite(),
						game.getBlack(),
						currentUser,
						opponent.equals(TxtChessUtil.getAI_Player(game)) ? opponent
								: manager.find(ChessUser.class, opponent)
										.getUserName())
						+ "<br/><br/>"
						+ TxtChessUtil.getTxtChess(game.reCreateBoard(),
								manager.find(ChessUser.class, currentUser))
						+ "<br/>");
		setJspPath("/jsp/common/MessageHandler.jsp");
	}