Skip to content

Commit d63b970

Browse files
committed
CHANGES:
- SRS: added instructor mode
1 parent bcbcff3 commit d63b970

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

extensions/srs/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ MyNode:
4444
show_passwords: false # Optional: do not show red/blue passwords in the status embed (default: true)
4545
radio_effect_override: false # optional: disable radio effects (LOS, etc)
4646
global_lobby_frequencies: 248.22,30.0,127.0 # optional: set your music channels in here
47-
autostart: true # optional: if you manage your SRS servers outside of DCSSB, set that to false
48-
always_on: true # start SRS as soon as possible (includes no_shutdown: true)
49-
no_shutdown: true # optional: don't shut down SRS on mission end (default: false)
47+
autostart: true # optional: if you manage your SRS servers outside of DCSSB, set that to false
48+
always_on: true # start SRS as soon as possible (includes no_shutdown: true)
49+
no_shutdown: true # optional: don't shut down SRS on mission end (default: false)
5050
srs_nudge_message: 'Optional nudge message' # optional: overwrite the existing nudge message
51-
51+
instructor_mode: true # enable instructor mode (as of SRS 2.3.3.0)
5252
```
5353
You need one entry in the node section, pointing to your DCS-SRS installation and one in every instance section,
5454
where you want to use SRS with. The next time the bot starts your server, it will auto-launch SRS and take care of it.

extensions/srs/extension.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ async def prepare(self) -> bool:
178178
self.config['spectators_audio_disabled'] = False
179179
dirty |= self._maybe_update_config('General Settings', 'SPECTATORS_AUDIO_DISABLED',
180180
'spectators_audio_disabled')
181+
# new instructor mode
182+
if parse(self.version) >= parse('2.3.3.0'):
183+
dirty |= self._maybe_update_config('General Settings', 'ALLOW_INSTRUCTOR_MODE',
184+
'instructor_mode')
181185
# disable effects (for music plugin)
182186
# TODO: better alignment with the music plugin!
183187
dirty |= self._maybe_update_config('General Settings', 'RADIO_EFFECT_OVERRIDE',
@@ -272,11 +276,16 @@ def run_subprocess():
272276
info = None
273277
out = subprocess.PIPE if self.config.get('debug', False) else subprocess.DEVNULL
274278
err = subprocess.PIPE if self.config.get('debug', False) else subprocess.STDOUT
275-
276-
proc = subprocess.Popen([
277-
self.get_exe_path(),
278-
f"-cfg={self.get_config_path()}"
279-
], startupinfo=info, stdout=out, stderr=err, close_fds=True)
279+
# we want the SRS logfile in our normal logs folder
280+
cwd = os.path.join(self.server.instance.home, 'Logs')
281+
282+
proc = subprocess.Popen(
283+
[
284+
self.get_exe_path(),
285+
f"-cfg={self.get_config_path()}"
286+
],
287+
cwd=cwd, startupinfo=info, stdout=out, stderr=err, close_fds=True
288+
)
280289

281290
if self.config.get('debug', False):
282291
Thread(target=log_output, args=(proc.stdout,logging.DEBUG), daemon=True).start()

extensions/srs/schemas/srs_schema.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ schema;node_srs_schema:
3535
always_on: {type: bool, nullable: false}
3636
radio_effect_override: {type: bool, nullable: false}
3737
global_lobby_frequencies: {type: str, nullable: false, range: {min: 1}}
38+
instructor_mode: {type: bool, nullable: false}
3839

3940
schema;instance_srs_schema:
4041
type: map

0 commit comments

Comments
 (0)