@@ -63,7 +63,7 @@ internal partial class GameVersionBase
6363 protected virtual IniFile GameIniProfile { get ; } = new ( ) ;
6464 protected virtual IniFile GameIniVersion { get ; } = new ( ) ;
6565 public virtual IniSection GameIniVersionSection { get => GameIniVersion [ DefaultIniVersionSection ] ; }
66- public virtual IniSection GameIniProfileSection { get => GameIniVersion [ DefaultIniProfileSection ] ; }
66+ public virtual IniSection GameIniProfileSection { get => GameIniProfile [ DefaultIniProfileSection ] ; }
6767 #endregion
6868
6969 #region Game Config Path Properties
@@ -75,7 +75,7 @@ protected virtual string GameIniVersionPath
7575 {
7676 get
7777 {
78- var configPath = GameIniProfile [ DefaultIniProfileSection ] [ "game_install_path" ] . ToString ( ) ;
78+ var configPath = GameIniProfileSection [ "game_install_path" ] . ToString ( ) ;
7979 var defaultPath = Path . Combine ( GameConfigDirPath ?? "" , GamePreset . GameDirectoryName ?? "Games" , ConfigFileName ) ;
8080
8181 if ( string . IsNullOrEmpty ( configPath ) ) return defaultPath ;
@@ -173,9 +173,9 @@ protected virtual void FixInvalidGameConfigId()
173173
174174 string gameIniVersionPath = Path . Combine ( GameDirPath , ConfigFileName ) ;
175175
176- GameIniVersion [ DefaultIniVersionSection ] [ channelIdKeyName ] = GamePreset . ChannelID ?? 0 ;
177- GameIniVersion [ DefaultIniVersionSection ] [ subChannelIdKeyName ] = GamePreset . SubChannelID ?? 0 ;
178- GameIniVersion [ DefaultIniVersionSection ] [ cpsKeyName ] = GamePreset . LauncherCPSType ;
176+ GameIniVersionSection [ channelIdKeyName ] = GamePreset . ChannelID ?? 0 ;
177+ GameIniVersionSection [ subChannelIdKeyName ] = GamePreset . SubChannelID ?? 0 ;
178+ GameIniVersionSection [ cpsKeyName ] = GamePreset . LauncherCPSType ;
179179
180180 SaveGameIni ( gameIniVersionPath , GameIniVersion ) ;
181181 }
@@ -198,7 +198,7 @@ protected virtual void FixInvalidGameBilibiliStatus(string? executableName)
198198 #region Update Game Config Methods
199199 public void UpdateGamePath ( string ? path , bool saveValue = true )
200200 {
201- GameIniProfile [ DefaultIniProfileSection ] [ "game_install_path" ] = path ? . Replace ( '\\ ' , '/' ) ;
201+ GameIniProfileSection [ "game_install_path" ] = path ? . Replace ( '\\ ' , '/' ) ;
202202 if ( saveValue )
203203 {
204204 SaveGameIni ( GameIniProfilePath , GameIniProfile ) ;
@@ -220,7 +220,7 @@ public void UpdateGameVersionToLatest(bool saveValue = true)
220220
221221 public void UpdateGameVersion ( GameVersion ? version , bool saveValue = true )
222222 {
223- GameIniVersion [ DefaultIniVersionSection ] [ "game_version" ] = version ? . VersionString ;
223+ GameIniVersionSection [ "game_version" ] = version ? . VersionString ;
224224 if ( saveValue )
225225 {
226226 SaveGameIni ( GameIniVersionPath , GameIniVersion ) ;
@@ -229,9 +229,9 @@ public void UpdateGameVersion(GameVersion? version, bool saveValue = true)
229229
230230 public void UpdateGameChannels ( bool saveValue = true )
231231 {
232- GameIniVersion [ DefaultIniVersionSection ] [ "channel" ] = DefaultGameChannelID ;
233- GameIniVersion [ DefaultIniVersionSection ] [ "sub_channel" ] = DefaultGameSubChannelID ;
234- GameIniVersion [ DefaultIniVersionSection ] [ "cps" ] = DefaultGameCps ;
232+ GameIniVersionSection [ "channel" ] = DefaultGameChannelID ;
233+ GameIniVersionSection [ "sub_channel" ] = DefaultGameSubChannelID ;
234+ GameIniVersionSection [ "cps" ] = DefaultGameCps ;
235235
236236 if ( saveValue )
237237 {
@@ -253,7 +253,7 @@ public void UpdatePluginVersions(Dictionary<string, GameVersion> versions, bool
253253 string keyName = $ "plugin_{ version . Key } _version";
254254
255255 // Set the value
256- GameIniVersion [ DefaultIniVersionSection ] [ keyName ] = version . Value . VersionString ;
256+ GameIniVersionSection [ keyName ] = version . Value . VersionString ;
257257 }
258258
259259 if ( saveValue )
@@ -274,7 +274,7 @@ public void UpdateSdkVersion(GameVersion? version, bool saveValue = true)
274274
275275 // Set the value
276276 const string keyName = "plugin_sdk_version" ;
277- GameIniVersion [ DefaultIniVersionSection ] [ keyName ] = version . ToString ( ) ;
277+ GameIniVersionSection [ keyName ] = version . ToString ( ) ;
278278
279279 if ( saveValue )
280280 {
@@ -339,7 +339,7 @@ public virtual void InitializeIniProp()
339339 InitializeIniProp ( GameIniProfilePath , GameIniProfile , DefaultIniProfile ,
340340 DefaultIniProfileSection ) ;
341341 InitializeIniProp ( GameIniVersionPath , GameIniVersion , DefaultIniVersion ,
342- DefaultIniVersionSection , true ) ;
342+ DefaultIniVersionSection ) ;
343343
344344 // Initialize the GameVendorType
345345 VendorTypeProp = new GameVendorProp ( GameDirPath ,
@@ -392,7 +392,7 @@ private void InitializeIniDefaults(IniFile ini, IniSection defaults, string sect
392392 }
393393 }
394394
395- UpdateGameChannels ( false ) ;
395+ // UpdateGameChannels(false);
396396 }
397397
398398 private void SaveGameIni ( string filePath , IniFile ini )
0 commit comments