def sync(self): self.debug("Synchronising Clients") plist = self.getPlayerList(maxRetries=4) mlist = {} for cid, c in plist.iteritems(): cid = str(cid) client = self.clients.getByCID(cid) if client: if client.guid and c.has_key("guid") and not self.IpsOnly: if functions.fuzzyGuidMatch(client.guid, c["guid"]): # player matches self.debug("in-sync %s == %s", client.guid, c["guid"]) mlist[str(cid)] = client else: self.debug("no-sync %s <> %s", client.guid, c["guid"]) client.disconnect() elif client.ip and c.has_key("ip"): if client.ip == c["ip"]: # player matches self.debug("in-sync %s == %s", client.ip, c["ip"]) mlist[str(cid)] = client else: self.debug("no-sync %s <> %s", client.ip, c["ip"]) client.disconnect() else: self.debug("no-sync: no guid or ip found.") return mlist
def sync(self): self.debug('Synchronising Clients') plist = self.getPlayerList(maxRetries=4) mlist = {} for cid, c in plist.iteritems(): client = self.clients.getByCID(cid) if client: if client.guid and c.has_key('guid') and not self.IpsOnly: if functions.fuzzyGuidMatch(client.guid, c['guid']): # player matches self.debug('in-sync %s == %s', client.guid, c['guid']) mlist[str(cid)] = client else: self.debug('no-sync %s <> %s', client.guid, c['guid']) client.disconnect() elif client.ip and c.has_key('ip'): if client.ip == c['ip']: # player matches self.debug('in-sync %s == %s', client.ip, c['ip']) mlist[str(cid)] = client else: self.debug('no-sync %s <> %s', client.ip, c['ip']) client.disconnect() else: self.debug('no-sync: no guid or ip found.') return mlist
def test_caseInsensitive(self): self.assertTrue(functions.fuzzyGuidMatch( '098F6BCD4621D373CADE4E832627B4F6', '098f6bcd4621d373cade4e832627b4f6')) self.assertTrue(functions.fuzzyGuidMatch( '098F6BCD4621D373CADE4E832627B4F6', '098f6bcd4621d373cade4e832627b4f')) self.assertTrue(functions.fuzzyGuidMatch( '098F6BCD4621D373CADE4E832627B4F6', '098f6bcd4621d373cde4e832627b4f6')) self.assertFalse(functions.fuzzyGuidMatch('098F6BCD4621D373CADE4E832627B4F6', '098f6bcd46d373cade4e832627b4f6')) self.assertTrue(functions.fuzzyGuidMatch( '098F6BCD4621D373CADE4E832627BF6', '098f6bcd4621d373cade4e832627b4f6')) self.assertFalse(functions.fuzzyGuidMatch('098F6BCD4621D373CADE4832627B4F6', '098f6bcd4621d73cade4e832627b4f6'))
def test_1(self): self.assertTrue(functions.fuzzyGuidMatch( '098f6bcd4621d373cade4e832627b4f6', '098f6bcd4621d373cade4e832627b4f6')) self.assertTrue(functions.fuzzyGuidMatch( '098f6bcd4621d373cade4e832627b4f6', '098f6bcd4621d373cade4e832627b4f')) self.assertTrue(functions.fuzzyGuidMatch( '098f6bcd4621d373cade4e832627b4f6', '098f6bcd4621d373cde4e832627b4f6')) self.assertTrue(functions.fuzzyGuidMatch( '098f6bcd4621d373cade4e832627bf6', '098f6bcd4621d373cade4e832627b4f6')) self.assertFalse(functions.fuzzyGuidMatch('098f6bcd4621d373cade4e832627b4f6', '098f6bcd46d373cade4e832627b4f6')) self.assertFalse(functions.fuzzyGuidMatch('098f6bcd4621d373cade4832627b4f6', '098f6bcd4621d73cade4e832627b4f6'))
def test_caseInsensitive(self): self.assertTrue( functions.fuzzyGuidMatch('098F6BCD4621D373CADE4E832627B4F6', '098f6bcd4621d373cade4e832627b4f6')) self.assertTrue( functions.fuzzyGuidMatch('098F6BCD4621D373CADE4E832627B4F6', '098f6bcd4621d373cade4e832627b4f')) self.assertTrue( functions.fuzzyGuidMatch('098F6BCD4621D373CADE4E832627B4F6', '098f6bcd4621d373cde4e832627b4f6')) self.assertFalse( functions.fuzzyGuidMatch('098F6BCD4621D373CADE4E832627B4F6', '098f6bcd46d373cade4e832627b4f6')) self.assertTrue( functions.fuzzyGuidMatch('098F6BCD4621D373CADE4E832627BF6', '098f6bcd4621d373cade4e832627b4f6')) self.assertFalse( functions.fuzzyGuidMatch('098F6BCD4621D373CADE4832627B4F6', '098f6bcd4621d73cade4e832627b4f6'))
def test_1(self): self.assertTrue( functions.fuzzyGuidMatch('098f6bcd4621d373cade4e832627b4f6', '098f6bcd4621d373cade4e832627b4f6')) self.assertTrue( functions.fuzzyGuidMatch('098f6bcd4621d373cade4e832627b4f6', '098f6bcd4621d373cade4e832627b4f')) self.assertTrue( functions.fuzzyGuidMatch('098f6bcd4621d373cade4e832627b4f6', '098f6bcd4621d373cde4e832627b4f6')) self.assertTrue( functions.fuzzyGuidMatch('098f6bcd4621d373cade4e832627bf6', '098f6bcd4621d373cade4e832627b4f6')) self.assertFalse( functions.fuzzyGuidMatch('098f6bcd4621d373cade4e832627b4f6', '098f6bcd46d373cade4e832627b4f6')) self.assertFalse( functions.fuzzyGuidMatch('098f6bcd4621d373cade4832627b4f6', '098f6bcd4621d73cade4e832627b4f6'))