Subversion Repositories

?revision_form?Rev ?revision_input??revision_submit??revision_endform?

Rev 41 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
41 magnus 1
From: Christian von Kietzell <christian@vonkietzell.de>
2
Bug-Debian: http://bugs.debian.org/633838
3
Forwarded: no
4
Description: Check whether an existing player is rejoining _before_
5
 checking whether the maximum of players has been reached.
6
 
7
--- pyscrabble-1.6.2/pyscrabble/net/server.py   2011-07-14 19:32:42.000000000 +0200
8
+++ pyscrabble-fixed/pyscrabble/net/server.py   2011-07-14 19:35:50.000000000 +0200
9
@@ -936,21 +936,21 @@
42 magnus 10
             client.denyJoinGame(command)
11
             return
12
 
13
-        if (game.getNumberOfPlayers() == constants.MAX_PLAYERS):
14
-            command.setData( ServerMessage([GAME_FULL]) )
15
-            command.setCommand( constants.GAME_JOIN_DENIED )
16
-            client.denyJoinGame(command)
17
-            return
18
-
19
         p = self.clients[client].clone()
20
 
21
-        if (game.isPaused() and not game.hasPlayer(p)):
22
-            command.setData( ServerMessage([CANNOT_JOIN_STARTED]) )
23
-            command.setCommand( constants.GAME_JOIN_DENIED )
24
-            client.denyJoinGame(command)
25
-            return
26
-
27
         if not game.hasPlayer( p ):
28
+            if (game.getNumberOfPlayers() == constants.MAX_PLAYERS):
29
+                command.setData( ServerMessage([GAME_FULL]) )
30
+                command.setCommand( constants.GAME_JOIN_DENIED )
31
+                client.denyJoinGame(command)
32
+                return
33
+
34
+            if (game.isPaused()):
35
+                command.setData( ServerMessage([CANNOT_JOIN_STARTED]) )
36
+                command.setCommand( constants.GAME_JOIN_DENIED )
37
+                client.denyJoinGame(command)
38
+                return
39
+
40
             game.addPlayer( p )
41
         else:
42
             game.removePending( p )