servers: infer CaptureSync from MaxPlayers

This commit is contained in:
Robin C. Ladiges
2024-10-18 02:59:06 +02:00
parent be34ab77f4
commit 2f63d2030e
3 changed files with 11 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ module.exports = {
'operator-linebreak' : [ 'error', 'before' ],
'no-console' : [ (process.env.NODE_ENV === 'production' ? 'error' : 'warn'), { allow: [ 'warn', 'error' ] } ],
'no-debugger' : process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'yoda' : 'off',
},
extends: [

View File

@@ -97,6 +97,13 @@ export default class SmooServerState extends Vue {
const playersColor = (players ? (players.length !== this.MaxPlayers ? 'text-success' : 'text-danger') : 'text-info')
const playersValue = (players ? players.length : '') + (players && this.MaxPlayers != null ? ' / ' : '') + (this.MaxPlayers ?? '')
settings.push(playersKey + ': <span class="' + playersColor + '">' + playersValue + '</span>')
if (8 < (this.MaxPlayers ?? 0)) {
settings.push('CaptureSync: <span class="text-danger">false</span>')
} else if (7 < (this.MaxPlayers ?? 0)) {
settings.push('CaptureSync: <span class="text-warning">not in Wooded</span>')
} else if (0 < (this.MaxPlayers ?? 0)) {
settings.push('CaptureSync: <span class="text-success">true</span>')
}
}
bool('ScenarioMerge', 'Scenario', 'MergeEnabled')
bool('ShineSync', 'Shines', 'Enabled')

View File

@@ -12,6 +12,9 @@
<b-tooltip target="servers-state" triggers="hover">
Settings:
<ul>
<li>
<code>CaptureSync</code>: if captures are visible to other players.
</li>
<li>
<code>ScenarioMerge</code>: the server forces all players to be in the same scenario to see each other.
</li>