bf2

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

Methods for working specifically with Battlefield 2 configuration files (.con)

Index

Constants

View Source
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

func GetDefaultProfileKey(h game.Handler) (string, error)

Get the default profile's key by reading and parsing the Battlefield 2 Global.con file

func GetDefaultProfileProfileCon added in v0.1.0

func GetDefaultProfileProfileCon(h game.Handler) (*config.Config, error)

Read and parse the Battlefield 2 Profile.con file for the current default profile

func GetEncryptedLogin added in v0.1.0

func GetEncryptedLogin(profileCon *config.Config) (string, string, error)

Extract profile name and encrypted password from a parsed Battlefield 2 Profile.con file

func GetProfiles added in v0.1.0

func GetProfiles(h game.Handler) ([]game.Profile, error)

func MarkAllVoiceOverHelpAsPlayed added in v0.1.0

func MarkAllVoiceOverHelpAsPlayed(generalCon *config.Config)

Add all voice over help lines as played (GeneralSettings.setPlayedVOHelp) in given General.con config

func PurgeLogoCache added in v0.1.2

func PurgeLogoCache(h game.Handler) error

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 PurgeServerFavorites(generalCon *config.Config)

func PurgeServerHistory added in v0.1.0

func PurgeServerHistory(generalCon *config.Config)

Remove all server history entries (GeneralSettings.addServerHistory) from given General.con config

func PurgeShaderCache added in v0.1.2

func PurgeShaderCache(h game.Handler) error

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

func SetDefaultProfile(globalCon *config.Config, profileKey string)

Types

type ProfileConfigFile added in v0.1.0

type ProfileConfigFile string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL