Class: SteamCodec::ACF
- Inherits:
-
Object
- Object
- SteamCodec::ACF
- Defined in:
- lib/steam_codec/ACF.rb
Defined Under Namespace
Classes: CheckGuid, InstallScripts, MountedDepots, SharedDepots, UserConfig
Instance Attribute Summary collapse
-
#AppID ⇒ Object
More about AppID => https://developer.valvesoftware.com/wiki/Steam_Application_IDs.
-
#BuildID ⇒ Object
Returns the value of attribute BuildID.
-
#BytesDownloaded ⇒ Object
Returns the value of attribute BytesDownloaded.
-
#BytesToDownload ⇒ Object
Returns the value of attribute BytesToDownload.
-
#CheckGuid ⇒ Object
readonly
Returns the value of attribute CheckGuid.
-
#FullValidateOnNextUpdate ⇒ Object
Returns the value of attribute FullValidateOnNextUpdate.
-
#InstallDir ⇒ Object
Returns the value of attribute InstallDir.
-
#InstallScripts ⇒ Object
readonly
Returns the value of attribute InstallScripts.
-
#LastOwner ⇒ Object
Returns the value of attribute LastOwner.
-
#LastUpdated ⇒ Object
Returns the value of attribute LastUpdated.
-
#MountedDepots ⇒ Object
readonly
Returns the value of attribute MountedDepots.
-
#SharedDepots ⇒ Object
readonly
Returns the value of attribute SharedDepots.
-
#SizeOnDisk ⇒ Object
Returns the value of attribute SizeOnDisk.
-
#StateFlags ⇒ Object
Returns the value of attribute StateFlags.
-
#Universe ⇒ Object
Returns the value of attribute Universe.
-
#UpdateResult ⇒ Object
Returns the value of attribute UpdateResult.
-
#UserConfig ⇒ Object
readonly
Returns the value of attribute UserConfig.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(appState = nil) ⇒ ACF
constructor
A new instance of ACF.
- #load(appState) ⇒ Object
Constructor Details
#initialize(appState = nil) ⇒ ACF
Returns a new instance of ACF.
34 35 36 |
# File 'lib/steam_codec/ACF.rb', line 34 def initialize(appState = nil) load(appState || KeyValues.new) end |
Instance Attribute Details
#AppID ⇒ Object
More about AppID => https://developer.valvesoftware.com/wiki/Steam_Application_IDs
5 6 7 |
# File 'lib/steam_codec/ACF.rb', line 5 def AppID @AppID end |
#BuildID ⇒ Object
Returns the value of attribute BuildID.
12 13 14 |
# File 'lib/steam_codec/ACF.rb', line 12 def BuildID @BuildID end |
#BytesDownloaded ⇒ Object
Returns the value of attribute BytesDownloaded.
15 16 17 |
# File 'lib/steam_codec/ACF.rb', line 15 def BytesDownloaded @BytesDownloaded end |
#BytesToDownload ⇒ Object
Returns the value of attribute BytesToDownload.
14 15 16 |
# File 'lib/steam_codec/ACF.rb', line 14 def BytesToDownload @BytesToDownload end |
#CheckGuid ⇒ Object (readonly)
Returns the value of attribute CheckGuid.
20 21 22 |
# File 'lib/steam_codec/ACF.rb', line 20 def CheckGuid @CheckGuid end |
#FullValidateOnNextUpdate ⇒ Object
Returns the value of attribute FullValidateOnNextUpdate.
16 17 18 |
# File 'lib/steam_codec/ACF.rb', line 16 def FullValidateOnNextUpdate @FullValidateOnNextUpdate end |
#InstallDir ⇒ Object
Returns the value of attribute InstallDir.
8 9 10 |
# File 'lib/steam_codec/ACF.rb', line 8 def InstallDir @InstallDir end |
#InstallScripts ⇒ Object (readonly)
Returns the value of attribute InstallScripts.
21 22 23 |
# File 'lib/steam_codec/ACF.rb', line 21 def InstallScripts @InstallScripts end |
#LastOwner ⇒ Object
Returns the value of attribute LastOwner.
13 14 15 |
# File 'lib/steam_codec/ACF.rb', line 13 def LastOwner @LastOwner end |
#LastUpdated ⇒ Object
Returns the value of attribute LastUpdated.
9 10 11 |
# File 'lib/steam_codec/ACF.rb', line 9 def LastUpdated @LastUpdated end |
#MountedDepots ⇒ Object (readonly)
Returns the value of attribute MountedDepots.
18 19 20 |
# File 'lib/steam_codec/ACF.rb', line 18 def MountedDepots @MountedDepots end |
#SharedDepots ⇒ Object (readonly)
Returns the value of attribute SharedDepots.
19 20 21 |
# File 'lib/steam_codec/ACF.rb', line 19 def SharedDepots @SharedDepots end |
#SizeOnDisk ⇒ Object
Returns the value of attribute SizeOnDisk.
11 12 13 |
# File 'lib/steam_codec/ACF.rb', line 11 def SizeOnDisk @SizeOnDisk end |
#StateFlags ⇒ Object
Returns the value of attribute StateFlags.
7 8 9 |
# File 'lib/steam_codec/ACF.rb', line 7 def StateFlags @StateFlags end |
#Universe ⇒ Object
Returns the value of attribute Universe.
6 7 8 |
# File 'lib/steam_codec/ACF.rb', line 6 def Universe @Universe end |
#UpdateResult ⇒ Object
Returns the value of attribute UpdateResult.
10 11 12 |
# File 'lib/steam_codec/ACF.rb', line 10 def UpdateResult @UpdateResult end |
#UserConfig ⇒ Object (readonly)
Returns the value of attribute UserConfig.
17 18 19 |
# File 'lib/steam_codec/ACF.rb', line 17 def UserConfig @UserConfig end |
Class Method Details
.load(data) ⇒ Object
28 29 30 31 32 |
# File 'lib/steam_codec/ACF.rb', line 28 def self.load(data) acf = KeyValues::load(data) return self.new(acf.AppState) if acf and acf.key?(:AppState) nil end |
.loadFromFile(file) ⇒ Object
22 23 24 25 26 |
# File 'lib/steam_codec/ACF.rb', line 22 def self.loadFromFile(file) acf = KeyValues::loadFromFile(file) return self.new(acf.AppState) if acf and acf.key?(:AppState) nil end |
Instance Method Details
#load(appState) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/steam_codec/ACF.rb', line 38 def load(appState) raise ArgumentError, "AppState must be instance of KeyValues" unless appState.is_a?(KeyValues) @AppState = appState @AppID = @AppState.AppID.to_i if @AppState.key?(:AppID) @Universe = @AppState.Universe.to_i if @AppState.key?(:Universe) @StateFlags = @AppState.StateFlags.to_i if @AppState.key?(:StateFlags) @InstallDir = @AppState.InstallDir if @AppState.key?(:InstallDir) @LastUpdated = @AppState.LastUpdated.to_i if @AppState.key?(:LastUpdated) @UpdateResult = @AppState.UpdateResult.to_i if @AppState.key?(:UpdateResult) @SizeOnDisk = @AppState.SizeOnDisk.to_i if @AppState.key?(:SizeOnDisk) @BuildID = @AppState.BuildID.to_i if @AppState.key?(:BuildID) @LastOwner = @AppState.LastOwner if @AppState.key?(:LastOwner) @BytesToDownload = @AppState.BytesToDownload.to_i if @AppState.key?(:BytesToDownload) @BytesDownloaded = @AppState.BytesDownloaded.to_i if @AppState.key?(:BytesDownloaded) @FullValidateOnNextUpdate = !@AppState.FullValidateOnNextUpdate.to_i.zero? if @AppState.key?(:FullValidateOnNextUpdate) userConfig = nil mountedDepots = {} sharedDepots = {} checkGuid = {} installScripts = {} userConfig = @AppState.UserConfig if @AppState.key?(:UserConfig) mountedDepots = @AppState.MountedDepots if @AppState.key?(:MountedDepots) sharedDepots = @AppState.SharedDepots if @AppState.key?(:sharedDepots) checkGuid = @AppState.CheckGuid if @AppState.key?(:CheckGuid) installScripts = @AppState.InstallScripts if @AppState.key?(:InstallScripts) @UserConfig = UserConfig.new(userConfig) @MountedDepots = MountedDepots.new(mountedDepots) @SharedDepots = SharedDepots.new(sharedDepots) @InstallScripts = InstallScripts.new(installScripts) end |