Add the resources as a submodule for deployment.

This commit is contained in:
Alexander 2015-08-05 03:46:11 -04:00
parent c609a44980
commit 2e6cc13c56
6 changed files with 40 additions and 6 deletions

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "resources"]
path = resources
url = git@Repo.Ez-webz.com:Stride/resources.git

View file

@ -6,6 +6,9 @@ The source code for Toontown Stride.
* Game Development
### Submodule info.
* First, Clone and then run: git submodule init then run: git submodule update
### Info
* Do not erase or revert another person's commit without first consulting them.

View file

@ -2,7 +2,7 @@
distribution dev
# Art assets:
model-path ../resources/
model-path resources/
# Server:
server-version tts-dev

1
resources Submodule

@ -0,0 +1 @@
Subproject commit bfab25e2257e238f86e6b44767ef65c91d2fbbe5

View file

@ -105,7 +105,7 @@ class DistributedBuildingMgrAI:
return (blocks, hqBlocks, gagshopBlocks, petshopBlocks, kartshopBlocks)
def findAllLandmarkBuildings(self):
backups = simbase.backups.load('block-info', (self.air.districtId, self.branchId), default={})
backups = self.load()
(blocks, hqBlocks, gagshopBlocks, petshopBlocks, kartshopBlocks) = self.getDNABlockLists()
for blockNumber in blocks:
self.newBuilding(blockNumber, backup=backups.get(blockNumber, None))
@ -194,4 +194,31 @@ class DistributedBuildingMgrAI:
'becameSuitTime': building.becameSuitTime
}
backups[blockNumber] = backup
simbase.backups.save('block-info', (self.air.districtId, self.branchId), backups)
if not self.air.dbConn:
simbase.backups.save('block-info', (self.air.districtId, self.branchId), backups)
else:
street = {'ai': self.shard, 'branch': self.branchID}
try:
self.air.mongodb.toontown.blockinfo.update(street, {'$setOnInsert': street, '$set': {'buildings': backups}}, upsert=True)
except AutoReconnect:
taskMgr.doMethodLater(config.GetInt('mongodb-retry-time', 2), self.save, 'retrySave', extraArgs=[])
def load(self):
blocks = {}
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}
try:
doc = self.air.mongodb.toontown.blockinfo.find_one(street)
except AutoReconnect:
return blocks
if not doc:
return blocks
return doc

View file

@ -16,20 +16,20 @@ class DNABulkLoader:
def loadDNABulk(dnaStorage, file):
dnaLoader = DNALoader()
fileu = '../resources/' + file
fileu = 'resources/' + file
dnaLoader.loadDNAFile(dnaStorage, fileu)
def loadDNAFile(dnaStorage, file):
print 'Reading DNA file...', file
dnaLoader = DNALoader()
fileu = '../resources/' + file
fileu = 'resources/' + file
node = dnaLoader.loadDNAFile(dnaStorage, fileu)
if node.node().getNumChildren() > 0:
return node.node()
def loadDNAFileAI(dnaStorage, file):
dnaLoader = DNALoader()
fileu = '../resources/' + file
fileu = 'resources/' + file
data = dnaLoader.loadDNAFileAI(dnaStorage, fileu)
return data