Skip to content

Commit 7a98a09

Browse files
committed
Reactions and warning messages added
1 parent 58725ca commit 7a98a09

File tree

6 files changed

+44
-23
lines changed

6 files changed

+44
-23
lines changed

core/data/impl/serverimpl.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ async def shutdown(self, force: bool = False) -> None:
697697
if await self.is_running():
698698
if not force:
699699
await self.do_shutdown()
700-
# wait 30/60s for the process to terminate
700+
# wait 30 / 60s for the process to terminate
701701
for i in range(1, 60 if self.node.locals.get('slow_system', False) else 30):
702702
if not self.process or not self.process.is_running():
703703
break
@@ -723,7 +723,7 @@ async def _terminate(self) -> None:
723723
if not self.process or not self.process.is_running():
724724
return
725725
self.process.terminate()
726-
# wait 30/60s for the process to terminate
726+
# wait 30 / 60s for the process to terminate
727727
for i in range(1, 60 if self.node.locals.get('slow_system', False) else 30):
728728
if not self.process or not self.process.is_running():
729729
return
@@ -1036,14 +1036,24 @@ async def loadMission(self, mission: int | str, modify_mission: bool | None = Tr
10361036
except ValueError:
10371037
return False
10381038
else:
1039+
timeout = 300 if self.node.locals.get('slow_system', False) else 180
10391040
try:
10401041
idx = mission_list.index(filename) + 1
10411042
if idx == start_index:
1042-
rc = await self.send_to_dcs_sync({"command": "startMission", "filename": filename})
1043+
rc = await self.send_to_dcs_sync({
1044+
"command": "startMission",
1045+
"filename": filename
1046+
}, timeout=timeout)
10431047
else:
1044-
rc = await self.send_to_dcs_sync({"command": "startMission", "id": idx})
1048+
rc = await self.send_to_dcs_sync({
1049+
"command": "startMission",
1050+
"id": idx
1051+
}, timeout=timeout)
10451052
except ValueError:
1046-
rc = await self.send_to_dcs_sync({"command": "startMission", "filename": filename})
1053+
rc = await self.send_to_dcs_sync({
1054+
"command": "startMission",
1055+
"filename": filename
1056+
}, timeout=timeout)
10471057
# We could not load the mission
10481058
result = rc['result'] if isinstance(rc['result'], bool) else (rc['result'] == 0)
10491059
if not result:

core/data/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def set_status(self, status: Status | str):
125125
else:
126126
new_status = status
127127
if new_status != self._status:
128-
self.log.debug(f"{self.name}: {self._status.name} => {new_status.name}")
128+
#self.log.debug(f"{self.name}: {self._status.name} => {new_status.name}")
129129
self.last_seen = datetime.now(timezone.utc)
130130
self._status = new_status
131131
self.status_change.set()

plugins/mission/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ DEFAULT:
6767
You can configure the behaviour of the mission plugin with an optional config/plugins/mission.yaml:
6868
```yaml
6969
DEFAULT:
70+
messages:
71+
ban_username: Inappropriate username.
72+
ban_evasion: Trying to evade a ban with a 2nd account.
7073
event_filter: # do NOT report these events (default: [])
7174
- connect
7275
- disconnect

plugins/mission/commands.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2280,15 +2280,24 @@ async def on_interaction(self, interaction: discord.Interaction):
22802280
})
22812281
# noinspection PyUnresolvedReferences
22822282
await interaction.response.edit_message(view=None)
2283+
await interaction.message.add_reaction('✅')
22832284
elif custom_id.startswith('ban_'):
2285+
config = self.get_config()
22842286
if custom_id.startswith('ban_profanity_'):
22852287
ucid = custom_id[len('ban_profanity_'):]
2286-
await self.bus.ban(ucid, interaction.user.display_name, _("Inappropriate nickname"))
2288+
await self.bus.ban(
2289+
ucid, interaction.user.display_name,
2290+
config.get('messages', {}).get('ban_username', 'Inappropriate username.')
2291+
)
22872292
elif custom_id.startswith('ban_evade_'):
22882293
ucid = custom_id[len('ban_evade_'):]
2289-
await self.bus.ban(ucid, interaction.user.display_name, _("Trying to evade a ban with a 2nd account."))
2294+
await self.bus.ban(
2295+
ucid, interaction.user.display_name,
2296+
config.get('messages', {}).get('ban_evasion', 'Trying to evade a ban with a 2nd account.')
2297+
)
22902298
# noinspection PyUnresolvedReferences
22912299
await interaction.response.edit_message(view=None)
2300+
await interaction.message.add_reaction('🚫')
22922301
elif custom_id == 'cancel':
22932302
# noinspection PyUnresolvedReferences
22942303
await interaction.response.edit_message(view=None)

requirements.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ discord.py==2.6.4
2727
eyeD3==0.9.9
2828

2929
# FastAPI: A modern, fast (high-performance), web framework for building APIs with Python 3.6+ based on standard Python type hints
30-
fastapi==0.121.3
30+
fastapi==0.122.1
3131

3232
# FuzzyWuzzy: Python library that uses Levenshtein Distance to calculate the differences between strings
3333
fuzzywuzzy==0.18.0
@@ -54,7 +54,7 @@ mgrs>=1.5.0 ; python_version < "3.13"
5454
minidump==0.0.24; sys_platform == 'win32'
5555

5656
# NumPy: Package for scientific computing with Python
57-
numpy==2.3.4 ; python_version >= "3.11"
57+
numpy==2.3.5 ; python_version >= "3.11"
5858
numpy==2.2.6 ; python_version < "3.11"
5959

6060
# Openpyxl: Python library to read/write Excel 2010 xlsx/xlsm/xltx/xltm files
@@ -73,10 +73,10 @@ pid==3.0.4
7373
pip-tools==7.5.2
7474

7575
# Psycopg: PostgreSQL database adapter for Python
76-
psycopg[binary]==3.2.12
76+
psycopg[binary]==3.2.13
7777

7878
# Psycopg Pool: PostgreSQL database adapter pool for Python
79-
psycopg-pool==3.2.7
79+
psycopg-pool==3.2.8
8080

8181
# PSUtil: Cross-platform library to access system details and process utilities
8282
psutil==7.1.3
@@ -113,7 +113,7 @@ ruamel-yaml-clib==0.2.15
113113
seaborn==0.13.2
114114

115115
# SQL parser, to allow multiline SQLs
116-
sqlparse==0.5.3
116+
sqlparse==0.5.4
117117

118118
# TimetoneFinder: Find the right timezones for a given coordinate
119119
tzfpy[tzdata]==1.1.0

requirements.txt

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ aiohttp==3.13.2
1010
aiosignal==1.4.0
1111
annotated-doc==0.0.4
1212
annotated-types==0.7.0
13-
anyio==4.11.0
13+
anyio==4.12.0
1414
astral==3.2
1515
async-timeout==5.0.1
1616
attrs==25.4.0
@@ -29,11 +29,11 @@ deprecation==2.1.0
2929
discord-py==2.6.4
3030
docopt==0.6.2
3131
et-xmlfile==2.0.0
32-
exceptiongroup==1.3.0
32+
exceptiongroup==1.3.1
3333
eyed3==0.9.9
34-
fastapi==0.121.3
34+
fastapi==0.122.1
3535
filetype==1.2.0
36-
fonttools==4.60.1
36+
fonttools==4.61.0
3737
frozenlist==1.8.0
3838
fuzzywuzzy==0.18.0
3939
gitdb==4.0.12
@@ -64,10 +64,10 @@ pillow==12.0.0
6464
pip-tools==7.5.2
6565
propcache==0.4.1
6666
psutil==7.1.3
67-
psycopg==3.2.12
68-
psycopg-binary==3.2.12
69-
psycopg-pool==3.2.7
70-
pydantic==2.12.4
67+
psycopg==3.2.13
68+
psycopg-binary==3.2.13
69+
psycopg-pool==3.2.8
70+
pydantic==2.12.5
7171
pydantic-core==2.41.5
7272
pygments==2.19.2
7373
pykwalify==1.8.0
@@ -89,8 +89,7 @@ ruamel-yaml-clib==0.2.15
8989
seaborn==0.13.2
9090
six==1.17.0
9191
smmap==5.0.2
92-
sniffio==1.3.1
93-
sqlparse==0.5.3
92+
sqlparse==0.5.4
9493
starlette==0.50.0
9594
tomli==2.3.0 ; python_version < "3.11"
9695
tomli-w==1.2.0

0 commit comments

Comments
 (0)