titanfall 0.0.0 → 0.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb78785671729431d9aaf9c54b65e0186da7cbe3
4
- data.tar.gz: a49e2a51679f0e212b631d635001c1e856411f3b
3
+ metadata.gz: 319401f081a4feef20dc2d13ab15fc8ea172b423
4
+ data.tar.gz: 49a94318eaebf03fc0368564211d3761988b4bc7
5
5
  SHA512:
6
- metadata.gz: 5c3bab31f1044202d0864e26b69aeb997a2955594b2b1c8fd76954c7d765268262964b9f89db7d9a55fa39d3cd75bb81581bc2679b33040bf6a97e407a17fdd0
7
- data.tar.gz: c1bba7c957184a8d5a382141100a4638efc47a1244845ebee41e70d60967781d828c155eed71f7af406682a239c84f93dbe3ec46181091dd3f353cece9a1933d
6
+ metadata.gz: 9f570fc0f53775684d37dfce724e6c39bf99aea64fd75e2faad3387486ee0bb89657ebdc103166b35254302ed982f12fa115ba9e05b0b2f133598c7790e154ec
7
+ data.tar.gz: f01f2d9d795f72e8dbd38da4c984db823f3f0995ea2b0293755c14d11eb6c706fbf199667dd94bd01dee5413d7c7a8e2b379687db62aabbb90f170c2f6ee9094
data/.gitignore ADDED
@@ -0,0 +1,7 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ tmp
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --order random
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ titanfall
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-2.0.0-p247
data/README.md CHANGED
@@ -1,4 +1,49 @@
1
- titanfall
2
- =========
1
+ # Titanfall Ruby Gem
3
2
 
4
- titanfall ruby gem
3
+ [Titanfall](http://www.titanfall.com/) PC ([Origin](https://www.origin.com)) Ruby Gem - Version 0.0.1
4
+
5
+ This gem is not endorsed, certified or otherwise approved in any way by Respawn Entertainment or any of its affiliates.
6
+
7
+ ## Get started in 3, 2, 1 … Mark!
8
+
9
+ From the command line
10
+
11
+ `gem install titanfall`
12
+
13
+ In your ruby file
14
+
15
+ require 'titanfall
16
+ t = Titanfall.new
17
+
18
+ Note: If your local save files are not located at `C:\Users\[YOUR_WIN_USERNAME]\Documents\Respawn`, you will need to pass the path during initialization
19
+
20
+ require 'titanfall
21
+ t = Titanfall.new "C:\Storage\Other\Path\to\Respawn"
22
+
23
+ ## Instance Methods
24
+
25
+ #### `bindings`
26
+ Get key bindings
27
+
28
+ t.bindings['1'] #=> "weaponSelectPrimary0"
29
+ t.bindings['2'] #=> "weaponSelectPrimary1"
30
+ t.bindings['3'] #=> "weaponSelectOrdnance"
31
+
32
+ #### `profile`
33
+ Get profile configs
34
+
35
+ t.profile['training_hasEverFinished'] #=> "1"
36
+
37
+ #### `settings`
38
+ Get setting configs
39
+
40
+ t.settings['m_sensitivity'] #=> "5"
41
+
42
+ #### `videoconfig`
43
+ Get video configs
44
+
45
+ t.videoconfig['setting.cl_fovScale'] #=> "1.0"
46
+
47
+ ## License
48
+
49
+ Titanfall Ruby Gem is released under the [MIT License](http://www.opensource.org/licenses/MIT).
@@ -0,0 +1,15 @@
1
+ module Base
2
+ attr_accessor :path
3
+
4
+ def initialize(override_path = nil)
5
+ @path = override_path || "C:\\Users\\#{username}\\Documents\\Respawn"
6
+ end
7
+
8
+ private
9
+
10
+ def username
11
+ ENV['username']
12
+ end
13
+
14
+ end
15
+
@@ -0,0 +1,26 @@
1
+ module Profile
2
+
3
+ def profile
4
+ profile_hash
5
+ end
6
+
7
+ private
8
+
9
+ def profile_hash
10
+ profile_cfg_file.split("\n").inject({}) do |hash, item|
11
+ item.tr!('"', '')
12
+ key, value = item.split(' ')
13
+ hash[key] = value
14
+ hash
15
+ end
16
+ end
17
+
18
+ def profile_cfg_file
19
+ File.open(profile_cfg_file_path, 'r').read
20
+ end
21
+
22
+ def profile_cfg_file_path
23
+ "#{path}\\TitanfallBeta\\profile\\profile.cfg"
24
+ end
25
+
26
+ end
@@ -0,0 +1,49 @@
1
+ module Settings
2
+
3
+ def bindings
4
+ bindings_hash
5
+ end
6
+
7
+ def settings
8
+ settings_hash
9
+ end
10
+
11
+ private
12
+
13
+ def bindings_hash
14
+ bind_rows.map { |x| x[5..-1] }.inject({}) do |hash, item|
15
+ key, value = item.split(' ', 2)
16
+ hash[key.tr!('"', '')] = value.tr!('"', '')
17
+ hash
18
+ end
19
+ end
20
+
21
+ def settings_hash
22
+ other_settings_rows.inject({}) do |hash, item|
23
+ key, value = item.split(' ')
24
+ hash[key] = value.tr!('"', '')
25
+ hash
26
+ end
27
+ end
28
+
29
+ def bind_rows
30
+ settings_collection.select { |row| row.start_with?('bind') }
31
+ end
32
+
33
+ def other_settings_rows
34
+ settings_collection.select { |row| !row.start_with?('bind') }
35
+ end
36
+
37
+ def settings_collection
38
+ settings_cfg_file.split("\n")
39
+ end
40
+
41
+ def settings_cfg_file
42
+ File.open(settings_cfg_file_path, 'r').read
43
+ end
44
+
45
+ def settings_cfg_file_path
46
+ "#{path}\\TitanfallBeta\\local\\settings.cfg"
47
+ end
48
+
49
+ end
@@ -0,0 +1,3 @@
1
+ module Version
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,29 @@
1
+ module VideoConfig
2
+
3
+ def videoconfig
4
+ videoconfig_hash
5
+ end
6
+
7
+ private
8
+
9
+ def videoconfig_hash
10
+ truncated_videoconfig.inject({}) do |hash, item|
11
+ key, value = item.split(' ')
12
+ hash[key.tr!('"', '')] = value.tr!('"', '')
13
+ hash
14
+ end
15
+ end
16
+
17
+ def truncated_videoconfig
18
+ videoconfig_txt_file.split("\n")[2..-2]
19
+ end
20
+
21
+ def videoconfig_txt_file
22
+ File.open(videoconfig_txt_file_path, 'r').read
23
+ end
24
+
25
+ def videoconfig_txt_file_path
26
+ "#{path}\\TitanfallBeta\\local\\videoconfig.txt"
27
+ end
28
+
29
+ end
data/lib/titanfall.rb ADDED
@@ -0,0 +1,13 @@
1
+ require 'titanfall/version'
2
+ require 'titanfall/base'
3
+ require 'titanfall/profile'
4
+ require 'titanfall/videoconfig'
5
+ require 'titanfall/settings'
6
+
7
+ class Titanfall
8
+ include Version
9
+ include Base
10
+ include Profile
11
+ include VideoConfig
12
+ include Settings
13
+ end
@@ -0,0 +1,85 @@
1
+ bind "1" "weaponSelectPrimary0"
2
+ bind "2" "weaponSelectPrimary1"
3
+ bind "3" "weaponSelectOrdnance"
4
+ bind "4" "+scriptcommand4"
5
+ bind "a" "+moveleft"
6
+ bind "c" "+melee"
7
+ bind "d" "+moveright"
8
+ bind "e" "+use"
9
+ bind "f" "+offhand1"
10
+ bind "g" "+weaponPickup"
11
+ bind "q" "+offhand2"
12
+ bind "r" "+reload"
13
+ bind "s" "+back"
14
+ bind "t" "say"
15
+ bind "v" "+ability 1"
16
+ bind "w" "+forward"
17
+ bind "x" "+scriptCommand1"
18
+ bind "y" "say_team"
19
+ bind "z" "+pushtotalk"
20
+ bind "`" "toggleconsole"
21
+ bind "SPACE" "+ability 3"
22
+ bind "TAB" "+showscores"
23
+ bind "ESCAPE" "ingamemenu_activate"
24
+ bind "PAUSE" "pause"
25
+ bind "SHIFT" "+speed"
26
+ bind "CTRL" "+toggle_duck"
27
+ bind "F10" "jpeg"
28
+ bind "MOUSE1" "+attack"
29
+ bind "MOUSE2" "+zoom"
30
+ bind "MOUSE3" "+offhand2"
31
+ bind "MWHEELUP" "+weaponCycle"
32
+ bind "MWHEELDOWN" "+weaponCycle"
33
+ bind "A_BUTTON" "+ability 3"
34
+ bind "B_BUTTON" "+toggle_duck"
35
+ bind "X_BUTTON" "+useandreload"
36
+ bind "Y_BUTTON" "+weaponpickupandcycle"
37
+ bind "L_SHOULDER" "+offhand2"
38
+ bind "R_SHOULDER" "+offhand1"
39
+ bind "BACK" "+showscores"
40
+ bind "START" "ingamemenu_activate"
41
+ bind "STICK1" "+speed"
42
+ bind "STICK2" "+melee"
43
+ bind "UP" "+scriptcommand1"
44
+ bind "DOWN" "+ability 1"
45
+ bind "LEFT" "weaponselectordnance"
46
+ bind "L_TRIGGER" "+zoom"
47
+ bind "R_TRIGGER" "+attack"
48
+ anim_showPoseParamErrors "0"
49
+ cc_lang ""
50
+ cc_linger_time "1.0"
51
+ cc_predisplay_time "0.25"
52
+ cl_allowupload "1"
53
+ cl_ignore_vpk_assocation "0"
54
+ cl_minimal_rtt_shadows "1"
55
+ cl_showhelp "1"
56
+ cl_showpluginmessages "1"
57
+ cl_support_vpk_assocation "0"
58
+ cl_thirdperson "0"
59
+ dlight_default_falloff "0.3"
60
+ func_break_max_pieces "15"
61
+ lookspring "0"
62
+ lookstrafe "0"
63
+ m_acceleration "0"
64
+ m_sensitivity "5"
65
+ mat_spewalloc "0"
66
+ mat_texture_list_content_path ""
67
+ name "xtaxta"
68
+ password ""
69
+ r_drawmodelstatsoverlaymax "1.5"
70
+ r_drawmodelstatsoverlaymin "0.1"
71
+ sound_num_speakers "2"
72
+ sound_volume_voice "1"
73
+ sv_forcepreload "0"
74
+ sv_noclipspeed "5"
75
+ sv_specaccelerate "5"
76
+ sv_specnoclip "1"
77
+ sv_specspeed "3"
78
+ sv_voiceenable "1"
79
+ voice_forcemicrecord "1"
80
+ voice_mixer_boost "0"
81
+ voice_mixer_mute "0"
82
+ voice_mixer_volume "1.0"
83
+ voice_modenable "1"
84
+ voice_scale "1"
85
+ voice_vox "1"
@@ -0,0 +1,31 @@
1
+ "VideoConfig"
2
+ {
3
+ "setting.cl_fovScale" "1.0"
4
+ "setting.cl_gib_allow" "1"
5
+ "setting.cl_particle_fallback_base" "3"
6
+ "setting.cl_particle_fallback_multiplier" "2"
7
+ "setting.cl_ragdoll_maxcount" "8"
8
+ "setting.cl_ragdoll_self_collision" "1"
9
+ "setting.csm_enabled" "0"
10
+ "setting.csm_quality_level" "0"
11
+ "setting.dlight_enable" "0"
12
+ "setting.mat_antialias_mode" "0"
13
+ "setting.mat_depthfeather_enable" "0"
14
+ "setting.mat_forceaniso" "1"
15
+ "setting.mat_mip_linear" "0"
16
+ "setting.mat_monitorgamma" "2.2"
17
+ "setting.mat_monitorgamma_tv_enabled" "0"
18
+ "setting.mat_picmip" "2"
19
+ "setting.mat_triplebuffered" "0"
20
+ "setting.mat_vsync" "1"
21
+ "setting.particle_cpu_level" "0"
22
+ "setting.r_createmodeldecals" "1"
23
+ "setting.r_decals" "2048"
24
+ "setting.r_lod_switch_scale" "0.600000"
25
+ "setting.shadow_enable" "0"
26
+ "setting.defaultres" "1280"
27
+ "setting.defaultresheight" "720"
28
+ "setting.fullscreen" "1"
29
+ "setting.nowindowborder" "0"
30
+ "setting.configversion" "2"
31
+ }
@@ -0,0 +1,20 @@
1
+ aimassist_lookSensitivity "1"
2
+ autosprint "0"
3
+ cl_safearea "0"
4
+ closecaption "0"
5
+ eula_version_accepted "0"
6
+ gamepad_button_layout "0"
7
+ gamepad_buttons_are_southpaw "0"
8
+ gamepad_stick_layout "0"
9
+ intro_viewed "0"
10
+ joy_deadzone_look_disabled "0"
11
+ joy_inverty "0"
12
+ joy_rumble "1"
13
+ localClientPlayerCachedLevel "14"
14
+ m_invert_pitch "0"
15
+ sound_musicReduced "0"
16
+ sound_volume "1"
17
+ sound_volume_music "1"
18
+ training_hasEverBeenStarted "1"
19
+ training_hasEverFinished "1"
20
+ training_resumeChoice "-2"
@@ -0,0 +1,11 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+ require 'titanfall'
4
+
5
+ RSpec.configure do |config|
6
+ # Run specs in random order to surface order dependencies. If you find an
7
+ # order dependency and want to debug it, you can fix the order by providing
8
+ # the seed, which is printed after each run.
9
+ # --seed 1234
10
+ config.order = 'random'
11
+ end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe Base do
4
+
5
+ context "Respawn folder path" do
6
+ it "resolves the default path" do
7
+ allow_any_instance_of(Titanfall).to receive(:username).and_return("Xta")
8
+
9
+ t = Titanfall.new
10
+ expect(t.path).to eql "C:\\Users\\Xta\\Documents\\Respawn"
11
+ end
12
+
13
+ it "accepts a file path argument to set the proper path" do
14
+ t = Titanfall.new "C:\\Users\\Other\\Library\\Documents\\Respawn"
15
+ expect(t.path).to eql "C:\\Users\\Other\\Library\\Documents\\Respawn"
16
+ end
17
+ end
18
+
19
+ end
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+
3
+ describe Profile do
4
+
5
+ context "profile configuration" do
6
+
7
+ it "returns profile configurations" do
8
+ test_profile_cfg_path = "#{File.dirname(__FILE__)}/../fixtures/Respawn/TitanfallBeta/profile/profile.cfg"
9
+ allow_any_instance_of(Titanfall).to receive(:profile_cfg_file_path).and_return(test_profile_cfg_path)
10
+
11
+ t = Titanfall.new
12
+ expect(t.profile['training_hasEverFinished']).to eql "1"
13
+ end
14
+ end
15
+
16
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe Settings do
4
+
5
+ context "settings configuration" do
6
+ let(:t) { Titanfall.new }
7
+
8
+ before :each do
9
+ test_settings_cfg_path = "#{File.dirname(__FILE__)}/../fixtures/Respawn/TitanfallBeta/local/settings.cfg"
10
+ allow_any_instance_of(Titanfall).to receive(:settings_cfg_file_path).and_return(test_settings_cfg_path)
11
+ end
12
+
13
+ it "returns settings key bindings" do
14
+ expect(t.bindings["SPACE"]).to eql "+ability 3"
15
+ end
16
+
17
+ it "returns settings configurations" do
18
+ expect(t.settings['m_sensitivity']).to eql "5"
19
+ expect(t.settings['password']). to eql ""
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ describe Titanfall::VERSION do
4
+
5
+ it "returns correct version" do
6
+ expect(Titanfall::VERSION).to eql "0.0.1"
7
+ end
8
+
9
+ end
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+
3
+ describe VideoConfig do
4
+
5
+ context "video configuration" do
6
+
7
+ it "returns video configurations" do
8
+ test_videoconfig_path = "#{File.dirname(__FILE__)}/../fixtures/Respawn/TitanfallBeta/local/videoconfig.txt"
9
+ allow_any_instance_of(Titanfall).to receive(:videoconfig_txt_file_path).and_return(test_videoconfig_path)
10
+
11
+ t = Titanfall.new
12
+ expect(t.videoconfig['setting.cl_fovScale']).to eql "1.0"
13
+ end
14
+ end
15
+
16
+ end
data/titanfall.gemspec ADDED
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'titanfall/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'titanfall'
8
+ spec.version = Version::VERSION
9
+ spec.date = '2014-02-15'
10
+ spec.authors = ['Rex Feng']
11
+ spec.email = ['rexfeng@gmail.com']
12
+ spec.description = 'titanfall helper gem'
13
+ spec.summary = 'titanfall gem'
14
+ spec.homepage = 'https://github.com/xta/titanfall'
15
+ spec.license = 'MIT'
16
+
17
+ spec.files = `git ls-files`.split($/)
18
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
+ spec.require_paths = ['lib']
21
+
22
+ spec.add_development_dependency 'bundler'
23
+ spec.add_development_dependency 'rake'
24
+ spec.add_development_dependency 'rspec'
25
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: titanfall
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rex Feng
@@ -52,14 +52,34 @@ dependencies:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description: titanfall gem
55
+ description: titanfall helper gem
56
56
  email:
57
57
  - rexfeng@gmail.com
58
58
  executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - .gitignore
63
+ - .rspec
64
+ - .ruby-gemset
65
+ - .ruby-version
62
66
  - README.md
67
+ - lib/titanfall.rb
68
+ - lib/titanfall/base.rb
69
+ - lib/titanfall/profile.rb
70
+ - lib/titanfall/settings.rb
71
+ - lib/titanfall/version.rb
72
+ - lib/titanfall/videoconfig.rb
73
+ - spec/fixtures/Respawn/TitanfallBeta/local/settings.cfg
74
+ - spec/fixtures/Respawn/TitanfallBeta/local/videoconfig.txt
75
+ - spec/fixtures/Respawn/TitanfallBeta/profile/profile.cfg
76
+ - spec/spec_helper.rb
77
+ - spec/unit/base_spec.rb
78
+ - spec/unit/profile_spec.rb
79
+ - spec/unit/settings_spec.rb
80
+ - spec/unit/version_spec.rb
81
+ - spec/unit/videoconfig_spec.rb
82
+ - titanfall.gemspec
63
83
  homepage: https://github.com/xta/titanfall
64
84
  licenses:
65
85
  - MIT
@@ -84,4 +104,13 @@ rubygems_version: 2.1.10
84
104
  signing_key:
85
105
  specification_version: 4
86
106
  summary: titanfall gem
87
- test_files: []
107
+ test_files:
108
+ - spec/fixtures/Respawn/TitanfallBeta/local/settings.cfg
109
+ - spec/fixtures/Respawn/TitanfallBeta/local/videoconfig.txt
110
+ - spec/fixtures/Respawn/TitanfallBeta/profile/profile.cfg
111
+ - spec/spec_helper.rb
112
+ - spec/unit/base_spec.rb
113
+ - spec/unit/profile_spec.rb
114
+ - spec/unit/settings_spec.rb
115
+ - spec/unit/version_spec.rb
116
+ - spec/unit/videoconfig_spec.rb