Class: TeamFortress
- Inherits:
-
Object
- Object
- TeamFortress
- Defined in:
- lib/servers/team_fortress.rb
Overview
A module to produce resources for a Team Fortress 2 server
Instance Attribute Summary collapse
-
#app_id ⇒ Object
readonly
Returns the value of attribute app_id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize ⇒ TeamFortress
constructor
A new instance of TeamFortress.
- #launch(install_path, map = "ctf_2fort", players = 24) ⇒ Object
- #post_install(install_path) ⇒ Object
Constructor Details
#initialize ⇒ TeamFortress
Returns a new instance of TeamFortress.
4 5 6 7 |
# File 'lib/servers/team_fortress.rb', line 4 def initialize @name = "tf2" @app_id = "232250" end |
Instance Attribute Details
#app_id ⇒ Object (readonly)
Returns the value of attribute app_id.
3 4 5 |
# File 'lib/servers/team_fortress.rb', line 3 def app_id @app_id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/servers/team_fortress.rb', line 3 def name @name end |
Instance Method Details
#launch(install_path, map = "ctf_2fort", players = 24) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/servers/team_fortress.rb', line 9 def launch(install_path, map = "ctf_2fort", players = 24) "cd #{install_path} && #{install_path}/srcds_run \ -console \ -game tf \ +sv_pure 1 \ +map #{map} \ +maxplayers #{players} \ -condebug & \ /usr/bin/tail -f #{install_path}/tf/console.log" end |
#post_install(install_path) ⇒ Object
21 22 23 |
# File 'lib/servers/team_fortress.rb', line 21 def post_install(install_path) system("touch #{install_path}/tf/console.log") end |