Add Max Players & Revert Port Change

Egg:
- Reverted the startup command so that the game port is the primary port and QUERY_PORT is the Server Query Port. I honestly think it will be confusing either way, so it's a wash for me; but ultimately, if Ptero calls the primary port the "Game Port" in Allocation Management, it should be Satisfactory's "game" port.
- Added the capability to override the server's default max players of 4. This consists of a new variable, default config file creation during install (because the server doesn't auto-create it), and a Configuration Files replacement on boot to accommodate variable changes.
- Reverted Game Port variable to Server Query Port variable.
- Changed port rules to use the more intuitive `between` rule.

README:
- Added Zarklord as a contributor.
- Added Max Players as an Egg Capability.
- Rewrote the Server Ports section (again) to accommodate the egg change and be as clear as possible.
- Added warning about stopping the server and saves.
- Added note to Minimum RAM Requirement that large saves can also cause excessive RAM usage.
- Updated Console Commands section with newly published Wiki information.
- Updated `steamclient.so` Wiki reference link (which will probably break again soon because the Wiki is being changed almost every hour now).

Co-Authored-By: Zarklord <1622280+Zarklord@users.noreply.github.com>
This commit is contained in:
Red-Thirten 2021-10-28 16:27:30 -07:00
parent 127bea6a4d
commit 40e73bb26b
2 changed files with 42 additions and 18 deletions

View File

@ -38,6 +38,14 @@ ___
<a href="https://github.com/parkervcp/eggs/commits?author=Software-Noob" title="Codes">💻</a>
<a href="https://github.com/parkervcp/eggs/commits?author=Software-Noob" title="Contributor">💡</a>
</td>
<td align="center">
<a href="https://github.com/Zarklord">
<img src="https://avatars.githubusercontent.com/u/1622280" width="50px;" alt=""/><br /><sub><b>Zarklord</b></sub>
</a>
<br />
<a href="https://github.com/parkervcp/eggs/commits?author=Zarklord" title="Codes">💻</a>
<a href="https://github.com/parkervcp/eggs/commits?author=Zarklord" title="Contributor">💡</a>
</td>
</tr>
</table>
<!-- markdownlint-enable -->
@ -51,6 +59,7 @@ ___
### Egg Capabilities
- Configuration of the Server Query, Beacon, and Game ports.
- Configurable to automatically check for server updates on start via SteamCMD. Forcing validation is also configurable.
- *[Experimental]* Max player configuration.
- Misc. settings listed below can be configured by an admin client via the game's UI, and are currently **not** set via the Egg:
- Server Password
- Admin Password
@ -59,35 +68,41 @@ ___
- ...and possibly more as the client's UI is developed further for more configuration options.
___
### Server Ports
Default server ports are listed below, but all three ports can be changed freely. Note: The Primary/Default/"Game" Port for your server in Pterodactyl will be your Server Query port. It is recommended to distance ports of other running Satisfactory servers in Pterodactyl by increments of 100 (it is currently unknown what the minimum increment is, but an increment of +1 caused cross-server talk in testing). Also, your internal ports **must match** your external ports on your network (ie. you can't have an external port of 7778 forwarded to your 7777 internal port; they must match). **All three ports are required to be open for normal server behavior!**
- Default server ports are listed below, but all three ports can be changed freely.
- **Note:** The Primary/Default/Game Port for your server in Pterodactyl will be Satisfactory's `-Port=????` game port, even though clients will **connect with the Query port**.
- It is recommended to distance ports of other running Satisfactory servers in Pterodactyl by **increments of 100** (it is currently unknown what the minimum increment is, but an increment of +1 caused cross-server talk in testing). Also, your internal ports **must match** your external ports on your network (ie. you can't have an external port of 7778 forwarded to your 7777 internal port; they must match).
- ***All three ports are required to be open for normal server behavior!***
| Port | Default (UDP) |
|---------|---------|
| **Server Query (Primary Port in Pterodactyl)** | 15777 |
| **Game (Primary Port in Pterodactyl)** | 7777 |
| Beacon | 15000 |
| Game | 7777 |
| Server Query | 15777 |
___
### Installation Requirements/Instructions
- No major requirements, other than RAM and Disk space noted below.
- You *do not* need to own the base game to host this server.
- However, to fully "initialize" your server, a client who owns the game must log into the server to "claim" it and create a new session. The generated session will not be written to disk until the first save occurs.
- Currently, there is no way to save the session on server stop. Therefore, ensure the session is saved or the last player has disconnected (causing an auto-save) before stopping the server.
___
### Minimum RAM Requirement
This server requires a minimum of 4096 MiB of RAM to boot, but the developers recommend 6144 to 8192 MiB of RAM for 4 players.
This server requires a minimum of 4096 MiB of RAM to boot, but the developers recommend 6144 to 8192 MiB of RAM for 4 players or large save files.
___
### Minimum Disk Requirement
This server requires just under 5 GB of disk space to safely run properly. However, save files could easily surpass this amount, so 7-10 GB is recommended.
___
### Save File Location
[According to the developer](https://www.youtube.com/watch?v=Nn-1s87JJxc), save files will be able to be uploaded and downloaded by clients via their game client in the future. Until then, below is the save file location in case you would like to upload or download a save file manually (note that it is different from their wiki):
[According to the developer](https://www.youtube.com/watch?v=Nn-1s87JJxc), save files will be able to be uploaded and downloaded by clients via their game client in the future. Until then, below is the save file location in case you would like to upload or download a save file manually:
`/home/container/.config/Epic/FactoryGame/Saved/SaveGames/server`
Single-player save files can be uploaded here and are playable if desired.
___
### Console
Currently, it does not appear that commands sent through the console register with the server. The in-game client command line can be used instead (but valid commands are currently unknown at this time).
### Console Commands
As of v5.0.4, the console tab in the client server manager is the only way to execute commands. Entering commands via Pterodactyl do nothing.
[List of known commands can be found via the Wiki](https://satisfactory.fandom.com/wiki/Dedicated_servers#Commands)
___
### Errors/Warnings
The following errors or warnings you see in the console can safely be ignored:
@ -97,7 +112,7 @@ steamclient.so: cannot open shared object file: No such file or directory
[S_API] SteamAPI_Init(): Loaded '/home/container/.steam/sdk64/steamclient.so' OK. (First tried local 'steamclient.so')
LogSteamShared: Warning: Steam Dedicated Server API failed to initialize.
```
The local file of 'steamclient.so' was attempted to be loaded, but could not because it is not present, causing the warning message. However, the backup `/home/container/.steam/sdk64/steamclient.so` is loaded successfully (this is the correct behavior according to the [Wiki](https://satisfactory.fandom.com/wiki/Dedicated_servers#SteamAPI_library_error)).
The local file of 'steamclient.so' was attempted to be loaded, but could not because it is not present, causing the warning message. However, the backup `/home/container/.steam/sdk64/steamclient.so` is loaded successfully (this is the correct behavior according to the [Wiki](https://satisfactory.fandom.com/wiki/Dedicated_servers#No_Such_File_or_Directory)).
```log
Warning: failed to init SDL thread priority manager: SDL not found

View File

@ -1,5 +1,5 @@
{
"_comment": "Pterodactyl Satisfactory Egg ~ Kubi, matthewp, and Red-Thirten ~ 2021-10-26",
"_comment": "Pterodactyl Satisfactory Egg ~ Red-Thirten, Kubi, matthewp, Software-Noob, and Zarklord ~ 2021-10-28",
"meta": {
"version": "PTDL_v1",
"update_url": null
@ -12,29 +12,29 @@
"ghcr.io\/pterodactyl\/games:source"
],
"file_denylist": [],
"startup": ".\/Engine\/Binaries\/Linux\/UE4Server-Linux-Shipping FactoryGame -ServerQueryPort={{SERVER_PORT}} -Port={{GAME_PORT}} -BeaconPort={{BEACON_PORT}}",
"startup": ".\/Engine\/Binaries\/Linux\/UE4Server-Linux-Shipping FactoryGame -Port={{SERVER_PORT}} -ServerQueryPort={{QUERY_PORT}} -BeaconPort={{BEACON_PORT}}",
"config": {
"files": "{}",
"files": "{\r\n \"FactoryGame\/Saved\/Config\/LinuxServer\/Game.ini\": {\r\n \"parser\": \"file\",\r\n \"find\": {\r\n \"MaxPlayers\": \"MaxPlayers={{server.build.env.MAX_PLAYERS}}\"\r\n }\r\n }\r\n}",
"startup": "{\r\n \"done\": \"Engine Initialization\"\r\n}",
"logs": "{}",
"stop": "^CC"
},
"scripts": {
"installation": {
"script": "#!\/bin\/bash\r\n\r\n## File: Pterodactyl Satisfactory Egg - egg-satisfactory.json\r\n## Authors: ryan@kubiq.io (Kubi), matthew@pterodactyl.io (matthewp), admin@softwarenoob.com (Software-Noob) & David Wolfe (Red-Thirten)\r\n## Date: 2021\/10\/27\r\n## License: MIT License\r\n\r\n# Download and install SteamCMD\r\ncd \/tmp\r\ncurl -sSL -o steamcmd.tar.gz http:\/\/media.steampowered.com\/installer\/steamcmd_linux.tar.gz\r\nmkdir -p \/mnt\/server\/steamcmd\r\ntar -xzvf steamcmd.tar.gz -C \/mnt\/server\/steamcmd\r\ncd \/mnt\/server\/steamcmd\r\n\r\n# SteamCMD fails otherwise for some reason, even running as root.\r\n# This is changed at the end of the install process anyways.\r\nchown -R root:root \/mnt\r\nexport HOME=\/mnt\/server\r\n\r\n# Install game server using SteamCMD\r\n.\/steamcmd.sh +login anonymous +force_install_dir \/mnt\/server +app_update ${SRCDS_APPID} validate +exit\r\n\r\n# Set up 32 and 64 bit libraries\r\nmkdir -p \/mnt\/server\/.steam\/sdk{32,64}\r\ncp -v linux32\/steamclient.so \/mnt\/server\/.steam\/sdk32\/steamclient.so\r\ncp -v linux64\/steamclient.so \/mnt\/server\/.steam\/sdk64\/steamclient.so\r\n\r\n# Satisfactory setup\r\ncd \/mnt\/server\/Engine\/Binaries\/Linux\r\nif [[ ! -f UE4Server-Linux-Shipping ]]; then\r\n echo -e \"\\n\\nSteamCMD failed to install the Satisfactory Dedicated Server!\"\r\n echo -e \"\\tTry reinstalling the server again.\\n\"\r\n exit 1\r\nelse\r\n chmod +x UE4Server-Linux-Shipping\r\nfi\r\n\r\necho -e \"\\n\\nSatisfactory Dedicated Server successfully installed!\\n\"",
"script": "#!\/bin\/bash\r\n\r\n# File: Pterodactyl Satisfactory Egg - egg-satisfactory.json\r\n# Authors: Red-Thirten, Kubi, matthewp, Software-Noob, and Zarklord\r\n# Date: 2021\/10\/28\r\n# License: MIT License\r\n\r\n## Download and install SteamCMD\r\ncd \/tmp\r\ncurl -sSL -o steamcmd.tar.gz http:\/\/media.steampowered.com\/installer\/steamcmd_linux.tar.gz\r\nmkdir -p \/mnt\/server\/steamcmd\r\ntar -xzvf steamcmd.tar.gz -C \/mnt\/server\/steamcmd\r\ncd \/mnt\/server\/steamcmd\r\n\r\n# SteamCMD fails otherwise for some reason, even running as root.\r\nchown -R root:root \/mnt\r\nexport HOME=\/mnt\/server\r\n\r\n# Install game server using SteamCMD\r\n.\/steamcmd.sh +login anonymous +force_install_dir \/mnt\/server +app_update ${SRCDS_APPID} validate +exit\r\n\r\n# Set up 32 and 64 bit libraries\r\nmkdir -p \/mnt\/server\/.steam\/sdk{32,64}\r\ncp -v linux32\/steamclient.so \/mnt\/server\/.steam\/sdk32\/steamclient.so\r\ncp -v linux64\/steamclient.so \/mnt\/server\/.steam\/sdk64\/steamclient.so\r\n\r\n## Satisfactory setup\r\n# Check for successful installation and make the core binary executable.\r\ncd \/mnt\/server\/Engine\/Binaries\/Linux\r\nif [[ ! -f UE4Server-Linux-Shipping ]]; then\r\n echo -e \"\\n\\nSteamCMD failed to install the Satisfactory Dedicated Server!\"\r\n echo -e \"\\tTry reinstalling the server again.\\n\"\r\n exit 1\r\nelse\r\n chmod +x UE4Server-Linux-Shipping\r\nfi\r\n\r\n# Make Config directory and default Game.ini file (since it is not created automatically by the server)\r\nmkdir -p \/mnt\/server\/FactoryGame\/Saved\/Config\/LinuxServer\/ && cd \"$_\"\r\nif [ ! -f Game.ini ]; then\r\n echo -e \"\\nGame.ini config file missing. Creating default.\"\r\n cat > Game.ini << EOF\r\n[\/Script\/Engine.GameSession]\r\nMaxPlayers=${MAX_PLAYERS}\r\nEOF\r\nfi\r\n\r\necho -e \"\\n\\nSatisfactory Dedicated Server successfully installed!\\n\"",
"container": "ghcr.io\/pterodactyl\/installers:debian",
"entrypoint": "bash"
}
},
"variables": [
{
"name": "[REQUIRED] Game Port",
"description": "This is the port that the game client uses to connect to the game world (not the lobby). Ensure this port matches your externally forwarded port, and is distanced from other running Satisfactory servers in Pterodactyl (increments of 100 are recommended). This is also true for the Primary (Query) Port!",
"env_variable": "GAME_PORT",
"default_value": "7777",
"name": "[REQUIRED] Server Query Port",
"description": "This is the port that your clients will type in and use to connect to the lobby (not the game world). Ensure this port matches your externally forwarded port, and is distanced from other running Satisfactory servers in Pterodactyl (increments of 100 are recommended). This is also true for the Primary\/Game Port!",
"env_variable": "QUERY_PORT",
"default_value": "15777",
"user_viewable": false,
"user_editable": false,
"rules": "required|integer|min:1024|max:65536"
"rules": "required|integer|between:1024,65536"
},
{
"name": "[REQUIRED] Beacon Port",
@ -43,7 +43,7 @@
"default_value": "15000",
"user_viewable": false,
"user_editable": false,
"rules": "required|integer|min:1024|max:65536"
"rules": "required|integer|between:1024,65536"
},
{
"name": "Automatic Updates",
@ -63,6 +63,15 @@
"user_editable": true,
"rules": "string|nullable"
},
{
"name": "[Experimental] Max Players",
"description": "The server and client are currently not optimized to support more than 4 players. However, you can override this value here at your own risk of poor performance.",
"env_variable": "MAX_PLAYERS",
"default_value": "4",
"user_viewable": true,
"user_editable": true,
"rules": "required|integer|min:1"
},
{
"name": "[Advanced] Satisfactory Dedicated Server App ID",
"description": "Steam App ID used for installation and updates. Rarely needs to be changed.",