This commit is contained in:
aozhiwei 2019-11-01 19:53:16 +08:00
parent 2257b1bff8
commit 8e3e149b1c
2 changed files with 5 additions and 3 deletions

View File

@ -2,4 +2,4 @@
cd ../tools/robot/virtualclient
#python robot.py ws://192.168.100.21:7101 hao1069 hao1069 $1
python robot.py "wss://game2001.kingsome.cn" hao1069 hao1069 $1
python robot.py "wss://game2001-banshu.kingsome.cn" hao1069 hao1069 $1

View File

@ -30,6 +30,7 @@ def getSession(account_id):
print(real_url)
req = urllib.request.Request(real_url)
data = urllib.request.urlopen(req).read()
print(data)
return json.loads(data.decode('utf-8'))['session_id']
def inputCommand(ws):
@ -57,8 +58,8 @@ def getSMMsg(sm_msgid):
#g_remote_ip = "ws://127.0.0.1:" + sys.argv[1]
g_remote_ip = sys.argv[1]
g_account_id = '6000_1008_' + sys.argv[2]
g_session_id = sys.argv[3]
g_account_id = '6000_2001_' + sys.argv[2]
g_session_id = getSession(g_account_id)
g_server_id = sys.argv[4]
g_seqid = 1000
g_login_time = time.time()
@ -132,6 +133,7 @@ def procSMUpdate(msg):
print(full_obj)
def onUserPacket(ws, msgid, msgbody):
print('onUserPacket')
global g_login_time
if time.time() - g_login_time > 30:
sendCMMove(ws)