tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kpreis...@apache.org
Subject svn commit: r1530342 - in /tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/drawboard: DrawboardEndpoint.java Room.java
Date Tue, 08 Oct 2013 16:39:41 GMT
Author: kpreisser
Date: Tue Oct  8 16:39:40 2013
New Revision: 1530342

URL: http://svn.apache.org/r1530342
Log:
- Use "100" as maximum number of players instead of "2" that was for debug purposes only.
- If a player couldn't enter the room, close the connection.

Modified:
    tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/drawboard/DrawboardEndpoint.java
    tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/drawboard/Room.java

Modified: tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/drawboard/DrawboardEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/drawboard/DrawboardEndpoint.java?rev=1530342&r1=1530341&r2=1530342&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/drawboard/DrawboardEndpoint.java
(original)
+++ tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/drawboard/DrawboardEndpoint.java
Tue Oct  8 16:39:40 2013
@@ -85,6 +85,8 @@ public final class DrawboardEndpoint ext
                         // reached.
                         client.sendMessage(new StringWebsocketMessage(
                                 "0" + ex.getLocalizedMessage()));
+                        // Close the connection.
+                        client.close();
                     }
 
                 } catch (RuntimeException ex) {

Modified: tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/drawboard/Room.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/drawboard/Room.java?rev=1530342&r1=1530341&r2=1530342&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/drawboard/Room.java (original)
+++ tomcat/trunk/webapps/examples/WEB-INF/classes/websocket/drawboard/Room.java Tue Oct  8
16:39:40 2013
@@ -125,7 +125,7 @@ public final class Room {
     /**
      * The maximum number of players that can join this room.
      */
-    private static final int MAX_PLAYER_COUNT = 2;
+    private static final int MAX_PLAYER_COUNT = 100;
 
     /**
      * List of all currently joined players.
@@ -168,7 +168,8 @@ public final class Room {
      */
     public Player createAndAddPlayer(Client client) {
         if (players.size() >= MAX_PLAYER_COUNT) {
-            throw new IllegalStateException("MAX_PLAYER_COUNT has been reached.");
+            throw new IllegalStateException("Maximum player count ("
+                    + MAX_PLAYER_COUNT + ") has been reached.");
         }
 
         Player p = new Player(this, client);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message