response.setContentType("text/html;charset=UTF-8");
final PrintWriter out = response.getWriter();
final String actionType = (String) request.getParameter("action");
final HttpSession session = request.getSession();
if ("gameData".equals(actionType)) {
final Game game = (Game) session.getAttribute("game");
out.print(DataGetter.getGameData(game));
}
if ("lobbyData".equals(actionType)) {
out.print(DataGetter.getLobbyData());
}
if ("gamesData".equals(actionType)) {
out.print(DataGetter.getGamesData());
}
if ("gamePlayersData".equals(actionType)) {
final Game game = (Game) session.getAttribute("game");
out.print(DataGetter.getGamePlayersData(game));
}
if ("openTokData".equals(actionType)) {
final Game game = (Game) session.getAttribute("game");
out.print(DataGetter.getOpenTokData(game));
}
if ("mapData".equals(actionType)) {
final Game game = (Game) session.getAttribute("game");
out.print(DataGetter.getMapData(game));
}
}