rpc: change rpc_getUserAccountId to call data from site

This commit is contained in:
Master Jumblespeed 2015-08-16 02:44:23 -04:00
parent 5018215e74
commit c3f9e861d0

View file

@ -2,7 +2,7 @@ import datetime
from direct.distributed.MsgTypes import CLIENTAGENT_EJECT from direct.distributed.MsgTypes import CLIENTAGENT_EJECT
from direct.distributed.PyDatagram import PyDatagram from direct.distributed.PyDatagram import PyDatagram
from direct.stdpy import threading2 from direct.stdpy import threading2
import re import re, json
from otp.distributed import OtpDoGlobals from otp.distributed import OtpDoGlobals
from toontown.distributed.ShardStatusReceiver import ShardStatusReceiver from toontown.distributed.ShardStatusReceiver import ShardStatusReceiver
@ -437,8 +437,14 @@ class ToontownRPCHandler(ToontownRPCHandlerBase):
On success: 100000000 On success: 100000000
On failure: None On failure: None
""" """
if str(userId) in self.air.csm.accountDB.dbm: response = executeHttpRequest('accountid', username=str(userId))
return int(self.air.csm.accountDB.dbm[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) @rpcmethod(accessLevel=MODERATOR)
def rpc_getUserAvatars(self, userId): def rpc_getUserAvatars(self, userId):
@ -817,4 +823,4 @@ class ToontownRPCHandler(ToontownRPCHandlerBase):
On failure: False On failure: False
""" """
return self.rpc_updateObject(accId, 'AccountUD', {'CHAT_SETTINGS': return self.rpc_updateObject(accId, 'AccountUD', {'CHAT_SETTINGS':
[int(speedChatPlus), int(trueFriends)]}) [int(speedChatPlus), int(trueFriends)]})