Sha256: 6da49fbfc521e24f3654e73cace6ba92c8c9f47056da271255cf62ffaddab664

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

module OMCL
  def self.launchMC(name, path)
    unless $authed
      RG::Log.crash "Did not authenticate!"
    end
    dat = YAML.load_file "#{path}/conf.yml"
    libs = Dir[path+"/libraries/**/*.*"]
    libs = libs.join ":"
    libs = libs + ":#{path}/bin/#{name}.jar"

    p dat

    min_mem = (dat["min_mem"] or "768M")
    max_mem = (dat["max_mem"] or "1G")
    main_class = (dat["mainclass"] or "net.minecraft.client.main.Main")

    opts = (dat["java_options"] or "")

    java_opts = <<-DATA
-server
-d32
-Xms#{min_mem}
-Xmx#{max_mem}
-Djava.library.path=#{path}/bin/natives/
-cp #{libs}
#{main_class}
#{opts}
DATA
    java_opts = java_opts.gsub(/\n/, " ")

    RG::Log.write "Starting..."

    cmd = "java #{java_opts} --username #{$username} --version #{name} --gameDir #{path} --assetsDir #{path}/assets --assetIndex #{dat["assets"].squish} --uuid #{$uid} --accessToken #{$access_token} --userType legacy --versionType #{dat["type"]} --nativeLauncherVersion 307"
    RG::Log.write "Launch command: " + cmd
    exec cmd
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omcl-0.0.0.1 lib/omcl/launch.rb