update
This commit is contained in:
parent
c50e2ab71f
commit
9cf915058b
Binary file not shown.
6
black.py
6
black.py
|
@ -1,5 +1,5 @@
|
|||
black_list = {
|
||||
0: {
|
||||
black_list = [
|
||||
{
|
||||
"Type": 1,
|
||||
"Index": 0,
|
||||
"DataNum": 1,
|
||||
|
@ -24,4 +24,4 @@ black_list = {
|
|||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
22
main.py
22
main.py
|
@ -14,7 +14,7 @@ def click_it(x, y):
|
|||
pyautogui.click(x, y)
|
||||
|
||||
|
||||
def is_white(black):
|
||||
def is_black(black):
|
||||
return True
|
||||
|
||||
|
||||
|
@ -37,17 +37,21 @@ def handle_client(client_socket):
|
|||
data = client_socket.recv(1024)
|
||||
try:
|
||||
data = data.decode("utf-8")
|
||||
Point = json.loads(data)["Point"]
|
||||
x_y = Point[0]
|
||||
x = x_y["x"]
|
||||
y = x_y["y"]
|
||||
data = json.loads(data)
|
||||
print(data)
|
||||
for v in black_list:
|
||||
if is_black(v):
|
||||
print("黑名单")
|
||||
client_socket.send(b"ACK!")
|
||||
client_socket.close()
|
||||
return
|
||||
Point = data["Point"]
|
||||
x = Point[0]["x"]
|
||||
y = Point[0]["y"]
|
||||
print(x, y)
|
||||
click_it(x, y)
|
||||
except Exception as e:
|
||||
# print(e)
|
||||
pass
|
||||
# 返还一个 ACK 在计算机网络中的意思是返回包确认,表示收到
|
||||
client_socket.send(b"ACK!")
|
||||
client_socket.close()
|
||||
|
||||
|
||||
# 等待连接,这里必定进入循环
|
||||
|
|
Loading…
Reference in New Issue