Package: pyscrabble-server
Version: 1.6.2-6.1
Severity: normal
Tags: upstream patch


If a game with a maximum of 6 players is paused none of the players will
be able to rejoin the game to resume it. The checks in net/server.py are
incorrect. Attached is a patch which fixes the problem.

-- System Information:
Debian Release: 6.0.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages pyscrabble-server depends on:
ii  adduser                 3.112+nmu2       add and remove users and groups
ii  lsb-base                3.2-23.2squeeze1 Linux Standard Base 3.2 init scrip
ii  pyscrabble-common       1.6.2-6.1        multiplayer scrabble implementatio
ii  python                  2.6.6-3+squeeze6 interactive high-level object-orie
ii  python-nevow            0.10.0-2         Web application templating system 
ii  python-zodb             1:3.9.4-1.1      Set of tools for using the Zope Ob

pyscrabble-server recommends no packages.

Versions of packages pyscrabble-server suggests:
pn  pyscrabble                    <none>     (no description available)

-- no debconf information
--- pyscrabble-1.6.2/pyscrabble/net/server.py   2011-07-14 09:31:46.000000000 
+0200
+++ pyscrabble-fixed/pyscrabble/net/server.py   2011-07-14 09:34:28.000000000 
+0200
@@ -935,22 +935,20 @@
             command.setCommand( constants.GAME_JOIN_DENIED )
             client.denyJoinGame(command)
             return
-        
-        if (game.getNumberOfPlayers() == constants.MAX_PLAYERS):
-            command.setData( ServerMessage([GAME_FULL]) )
-            command.setCommand( constants.GAME_JOIN_DENIED )
-            client.denyJoinGame(command)
-            return
 
         p = self.clients[client].clone()
-        
-        if (game.isPaused() and not game.hasPlayer(p)):
-            command.setData( ServerMessage([CANNOT_JOIN_STARTED]) )
-            command.setCommand( constants.GAME_JOIN_DENIED )
-            client.denyJoinGame(command)
-            return
 
-        if not game.hasPlayer( p ):
+        if not game.hasPlayer(p):
+            if (game.getNumberOfPlayers() == constants.MAX_PLAYERS):
+                command.setData( ServerMessage([GAME_FULL]) )
+                command.setCommand( constants.GAME_JOIN_DENIED )
+                client.denyJoinGame(command)
+                return
+            if (game.isPaused()):
+                command.setData( ServerMessage([CANNOT_JOIN_STARTED]) )
+                command.setCommand( constants.GAME_JOIN_DENIED )
+                client.denyJoinGame(command)
+                return
             game.addPlayer( p )
         else:
             game.removePending( p )

Reply via email to