mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-23 11:42:39 -06:00
rpc: change rpc_getUserAccountId to call data from site
This commit is contained in:
parent
5018215e74
commit
c3f9e861d0
1 changed files with 10 additions and 4 deletions
|
@ -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)]})
|
||||||
|
|
Loading…
Reference in a new issue