Browse Source

use new webapi shortcuts in SteamClient

pull/41/head
Rossen Georgiev 9 years ago
parent
commit
f36ddfd116
  1. 5
      steam/client/builtins/web.py
  2. 7
      steam/core/cm.py

5
steam/client/builtins/web.py

@ -2,7 +2,7 @@
Web related features
"""
from binascii import hexlify
from steam import WebAPI
from steam import webapi
from steam.core.crypto import generate_session_key, symmetric_encrypt, sha1_hash, random_bytes
from steam.util.web import make_requests_session
@ -32,8 +32,7 @@ class Web(object):
}
try:
api = WebAPI(None)
resp = api.ISteamUserAuth.AuthenticateUser(**data)
resp = webapi.post('ISteamUserAuth', 'AuthenticateUser', 1, params=data)
except Exception as exp:
self._logger.debug("get_web_session_cookies error: %s" % str(exp))
return None

7
steam/core/cm.py

@ -347,7 +347,7 @@ class CMClient(EventEmitter):
self.steam_id = SteamID(msg.header.steamid)
self.session_id = msg.header.client_sessionid
self.webapi_authenticate_user_nonce = msg.body.webapi_authenticate_user_nonce
self.webapi_authenticate_user_nonce = msg.body.webapi_authenticate_user_nonce.encode('ascii')
if self._heartbeat_loop:
self._heartbeat_loop.kill()
@ -431,11 +431,10 @@ class CMServerList(object):
:return: booststrap success
:rtype: :class:`bool`
"""
from steam import WebAPI
from steam import _webapi
try:
api = WebAPI(None)
resp = api.ISteamDirectory.GetCMList_v1(cellid=cellid)
resp = _webapi.get('ISteamDirectory', 'GetCMList', 1, params={'cellid': cellid})
except Exception as exp:
self._log.error("WebAPI boostrap failed: %s" % str(exp))
return False

Loading…
Cancel
Save