Skip to content

Commit

Permalink
对send_to_server()函数进行了一些修改
Browse files Browse the repository at this point in the history
  • Loading branch information
MCTF-Alpha-27 authored May 2, 2022
1 parent 43d7555 commit fd97e91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 7 additions & 1 deletion main.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"""
import random
import os
import subprocess
from threading import Thread

__version__ = "2.0.0" # 版本
__version__ = "2.0.1" # 版本
__author__ = "Jerry" # 作者

try:
Expand All @@ -22,8 +23,13 @@ with open("name.ini", "w") as f:
with open("msg_type.ini", "w") as f:
f.write("normal")

def run(file):
subprocess.run("pythonw %s"%file, shell=True)

server = Thread(target=ef.start, args=("server.pyw",)) # 服务端线程
client = Thread(target=ef.start, args=("client.pyw",)) # 客户端线程
#server = Thread(target=run, args=("server.pyw",))
#client = Thread(target=run, args=("server.pyw",))
t = [server, client]

if __name__ == "__main__":
Expand Down
4 changes: 0 additions & 4 deletions plugins/lib/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@ def display(text, end = "\n"): # 显示消息
text_message.insert(END, end)

def send_to_server(text): # 向服务器发送信息
with open("msg_type.ini","w") as f:
f.write("system")
ef.wait(0.1)
s.send(bytes(text, "utf-8"))
ef.wait(0.1)
with open("msg_type.ini","w") as f:
f.write("normal")

def send(): # 发送消息
send_msg = text_text.get("0.0", END)
Expand Down

0 comments on commit fd97e91

Please sign in to comment.