You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,14 @@
4
4
5
5
The command-line tool for quick, simple deployment and management of Linux dedicated game servers.
6
6
7
-
* User docs: [docs.linuxgsm.com](https://docs.linuxgsm.com)
8
-
* Dev Docs: [dev-docs.linuxgsm.com](https://dev-docs.linuxgsm.com)
7
+
- User docs: [docs.linuxgsm.com](https://docs.linuxgsm.com)
8
+
- Dev Docs: [dev-docs.linuxgsm.com](https://dev-docs.linuxgsm.com)
9
9
10
10
## Introduction
11
11
12
12
Welcome to the LinuxGSM developer documentation that covers how to get started, tooling, workflow, best practices, and code standards.
13
13
14
-
If you want to contribute to LinuxGSM and need assistance feel free to pop on the LinuxGSM [Discord](https://linuxgsm.com/discord)and have a chat with some of the contributors.
14
+
If you want to contribute to LinuxGSM and need assistance feel free to pop on the LinuxGSM [Discord](https://linuxgsm.com/discord)and have a chat with some of the contributors.
Copy file name to clipboardExpand all lines: code-standards/style-guide.md
+32-32Lines changed: 32 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ Here are some of them.
5
5
6
6
## Variables
7
7
8
-
####Naming variables
8
+
### Naming variables
9
9
10
10
Variables should be made of lowercase letters only and should be descriptive enough to understand its purpose (even if the variable is longer that preferred).
11
11
@@ -25,7 +25,7 @@ Variable should always be called between brackets and double quotes to prevent g
25
25
echo"${var}"
26
26
```
27
27
28
-
###Directories
28
+
## Directories
29
29
30
30
Directories are called using LinuxGSM directories variables, or relative to those. Common directory variables can be found in `linuxgsm.sh` and `_default.cfg` .
31
31
@@ -42,15 +42,15 @@ find "${executabledir}/bin"
42
42
43
43
If statements should look like the following
44
44
45
-
```
45
+
```bash
46
46
if [ "${shortname}"=="csgo" ];then
47
47
# content
48
48
fi
49
49
```
50
50
51
51
if statements with multiple options like so
52
52
53
-
```
53
+
```bash
54
54
if [ "${shortname}"=="csgo" ]||[ "${shortname}"=="css" ];then
55
55
# content
56
56
fi
@@ -60,9 +60,9 @@ fi
60
60
61
61
### Syntax
62
62
63
-
* The `if [ statement ]; then` should be a one-liner operation.
64
-
* Signs comparators like `==`, `lt`, `lt` etc. are preferred to `-eq`, `-le`, `-lt`.
65
-
* Anything within an if statement must be tabulated one step deeper.
63
+
- The `if [ statement ]; then` should be a one-liner operation.
64
+
- Signs comparators like `==`, `lt`, `lt` etc. are preferred to `-eq`, `-le`, `-lt`.
65
+
- Anything within an if statement must be tabulated one step deeper.
66
66
67
67
Example:
68
68
@@ -74,7 +74,7 @@ fi
74
74
75
75
### Expression Standards
76
76
77
-
Common if expressions LinuxGSM uses. More expressions [here](http://tldp.org/LDP/Bash-Beginners-Guide/html/sect\_07\_01.html).
77
+
Common if expressions LinuxGSM uses. More expressions [here](http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html).
* Anything within a loop must be tabulated one step deeper.
130
+
- Loops should be a one liner statement.
131
+
- Anything within a loop must be tabulated one step deeper.
132
132
133
133
```bash
134
134
while [ "${var}"<"${cap}" ];do
@@ -139,17 +139,17 @@ done
139
139
140
140
## Comments
141
141
142
-
As English is not always the native language of a developer, comments should use a formal writing style and be straight to the point. If unsure this short formal writing [guide](http://www2.ivcc.edu/rambo/tip\_formal\_writing\_voice.htm) will help.
142
+
As English is not always the native language of a developer, comments should use a formal writing style and be straight to the point. If unsure this short formal writing [guide](http://www2.ivcc.edu/rambo/tip_formal_writing_voice.htm) will help.
143
143
144
144
```bash
145
145
# Using comments help developers understand complex code, but should be used sparingly.
146
146
```
147
147
148
148
## Functions
149
149
150
-
* Function should be named starting with `fn_` and using lowercase letters only.
151
-
* Any recurrent task should be put into a function.
152
-
* Anything within a function must be tabulated one step deeper.
150
+
- Function should be named starting with `fn_` and using lowercase letters only.
151
+
- Any recurrent task should be put into a function.
152
+
- Anything within a function must be tabulated one step deeper.
153
153
154
154
Example:
155
155
@@ -161,56 +161,56 @@ fn_myfunction(){
161
161
162
162
## Messages
163
163
164
-
*Messages should be given using core\_messages.sh forms
165
-
* Additional information messages are given in the form of `echo -e " * Message here"`
164
+
-Messages should be given using core_messages.sh forms
165
+
- Additional information messages are given in the form of `echo -e " * Message here"`
166
166
167
167
## Automated Messages
168
168
169
-
Automated messages are used with any commands that are non-interactive. Examples of this include Start, Stop and Monitor. There are various different alert messages available see [Exit-Codes](broken-reference) for details.
169
+
Automated messages are used with any commands that are non-interactive. Examples of this include Start, Stop and Monitor. There are various different alert messages available see [Exit-Codes](../technical/exit-codes.md) for details.
170
170
171
171
Each automated message starts with `fn_print_dots` to show a process is happening but with no known outcome.
172
172
173
-
`fn_print_dots`
173
+
### `fn_print_dots`
174
174
175
-
```
175
+
Once an outcome of a process is known the message uses an outcome message like `fn_print_ok` or `fn_print_fail`
176
+
177
+
```text
176
178
[ .... ] Starting fctrserver:
177
179
```
178
180
179
-
Once an outcome of a process is known the message uses an outcome message like `fn_print_ok` or `fn_print_fail`
181
+
### `fn_print_ok`
180
182
181
-
fn\_print\_ok
182
-
183
-
```
183
+
```text
184
184
[ OK ] Starting fctrserver: Factorio Server
185
185
```
186
186
187
187
The option of a newline is also available by appending `_nl` for example `fn_print_ok_nl`. This will add a carriage return to the message preventing it being overwritten by the next message.
188
188
189
-
```
189
+
```text
190
190
[ OK ] Stopping fctrserver: Graceful: CTRL+c: 2: OK
191
191
[ .... ] Starting fctrserver: Factorio Server
192
192
```
193
193
194
-
####Characteristics
194
+
### Characteristics of Automated Messages
195
195
196
-
Interactive messages contain extra detail at the begining of the message that is pre-populated. Full stops must `not` be used with this type of message.
196
+
Automated messages contain extra detail at the begining of the message that is pre-populated. Full stops must `not` be used with this type of message.
197
197
198
-
###Interactive Messages
198
+
## Interactive Messages
199
199
200
200
Interactive messages are used with any commands that have interactive elements. Examples of this include Install, console and debug. There are various different alert messages available see \[\[Exit-Codes]] for details.
201
201
202
-
```
202
+
```text
203
203
Warning! If fctrserver is already running it will be stopped.
204
204
```
205
205
206
206
standard echo commands are normally used to supplement an alert or if an alert is not required. Bullet points can also be used
207
207
208
-
```
208
+
```bash
209
209
Information! Press "CTRL+b"then"d" to exit console.
210
210
Warning! Do NOT press CTRL+c to exit.
211
211
* https://docs.linuxgsm.com/commands/console
212
212
```
213
213
214
-
####Characteristics
214
+
### Characteristics of Interactive Messages
215
215
216
216
Treat interactive messages as a standard sentence. All messages must begin with a capital and end with a full stop
Copy file name to clipboardExpand all lines: getting-started/adding-a-new-game-server.md
+14-15Lines changed: 14 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -6,23 +6,23 @@ Adding a new game server is one of the most common things developers do. This gu
6
6
replace gameserver with the name of the new server e.g rustserver
7
7
{% endhint %}
8
8
9
-
###Create new \_default.cfg config file
9
+
## Create new \_default.cfg config file
10
10
11
11
Firstly create a new `_default.cfg` file in `lgsm/config-default/config-lgsm/gameserver` . An existing \_default.cfg file can be used as a template.
12
12
13
13
Update all the variables in the new `_default.cfg` file to fit the new server.
14
14
15
15
Some common variables that will need updating:
16
16
17
-
* Add `## SteamCMD Login` section only if required.
18
-
*`startparameters` are any parameters the executable requires to run the game server.
19
-
*`appid` used to download a game server from Steam. Remove if not using steam.
20
-
*`steammaster` used if the game servers are listed on the Steam master servers.
21
-
*`stopmode` defines how a server can safely exit.
22
-
*`querymode` defines the type of query monitor that can be used to check the server is responding.
23
-
* console type highlights to users if the console outputs and is interactive.
24
-
* Game Server Details `gamename` , `engine`, `glibc`.
25
-
* Various directory and config variables.
17
+
- Add `## SteamCMD Login` section only if required.
18
+
-`startparameters` are any parameters the executable requires to run the game server.
19
+
-`appid` used to download a game server from Steam. Remove if not using steam.
20
+
-`steammaster` used if the game servers are listed on the Steam master servers.
21
+
-`stopmode` defines how a server can safely exit.
22
+
-`querymode` defines the type of query monitor that can be used to check the server is responding.
23
+
- console type highlights to users if the console outputs and is interactive.
24
+
- Game Server Details `gamename` , `engine`, `glibc`.
25
+
- Various directory and config variables.
26
26
27
27
## Add the new server to serverlist.csv
28
28
@@ -32,10 +32,10 @@ Add the new server details to `serverlist.csv` as well as add any dependency req
32
32
33
33
Some game servers require alterations before they can start common examples include:
34
34
35
-
* copying library files to serverfiles
36
-
* symlinking files
37
-
* creating directories
38
-
* adding a directory to `LD_LIBRARY_PATH`
35
+
- copying library files to serverfiles
36
+
- symlinking files
37
+
- creating directories
38
+
- adding a directory to `LD_LIBRARY_PATH`
39
39
40
40
If this is required a fix module will need to be created.
41
41
@@ -71,4 +71,3 @@ Not all game servers use SteamCMD. If this is the case a custom update module wi
71
71
## Custom Commands
72
72
73
73
Some game servers may require bespoke commands to complete tasks. Examples of this include Teamspeak 3 and Unreal Tournament 2004. Take a look at the `core_getopts.sh` module for examples of how to add commands.
0 commit comments