Skip to content

Commit 928fd20

Browse files
authored
Merge pull request #2 from HytexLy/the-big-a-branch
Refactor scanner options and GUI, add MC version output
2 parents 4b2d39a + 8f3a31d commit 928fd20

3 files changed

Lines changed: 139 additions & 199 deletions

File tree

6.24 KB
Binary file not shown.

mcstatus_probe.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,15 @@ def log(msg: str) -> None:
7979
latency_ms = getattr(status, "latency", None)
8080
players_online = getattr(status.players, "online", None)
8181
players_max = getattr(status.players, "max", None)
82+
version = getattr(getattr(status, "version", None), "name", None)
8283

8384
parts = [f"{args.ip}:{args.port}"]
8485
if players_online is not None and players_max is not None:
8586
parts.append(f"players {players_online}/{players_max}")
8687
if latency_ms is not None:
8788
parts.append(f"latency {latency_ms:.1f} ms")
89+
if version:
90+
parts.append(f"version {version}")
8891
if motd:
8992
parts.append(f"motd \"{motd}\"")
9093

0 commit comments

Comments
 (0)