Class: SevenDays
- Inherits:
-
Object
- Object
- SevenDays
- Defined in:
- lib/servers/seven_days.rb
Overview
Create a 7 Days to Die 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 ⇒ SevenDays
constructor
A new instance of SevenDays.
- #launch(install_path) ⇒ Object
- #post_install(install_path) ⇒ Object
Constructor Details
#initialize ⇒ SevenDays
Returns a new instance of SevenDays.
6 7 8 9 |
# File 'lib/servers/seven_days.rb', line 6 def initialize @name = "sdtd" @app_id = "294420" end |
Instance Attribute Details
#app_id ⇒ Object (readonly)
Returns the value of attribute app_id.
5 6 7 |
# File 'lib/servers/seven_days.rb', line 5 def app_id @app_id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/servers/seven_days.rb', line 5 def name @name end |
Instance Method Details
#launch(install_path) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/servers/seven_days.rb', line 11 def launch(install_path) "cd #{install_path} && export LD_LIBRARY_PATH=. && #{install_path}/7DaysToDieServer.x86_64 \ -logfile #{install_path}/server.log \ -quit \ -batchmode \ -nographics \ -dedicated \ -configfile=#{install_path}/serverconfig.xml & \ /usr/bin/tail -f #{install_path}/server.log" end |
#post_install(install_path) ⇒ Object
24 25 26 |
# File 'lib/servers/seven_days.rb', line 24 def post_install(install_path) system("touch #{install_path}/server.log") # TODO: This won't scale end |