Fix a rpc method.

This commit is contained in:
Alexander 2015-08-20 00:49:58 -04:00
parent d536ca4ec4
commit 60f3706aae

View file

@ -667,13 +667,13 @@ class ToontownRPCHandler(ToontownRPCHandlerBase):
Example response: [100000001, ...] Example response: [100000001, ...]
""" """
if not config.GetBool('want-mongo-client', False): if not config.GetBool('want-mongo', False):
return [] return []
if not needle: if not needle:
return [] return []
self.air.mongodb.astron.objects.ensure_index('fields.setName') self.air.database.astron.objects.ensure_index('fields.setName')
exp = re.compile('.*%s.*' % needle, re.IGNORECASE) exp = re.compile('.*%s.*' % needle, re.IGNORECASE)
result = self.air.mongodb.astron.objects.find({'fields.setName._0': exp}) result = self.air.database.astron.objects.find({'fields.setName._0': exp})
return [avatar['_id'] for avatar in result] return [avatar['_id'] for avatar in result]
# --- SHARDS --- # --- SHARDS ---