Skip to content

Instantly share code, notes, and snippets.

@tomkins
Last active February 18, 2024 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomkins/b9aeeeef725eb1b002b2999b34303009 to your computer and use it in GitHub Desktop.
Save tomkins/b9aeeeef725eb1b002b2999b34303009 to your computer and use it in GitHub Desktop.
Legions cloud-config.yml
#cloud-config
users:
- default
- name: legions
system: true
homedir: /opt/legions
shell: /usr/sbin/nologin
write_files:
- path: /etc/systemd/system/legions@.service
content: |
[Unit]
Description=Legions Server (%I)
[Service]
ExecStart=/opt/legions/live/Legions.linux --mod-list=modList_Server.txt --server-config=%i.cs
User=legions
WorkingDirectory=/opt/legions/live
Restart=always
[Install]
WantedBy=multi-user.target
- path: /etc/legions/cloud.cs
content: |
/**
* Admin Levels: Every superior admin level can do everything
* the level below can do.
*
* Level 1: Pug Admin
* - Can set the server password so people can join pugs
* - Can force players to switch teams
* - Can change maps
* Level 2: Moderator
* - Can kick and ban people
* Level 3: Admin
* - Slash commands
* Level 4: Super Admin
* - Has Eval access
* Level 5: Owner
* - God
*/
// This level can't do anything
$Host::Admins::Name[0] = "Player";
$Host::Admins::Level[0] = 0;
$Host::Admins::Password[0] = "";
$Host::Admins::Name[1] = "PUG";
$Host::Admins::Level[1] = 1;
$Host::Admins::Password[1] = "change_me1";
$Host::Admins::Name[2] = "Moderator";
$Host::Admins::Level[2] = 2;
$Host::Admins::Password[2] = "change_me2";
$Host::Admins::Name[3] = "Admin";
$Host::Admins::Level[3] = 3;
$Host::Admins::Password[3] = "change_me3";
$Host::Admins::Name[4] = "Super Admin";
$Host::Admins::Level[4] = 4;
$Host::Admins::Password[4] = "change_me4";
$Host::Admins::Name[5] = "Owner";
$Host::Admins::Level[5] = 5;
$Host::Admins::Password[5] = "change_me5";
$Host::AutoResetPassword = false;
$Host::AutoResetPasswordTime = 600000; // Default of 600,000 milliseconds = 10 minutes after all players have left
$Host::DefaultPassword = "";
// A lot of these will be overrided by Server::create() in server.cs
// if the options are selected using the GUI page gameMenu.cs
$Host::Name = "A Dedicated Server";
$Host::Port = 28001;
$Host::GameType = "CTF";
$Host::MaxPlayers = 32;
$Host::MaxObservers = 10;
$Host::Type = "Multiplayer Web";
$Host::MinimumStartPlayers = 1;
$Host::BroadcastMaster = true;
new scriptGroup(MapRotationGroup)
{
};
addMapToRotation("Fallout.mis","CTF",14,40);
addMapToRotation("Frostbyte.mis","CTF",0,22);
addMapToRotation("WinterMelt.mis","CTF",0,20);
addMapToRotation("ZenithCauldron.mis","CTF",14,40);
addMapToRotation("SandBox.mis","TDM",0,30);
bootcmd:
- "dpkg --add-architecture i386"
packages:
- libstdc++6:i386
- parallel
runcmd:
- "mkdir /opt/legions"
- "rsync -a --stats --progress --compress --chown=legions:legions rsync.legionsoverdrive.com::live /opt/legions/live"
- "find /etc/legions -type f | parallel install --owner=legions --group=legions {} /opt/legions/live/server/preferences/{/}"
- "find /etc/legions -type f | parallel systemctl enable legions@{/.}.service"
- "find /etc/legions -type f | parallel --delay 10 systemctl start legions@{/.}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment