Module: Lich::Common::Authentication::LaunchData
- Defined in:
- documented/common/authentication/launch_data.rb
Class Method Summary collapse
-
.create_entry(char_name:, game_code:, game_name:, user_id:, password:, frontend:, custom_launch: nil, custom_launch_dir: nil) ⇒ Hash
Creates a launch entry for a character in the game.
-
.prepare(auth_data, frontend, custom_launch = nil, custom_launch_dir = nil) ⇒ Array<String>
Prepares launch data based on authentication information and frontend type.
Class Method Details
.create_entry(char_name:, game_code:, game_name:, user_id:, password:, frontend:, custom_launch: nil, custom_launch_dir: nil) ⇒ Hash
Creates a launch entry for a character in the game.
64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'documented/common/authentication/launch_data.rb', line 64 def self.create_entry(char_name:, game_code:, game_name:, user_id:, password:, frontend:, custom_launch: nil, custom_launch_dir: nil) { char_name: char_name, game_code: game_code, game_name: game_name, user_id: user_id, password: password, frontend: frontend, custom_launch: custom_launch, custom_launch_dir: custom_launch_dir } end |
.prepare(auth_data, frontend, custom_launch = nil, custom_launch_dir = nil) ⇒ Array<String>
Prepares launch data based on authentication information and frontend type.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'documented/common/authentication/launch_data.rb', line 15 def self.prepare(auth_data, frontend, custom_launch = nil, custom_launch_dir = nil) launch_data = auth_data.map { |k, v| "#{k.upcase}=#{v}" } # Modify launch data based on frontend case frontend.to_s.downcase when 'wizard' launch_data.collect! { |line| line.sub(/GAMEFILE=.+/, 'GAMEFILE=WIZARD.EXE') .sub(/GAME=.+/, 'GAME=WIZ') .sub(/FULLGAMENAME=.+/, 'FULLGAMENAME=Wizard Front End') } when 'avalon' launch_data.collect! { |line| line.sub(/GAME=.+/, 'GAME=AVALON') } when 'suks' launch_data.collect! { |line| line.sub(/GAMEFILE=.+/, 'GAMEFILE=WIZARD.EXE') .sub(/GAME=.+/, 'GAME=SUKS') } end # Add custom launch information if provided if custom_launch launch_data.push "CUSTOMLAUNCH=#{custom_launch}" launch_data.push "CUSTOMLAUNCHDIR=#{custom_launch_dir}" if custom_launch_dir end launch_data end |