Opened 9 years ago

Closed 3 years ago

#3548 closed defect (fixed)

Lobby bot (XPartaMupp) - remove dead games

Reported by: elexis Owned by:
Priority: Must Have Milestone: Alpha 25
Component: Multiplayer lobby Keywords:
Cc: Patch:

Description (last modified by wraitii)

Sometimes games don't become unregistered correctly and thus will be listed in the lobby until the bot is restarted.

We should implement some timeout value, so that they become unlisted if we don't hear from them after some meaningful time (10min?).

Users who know they will be banned use this to show their game in the lobby.

http://trac.wildfiregames.com/raw-attachment/ticket/3548/wanna%20hoox.jpg

Attachments (1)

wanna hoox.jpg (126.5 KB ) - added by elexis 9 years ago.
Notice three dead games of that user being listed for the lifespan of WfgBot.

Download all attachments as: .zip

Change History (6)

by elexis, 9 years ago

Attachment: wanna hoox.jpg added

Notice three dead games of that user being listed for the lifespan of WfgBot.

comment:1 by elexis, 9 years ago

Description: modified (diff)

comment:2 by elexis, 9 years ago

Priority: Should HaveMust Have
Summary: Lobby bot (XPartaMupp) - remove games after a timeoutLobby bot (XPartaMupp) - remove dead games

According to leper the easiest way to do this is to remove the game when the hosting player leaves the lobby (i.e. being banned). Could be something like that:

Index: source/tools/XpartaMuPP/XpartaMuPP.py
===================================================================
--- source/tools/XpartaMuPP/XpartaMuPP.py	(revision 17144)
+++ source/tools/XpartaMuPP/XpartaMuPP.py	(working copy)
@@ -577,10 +577,17 @@ class XpartaMuPP(sleekxmpp.ClientXMPP):
           break
       # Remove them from the local player list.
       self.lastLeft = str(presence['muc']['jid'])
       if str(presence['muc']['jid']) in self.nicks:
         del self.nicks[str(presence['muc']['jid'])]
+      # Try removing the game
+      try:
+        self.gameList.removeGame(presence['muc']['jid'])
+        self.sendGameList()
+      except:
+        traceback.print_exc()
+        logging.error("Failed to process game unregistration data")
 
   def muc_message(self, msg):
     """
     Process new messages from the chatroom.
     """

Not tested.

Version 0, edited 9 years ago by elexis (next)

comment:3 by elexis, 8 years ago

Is still the case as of alpha 20 when banning a user (alpha 20 lobby with r18609 applied).

comment:4 by wraitii, 3 years ago

Description: modified (diff)
Milestone: BacklogAlpha 25

Need clarification but I think we know clear out games when players disconnect, which ought be good enough to GC everything -> this might be fixed

comment:5 by wraitii, 3 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.