Esempio n. 1
0
def get_is_proxy(accountName, callback):
	ts = get_cur_timestamp()
	to_sign = accountName + "_" + str(ts) + "_" + switch.PHP_SERVER_SECRET
	sign = get_md5(to_sign)
	url = switch.PHP_SERVER_URL + 'is_proxy'
	suffix = '?timestamp=' + str(ts) + '&unionid=' + accountName + '&sign=' + sign
	AsyncRequest.Request(url + suffix, lambda x: callback(x))
Esempio n. 2
0
def get_user_info(accountName, callback):
	ts = int(time.mktime(datetime.now().timetuple()))
	tosign = accountName + "_" + str(ts) + "_" + switch.PHP_SERVER_SECRET
	m1 = hashlib.md5()
	m1.update(tosign.encode())
	sign = m1.hexdigest()
	url = switch.PHP_SERVER_URL + 'user_info_server'
	suffix = '?timestamp=' + str(ts) + '&unionid=' + accountName + '&sign=' + sign
	AsyncRequest.Request(url + suffix, lambda x:callback(x.read()) if x else DEBUG_MSG(url + suffix + " error!"))
Esempio n. 3
0
def get_agent_info(userId, callback):
    ts = int(time.mktime(datetime.now().timetuple()))
    tosign = str(userId) + "_" + str(ts) + "_" + switch.PHP_SERVER_SECRET
    m1 = hashlib.md5()
    m1.update(tosign.encode())
    sign = m1.hexdigest()
    url = switch.PHP_SERVER_URL + 'agent_info_server'
    suffix = '?timestamp=' + str(ts) + '&userId=' + str(userId) + '&sign=' + sign
    AsyncRequest.Request(url + suffix, lambda x: callback(x))
Esempio n. 4
0
def getDebugPrefab(owner, callback):
    ts = int(time.mktime(datetime.now().timetuple()))
    url = '{}?timestamp={}&from=py&game={}&owner={}'.format(
        switch.PHP_DEBUG_URL, ts, const.DEBUG_JSON_NAME, owner)
    AsyncRequest.Request(url, lambda x: callback(x))