Split the monolithic test server into a reusable server core and a thin terminal launcher, and add a PySide6 developer GUI. Added server_core.py (FalloutTogetherServer) with lifecycle control, thread-safe client snapshots, stats and log listener support; added client_session.py for per-client state; added dev_server_app.py GUI and requirements.txt. Updated server.py to use the new server core, and revised server/README.md and docs/dev-log.md to document the new structure, usage, and validation steps. Protocol behavior (welcome/transform/disconnect handling and newline-separated JSON) remains unchanged.
25 lines
430 B
Python
25 lines
430 B
Python
from __future__ import annotations
|
|
|
|
from server_core import FalloutTogetherServer
|
|
|
|
|
|
def log(message: str) -> None:
|
|
print(message, flush=True)
|
|
|
|
|
|
def main() -> None:
|
|
server = FalloutTogetherServer()
|
|
server.add_log_listener(log)
|
|
|
|
try:
|
|
server.serve_forever()
|
|
finally:
|
|
server.stop()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
try:
|
|
main()
|
|
except KeyboardInterrupt:
|
|
log("\nServer stopped.")
|