Class: MojangProcessArgumentsSanitizer

Inherits:
BaseSanitizer show all
Defined in:
lib/wonko_the_sane/input/mojang_input.rb

Class Method Summary collapse

Class Method Details

.sanitize(file) ⇒ Object



200
201
202
203
204
205
206
207
208
209
210
211
212
213
# File 'lib/wonko_the_sane/input/mojang_input.rb', line 200

def self.sanitize(file)
  if file.client.extra[:processArguments]
    case file.client.extra[:processArguments]
      when 'legacy'
        file.client.minecraftArguments = ' ${auth_player_name} ${auth_session}'
      when 'username_session'
        file.client.minecraftArguments = '--username ${auth_player_name} --session ${auth_session}'
      when 'username_session_version'
        file.client.minecraftArguments = '--username ${auth_player_name} --session ${auth_session} --version ${profile_name}'
    end
    file.client.extra.delete :processArguments
  end
  file
end