gnome-games r7963 - branches/gnome-2-24/glchess/src/lib/ggz
- From: rancell svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-games r7963 - branches/gnome-2-24/glchess/src/lib/ggz
- Date: Wed, 8 Oct 2008 03:57:53 +0000 (UTC)
Author: rancell
Date: Wed Oct 8 03:57:53 2008
New Revision: 7963
URL: http://svn.gnome.org/viewvc/gnome-games?rev=7963&view=rev
Log:
Ignore GGZ server remove player/table for unknown players/tables (Bug #545155)
Modified:
branches/gnome-2-24/glchess/src/lib/ggz/client.py
Modified: branches/gnome-2-24/glchess/src/lib/ggz/client.py
==============================================================================
--- branches/gnome-2-24/glchess/src/lib/ggz/client.py (original)
+++ branches/gnome-2-24/glchess/src/lib/ggz/client.py Wed Oct 8 03:57:53 2008
@@ -349,7 +349,12 @@
self.client.feedback.tableUpdated(table)
def tableRemoved(self, tableId):
- table = self.client.tables.pop(tableId)
+ try:
+ table = self.client.tables.pop(tableId)
+ except KeyError:
+ # We do not know of this table - this could occur if we receive a
+ # table remove event before we get the table list.
+ return
self.client.feedback.tableRemoved(table)
def onPlayerList(self, room, players):
@@ -397,7 +402,13 @@
self.client.feedback.playerAdded(player)
def playerRemoved(self, name, room, toRoom):
- player = self.client.players.pop(name)
+ try:
+ player = self.client.players.pop(name)
+ except KeyError:
+ # We do not know of this player - this could occur if we receive a
+ # player remove event before we get the player list.
+ return
+
player.room.nPlayers -= 1
player.lastRoom = player.room
try:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]