mirror of
https://github.com/hubHarmony/servii-backend.git
synced 2024-11-17 21:40:31 +00:00
23 lines
614 B
Python
23 lines
614 B
Python
import firebase_manager
|
|
from mcipc.query import Client
|
|
|
|
|
|
def ban_user(user_id: str):
|
|
try:
|
|
firebase_manager.auth.update_user(user_id, disabled=False)
|
|
print("Banned : "+user_id)
|
|
except Exception as e:
|
|
print("Error banning user "+user_id, "|", str(e), type(e).__name__)
|
|
|
|
|
|
def get_online_players(port) -> int:
|
|
with Client('127.0.0.1', port) as client:
|
|
stats: mcipc.query.proto.FullStats = client.stats(full=True)
|
|
stats: int = stats.num_players
|
|
return stats
|
|
|
|
|
|
if __name__ == '__main__':
|
|
#ban_user("MpkbDMOO8PQddQgB5VgBQdTMWF53")
|
|
get_online_players(25565)
|