[+] Fixed query problem

This commit is contained in:
Charles Le Maux 2024-09-06 17:54:04 +02:00
parent a0a2a8cf43
commit c9c542dcbc

View File

@ -1,12 +1,12 @@
import subprocess
import shlex
import subprocess
import time
import mcipc.query
import mcipc.query.client
from typing import Union
import mcipc.query
import mcipc.query.client
import firebase_manager
import generic_executor
class MinecraftServerManager:
@ -88,8 +88,7 @@ class MinecraftServerManager:
if not self.servers[port]:
return 0
with mcipc.query.Client('127.0.0.1', port) as client:
stats: mcipc.query.proto.FullStats = client.stats(full=True)
stats: int = stats.num_players
stats: int = client.stats(full=False).num_players
return stats
def set_cooldown(self, user_id):