RakNet  4.0
Public Member Functions | List of all members
RakNet::AutopatcherRepositoryInterface Class Referenceabstract

An interface used by AutopatcherServer to get the data necessary to run an autopatcher. This is up to you to implement for custom repository solutions. More...

#include <AutopatcherRepositoryInterface.h>

Inheritance diagram for RakNet::AutopatcherRepositoryInterface:
RakNet::AutopatcherMySQLRepository RakNet::AutopatcherPostgreRepository

Public Member Functions

virtual bool GetChangelistSinceDate (const char *applicationName, FileList *addedFiles, FileList *deletedFiles, double sinceDate)=0
 
virtual bool GetPatches (const char *applicationName, FileList *input, FileList *patchList)=0
 
virtual bool GetMostRecentChangelistWithPatches (RakNet::RakString &applicationName, FileList *patchedFiles, FileList *updatedFiles, FileList *updatedFileHashes, FileList *deletedFiles, double *priorRowPatchTime, double *mostRecentRowPatchTime)=0
 
virtual const char * GetLastError (void) const =0
 
virtual const int GetIncrementalReadChunkSize (void) const =0
 
- Public Member Functions inherited from RakNet::IncrementalReadInterface
virtual unsigned int GetFilePart (const char *filename, unsigned int startReadBytes, unsigned int numBytesToRead, void *preallocatedDestination, FileListNodeContext context)
 

Detailed Description

An interface used by AutopatcherServer to get the data necessary to run an autopatcher. This is up to you to implement for custom repository solutions.

Member Function Documentation

virtual bool RakNet::AutopatcherRepositoryInterface::GetChangelistSinceDate ( const char *  applicationName,
FileList *  addedFiles,
FileList *  deletedFiles,
double  sinceDate 
)
pure virtual

Get list of files added and deleted since a certain date. This is used by AutopatcherServer and not usually explicitly called.

Parameters
[in]applicationNameA null terminated string identifying the application
[out]addedFilesA list of the current versions of filenames with hashes as their data that were created after sinceData
[out]deletedFilesA list of the current versions of filenames that were deleted after sinceData
[in]Aninput date, in whatever format your repository uses
[out]currentDateThe current server date, in whatever format your repository uses
Returns
True on success, false on failure.

Implemented in RakNet::AutopatcherPostgreRepository, and RakNet::AutopatcherMySQLRepository.

virtual const int RakNet::AutopatcherRepositoryInterface::GetIncrementalReadChunkSize ( void  ) const
pure virtual
Returns
Passed to FileListTransfer::Send() as the _chunkSize parameter.

Implemented in RakNet::AutopatcherPostgreRepository, and RakNet::AutopatcherMySQLRepository.

virtual const char* RakNet::AutopatcherRepositoryInterface::GetLastError ( void  ) const
pure virtual
Returns
Whatever this function returns is sent from the AutopatcherServer to the AutopatcherClient when one of the above functions returns false.

Implemented in RakNet::AutopatcherPostgreRepository, and RakNet::AutopatcherMySQLRepository.

virtual bool RakNet::AutopatcherRepositoryInterface::GetMostRecentChangelistWithPatches ( RakNet::RakString applicationName,
FileList *  patchedFiles,
FileList *  updatedFiles,
FileList *  updatedFileHashes,
FileList *  deletedFiles,
double *  priorRowPatchTime,
double *  mostRecentRowPatchTime 
)
pure virtual

For the most recent update, return files that were patched, added, or deleted. For files that were patched, return both the patch in patchedFiles and the current version in updatedFiles The cache will be used if the client last patched between priorRowPatchTime and mostRecentRowPatchTime No files changed will be returned to the client if the client last patched after mostRecentRowPatchTime

Parameters
[in,out]applicationNameName of the application to get patches for. If empty, uses the most recently updated application, and the string will be updated to reflect this name.
[out]patchedFilesGiven the most recent update, if a file was patched, add it to this list. The context data for each file will be PC_HASH_WITH_PATCH. The first 4 bytes of data should be a hash of the file being patched. The second 4 bytes should be the hash of the file after the patch. The remaining bytes should be the patch itself.
[out]updatedFilesThe current value of the file. List should have the same length and order as patchedFiles
[out]updatedFileHashesThe hash of the current value of the file. List should have the same length and order as patchedFiles
[out]deletedFilesFiles that were deleted in the last patch.
[out]priorRowPatchTimeWhen the patch before the most recent patch took place. 0 means never.
[out]mostRecentRowPatchTimeWhen the most recent patch took place. 0 means never.
Returns
true on success, false on failure

Implemented in RakNet::AutopatcherPostgreRepository, and RakNet::AutopatcherMySQLRepository.

virtual bool RakNet::AutopatcherRepositoryInterface::GetPatches ( const char *  applicationName,
FileList *  input,
FileList *  patchList 
)
pure virtual

Get patches (or files) for every file in input, assuming that input has a hash for each of those files.

Parameters
[in]applicationNameA null terminated string identifying the application
[in]inputA list of files with SHA1_LENGTH byte hashes to get from the database.
[out]patchListYou should return list of files with either the filedata or the patch. This is a subset of input. The context data for each file will be either PC_WRITE_FILE (to just write the file) or PC_HASH_WITH_PATCH (to patch). If PC_HASH_WITH_PATCH, then the file contains a SHA1_LENGTH byte patch followed by the hash. The datalength is patchlength + SHA1_LENGTH
[out]currentDateThe current server date, in whatever format your repository uses
Returns
True on success, false on failure.

Implemented in RakNet::AutopatcherPostgreRepository, and RakNet::AutopatcherMySQLRepository.


The documentation for this class was generated from the following file: