From c3f9e861d09ccc7a9c73e06725c54a9159189a7d Mon Sep 17 00:00:00 2001 From: Master Jumblespeed Date: Sun, 16 Aug 2015 02:44:23 -0400 Subject: [PATCH] rpc: change rpc_getUserAccountId to call data from site --- toontown/rpc/ToontownRPCHandler.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/toontown/rpc/ToontownRPCHandler.py b/toontown/rpc/ToontownRPCHandler.py index f1f94c8a..f5252f40 100755 --- a/toontown/rpc/ToontownRPCHandler.py +++ b/toontown/rpc/ToontownRPCHandler.py @@ -2,7 +2,7 @@ import datetime from direct.distributed.MsgTypes import CLIENTAGENT_EJECT from direct.distributed.PyDatagram import PyDatagram from direct.stdpy import threading2 -import re +import re, json from otp.distributed import OtpDoGlobals from toontown.distributed.ShardStatusReceiver import ShardStatusReceiver @@ -437,8 +437,14 @@ class ToontownRPCHandler(ToontownRPCHandlerBase): On success: 100000000 On failure: None """ - if str(userId) in self.air.csm.accountDB.dbm: - return int(self.air.csm.accountDB.dbm[str(userId)]) + response = executeHttpRequest('accountid', username=str(userId)) + if response is not None: + response = json.loads(response) + if response['success'] is True: + return str(response['accountId']) + else: + print response['error'] + return False @rpcmethod(accessLevel=MODERATOR) def rpc_getUserAvatars(self, userId): @@ -817,4 +823,4 @@ class ToontownRPCHandler(ToontownRPCHandlerBase): On failure: False """ return self.rpc_updateObject(accId, 'AccountUD', {'CHAT_SETTINGS': - [int(speedChatPlus), int(trueFriends)]}) \ No newline at end of file + [int(speedChatPlus), int(trueFriends)]})