SLikeNet 0.1.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
SLNet::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 <slikenet/AutopatcherRepositoryInterface.h>`

Inheritance diagram for SLNet::AutopatcherRepositoryInterface:

## Public Member Functions

virtual bool | GetChangelistSinceDate (const char *applicationName, FileList *addedOrModifiedFilesWithHashData, FileList *deletedFiles, double sinceDate)=0
virtual int | GetPatches (const char *applicationName, FileList *input, bool allowDownloadOfOriginalUnmodifiedFiles, FileList *patchList)=0
virtual bool | GetMostRecentChangelistWithPatches (SLNet::RakString &applicationName, FileList *patchedFiles, FileList *updatedFiles, FileList *addedOrModifiedFileHashes, 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 SLNet::IncrementalReadInterface
| IncrementalReadInterface ()
virtual | ~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.

Definition at line 35 of file AutopatcherRepositoryInterface.h.

## Member Function Documentation

virtual bool SLNet::AutopatcherRepositoryInterface::GetChangelistSinceDate | ( | const char * | applicationName,
|  | FileList * | addedOrModifiedFilesWithHashData,
|  | 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] | applicationName | A null terminated string identifying the application
  [out] | addedFiles | A list of the current versions of filenames with hashes as their data that were created after sinceData
  [out] | deletedFiles | A list of the current versions of filenames that were deleted after sinceData
  [in] | An | input date, in whatever format your repository uses
  [out] | currentDate | The current server date, in whatever format your repository uses

Returns
  True on success, false on failure.

virtual const int SLNet::AutopatcherRepositoryInterface::GetIncrementalReadChunkSize | ( | void |  | ) | const

pure virtual

Returns
  Passed to FileListTransfer::Send() as the _chunkSize parameter.

virtual const char* SLNet::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.

virtual bool SLNet::AutopatcherRepositoryInterface::GetMostRecentChangelistWithPatches | ( | SLNet::RakString & | applicationName,
|  | FileList * | patchedFiles,
|  | FileList * | updatedFiles,
|  | FileList * | addedOrModifiedFileHashes,
|  | 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

Parameters

  [in,out] | applicationName | Name 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] | patchedFiles | A list of patched files with op PC_HASH_2_WITH_PATCH. It has 2 hashes, the priorHash and the currentHash. The currentHash is checked on the client after patching for patch success. The priorHash is checked in AutopatcherServer::OnGetPatch() to see if the client is able to hash with the version they currently have
  [out] | patchedFiles | A list of new files. It contains the actual data in addition to the filename
  [out] | addedOrModifiedFileHashes | A list of file hashes that were either modified or new. This is returned to the client when replying to ID_AUTOPATCHER_CREATION_LIST, which tells the client what files have changed on the server since a certain date
  [out] | deletedFiles | A list of the current versions of filenames that were deleted in the most recent patch
  [out] | whenPatched | time in seconds since epoch when patched. Use time() function to get this in C

Returns
  true on success, false on failure

virtual int SLNet::AutopatcherRepositoryInterface::GetPatches | ( | const char * | applicationName,
|  | FileList * | input,
|  | bool | allowDownloadOfOriginalUnmodifiedFiles,
|  | 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] | applicationName | A null terminated string identifying the application
  [in] | input | A list of files with SHA1_LENGTH byte hashes to get from the database.
  [out] | patchList | You 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] | currentDate | The current server date, in whatever format your repository uses

Returns
  1 on success, 0 on database failure, -1 on tried to download original unmodified file

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

- Source/include/slikenet/AutopatcherRepositoryInterface.h