mirror of
https://github.com/imayushsaini/Bombsquad-Ballistica-Modded-Server.git
synced 2025-11-14 17:46:03 +00:00
hello API 8 !
This commit is contained in:
parent
3a2b6ade68
commit
0284fee95c
1166 changed files with 26061 additions and 375100 deletions
37
dist/ba_root/mods/serverData/serverdata.py
vendored
37
dist/ba_root/mods/serverData/serverdata.py
vendored
|
|
@ -1,37 +0,0 @@
|
|||
# Released under the MIT License. See LICENSE for details.
|
||||
|
||||
import fcntl
|
||||
import _ba
|
||||
import os
|
||||
clients = {}
|
||||
cachedclients = []
|
||||
muted = False
|
||||
coopmode = False
|
||||
ips = {}
|
||||
recents = []
|
||||
|
||||
|
||||
SERVER_DATA_PATH = os.path.join(
|
||||
_ba.env()["python_directory_user"], "serverData" + os.sep
|
||||
)
|
||||
|
||||
|
||||
def get_stats_index():
|
||||
return [x for x in os.listdir(SERVER_DATA_PATH) if "log" in x]
|
||||
|
||||
|
||||
def read_logs(filename):
|
||||
file_path = SERVER_DATA_PATH+filename
|
||||
if not os.path.exists(file_path):
|
||||
return ""
|
||||
file = open(file_path, "r")
|
||||
fcntl.flock(file.fileno(), fcntl.LOCK_SH)
|
||||
contents = ""
|
||||
try:
|
||||
contents = file.read()
|
||||
|
||||
finally:
|
||||
fcntl.flock(file.fileno(), fcntl.LOCK_UN)
|
||||
file.close()
|
||||
|
||||
return contents
|
||||
Loading…
Add table
Add a link
Reference in a new issue