From 2f96488aece53929ea91b09544c85442b9af82f5 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sun, 16 Aug 2015 02:28:44 -0400 Subject: [PATCH 1/3] Changed the way we call the mongodb so the database match up. --- deployment/public_client.prc | 4 ++-- deployment/server.prc | 2 +- toontown/distributed/ToontownInternalRepository.py | 14 ++++++++++---- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/deployment/public_client.prc b/deployment/public_client.prc index abae39fa..c53b4bc5 100644 --- a/deployment/public_client.prc +++ b/deployment/public_client.prc @@ -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 diff --git a/deployment/server.prc b/deployment/server.prc index 657b5f75..5ff5390a 100644 --- a/deployment/server.prc +++ b/deployment/server.prc @@ -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 diff --git a/toontown/distributed/ToontownInternalRepository.py b/toontown/distributed/ToontownInternalRepository.py index 40a65d40..327292d2 100755 --- a/toontown/distributed/ToontownInternalRepository.py +++ b/toontown/distributed/ToontownInternalRepository.py @@ -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) From c98510471d6f0cbbe5159935a803281ccf78e2d3 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sun, 16 Aug 2015 02:29:12 -0400 Subject: [PATCH 2/3] Fixed the missiong Icon from the game. (Can be reverted) --- toontown/toonbase/ToonBase.py | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/toontown/toonbase/ToonBase.py b/toontown/toonbase/ToonBase.py index e4aa8e80..52f7a1bb 100755 --- a/toontown/toonbase/ToonBase.py +++ b/toontown/toonbase/ToonBase.py @@ -27,6 +27,21 @@ from toontown.toonbase import TTLocalizer from toontown.toonbase import ToontownBattleGlobals from toontown.toontowngui import TTDialog +tempdir = tempfile.mkdtemp() +vfs = VirtualFileSystem.getGlobalPtr() +searchPath = DSearchPath() +if __debug__: + searchPath.appendDirectory(Filename('resources/phase_3/etc')) +searchPath.appendDirectory(Filename('/phase_3/etc')) + +for filename in ['toonmono.cur', 'icon.ico']: + p3filename = Filename(filename) + found = vfs.resolveFilename(p3filename, searchPath) + if not found: + continue + with open(os.path.join(tempdir, filename), 'wb') as f: + f.write(vfs.readFile(p3filename, False)) +loadPrcFileData('Window: icon', 'icon-filename %s' % Filename.fromOsSpecific(os.path.join(tempdir, 'icon.ico'))) class ToonBase(OTPBase.OTPBase): notify = DirectNotifyGlobal.directNotify.newCategory('ToonBase') @@ -148,23 +163,7 @@ class ToonBase(OTPBase.OTPBase): return result def setCursorAndIcon(self): - tempdir = tempfile.mkdtemp() atexit.register(shutil.rmtree, tempdir) - vfs = VirtualFileSystem.getGlobalPtr() - - searchPath = DSearchPath() - if __debug__: - searchPath.appendDirectory(Filename('resources/phase_3/etc')) - searchPath.appendDirectory(Filename('/phase_3/etc')) - - for filename in ['toonmono.cur', 'icon.ico']: - p3filename = Filename(filename) - found = vfs.resolveFilename(p3filename, searchPath) - if not found: - return # Can't do anything past this point. - - with open(os.path.join(tempdir, filename), 'wb') as f: - f.write(vfs.readFile(p3filename, False)) wp = WindowProperties() wp.setCursorFilename(Filename.fromOsSpecific(os.path.join(tempdir, 'toonmono.cur'))) From 833d9b2880881d7d5cb34ff011146e3caececc47 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sun, 16 Aug 2015 02:32:13 -0400 Subject: [PATCH 3/3] Remove debug message. --- toontown/uberdog/ClientServicesManagerUD.py | 1 - 1 file changed, 1 deletion(-) diff --git a/toontown/uberdog/ClientServicesManagerUD.py b/toontown/uberdog/ClientServicesManagerUD.py index bf873340..9402d17e 100755 --- a/toontown/uberdog/ClientServicesManagerUD.py +++ b/toontown/uberdog/ClientServicesManagerUD.py @@ -275,7 +275,6 @@ class RemoteAccountDB: r = executeHttpRequest('associateuser', username=str(userId), accountId=str(accountId)) try: r = json.loads(r) - print r if r['success']: callback(True) else: