mirror of
https://github.com/hubHarmony/servii-backend.git
synced 2024-11-17 21:40:31 +00:00
[+] Fixed query problem
This commit is contained in:
parent
a0a2a8cf43
commit
c9c542dcbc
@ -1,12 +1,12 @@
|
|||||||
import subprocess
|
|
||||||
import shlex
|
import shlex
|
||||||
|
import subprocess
|
||||||
import time
|
import time
|
||||||
import mcipc.query
|
|
||||||
import mcipc.query.client
|
|
||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
|
import mcipc.query
|
||||||
|
import mcipc.query.client
|
||||||
|
|
||||||
import firebase_manager
|
import firebase_manager
|
||||||
import generic_executor
|
|
||||||
|
|
||||||
|
|
||||||
class MinecraftServerManager:
|
class MinecraftServerManager:
|
||||||
@ -88,8 +88,7 @@ class MinecraftServerManager:
|
|||||||
if not self.servers[port]:
|
if not self.servers[port]:
|
||||||
return 0
|
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: int = client.stats(full=False).num_players
|
||||||
stats: int = stats.num_players
|
|
||||||
return stats
|
return stats
|
||||||
|
|
||||||
def set_cooldown(self, user_id):
|
def set_cooldown(self, user_id):
|
||||||
|
Loading…
Reference in New Issue
Block a user