Skip to content

Commit

Permalink
Initialize default INI for Bilibili
Browse files Browse the repository at this point in the history
  • Loading branch information
bagusnl committed Oct 5, 2023
1 parent 18c325a commit d021a70
Showing 1 changed file with 37 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ private IniSection _defaultIniProfile
};
}

private IniSection _defaultIniProfileBilibili
{
get => new IniSection()
{
{ "cps", new IniValue("bilibili") },
{ "channel", new IniValue("14") },
{ "sub_channel", new IniValue("0") },
{ "game_install_path", new IniValue(_defaultGameDirPath.Replace('\\', '/')) },
{ "game_start_name", new IniValue(GamePreset.GameExecutableName) },
{ "is_first_exit", new IniValue(false) },
{ "exit_type", new IniValue(2) }
};
}

private IniSection _defaultIniVersion
{
get => new IniSection()
Expand All @@ -43,6 +57,18 @@ private IniSection _defaultIniVersion
{ "sdk_version", new IniValue() }
};
}

private IniSection _defaultIniVersionBilibili
{
get => new IniSection()
{
{ "channel", new IniValue(14) },
{ "cps", new IniValue("bilibili") },
{ "game_version", new IniValue() },
{ "sub_channel", new IniValue(0) },
{ "sdk_version", new IniValue() }
};
}
#endregion

#region Properties
Expand Down Expand Up @@ -268,9 +294,17 @@ private void InitializeIniProp()
GameConfigDirPath = Path.Combine(LauncherConfig.AppGameFolder, GamePreset.ProfileName);

// Initialize INIs
InitializeIniProp(GameIniProfilePath, GameIniProfile, _defaultIniProfile, _defaultIniProfileSection);
InitializeIniProp(GameIniVersionPath, GameIniVersion, _defaultIniVersion, _defaultIniVersionSection);

if (GamePreset.ZoneName == "Bilibili")
{
InitializeIniProp(GameIniProfilePath, GameIniProfile, _defaultIniProfileBilibili, _defaultIniProfileSection);
InitializeIniProp(GameIniVersionPath, GameIniVersion, _defaultIniVersionBilibili, _defaultIniVersionSection);
}
else
{
InitializeIniProp(GameIniProfilePath, GameIniProfile, _defaultIniProfile, _defaultIniProfileSection);
InitializeIniProp(GameIniVersionPath, GameIniVersion, _defaultIniVersion, _defaultIniVersionSection);
}

// Initialize the GameVendorType
VendorTypeProp = new GameVendorProp(GameDirPath, Path.GetFileNameWithoutExtension(GamePreset.GameExecutableName), GamePreset.VendorType);
}
Expand Down

0 comments on commit d021a70

Please sign in to comment.