launchcraft 0.0.1 → 0.0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/minecraft +4 -0
- data/lib/launchcraft/config.rb +4 -0
- data/lib/launchcraft/java.rb +1 -1
- data/lib/launchcraft/md5_file.rb +5 -0
- data/lib/launchcraft/update.rb +1 -1
- data/lib/launchcraft/version.rb +1 -1
- data/lib/launchcraft.rb +12 -1
- metadata +8 -5
- data/lib/launchcraft/lzma.rb +0 -29
data/bin/minecraft
CHANGED
@@ -77,6 +77,10 @@ OptionParser.new {|opts|
|
|
77
77
|
$pass = pass
|
78
78
|
}
|
79
79
|
|
80
|
+
opts.on('-n', '--appname APPNAME', 'Set application name (change directory)') {|appname|
|
81
|
+
LaunchCraft.appname = appname
|
82
|
+
}
|
83
|
+
|
80
84
|
opts.on_tail('-v', '--version', 'Show version') {
|
81
85
|
puts "launchcraft #{LaunchCraft::VERSION}"
|
82
86
|
exit 0
|
data/lib/launchcraft/config.rb
CHANGED
data/lib/launchcraft/java.rb
CHANGED
@@ -73,7 +73,7 @@ class LaunchCraft
|
|
73
73
|
bindir = File.join(LaunchCraft.working_dir, 'bin')
|
74
74
|
[BIN, '-Xmx1024M', '-Xms512M', '-cp', %w[jinput lwjgl lwjgl_util minecraft].map {|x|
|
75
75
|
File.join(bindir, "#{x}.jar")
|
76
|
-
}.join(':'), "-Djava.library.path=#{File.join(bindir, 'natives')}",
|
76
|
+
}.join(':'), "-Djava.library.path=#{File.join(bindir, 'natives')}", "-Dminecraft.appname=#{LaunchCraft.appname}",
|
77
77
|
'net.minecraft.client.Minecraft', user, sessid].compact
|
78
78
|
end
|
79
79
|
end
|
data/lib/launchcraft/md5_file.rb
CHANGED
@@ -26,7 +26,12 @@ class LaunchCraft
|
|
26
26
|
attr_accessor "#{OS.parse.to_s.gsub(/^macos$/, 'macosx')}_natives".to_sym
|
27
27
|
|
28
28
|
def initialize
|
29
|
+
rehash
|
30
|
+
end
|
31
|
+
|
32
|
+
def rehash
|
29
33
|
@path = File.join(LaunchCraft.working_dir, 'bin', 'md5s')
|
34
|
+
self.lwjgl = self.jinput = self.lwjgl_util = self.minecraft = self.natives = nil
|
30
35
|
parse if File.file?(@path)
|
31
36
|
end
|
32
37
|
|
data/lib/launchcraft/update.rb
CHANGED
data/lib/launchcraft/version.rb
CHANGED
data/lib/launchcraft.rb
CHANGED
@@ -21,7 +21,18 @@ require 'os'
|
|
21
21
|
require 'launchcraft/version'
|
22
22
|
|
23
23
|
class LaunchCraft
|
24
|
-
def self.
|
24
|
+
def self.appname
|
25
|
+
@appname ||= 'minecraft'
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.appname=(name)
|
29
|
+
@appname = name.to_s
|
30
|
+
Config.rehash
|
31
|
+
MD5File.rehash
|
32
|
+
@appname
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.working_dir (appname=self.appname)
|
25
36
|
res = case OS.parse
|
26
37
|
when :linux, :solaris
|
27
38
|
File.join(ENV['HOME'], ".#{appname}")
|
metadata
CHANGED
@@ -6,7 +6,8 @@ version: !ruby/object:Gem::Version
|
|
6
6
|
- 0
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
|
9
|
+
- 1
|
10
|
+
version: 0.0.1.1
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- shura
|
@@ -14,11 +15,11 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2011-09-
|
18
|
+
date: 2011-09-28 00:00:00 +02:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
|
-
name:
|
22
|
+
name: lzma-ffi
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
25
|
none: false
|
@@ -27,7 +28,10 @@ dependencies:
|
|
27
28
|
- !ruby/object:Gem::Version
|
28
29
|
segments:
|
29
30
|
- 0
|
30
|
-
|
31
|
+
- 0
|
32
|
+
- 1
|
33
|
+
- 2
|
34
|
+
version: 0.0.1.2
|
31
35
|
type: :runtime
|
32
36
|
version_requirements: *id001
|
33
37
|
- !ruby/object:Gem::Dependency
|
@@ -66,7 +70,6 @@ extra_rdoc_files: []
|
|
66
70
|
|
67
71
|
files:
|
68
72
|
- lib/launchcraft/md5_file.rb
|
69
|
-
- lib/launchcraft/lzma.rb
|
70
73
|
- lib/launchcraft/zip.rb
|
71
74
|
- lib/launchcraft/version.rb
|
72
75
|
- lib/launchcraft/java.rb
|
data/lib/launchcraft/lzma.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# Copyleft shura. [ shura1991@gmail.com ]
|
3
|
-
#
|
4
|
-
# This file is part of launchcraft.
|
5
|
-
#
|
6
|
-
# launchcraft is free software: you can redistribute it and/or modify
|
7
|
-
# it under the terms of the GNU Affero General Public License as published
|
8
|
-
# by the Free Software Foundation, either version 3 of the License, or
|
9
|
-
# (at your option) any later version.
|
10
|
-
#
|
11
|
-
# launchcraft is distributed in the hope that it will be useful,
|
12
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
-
# GNU Affero General Public License for more details.
|
15
|
-
#
|
16
|
-
# You should have received a copy of the GNU Affero General Public License
|
17
|
-
# along with launchcraft. If not, see <http://www.gnu.org/licenses/>.
|
18
|
-
#++
|
19
|
-
|
20
|
-
require 'lzma'
|
21
|
-
|
22
|
-
class LZMA
|
23
|
-
def self.extract (file, out=File.basename(file, '.lzma'))
|
24
|
-
File.open(out, 'wb') {|f|
|
25
|
-
f.write(decompress(File.read(file)))
|
26
|
-
}
|
27
|
-
out
|
28
|
-
end
|
29
|
-
end
|