mirror of
https://github.com/hubHarmony/servii-backend.git
synced 2024-11-17 21:40:31 +00:00
[+] Fixed non-static get_online_players
This commit is contained in:
parent
6600b751ea
commit
1f8c6c22af
@ -76,6 +76,8 @@ class MinecraftServerManager:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def get_online_players(self, port) -> int:
|
def get_online_players(self, port) -> int:
|
||||||
|
if not self.servers[port]:
|
||||||
|
return 0
|
||||||
with mcipc.query.Client('127.0.0.1', port) as client:
|
with mcipc.query.Client('127.0.0.1', port) as client:
|
||||||
stats: mcipc.query.proto.FullStats = client.stats(full=True)
|
stats: mcipc.query.proto.FullStats = client.stats(full=True)
|
||||||
stats: int = stats.num_players
|
stats: int = stats.num_players
|
||||||
|
Loading…
Reference in New Issue
Block a user