2024-07-09 17:40:18 +00:00
|
|
|
import firebase_manager
|
2024-08-11 09:02:10 +00:00
|
|
|
from mcipc.query import Client
|
2024-07-09 17:40:18 +00:00
|
|
|
|
|
|
|
|
2024-07-10 17:33:54 +00:00
|
|
|
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__)
|
2024-07-09 17:40:18 +00:00
|
|
|
|
|
|
|
|
2024-08-11 09:02:10 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
|
2024-07-09 17:40:18 +00:00
|
|
|
if __name__ == '__main__':
|
2024-08-11 09:02:10 +00:00
|
|
|
#ban_user("MpkbDMOO8PQddQgB5VgBQdTMWF53")
|
|
|
|
get_online_players(25565)
|