Skip to content

Commit 70e22ef

Browse files
committed
CHANGES:
- GreenieBoard: FunkMan can be disabled per server now
1 parent 96a1d8a commit 70e22ef

File tree

7 files changed

+33
-21
lines changed

7 files changed

+33
-21
lines changed

core/utils/validators.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,11 @@ def any_of(value, rule_obj, path):
124124
pass
125125
else:
126126
msg = []
127-
new_path = []
127+
new_path = set()
128128
for error in errors:
129-
new_path.append(re.findall(r"Path: '([^']*)'\.", error.msg)[0])
129+
path_part = re.findall(r"Path: '([^']*)'\.", error.msg)
130+
if path_part:
131+
new_path.add(path_part[0])
130132
msg.append(re.sub(r"Path: '[^']*'\.", "", error.msg).strip())
131133
raise SchemaError(msg='\n'.join(msg), path='\n'.join([f"{path}{p}" for p in new_path]))
132134
rule_obj.enum = None

plugins/greenieboard/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,22 @@ DEFAULT:
100100
OWO: 2
101101
WO: 1
102102
C: 0
103-
credits: true # People should get credits for their landings (see CreditSystem)
103+
credits: true # People should get credits for their landings (see CreditSystem)
104104
Moose.AIRBOSS:
105-
basedir: airboss # Trapsheets will be stored in Saved Games\<instance>\airboss
106-
FunkMan: # if you want to use the FunkMan integration
105+
basedir: airboss # Trapsheets will be stored in Saved Games\<instance>\airboss
106+
FunkMan: # if you want to use the FunkMan integration
107107
IMAGEPATH: ../FunkMan/funkpics/
108108
install: ../FunkMan
109-
DCS.release_server: # our server uses Moose.AIRBOSS
110-
num_rows: 5 # Overwrite the number of rows to display (default: 10)
109+
DCS.release_server: # our server uses Moose.AIRBOSS
110+
num_rows: 5 # Overwrite the number of rows to display (default: 10)
111111
Moose.AIRBOSS:
112-
basedir: airboss # overwrite the default in here, if you like
112+
basedir: airboss # overwrite the default in here, if you like
113113
grades: AIRBOSS-{carrier}_LSOGrades.csv
114114
trapsheets: '*AIRBOSS-{carrier}_Trapsheet-{name}_{unit_type}*.csv'
115-
persistent_board: true # if true, a persistent board will be uploaded into persistent_channel
116-
persistent_channel: 123456789 # Optional: in which channel to post the board (default: status channel)
115+
FunkMan:
116+
enabled: false # We need to disable FunkMan, if we want SC or Moose.AIRBOSS instead
117+
persistent_board: true # if true, a persistent board will be uploaded into persistent_channel
118+
persistent_channel: 123456789 # Optional: in which channel to post the board (default: status channel)
117119
squadrons:
118120
- name: 'My Fancy Squadron 1' # Optional: display boards for these squadrons
119121
channel: 1234567890 # Optional: channel ID (default, persistent_channel above)

plugins/greenieboard/listener.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import string
77
import sys
88

9-
from core import EventListener, Server, Player, Channel, Side, Plugin, PersistentReport, event, get_translation, utils
9+
from core import EventListener, Server, Player, Channel, Side, PersistentReport, event, get_translation, utils
1010
from matplotlib import pyplot as plt
1111
from pathlib import Path
1212
from plugins.creditsystem.player import CreditPlayer
@@ -222,7 +222,7 @@ async def onMissionEvent(self, server: Server, data: dict) -> None:
222222
return
223223
config = self.plugin.get_config(server)
224224
# ignore SC / Moose.AIRBOSS events, if FunkMan is enabled
225-
if 'FunkMan' in config:
225+
if 'FunkMan' in config and config['FunkMan'].get('enabled', True):
226226
return
227227
player: Player = server.get_player(name=data['initiator']['name']) if 'name' in data['initiator'] else None
228228
if player:

plugins/greenieboard/schemas/greenieboard_schema.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ schema;element_schema:
6767
basedir: {type: str, nullable: false, range: {min: 1}}
6868
grades: {type: str, nullable: false, range: {min: 1}}
6969
trapsheets: {type: str, nullable: false, range: {min: 1}}
70+
FunkMan:
71+
type: map
72+
nullable: false
73+
mapping:
74+
enabled: {type: bool, nullable: false}
7075

7176
type: map
7277
func: check_main_structure

plugins/voting/schemas/mission_schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ schema;mission_schema:
99
- type: str
1010
nullable: false
1111
unique: true
12-
range: {min: 1}
12+
range: {min: 1}

plugins/voting/schemas/preset_schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ schema;preset_schema:
44
mapping:
55
choices:
66
type: seq
7-
nullable: false
7+
nullable: true
88
sequence:
99
- type: str
1010
nullable: false

samples/plugins/greenieboard.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,22 @@ DEFAULT:
1515
OWO: 2
1616
WO: 1
1717
C: 0
18+
credits: true # People should get credits for their landings (see CreditSystem)
1819
Moose.AIRBOSS:
19-
basedir: airboss # Trapsheets will be stored in Saved Games\<instance>\airboss
20-
FunkMan: # if you want to use the FunkMan integration
20+
basedir: airboss # Trapsheets will be stored in Saved Games\<instance>\airboss
21+
FunkMan: # if you want to use the FunkMan integration
2122
IMAGEPATH: ../FunkMan/funkpics/
2223
install: ../FunkMan
23-
DCS.release_server: # our server uses Moose.AIRBOSS
24-
num_rows: 5 # Overwrite the number of rows to display (default: 10)
24+
DCS.release_server: # our server uses Moose.AIRBOSS
25+
num_rows: 5 # Overwrite the number of rows to display (default: 10)
2526
Moose.AIRBOSS:
26-
basedir: airboss # overwrite the default in here, if you like
27+
basedir: airboss # overwrite the default in here, if you like
2728
grades: AIRBOSS-{carrier}_LSOGrades.csv
2829
trapsheets: '*AIRBOSS-{carrier}_Trapsheet-{name}_{unit_type}*.csv'
29-
persistent_board: true # if true, a persistent board will be uploaded into persistent_channel
30-
persistent_channel: 123456789 # Optional: in which channel to post the board (default: status channel)
30+
FunkMan:
31+
enabled: false # We need to disable FunkMan, if we want SC or Moose.AIRBOSS instead
32+
persistent_board: true # if true, a persistent board will be uploaded into persistent_channel
33+
persistent_channel: 123456789 # Optional: in which channel to post the board (default: status channel)
3134
squadrons:
3235
- name: 'My Fancy Squadron 1' # Optional: display boards for these squadrons
3336
channel: 1234567890 # Optional: channel ID (default, persistent_channel above)

0 commit comments

Comments
 (0)