sploit for arena-battle
This commit is contained in:
+34
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Simple log tail for Arena Battle Server
|
||||
"""
|
||||
|
||||
import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
LOG_FILE = Path(__file__).parent.parent / "logs" / "server.log"
|
||||
|
||||
def tail_log():
|
||||
if not LOG_FILE.exists():
|
||||
print(f"Log file not found: {LOG_FILE}")
|
||||
print("Start the server first.")
|
||||
sys.exit(1)
|
||||
|
||||
print(f"=== Tail {LOG_FILE} (Ctrl+C to stop) ===")
|
||||
|
||||
with open(LOG_FILE, "r") as f:
|
||||
f.seek(0, 2)
|
||||
|
||||
while True:
|
||||
line = f.readline()
|
||||
if line:
|
||||
print(line.strip())
|
||||
else:
|
||||
time.sleep(0.5)
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
tail_log()
|
||||
except KeyboardInterrupt:
|
||||
print("\nStopped")
|
||||
Reference in New Issue
Block a user