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
You can run other game servers Docker containers using the `custom` server module option. See [Custom game](#custom-game).
62
+
You can run other game servers Docker containers using the `custom` server module option. See [Custom game](#custom-game) and custom game [example](#examples).
61
63
62
64
## Strategy
63
65
@@ -264,7 +266,7 @@ Other "Common values" are also required but are the same between servers or/and
264
266
265
267
#### Examples
266
268
267
-
For a full example, check the [`servers.tf`](servers.tf) and [`regions.tf`](regions.tf) files themselves.
269
+
For a full example, check the [`servers.tf`](servers.tf) and [`regions.tf`](regions.tf) files themselves. See [ryshe/terraria](https://hub.docker.com/r/ryshe/terraria/).
268
270
269
271
<details>
270
272
@@ -382,6 +384,37 @@ EOT
382
384
383
385
<summary>Custom game</summary>
384
386
387
+
Creating a TShock Terraria server using the `custom` game option.
388
+
See [ryshe/terraria](https://hub.docker.com/r/ryshe/terraria/).
@@ -473,14 +506,16 @@ Daily snapshots of the data volume are taken via Data Lifecycle Manager. However
473
506
474
507
See also [Restoring a backup](#restoring-a-backup)
475
508
476
-
### Protecting your server from the internet
509
+
### Game specific post-setup
477
510
478
-
Since you're running a public server, techinically **anyone on the internet** can join your server and do anything (grief, cheat, troll, etc).
511
+
Since you're running a public server, techinically **anyone on the internet** can join your server and do anything (grief, cheat, crash the server, etc).
479
512
This is most likely not desirable and you might want to do game-specific configuration
480
-
to limit the server for you and your friends. (one of the purposes of this project)
513
+
to limit the server for you and your friends.
481
514
482
515
These are done by SSH-ing into your instance and then running commands or modifying some game server configuration files. (See also [SSH](#ssh))
483
516
517
+
You'll also want to do this to load an existing save / world, depending on the game.
518
+
484
519
15. Please **check the "post-setup" section on each games' [Game-specific notes](#game-specific-notes)** for things you may want to do.
485
520
486
521
Check also [Useful info and commands](#useful-info-and-commands).
@@ -502,7 +537,7 @@ You can do that by op-ing yourself by creating an whitelist on the Minecraft ser
502
537
503
538
1. Connect to your running server instance using SSH (See [SSH](#ssh))
504
539
2. Attach your terminal to the Minecraft server terminal by running `docker attach minecraft-mc-1`
505
-
3. Run `whitelist <player name>` to whitelist someone. You could also give yourself admin using `op <your player name>` to run more commands from within your game chat.
540
+
3. Run `whitelist add <player name>` to whitelist someone. You could also give yourself admin using `op <your player name>` to run more commands from within your game chat.
506
541
507
542
If you're running an offline server, you could also consider setup an auth plugin such as [AuthMeReloaded](https://www.spigotmc.org/resources/authmereloaded.6269/) (Spigot).
508
543
@@ -535,6 +570,22 @@ Finally, save around 600MiB-1GiB for the JVM / Off-heap memory. Examples:
535
570
536
571
</details>
537
572
573
+
<details>
574
+
<summary>Terraria</summary>
575
+
576
+
### Terraria post-setup
577
+
578
+
You should set up a server password so only you and your friends can join the server.
579
+
580
+
1. Connect to your running server instance using SSH (See [SSH](#ssh))
581
+
2. Edit the file at `/srv/terraria/config.json`
582
+
3. Set a password in the `Settings.ServerPassword` field
583
+
4. Restart the server by running `docker compose restart terraria-terraria-1` or by restarting the whole instance.
584
+
585
+
See also TShock [Config Settings](https://tshock.readme.io/docs/config-settings) and [Setting Up Your Server](https://tshock.readme.io/docs/setting-up-your-server).
586
+
587
+
</details>
588
+
538
589
### Regions
539
590
540
591
Sometimes you want to change the AWS region you server is located at, due to latency and/or price. By default this project
@@ -612,6 +663,7 @@ To help choose a instance type different from the defaults, check out:
612
663
- Grouping "Cost" by "Daily" can facilitate visualize how much (the instance alone) would cost for 24h of gameplay.
-[Geekbench Browser](https://browser.geekbench.com/search?utf8=✓&q=amazon+ec2) (CPU single-core and multi-core performance benchmarks)
615
667
616
668
If you choose a burstable instance types (`t4g`, `t3a`, `t3` and `t2`), check ["Things to keep in mind"](#things-to-keep-in-mind) in Cost breakdown
617
669
@@ -639,21 +691,28 @@ by using the `custom` value in the `game` variable.
639
691
640
692
The game server must meet the following criteria:
641
693
642
-
- It can run on Linux
643
-
- It is containerized using Docker (for example, using [steamcmd](https://hub.docker.com/r/steamcmd/steamcmd) image as base)
644
-
- It can handle rare sudden shutdowns (due to the nature of Spot instances)
645
-
- This means it is able to shut down gracefully or/and auto-save if needed, also if requested via Discord slash command.
646
-
- The "main port" of the game server, the one players stay connected to, uses TCP (for auto-shutdown to work properly)
694
+
- It can run on Linux 64-bits
695
+
- It is containerized using Docker (for example, based on [CM2.Network steamcmd](https://cm2.network) or [steamcmd/steamcmd](https://hub.docker.com/r/steamcmd/steamcmd))
696
+
- The container can be run on `x86_64` or `arm64` architectures
697
+
- It can handle rare sudden shutdowns
698
+
- This is due to the nature of Spot instances or if someone requests it via Discord slash commands
699
+
- This means it should be able to shut down gracefully and preferrably auto-save periodically
700
+
- It makes sense for this project:
701
+
- This project allows part of the friend group to play on the server, without
702
+
requiring the host player who has the save file to be online at all play sessions.
703
+
Examples are Multiplayer "Open World Survival Craft" / Sandbox games.
704
+
- Some games though, can only be played or only make sense to play when the all players are together.
647
705
648
-
To define a custom game server:
706
+
To define a custom game server (see also custom game [example](#examples)):
649
707
650
708
1. Copy and paste a new server module usage in the [`servers.tf`](servers.tf) file.
651
709
2. Set common server-specific values such as `id`, `az`, `hostname` and other DDNS config.
652
710
3. Set `game` to `custom` and define an alphanumeric `custom_game_name` (e.g `CustomGame`).
653
711
4. Set the game's networking using `main_port` and add `sg_ingress_rules` as needed.
654
712
5. Set the game's available storage using `data_volume_size` and backup frequency and retation using the `data_volume_snapshot_*` variables.
655
713
- If your volume is too big and/or the game data changes too much between snapshots (e.g big save files are compressed each time), consider lowering snapshot retention. Check AWS pricing calculator.
656
-
6. Configure the Docker Compose file which will be used within the instance by setting up the `compose_*` variables.
714
+
6. Configure the Docker Compose file which will be used within the instance by setting up at least the `compose_services` variable.
715
+
- Create a service with the name `main`
657
716
- Networking: Define the container `ports` to match `main_port` and `sg_ingress_rules`.
658
717
- Storage: Define a volume matching `server_data_path`, which is based from lowercase value of `custom_game_name`
659
718
(e.g `/srv/customgame`, See [server/main.tf](server/main.tf)).
@@ -667,6 +726,8 @@ To define a custom game server:
667
726
668
727
### SSH
669
728
729
+
You most likely will want to SSH into your instance at least once to maybe upload an existing save / world or to modify server configuration.
730
+
670
731
I recommend using some UI application to help navigate and manage files via SSH like [VS Code Remote Explorer](https://marketplace.visualstudio.com/items?itemName=ms-vscode.remote-explorer).
671
732
672
733
SSH into your instance using the `ec2-user` user. Example:
0 commit comments