C# Class Nexus.Client.ModRepositories.Nexus.NexusModRepository

The Nexus mod repository is the repository hosted with the Nexus group of websites.
Inheritance: IModRepository
显示文件 Open project: NexusMods/NexusModManager-4.5

Private Properties

Property Type Description
Convert IModInfo
GetBestFileserver List
GetFileInfoForFile NexusModFileInfo
GetUserCredentials void
UserStatusUpdateEvent void

Public Methods

Method Description
FindMods ( string p_strModNameSearchString, bool p_booIncludeAllTerms ) : IList

Finds the mods containing the given search terms.

FindMods ( string p_strModNameSearchString, string p_strAuthorSearchString ) : IList

Finds the mods by Author name.

FindMods ( string p_strModNameSearchString, string p_strModAuthor, bool p_booIncludeAllTerms ) : IList

Finds the mods containing the given search terms.

GetDefaultFileInfo ( string p_strModId ) : IModFileInfo

Gets the file info for the default file of the speficied mod.

GetFileInfo ( string p_strModId, string p_strFileId ) : IModFileInfo

Gets the file info for the specified download file of the specified mod.

GetFileInfoForFile ( string p_strFilename ) : IModFileInfo

Gets the file info for the specified download file.

GetFilePartInfo ( string p_strModId, string p_strFileId, string p_strUserLocation, string &p_strRepositoryMessage ) : List

Gets the URLs of the file parts for the default download file of the specified mod.

GetFilePartUrls ( string p_strModId, string p_strFileId ) : System.Uri[]

Gets the URLs of the file parts for the default download file of the specified mod.

GetModFileInfo ( string p_strModId ) : IList

Gets the list of files for the specified mod.

GetModInfo ( string p_strModId ) : IModInfo

Gets the info for the specifed mod.

GetModInfoForFile ( string p_strFilename ) : IModInfo

Gets the mod info for the mod to which the specified download file belongs.

GetModListInfo ( List p_lstModList ) : List

Gets the info for the specifed mod list.

GetRepository ( IGameMode p_gmdGameMode ) : IModRepository

Gets an instance of the Nexus mod repository.

Login ( string>.Dictionary p_dicTokens ) : bool

Logs the user into the mod repository.

Login ( string p_strUsername, string p_strPassword, string>.Dictionary &p_dicTokens ) : bool

Logs the user into the mod repository.

Logout ( ) : void

Logs the user out of the mod repository.

NexusModRepository ( IGameMode p_gmdGameMode ) : System

A simple constructor the initializes the object with the required dependencies.

ToggleEndorsement ( string p_strModId, int p_intLocalState ) : bool

Toggles the mod Endorsement state.

Protected Methods

Method Description
GetProxyFactory ( ) : ChannelFactory

Returns a factory that is used to create proxies to the repository.

GetProxyFactory ( bool p_booIsGatekeeper ) : ChannelFactory

Returns a factory that is used to create proxies to the repository.

GetProxyFactory ( bool p_booIsGatekeeper, long p_timeout ) : ChannelFactory

Returns a factory that is used to create proxies to the repository.

GetProxyFactory ( long p_timeout ) : ChannelFactory

Returns a factory that is used to create proxies to the repository.

ParseModIdFromFilename ( string p_strFilename, IModInfo &p_mifInfo ) : string

Parses out the mod id from the given mod file name.

SetFileServerZones ( ) : void
SetWebsite ( IGameMode p_gmdGameMode ) : void

Sets the service endpoint to use for the given game mode.

Private Methods

Method Description
Convert ( NexusModInfo p_nmiNexusModInfo ) : IModInfo

Converts the native Nexus repository mod info data structure into an IModInfo structure.

GetBestFileserver ( List fsiList, string p_strUserLocation, string &p_strRepositoryMessage ) : List
GetFileInfoForFile ( string p_strFilename, IModInfo &p_mifInfo ) : NexusModFileInfo

Gets the file info for the specified download file.

GetUserCredentials ( ) : void

Gets the user's membership status.

UserStatusUpdateEvent ( ) : void

Method Details

FindMods() public method

Finds the mods containing the given search terms.
Thrown if the repository cannot be reached.
public FindMods ( string p_strModNameSearchString, bool p_booIncludeAllTerms ) : IList
p_strModNameSearchString string The terms to use to search for mods.
p_booIncludeAllTerms bool Whether the returned mods' names should include all of /// the given search terms.
return IList

FindMods() public method

Finds the mods by Author name.
Thrown if the repository cannot be reached.
public FindMods ( string p_strModNameSearchString, string p_strAuthorSearchString ) : IList
p_strModNameSearchString string The terms to use to search for mods.
p_strAuthorSearchString string The Author to use to search for mods.
return IList

FindMods() public method

Finds the mods containing the given search terms.
Thrown if the repository cannot be reached.
public FindMods ( string p_strModNameSearchString, string p_strModAuthor, bool p_booIncludeAllTerms ) : IList
p_strModNameSearchString string The terms to use to search for mods.
p_strModAuthor string The Mod author.
p_booIncludeAllTerms bool Whether the returned mods' names should include all of /// the given search terms.
return IList

GetDefaultFileInfo() public method

Gets the file info for the default file of the speficied mod.
Thrown if the repository cannot be reached.
public GetDefaultFileInfo ( string p_strModId ) : IModFileInfo
p_strModId string The id of the mod the whose default file's metadata is to be retrieved.
return IModFileInfo

GetFileInfo() public method

Gets the file info for the specified download file of the specified mod.
Thrown if the repository is not available. Thrown if the repository cannot be reached.
public GetFileInfo ( string p_strModId, string p_strFileId ) : IModFileInfo
p_strModId string The id of the mod the whose file's metadata is to be retrieved.
p_strFileId string The id of the download file whose metadata is to be retrieved.
return IModFileInfo

GetFileInfoForFile() public method

Gets the file info for the specified download file.
public GetFileInfoForFile ( string p_strFilename ) : IModFileInfo
p_strFilename string The name of the file whose info is to be returned..
return IModFileInfo

GetFilePartInfo() public method

Gets the URLs of the file parts for the default download file of the specified mod.
Thrown if the repository cannot be reached.
public GetFilePartInfo ( string p_strModId, string p_strFileId, string p_strUserLocation, string &p_strRepositoryMessage ) : List
p_strModId string The id of the mod whose default download file's parts' URLs are to be retrieved.
p_strFileId string The id of the file whose parts' URLs are to be retrieved.
p_strUserLocation string The preferred user location.
p_strRepositoryMessage string Custom repository message, if needed.
return List

GetFilePartUrls() public method

Gets the URLs of the file parts for the default download file of the specified mod.
Thrown if the repository cannot be reached.
public GetFilePartUrls ( string p_strModId, string p_strFileId ) : System.Uri[]
p_strModId string The id of the mod whose default download file's parts' URLs are to be retrieved.
p_strFileId string The id of the file whose parts' URLs are to be retrieved.
return System.Uri[]

GetModFileInfo() public method

Gets the list of files for the specified mod.
Thrown if the repository cannot be reached.
public GetModFileInfo ( string p_strModId ) : IList
p_strModId string The id of the mod whose list of files is to be returned.
return IList

GetModInfo() public method

Gets the info for the specifed mod.
Thrown if the repository cannot be reached.
public GetModInfo ( string p_strModId ) : IModInfo
p_strModId string The id of the mod info is be retrieved.
return IModInfo

GetModInfoForFile() public method

Gets the mod info for the mod to which the specified download file belongs.
public GetModInfoForFile ( string p_strFilename ) : IModInfo
p_strFilename string The name of the file whose mod's info is to be returned..
return IModInfo

GetModListInfo() public method

Gets the info for the specifed mod list.
Thrown if the repository cannot be reached.
public GetModListInfo ( List p_lstModList ) : List
p_lstModList List The mod list to.
return List

GetProxyFactory() protected method

Returns a factory that is used to create proxies to the repository.
protected GetProxyFactory ( ) : ChannelFactory
return ChannelFactory

GetProxyFactory() protected method

Returns a factory that is used to create proxies to the repository.
protected GetProxyFactory ( bool p_booIsGatekeeper ) : ChannelFactory
p_booIsGatekeeper bool Whether or not we are communicating with the gatekeeper.
return ChannelFactory

GetProxyFactory() protected method

Returns a factory that is used to create proxies to the repository.
protected GetProxyFactory ( bool p_booIsGatekeeper, long p_timeout ) : ChannelFactory
p_booIsGatekeeper bool Whether or not we are communicating with the gatekeeper.
p_timeout long The timeout value.
return ChannelFactory

GetProxyFactory() protected method

Returns a factory that is used to create proxies to the repository.
protected GetProxyFactory ( long p_timeout ) : ChannelFactory
p_timeout long
return ChannelFactory

GetRepository() public static method

Gets an instance of the Nexus mod repository.
public static GetRepository ( IGameMode p_gmdGameMode ) : IModRepository
p_gmdGameMode IGameMode The current game mode.
return IModRepository

Login() public method

Logs the user into the mod repository.
public Login ( string>.Dictionary p_dicTokens ) : bool
p_dicTokens string>.Dictionary The authentication tokens with which to login.
return bool

Login() public method

Logs the user into the mod repository.
Thrown if the repository is not available.
public Login ( string p_strUsername, string p_strPassword, string>.Dictionary &p_dicTokens ) : bool
p_strUsername string The username of the account with which to login.
p_strPassword string The password of the account with which to login.
p_dicTokens string>.Dictionary The returned tokens that can be used to login instead of the username/password /// credentials.
return bool

Logout() public method

Logs the user out of the mod repository.
public Logout ( ) : void
return void

NexusModRepository() public method

A simple constructor the initializes the object with the required dependencies.
public NexusModRepository ( IGameMode p_gmdGameMode ) : System
p_gmdGameMode IGameMode The game mode for which mods are being managed.
return System

ParseModIdFromFilename() protected method

Parses out the mod id from the given mod file name.
protected ParseModIdFromFilename ( string p_strFilename, IModInfo &p_mifInfo ) : string
p_strFilename string The filename from which to parse the mod id.
p_mifInfo IModInfo The mod info for the mod identified by the parsed mod id.
return string

SetFileServerZones() protected method

protected SetFileServerZones ( ) : void
return void

SetWebsite() protected method

Sets the service endpoint to use for the given game mode.
protected SetWebsite ( IGameMode p_gmdGameMode ) : void
p_gmdGameMode IGameMode The game mode for which mods are being managed.
return void

ToggleEndorsement() public method

Toggles the mod Endorsement state.
Thrown if the repository cannot be reached.
public ToggleEndorsement ( string p_strModId, int p_intLocalState ) : bool
p_strModId string The mod ID.
p_intLocalState int The local Endorsement state.
return bool