Esempio n. 1
0
 def addUser(self, **kwargs):
     if 'player' in kwargs:
         name = kwargs['player']
         if name not in self.available and name not in self.awayfromkb and name not in self.playing:
             self.sigPlayerNewlyJoined.emit(name)
         if name in self.players:
             p = self.players[name]
             for k, v in kwargs.items():
                 if v and not (k == 'cc' and isUnknownCountryCode(v)):
                     setattr(p, k, v)
         else:
             p = Player(**kwargs)
             self.players[name] = p
             self.sendPingQuery(p)
             if isUnknownCountryCode(p.cc):
                 p.cc, p.country, p.city = geolookup(p.ip)
Esempio n. 2
0
 def addUser(self, **kwargs):
     if 'player' in kwargs:
         name = kwargs['player']
         if name not in self.available and name not in self.awayfromkb and name not in self.playing:
             self.sigPlayerNewlyJoined.emit(name)
         if name in self.players:
             p = self.players[name]
             for k, v in kwargs.items():
                 if v and not (k == 'cc' and isUnknownCountryCode(v)):
                     setattr(p, k, v)
         else:
             p = Player(**kwargs)
             self.players[name] = p
             self.sendPingQuery(p)
             if isUnknownCountryCode(p.cc):
                 p.cc, p.country, p.city = geolookup(p.ip)