Replace self.shard with the correct districtId.

This commit is contained in:
Alexander 2015-08-05 04:02:12 -04:00
parent 5c776d6cc8
commit 00e3650737
2 changed files with 5 additions and 5 deletions

View file

@ -197,7 +197,7 @@ class DistributedBuildingMgrAI:
if not self.air.dbConn:
simbase.backups.save('block-info', (self.air.districtId, self.branchId), backups)
else:
street = {'ai': self.shard, 'branch': self.branchID}
street = {'district': self.air.districtId, 'branch': self.branchID}
try:
self.air.mongodb.toontown.blockinfo.update(street, {'$setOnInsert': street, '$set': {'buildings': backups}}, upsert=True)
except AutoReconnect:
@ -208,8 +208,8 @@ class DistributedBuildingMgrAI:
if not self.air.dbConn:
blocks = simbase.backups.load('block-info', (self.air.districtId, self.branchId), default={})
return blocks
self.air.mongodb.toontown.blockinfo.ensure_index([('ai', 1), ('branch', 1)])
street = {'ai': self.shard, 'branch': self.branchID}
self.air.mongodb.toontown.blockinfo.ensure_index([('district', 1), ('branch', 1)])
street = {'district': self.air.districtId, 'branch': self.branchID}
try:
doc = self.air.mongodb.toontown.blockinfo.find_one(street)
except AutoReconnect:

View file

@ -11,9 +11,9 @@ class LeaderboardMgrAI:
self.database = simbase.backups.load('leaderboard', (self.air.districtId,), default=({}))
else:
self.air.mongodb.toontown.leaderboard.ensure_index([('ai', 1)])
street = {'ai': self.air.districtId}
district = {'ai': self.air.districtId}
try:
doc = self.air.mongodb.toontown.leaderboard.find_one(street)
doc = self.air.mongodb.toontown.leaderboard.find_one(district)
except AutoReconnect:
return blocks