C# Class AdvancedLauncher.SDK.Management.FileSystemManager

The DMO File System manager
Inheritance: CrossDomainObject, IFileSystemManager
Show file Open project: GoldRenard/DMOAdvancedLauncher

Private Properties

Property Type Description
ConvertToUint32 uint
GetEntryIndex int
OnFileWrited void
ReadFile Stream
WriteMapFile bool
_WriteStream bool

Public Methods

Method Description
Close ( ) : void

Closes game archive

Dispose ( ) : void

Object dispose method

FileHash ( string filePath ) : uint

Calculates file hash (internal file ID). Is is hash function over the game path (not the file itself).

FileSystemManager ( ) : System

Base constructor

FileSystemManager ( Dispatcher OwnerDispatcher ) : System

Constructon with UI Dispatcher to invoke the events.

Initialize ( ) : void

API initialization method

Initialize ( ILogManager logManager ) : void

Initializes with specified ILogManager for logging

IsFileLocked ( string file ) : bool

Checks access to file

Open ( FileAccess access, int archiveHeader, string headerFile, string packageFile ) : bool

Opens game archives

ReadFile ( string name ) : Stream

Reads file by name

ReadFile ( uint id ) : Stream

Reads file by id

WriteDirectory ( string path, bool deleteOnComplete ) : bool

Writes the full directory content into game archive

WriteFile ( string sourceFile, string destination ) : bool

Writes file to archive.

WriteStream ( Stream sourceStream, string destination ) : bool

Writes stream to archive.

WriteStream ( Stream sourceStream, uint entryId ) : bool

Writes stream to archive.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Object dispose method

Private Methods

Method Description
ConvertToUint32 ( long l ) : uint

Convert long to uint

GetEntryIndex ( uint fileId ) : int

Get internal entry index

OnFileWrited ( int fileNum, int fileCount ) : void
ReadFile ( int entryIndex ) : Stream

Reads file by entry index

WriteMapFile ( ) : bool

Writes map file (header file)

_WriteStream ( Stream SourceStream, uint entryId ) : bool

Writes stream to archive.

Method Details

Close() public method

Closes game archive
public Close ( ) : void
return void

Dispose() public method

Object dispose method
public Dispose ( ) : void
return void

Dispose() protected method

Object dispose method
protected Dispose ( bool disposing ) : void
disposing bool True for managed resources
return void

FileHash() public method

Calculates file hash (internal file ID). Is is hash function over the game path (not the file itself).
public FileHash ( string filePath ) : uint
filePath string File path
return uint

FileSystemManager() public method

Base constructor
public FileSystemManager ( ) : System
return System

FileSystemManager() public method

Constructon with UI Dispatcher to invoke the events.
public FileSystemManager ( Dispatcher OwnerDispatcher ) : System
OwnerDispatcher System.Windows.Threading.Dispatcher UI Dispatcher
return System

Initialize() public method

API initialization method
public Initialize ( ) : void
return void

Initialize() public method

Initializes with specified ILogManager for logging
public Initialize ( ILogManager logManager ) : void
logManager ILogManager The interface
return void

IsFileLocked() public static method

Checks access to file
public static IsFileLocked ( string file ) : bool
file string Full path to file
return bool

Open() public method

Opens game archives
public Open ( FileAccess access, int archiveHeader, string headerFile, string packageFile ) : bool
access FileAccess File access mode.
archiveHeader int Archives header number. Usually it is 16 for common game archive
headerFile string Header file path
packageFile string Packages file path
return bool

ReadFile() public method

Reads file by name
public ReadFile ( string name ) : Stream
name string File name
return Stream

ReadFile() public method

Reads file by id
public ReadFile ( uint id ) : Stream
id uint File id
return Stream

WriteDirectory() public method

Writes the full directory content into game archive
public WriteDirectory ( string path, bool deleteOnComplete ) : bool
path string Directory path
deleteOnComplete bool Set True of you want delete this directory awter write.
return bool

WriteFile() public method

Writes file to archive.
public WriteFile ( string sourceFile, string destination ) : bool
sourceFile string Source file (physical on the disk)
destination string Destination file (internal file path inside archive)
return bool

WriteStream() public method

Writes stream to archive.
public WriteStream ( Stream sourceStream, string destination ) : bool
sourceStream Stream Source stream
destination string Destination file (internal file path inside archive)
return bool

WriteStream() public method

Writes stream to archive.
public WriteStream ( Stream sourceStream, uint entryId ) : bool
sourceStream Stream Source stream
entryId uint ID of destination file
return bool