From a5f82eb08ef944e8b7dd96ce3754868e225a080d Mon Sep 17 00:00:00 2001 From: Andy Janata Date: Mon, 30 Jan 2012 23:53:00 -0800 Subject: [PATCH] TODO cleanup --- WebContent/js/cah.ajax.handlers.js | 4 +--- WebContent/js/cah.game.js | 2 ++ src/net/socialgamer/cah/Schema.java | 9 --------- src/net/socialgamer/cah/TestServlet.java | 9 --------- src/net/socialgamer/cah/data/GameManager.java | 7 ++++++- src/net/socialgamer/cah/handlers/FirstLoadHandler.java | 1 - src/net/socialgamer/cah/handlers/NamesHandler.java | 2 +- 7 files changed, 10 insertions(+), 24 deletions(-) diff --git a/WebContent/js/cah.ajax.handlers.js b/WebContent/js/cah.ajax.handlers.js index 02cb892..0668b61 100644 --- a/WebContent/js/cah.ajax.handlers.js +++ b/WebContent/js/cah.ajax.handlers.js @@ -22,8 +22,6 @@ cah.ajax.ErrorHandlers[cah.$.AjaxOperation.REGISTER] = function(data) { cah.ajax.SuccessHandlers[cah.$.AjaxOperation.FIRST_LOAD] = function(data) { if (data.in_progress) { - // TODO reload data. see what 'next' is and go from there. - // for now just load the nickname cah.nickname = data['nickname']; cah.log.status("You have reconnected as " + cah.nickname); $("#nickbox").hide(); @@ -45,7 +43,7 @@ cah.ajax.SuccessHandlers[cah.$.AjaxOperation.FIRST_LOAD] = function(data) { }; cah.ajax.ErrorHandlers[cah.$.AjaxOperation.FIRST_LOAD] = function(data) { - // TODO dunno what to do here, if anything + // pass }; /** diff --git a/WebContent/js/cah.game.js b/WebContent/js/cah.game.js index 8cb46e4..f29e13a 100644 --- a/WebContent/js/cah.game.js +++ b/WebContent/js/cah.game.js @@ -190,6 +190,8 @@ cah.Game = function(id) { /** * Load game data from the server and display the game lobby. * + * TODO reload round win state + * * @param {number} * gameId The game id. */ diff --git a/src/net/socialgamer/cah/Schema.java b/src/net/socialgamer/cah/Schema.java index 4beaa94..a553f8c 100644 --- a/src/net/socialgamer/cah/Schema.java +++ b/src/net/socialgamer/cah/Schema.java @@ -20,21 +20,12 @@ import org.hibernate.dialect.PostgreSQLDialect; public class Schema extends HttpServlet { private static final long serialVersionUID = 1L; - /** - * @see HttpServlet#HttpServlet() - */ - public Schema() { - super(); - // TODO Auto-generated constructor stub - } - /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ @Override protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { - // TODO Auto-generated method stub final AnnotationConfiguration c = new AnnotationConfiguration(); c.configure(); final String[] ls = c.generateSchemaCreationScript(new PostgreSQLDialect()); diff --git a/src/net/socialgamer/cah/TestServlet.java b/src/net/socialgamer/cah/TestServlet.java index 981f148..587d052 100644 --- a/src/net/socialgamer/cah/TestServlet.java +++ b/src/net/socialgamer/cah/TestServlet.java @@ -28,14 +28,6 @@ public class TestServlet extends HttpServlet { private SessionFactory sessionFactory; - /** - * @see HttpServlet#HttpServlet() - */ - public TestServlet() { - super(); - // TODO Auto-generated constructor stub - } - @Override public void init() { sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory(); @@ -47,7 +39,6 @@ public class TestServlet extends HttpServlet { @Override protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { - // TODO Auto-generated method stub // response.setCharacterEncoding("UTF-8"); final PrintWriter out = response.getWriter(); // ServletOutputStream out = response.getOutputStream(); diff --git a/src/net/socialgamer/cah/data/GameManager.java b/src/net/socialgamer/cah/data/GameManager.java index 5e57313..ae89ffc 100644 --- a/src/net/socialgamer/cah/data/GameManager.java +++ b/src/net/socialgamer/cah/data/GameManager.java @@ -5,6 +5,7 @@ import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.TreeMap; @@ -120,7 +121,11 @@ public class GameManager implements Provider { if (nextId == -1 || games.containsKey(nextId)) { nextId = gameId; } - // TODO remove the players from the game + // remove the players from the game + final List users = game.getUsers(); + for (final User user : users) { + game.removePlayer(user); + } broadcastGameListRefresh(); } diff --git a/src/net/socialgamer/cah/handlers/FirstLoadHandler.java b/src/net/socialgamer/cah/handlers/FirstLoadHandler.java index 4b95284..3edb2ed 100644 --- a/src/net/socialgamer/cah/handlers/FirstLoadHandler.java +++ b/src/net/socialgamer/cah/handlers/FirstLoadHandler.java @@ -41,7 +41,6 @@ public class FirstLoadHandler extends Handler { ret.put(AjaxResponse.IN_PROGRESS, Boolean.TRUE); ret.put(AjaxResponse.NICKNAME, user.getNickname()); - // TODO more if (user.getGame() != null) { ret.put(AjaxResponse.NEXT, ReconnectNextAction.GAME.toString()); ret.put(AjaxResponse.GAME_ID, user.getGame().getId()); diff --git a/src/net/socialgamer/cah/handlers/NamesHandler.java b/src/net/socialgamer/cah/handlers/NamesHandler.java index fc0b2ae..fcfcdf1 100644 --- a/src/net/socialgamer/cah/handlers/NamesHandler.java +++ b/src/net/socialgamer/cah/handlers/NamesHandler.java @@ -33,7 +33,7 @@ public class NamesHandler extends Handler { public Map handle(final RequestWrapper request, final HttpSession session) { final Map ret = new HashMap(); - // TODO once there are multiple rooms, we needCollectionhich one was asked for + // TODO once there are multiple rooms, we need which one was asked for final Collection userList = users.getUsers(); final List names = new ArrayList(userList.size()); for (final User u : userList) {