class Object

Public Instance Methods

game_hash() click to toggle source
# File lib/cli/game_hash.rb, line 9
def game_hash
  {
    "rust" => Rust.new,
    "sdtd" => SevenDays.new,
    "gmod" => GarrysMod.new,
    "tf2" => TeamFortress.new,
    "minecraft" => MinecraftSpigot.new
  }
end
install(game, path, steam_user, steam_password) click to toggle source
# File lib/cli/install.rb, line 21
def install(game, path, steam_user, steam_password)
  puts "Beginning to install dedicated server for #{game.name}. This may take a while...".blue
  system("rm -f #{"/tmp/#{game.name}.service"}")
  system("rm -f /etc/systemd/system/#{game.name}.service")
  GameTemplate.new(game)
              .install(Helpers.get_install_path(path, game.name),
                       Helpers.get_steamcmd_login(steam_user, steam_password))
  puts "Dedicated server installation for #{game.name} complete. Check the output for messages or warnings.".green
end
update(game, path, steam_user, steam_password) click to toggle source
# File lib/cli/update.rb, line 22
def update(game, path, steam_user, steam_password)
  puts "Beginning #{game.name} server update. This may take a while...".blue
  system("rm -f #{"/tmp/#{game.name}.service"}")
  system("rm -f /etc/systemd/system/#{game.name}.service")
  GameTemplate.new(game)
              .install(Helpers.get_install_path(path, game.name),
                       Helpers.get_steamcmd_login(steam_user, steam_password))
  puts "#{game.name} server update complete. Check the output for messages or warnings.".green
end