-
Notifications
You must be signed in to change notification settings - Fork 0
/
Debug_Plt_debugger.py
executable file
·48 lines (41 loc) · 1015 Bytes
/
Debug_Plt_debugger.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python
# -*-coding: UTF-8 -*-
#for testing ai_debugger using data in Ui_2DReplay/testdata.py
import socket,sio,time
from testdata_debugger import *
serv = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
#try:
serv.bind((sio.HOST,sio.UI_PORT))
#except:
# print 'port occupied, the program will exit...'
# time.sleep(3)
# exit(1)
serv.listen(1)
connUI, address = serv.accept()
(gameMode,gameMapPath,gameAIPath)=sio._recvs(connUI)
print gameMode,gameMapPath,gameAIPath
aiInfo = []
sio._sends(connUI, (maps,units0,aiInfo))
#Round 1
sio._sends(connUI, begInfo0)
#time.sleep(3)
sio._sends(connUI, (cmd0, endInfo0))
print "re1 send"
#time.sleep(8)
#Round 2
sio._sends(connUI, begInfo1)
#time.sleep(3)
sio._sends(connUI, (cmd1, endInfo1))
print "re2 send"
#time.sleep(10)
#Round 3
sio._sends(connUI, begInfo2)
#time.sleep(3)
#cmd0 = Command(0,(0,0))
sio._sends(connUI, (cmd2, endInfo2))
print "re3 send"
#time.sleep(10)
winner = "side1"
sio._sends(connUI,winner)
connUI.close()
serv.close()