mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Enable configuration of the server bind address.
A serverconfig.env (or just environment variables) can be set to override the default bind address/port for the backend. This is passed to the front end as a query parameter.
This commit is contained in:
@@ -15,6 +15,7 @@ from PySide2.QtWebEngineWidgets import (
|
||||
)
|
||||
|
||||
from game import Game
|
||||
from game.server.settings import ServerSettings
|
||||
from qt_ui.models import GameModel
|
||||
from .model import MapModel
|
||||
|
||||
@@ -61,6 +62,12 @@ class QLiberationMap(QWebEngineView):
|
||||
url = QUrl.fromLocalFile(
|
||||
str(Path("resources/ui/map/canvas.html").resolve())
|
||||
)
|
||||
server_settings = ServerSettings.get()
|
||||
host = server_settings.server_bind_address
|
||||
if host.startswith("::"):
|
||||
host = f"[{host}]"
|
||||
port = server_settings.server_port
|
||||
url.setQuery(f"server={host}:{port}")
|
||||
self.page.load(url)
|
||||
self.setPage(self.page)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user