Skip to content

Commit f77afad

Browse files
WillowSauceRWillowSauceR
authored andcommitted
Add arg "--display-online" & Fix "OpenMe.bat"
1 parent a20f554 commit f77afad

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
echo "@echo off" >> .\OpenMe.bat
4646
echo "echo Type a program name here to run." >> .\OpenMe.bat
4747
echo "echo Such as scan, motd and send." >> .\OpenMe.bat
48-
echo "echo <=>" >> .\OpenMe.bat
48+
echo "echo [+]" >> .\OpenMe.bat
4949
echo "cmd" >> .\OpenMe.bat
5050
echo "@echo on" >> .\OpenMe.bat
5151

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## scan.py
88

9-
### 使用方法: `python3 scan.py [目标地址] -i [可选:发包间隔] -p [可选:本地端口]`
9+
### 使用方法: `python3 scan.py [目标地址] -i [可选:发包间隔] -p [可选:本地端口] -do [可选:只显示玩家在线数量大于或等于此数值的服务器]`
1010

1111
#### 描述: 扫描IP上的所有BE协议服务器
1212

scan.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ def recv_packets(udp_skt, pbar):
9999
f"[Online ] {infos['online']}/{infos['max_player']}",
100100
f"[Count ] {server_count}",
101101
""]
102-
103-
pbar.write("\n".join(values))
102+
if int(infos['online']) >= display_online:
103+
pbar.write("\n".join(values))
104104
scan_res.append(values)
105105
except socket.timeout:
106106
continue
@@ -124,12 +124,15 @@ def recv_packets(udp_skt, pbar):
124124
help="send packet interval. recommand 0.01~0.0001")
125125
parser.add_argument("-p", "--port", default=random.randint(1024, 65535), type=int,
126126
help="local port for send packet")
127+
parser.add_argument("-do", "--display-online", default=0, type=int,
128+
help="only displayed when the number of online players is greater than or equal to this value")
127129

128130
args, unparsed = parser.parse_known_args()
129131

130132
addr = args.addr
131133
interval = args.interval
132134
local_port = args.port
135+
display_online = args.display_online
133136

134137
udp_skt = get_udp_socket(local_port)
135138

0 commit comments

Comments
 (0)