Changed the way we call the mongodb so the database match up.

This commit is contained in:
Alexander 2015-08-16 02:28:44 -04:00
parent 5018215e74
commit 2f96488aec
3 changed files with 13 additions and 7 deletions

View file

@ -3,7 +3,7 @@
# Config.prc should be reproduced here.
# Client settings
window-title Toontown Stride
window-title Toontown Stride [Alpha]
server-version SERVER_VERSION_HERE
video-library-name p3ffmpeg
want-dev #f
@ -50,7 +50,7 @@ want-chinese-checkers #t
want-checkers #t
want-house-types #t
want-gifting #t
want-top-toons #f
want-top-toons #t
want-language-selection #t
estate-day-night #t
want-mat-all-tailors #t

View file

@ -20,7 +20,7 @@ want-chinese-checkers #t
want-checkers #t
want-house-types #t
want-gifting #t
want-top-toons #f
want-top-toons #t
want-language-selection #t
estate-day-night #t
want-mat-all-tailors #t

View file

@ -21,13 +21,19 @@ class ToontownInternalRepository(AstronInternalRepository):
self.__messenger = ToontownNetMessengerAI(self)
if self.wantMongo:
import pymongo
self.dbConn = pymongo.MongoClient(config.GetString('mongodb-url', 'localhost'))
self.dbGlobalCursor = self.dbConn.toontownstride
self.dbCursor = self.dbGlobalCursor['air-%d' % self.ourChannel]
mongourl = config.GetString('mongodb-url', 'mongodb://localhost')
replicaset = config.GetString('mongodb-replicaset', '')
db = (urlparse.urlparse(mongourl).path or '/Astron_Dev')[1:]
if replicaset:
self.dbConn = pymongo.MongoClient(mongourl, replicaset=replicaset)
else:
self.dbConn = pymongo.MongoClient(mongourl)
self.database = self.dbConn[db]
self.dbGlobalCursor = self.database.toontownstride
else:
self.dbConn = None
self.database = None
self.dbGlobalCursor = None
self.dbCursor = None
def sendNetEvent(self, message, sentArgs=[]):
self.__messenger.send(message, sentArgs)