Skip to content

Commit 2e718f3

Browse files
committed
CHANGES:
- SRS can be launched with the old GUI server again (use: gui_server: true in your nodes.yaml) - Proper error message if your bot was not invited to any discord yet.
1 parent 97889d8 commit 2e718f3

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

extensions/srs/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ MyNode:
3232
config: '{instance.home}\Config\SRS.cfg'
3333
host: 127.0.0.1
3434
port: 5002
35-
minimized: true # start SRS minimized (default: true)
35+
gui_server: true # Optional: use the SRS-Server.exe (GUI server) instead of the command line one
36+
minimized: true # Old SR-Server.exe: start SRS minimized (default: true)
3637
autoconnect: true # install the appropriate DCS-SRS-AutoConnectGameGUI.lua, default: true
3738
awacs: true # if you use LotAtc
3839
lotatc_export_port: 10712

extensions/srs/extension.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,13 @@ def get_inst_path(self) -> str:
402402

403403
def get_exe_path(self) -> str:
404404
if parse(self.version) >= parse('2.2.0.0'):
405-
os_dir = 'ServerCommandLine-Windows' if sys.platform == 'win32' else 'ServerCommandLine-Linux'
406-
self.exe_name = 'SRS-Server-Commandline.exe' if sys.platform == 'win32' else 'SRS-Server-Commandline'
407-
return os.path.join(self.get_inst_path(), os_dir, self.exe_name)
408-
#return os.path.join(self.get_inst_path(), 'Server', 'SRS-Server.exe')
405+
if self.config.get('gui_server', False):
406+
self.exe_name = 'SRS-Server.exe'
407+
return os.path.join(self.get_inst_path(), 'Server', self.exe_name)
408+
else:
409+
os_dir = 'ServerCommandLine-Windows' if sys.platform == 'win32' else 'ServerCommandLine-Linux'
410+
self.exe_name = 'SRS-Server-Commandline.exe' if sys.platform == 'win32' else 'SRS-Server-Commandline'
411+
return os.path.join(self.get_inst_path(), os_dir, self.exe_name)
409412
else:
410413
self.exe_name = 'SR-Server.exe'
411414
return os.path.join(self.get_inst_path(), self.exe_name)

extensions/srs/schemas/srs_schema.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ schema;instance_srs_schema:
2929
config: {type: str, required: true, nullable: false}
3030
host: {type: str, nullable: false, range: {min: 1}}
3131
port: {type: int, nullable: false, func: unique_port}
32+
gui_server: {type: bool, nullable: false}
3233
minimized: {type: bool, nullable: false}
3334
debug: {type: bool, nullable: false}
3435
awacs: {type: bool, nullable: false}

services/bot/dcsserverbot.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ async def register_guild_name():
196196

197197
try:
198198
await self.wait_until_ready()
199+
if not self.guilds:
200+
self.log.error("You need to invite your bot to a Discord server!")
201+
raise FatalException()
199202
asyncio.create_task(register_guild_name())
200203
if not self.synced:
201204
self.log.info(f'- Preparing Discord Bot "{self.user.name}" ...')

0 commit comments

Comments
 (0)