Documentation ¶
Overview ¶
Methods for working specifically with Battlefield 2 configuration files (.con)
Index ¶
- Constants
- func GetDefaultProfileKey(h game.Handler) (string, error)
- func GetDefaultProfileProfileCon(h game.Handler) (*config.Config, error)
- func GetEncryptedLogin(profileCon *config.Config) (string, string, error)
- func GetProfiles(h game.Handler) ([]game.Profile, error)
- func MarkAllVoiceOverHelpAsPlayed(generalCon *config.Config)
- func PurgeLogoCache(h game.Handler) error
- func PurgeOldDemoBookmarks(demoBookmarksCon *config.Config, reference time.Time, maxAge time.Duration)
- func PurgeServerFavorites(generalCon *config.Config)
- func PurgeServerHistory(generalCon *config.Config)
- func PurgeShaderCache(h game.Handler) error
- func ReadProfileConfigFile(h game.Handler, profileKey string, configFile ProfileConfigFile) (*config.Config, error)
- func SetDefaultProfile(globalCon *config.Config, profileKey string)
- type ProfileConfigFile
Constants ¶
const ( ProfileConfigFileAudioCon ProfileConfigFile = "Audio.con" ProfileConfigFileControlsCon ProfileConfigFile = "Controls.con" ProfileConfigFileDemoBookmarksCon ProfileConfigFile = "DemoBookmarks.con" ProfileConfigFileGeneralCon ProfileConfigFile = "General.con" ProfileConfigFileHapticCon ProfileConfigFile = "Haptic.con" ProfileConfigFileMapListCon ProfileConfigFile = "mapList.con" ProfileConfigFileProfileCon ProfileConfigFile = "Profile.con" ProfileConfigFileServerSettingsCon ProfileConfigFile = "ServerSettings.con" ProfileConfigFileVideoCon ProfileConfigFile = "Video.con" DefaultProfileKey = "Default" GlobalConKeyDefaultProfileRef = "GlobalSettings.setDefaultUser" ProfileConKeyName = "LocalProfile.setName" ProfileConKeyNick = "LocalProfile.setNick" ProfileConKeyGamespyNick = "LocalProfile.setGamespyNick" ProfileConKeyEmail = "LocalProfile.setEmail" ProfileConKeyPassword = "LocalProfile.setPassword" GeneralConKeyServerHistory = "GeneralSettings.addServerHistory" GeneralConKeyFavoriteServer = "GeneralSettings.addFavouriteServer" GeneralConKeyVoiceOverHelpPlayed = "GeneralSettings.setPlayedVOHelp" DemoBookmarksConKeyDemoBookmark = "LocalProfile.addDemoBookmark" )
Variables ¶
This section is empty.
Functions ¶
func GetDefaultProfileKey ¶ added in v0.1.0
Get the default profile's key by reading and parsing the Battlefield 2 Global.con file
func GetDefaultProfileProfileCon ¶ added in v0.1.0
Read and parse the Battlefield 2 Profile.con file for the current default profile
func GetEncryptedLogin ¶ added in v0.1.0
Extract profile name and encrypted password from a parsed Battlefield 2 Profile.con file
func MarkAllVoiceOverHelpAsPlayed ¶ added in v0.1.0
Add all voice over help lines as played (GeneralSettings.setPlayedVOHelp) in given General.con config
func PurgeLogoCache ¶ added in v0.1.2
func PurgeOldDemoBookmarks ¶ added in v0.1.5
func PurgeOldDemoBookmarks(demoBookmarksCon *config.Config, reference time.Time, maxAge time.Duration)
Remove all demo bookmarks older than the given duration (actual age is calculated based on the given reference)
func PurgeServerFavorites ¶ added in v0.2.0
func PurgeServerHistory ¶ added in v0.1.0
Remove all server history entries (GeneralSettings.addServerHistory) from given General.con config
func PurgeShaderCache ¶ added in v0.1.2
func ReadProfileConfigFile ¶ added in v0.1.0
func ReadProfileConfigFile(h game.Handler, profileKey string, configFile ProfileConfigFile) (*config.Config, error)
Read a config file from the given Battlefield 2 profile
func SetDefaultProfile ¶ added in v0.1.0
Types ¶
type ProfileConfigFile ¶ added in v0.1.0
type ProfileConfigFile string