Skip to content

Commit 7fd6f3a

Browse files
committed
Merge branch 'development'
2 parents 9c68866 + 39df023 commit 7fd6f3a

File tree

221 files changed

+3864
-1883
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+3864
-1883
lines changed

COALITIONS.md

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,40 @@
11
# Coalitions
22
If you want to support Blue and Red coalitions in your Discord and your DCS servers, you're good to go!
3-
As there are major changes to how the bot behaves with COALITIONS enabled, I decided to have a separate documentation
4-
about it. It has redundant information in it, which is usually a bad idea, but I thought it might be easier for you
5-
guys to have everything in one place.<br/>
6-
Coalitions are implemented by slot blocking, but can use the feature of coalition passwords in DCS, too.
3+
As there are major changes to how the bot behaves with COALITIONS enabled, I decided to have separate documentation
4+
about it.
5+
6+
> [!IMPORTANT]
7+
> As of version 2.9.21, DCS World has its own coalition locking feature.
8+
> DCSServerBot uses this system from now on, with some personal add-ons.
9+
> This has a slight impact on how the locking mechanism works.
10+
>
11+
> In the past, DCSServerBot had a cooldown lock, meaning you could not join the opposite coalition for a specific time
12+
> after you **left** your coalition.<br>
13+
> DCS now has a time-based lock.
14+
> You cannot switch coalitions at all in-between of a specific lock time.
15+
> If you are able to switch coalitions, though, you can directly switch to the opposite coalition.
16+
> Keep this in mind whenever you plan the lock times.
717
818
> [!NOTE]
919
> With COALITIONS enabled, some persistent displays will not appear in your server status channels (or will be changed)
1020
> like Player information or Mission Statistics, which would render all the work useless, if you could peek in there and
11-
> see what is going on. You can still use the commands like `/player list` or `/missionstats` in your dedicated coalition
21+
> see what's going on. You can still use commands like `/player list` or `/missionstats` in your dedicated coalition
1222
> channels, but you can't see data from the opposite coalition anymore.
1323
14-
COALITION handling can be enabled in each server individually. So if you only want to enable strict red/blue
15-
handling in one server, you can do that. Every other server (and their persistent embeds) will not be affected.
24+
COALITION handling can be enabled in each server individually.
25+
If you only want to enable strict red/blue handling in one server, you can do that.
26+
Every other server (and their persistent embeds) will not be affected.
1627

1728
---
1829
## Bot Configuration
19-
There are some specific settings for coalitions that you can set in your configuration:
30+
There are some specific settings for coalitions that you can set in your configuration.
31+
Please do **not** set the coalition-specific settings in serverSettings.lua.
32+
The bot takes care of those.
2033

21-
### bot.yml
34+
### bot.yaml
2235
a) Greeting Direct Message (DM)
2336
```yaml
2437
# [...]
25-
message_ban: User has been banned on Discord.
26-
message_autodelete: 300
2738
greeting_dm: This server has a coalition system enabled. Please use .red or .blue in the in-game chat to join a coalition.
2839
# [...]
2940
```
@@ -59,20 +70,21 @@ My Fancy Server:
5970
red_events: 123459876123459876 # Optional: same as blue_events for red.
6071
# [...]
6172
coalitions:
62-
lock_time: 1 day # time in which you are not allowed to move to the opposite coalition after leaving one coalition
73+
lock_time: 1 day # time in which you are not allowed to change coalitions.
6374
allow_players_pool: false # don't allow access to the players pool
6475
blue_role: 1234123412341234 # Discord role for the blue coalition
6576
red_role: 43214321432143210 # Discord role for the red coalition
6677
```
6778
> [!IMPORTANT]
68-
> Make sure, that all channels for red and blue coalitions have read access **only** for this coalition and not for
79+
> Make sure that all channels for red and blue coalitions have read access **only** for this coalition and not for
6980
> @everyone or the other coalition! The CHAT-channels for red and blue are similar to the general chat channel,
7081
> but they only replicate chat messages that are being sent to that specific coalition in game.
7182
> Unfortunately, it is not possible to chat back yet, as the DCS API doesn't allow it yet.
7283
7384
## Discord Configuration
7485
The bot uses the following **internal** roles to apply specific permissions to commands.
75-
You can change the role names to the ones being used in your discord. That has to be done in the dcsserverbot.ini
86+
You can change the role names to the ones being used in your discord.
87+
That has to be done in the bot.yaml for general roles like GameMaster and for specific ones in the servers.yaml
7688
configuration file.
7789
7890
| Role | Description |
@@ -82,23 +94,21 @@ configuration file.
8294
| red_role | People with this role are members of the red coalition. See Coalitions below for details. |
8395
8496
## Discord Commands
85-
These discord commands are either exclusively for coalition handling like .join and .leave or have been amended for
86-
coalition use, which means, that the data they display is filtered to data that belongs to your coalition only.
97+
These discord commands are either exclusively for coalition handling like /reset_coalitions or have been amended for
98+
coalition use, which means that the data they display is filtered to data that belongs to your coalition only.
8799
88-
| Command | Parameter | Channel | Role | Description |
89-
|-------------------|--------------------------|---------------|------------------------|-----------------------------------------------------------------------------------------------------------|
90-
| /server password | \<password\> [coalition] | admin-channel | DCS Admin | Changes the password of a specific coalition on this server. |
91-
| /player list | | all | DCS | Lists the players currently active on the server (for your coalition only!). |
92-
| /mission briefing | | all | DCS | Shows the description / briefing of the running mission (for your coalition only!). |
93-
| /missionstats | | all | DCS | Display the current mission situation for either red or blue and the achievements in kills and captures. |
100+
| Command | Parameter | Channel | Role | Description |
101+
|-------------------|----------------------|---------------|-----------------------|----------------------------------------------------------------------------------------------------------|
102+
| /server password | password [coalition] | admin-channel | DCS Admin | Changes the password of a specific coalition on this server. |
103+
| /player list | | all | DCS | Lists the players currently active on the server (for your coalition only!). |
104+
| /mission briefing | | all | DCS | Shows the description / briefing of the running mission (for your coalition only!). |
105+
| /missionstats | | all | DCS | Display the current mission situation for either red or blue and the achievements in kills and captures. |
106+
| /reset_coalition | server player | admin-channel | DCS Admin, GameMaster | Resets the coalition cooldown for a specific user on a specific server. |
107+
| /reset_coalitions | [server] | all | DCS Admin, GameMaster | Resets all coalition cooldowns (optional: on a specific server). |
94108
95109
## In-Game Chat Commands
96110
97-
| Command | Parameter | Role | Description |
98-
|------------|----------------|------|--------------------------------|
99-
| .join | \<coalition\> | all | Join a coalition. |
100-
| .leave | | all | Leave a coalition. |
101-
| .red | | all | Join the red coalition. |
102-
| .blue | | all | Join the blue coalition. |
103-
| .coalition | | all | Shows your current coalition. |
104-
| .password | | all | Shows your coalition password. |
111+
| Command | Parameter | Role | Description |
112+
|------------|----------------|-----------|----------------------------------------------------|
113+
| -coalition | | all | Shows your current coalition (if you have joined). |
114+
| -password | | red/ blue | Shows your coalition password (if set). |

MULTINODE.md

Lines changed: 78 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ or outages.
1818

1919
If you want to run your DCSServerBot over multiple locations, you need to prepare your setup:
2020

21+
## Cluster Configuration
22+
DCSServerBot lets you configure your cluster with several parameters.
23+
```yaml
24+
MyNode: # This is the name of your first node (will be different for you, usually the hostname is used).
25+
cluster:
26+
cloud_drive: true # Is your DCSServerBot installed on a cloud drive (Google Drive, OneDrive, etc.)? Default is true.
27+
heartbeat: 60 # Heartbeat between the nodes in a cluster. Default is 30, use larger values if your nodes are not in the same network.
28+
preferred_master: true # This node will always be the master. If your database is installed on a node, make it your preferred master node.
29+
no_master: true # This node will never become a master. You cannot specify preferred_master and no_master on the same node.
30+
```
31+
2132
## Cloud-Drive Setup (default)
2233
You need to make sure that every node in your cluster is aware of the full configuration. The best way to achieve this
2334
is to have the bot or at least the bot's configuration installed on a cloud drive, like OneDrive or Google Drive.
@@ -32,22 +43,24 @@ autoupdate: true
3243
3344
b) nodes.yaml
3445
```yaml
35-
Node1: # this is the name of your first node. will be different for you
36-
cloud_drive: true # this is the default, so no need to specify it in here, just for reference
37-
heartbeat: 60 # sometimes a larger heartbeat makes the connection between the nodes more stable. I recommend using 60 here (default = 30)
38-
preferred_master: true # if your database is installed on Node1, make it your preferred master node
46+
Node1: # this is the name of your first node (will be different for you, usually the hostname is used)
3947
database:
4048
url: postgres://dcsserverbot:[email protected]:5432/dcsserverbot?sslmode=prefer # if your database is installed on Node1
49+
cluster:
50+
cloud_drive: true # this is the default, so no need to specify it in here, just for reference
51+
heartbeat: 60 # sometimes a larger heartbeat makes the connection between the nodes more stable. I recommend using 60 here if your nodes are not on the same network (default = 30)
4152
# ... anything else like extensions, instances, ... for Node1
42-
Node2: # this is the name of your second node. will be different for you
43-
heartbeat: 60 # sometimes a larger heartbeat makes the connection between the nodes more stable. I recommend using 60 here (default = 30)
53+
Node2: # this is the name of your second node (will be different for you, usually the hostname is used)
4454
database:
4555
url: postgres://dcsserverbot:[email protected]:5432/dcsserverbot?sslmode=prefer # replace xxx.xxx.xxx.xxx with the IP of Node1
56+
cluster:
57+
heartbeat: 60 # sometimes a larger heartbeat makes the connection between the nodes more stable. I recommend using 60 here if your nodes are not on the same network (default = 30)
4658
# ... anything else like extensions, instances, ... for Node2
47-
Node3: # this is the name of your third node. will be different for you
48-
heartbeat: 60 # sometimes a larger heartbeat makes the connection between the nodes more stable. I recommend using 60 here (default = 30)
59+
Node3: # this is the name of your third node (will be different for you, usually the hostname is used)
4960
database:
5061
url: postgres://dcsserverbot:[email protected]:5432/dcsserverbot?sslmode=prefer # replace xxx.xxx.xxx.xxx with the IP of Node1
62+
cluster:
63+
heartbeat: 60 # sometimes a larger heartbeat makes the connection between the nodes more stable. I recommend using 60 here if your nodes are not on the same network (default = 30)
5164
# ... anything else like extensions, instances, ... for Node3
5265
```
5366

@@ -61,17 +74,50 @@ autoupdate: true
6174
6275
b) nodes.yaml
6376
```yaml
64-
Node1: # this is the name of your first node. will be different for you
65-
cloud_drive: false # tell the bot that you are NOT installed on a cloud drive
66-
# ... same as before
67-
Node2: # this is the name of your second node. will be different for you
68-
cloud_drive: false # tell the bot that you are NOT installed on a cloud drive
69-
# ... same as before
70-
Node3: # this is the name of your third node. will be different for you
71-
cloud_drive: false # tell the bot that you are NOT installed on a cloud drive
72-
# ... same as before
77+
Node1: # this is the name of your first node (will be different for you, usually the hostname is used)
78+
cluster:
79+
cloud_drive: false # tell the bot that it is NOT installed on a cloud drive
80+
# ... same as above
81+
Node2: # this is the name of your second node (will be different for you, usually the hostname is used)
82+
cluster:
83+
cloud_drive: false # tell the bot that it is NOT installed on a cloud drive
84+
# ... same as above
85+
Node3: # this is the name of your third node (will be different for you, usually the hostname is used)
86+
cluster:
87+
cloud_drive: false # tell the bot that it is NOT installed on a cloud drive
88+
# ... same as above
7389
```
7490

91+
## Master Handling
92+
The DCSServerBot cluster consists of one master node and multiple agent nodes.
93+
The master holds some services that are only allowed to run once in your cluster, like the Discord bot.
94+
As this is usually linked to heavy database access, it is recommended to have the master node on the same server that
95+
holds the database.
96+
Installations which use a central database on a dedicated server or even a cloud database do not need to consider this.
97+
98+
If you want to bind your master to a specific node, you set this node as `preferred_master: true`.
99+
In this case and unless this node does not run, it will be the master node.
100+
101+
In rare cases it might be that you do not want a node to become master at all.
102+
This might be true if you run a node on a remotely hosted server like with Fox3 (or any other hoster), you can't
103+
sync the configuration, or any other reason that might prevent you from having this node as master.
104+
In this case you can configure `no_master: true` for this node.
105+
106+
```yaml
107+
Node1: # this is the name of your first node (will be different for you, usually the hostname is used)
108+
cluster:
109+
preferred_master: true # Optional: if your database is installed on Node1, make it your preferred master node
110+
# ... same as above
111+
Node2: # this is the name of your second node (will be different for you, usually the hostname is used)
112+
# ... same as above
113+
Node3: # this is the name of your third node (will be different for you, usually the hostname is used)
114+
cluster:
115+
no_master: true # Optional: This node will never become a master
116+
# ... same as above
117+
```
118+
> [!IMPORTANT]
119+
> If no node is available to take over the master, your cluster will not work.
120+
75121
## PostgreSQL Setup
76122
A standard PostgreSQL installation does not allow remote access to the database. To change it, follow [this guide](https://blog.devart.com/configure-postgresql-to-allow-remote-connection.html).
77123
In addition, you would need to allow external access to your database by forwarding the database port (default: 5432)
@@ -129,6 +175,21 @@ that are named DCS.release_server on any of your nodes. This can be what you wan
129175
I would always recommend creating the node-specific version (ex: "Multi-Node-Config" above) to avoid confusion. That's
130176
what the bot will create during a default installation also.
131177
178+
## Running a node for another group
179+
To run a node where you want to run servers for another group, you can use the `restrict_commands` setting in your
180+
nodes.yaml. This will disable commands that can affect the integrity of your PC, like `/node shell`.
181+
This is recommended for nodes that are run by you, but Admin accesses are happening without your control.
182+
```yaml
183+
Node1: # node where I have full control
184+
# ...
185+
Node2: # node where I do not have full control
186+
restrict_commands: true
187+
# ...
188+
```
189+
190+
> [!NOTE]
191+
> Unless you specify `restrict_owner: true` in nodes.yaml, the owner of the bot can still run restricted commands.
192+
132193
### Moving a Server from one Node / Instance to another
133194
Each server is loosely coupled to an instance on a node. You can migrate a server to another instance though, by using
134195
the `/server migrate` command.

0 commit comments

Comments
 (0)