#include <Autopatcher.h>
Public Member Functions | |
AutoPatcher () | |
~AutoPatcher () | |
void | Clear (void) |
void | SetOrderingStream (int streamIndex) |
void | SetNetworkingSystem (RakPeerInterface *localSystem) |
void | SetNetworkingSystem (RakClientInterface *localSystem) |
void | SetNetworkingSystem (RakServerInterface *localSystem) |
void | SetCompressionBoundary (unsigned boundary) |
SetFileDownloadableResult | SetFileDownloadable (char *filename, bool checkFileSignature) |
bool | UnsetFileDownloadable (char *filename) |
unsigned long | GetDownloadStatus (char *filename, unsigned *fileLength, bool *fileDataIsCompressed, unsigned *compressedFileLength) |
void | SetDownloadedFileDirectoryPrefix (char *prefix) |
void | RequestDownloadableFileList (PlayerID remoteSystem) |
void | SendDownloadableFileList (PlayerID remoteSystem) |
void | OnAutopatcherFileList (Packet *packet, bool onlyAcceptFilesIfRequested) |
void | OnAutopatcherRequestFiles (Packet *packet) |
void | OnAutopatcherSetDownloadList (Packet *packet) |
bool | OnAutopatcherWriteFile (Packet *packet) |
Static Public Member Functions | |
static bool | CreateFileSignature (char *filename) |
static bool | GenerateSHA1 (char *filename, char SHA1Code[SHA1_LENGTH]) |
static int | GetFileLength (char *filename) |
static bool | WriteFileWithDirectories (const char *path, char *data, unsigned dataLength) |
Protected Attributes | |
RakPeerInterface * | rakPeerInterface |
One of these 3 must be set in order to send data. | |
RakClientInterface * | rakClientInterface |
One of these 3 must be set in order to send data. | |
RakServerInterface * | rakServerInterface |
One of these 3 must be set in order to send data. | |
char * | downloadPrefix |
The directory to download into basically. | |
unsigned | compressionBoundary |
Files of length >= this will be compressed. | |
bool | downloadableFilesRequested |
true if the downloadableFiles have been requested | |
int | orderingStream |
The ordering stream to use. | |
BasicDataStructures::List< DownloadableFileDescriptor * > | downloadableFiles |
Directory of files that are downloadable. | |
BasicDataStructures::List< DownloadableFileDescriptor * > | downloadingFiles |
Directory of files that are downloadable. |
This class define the autopatcher facilities. It provide client and server side features to update file of the server side to the client. Missing files are created while modified files are updated. This mecanism use UDP. It might be more efficient to use TCP for large file.
|
Default Constructor |
|
Destructor |
|
Frees all downloadable files. Frees the download directory prefix. |
|
Creates a .sha file signature for a particular file. This is used by SetFileDownloadable with checkFileSignature as true
|
|
|
|
Returns how many files are still in the download list. Requires a previous call to OnAutopatcherFileList If returns >=1 filename and fileLength will be filled in to match the current file being downloaded A value of 0 for compressedFileLength indicates unknown
|
|
|
|
If the packet identifier is ID_AUTOPATCHER_FILE_LIST, call this function with the packet. It will parse out all the files on the remote system and request to download the ones we don't have or don't match. The remote system should get a packet with ID ID_AUTOPATCHER_REQUEST_FILES for each file requested We can specify to only accept files if we previously requested them by a call to RequestDownloadableFileList. Set onlyAcceptFilesIfRequested to true to do this After this function is called you can call GetDownloadStatus(...) To find out which, if any, files are currently downloading
|
|
If the packet identifier is ID_AUTOPATCHER_REQUEST_FILES, call this function with the packet. Reads the files from disk and sends them to the specified system
|
|
If the packet identifier is ID_AUTOPATCHER_SET_DOWNLOAD_LIST, call this function with the packet. Finalizes the list of files that will be downloaded.
|
|
If the packet identifier is ID_AUTOPATCHER_WRITE_FILE, call this function with the packet. Writes a file to disk. There is security to prevent writing files we didn't ask for
|
|
Requests that the remote system send the directory of files that are downloadable. The remote system should get ID_AUTOPATCHER_REQUEST_FILE_LIST. When it does, it should call SendDownloadableFileList with the playerID of the sender. For the client, you can put UNASSIGNED_PLAYER_ID for remoteSystem
|
|
If the packet identifier is ID_AUTOPATCHER_REQUEST_FILE_LIST, call this function with packet->playerID Sends a list of all downloadable files to the remote system The remote system should get a packet with ID ID_AUTOPATCHER_FILE_LIST. When it does, it should call OnAutopatcherFileList with the packet from the network
|
|
Set the value at which files larger than this will be compressed. Files smaller than this will not be compressed. Defaults to 1024. Only changes files later passed to SetFileDownloadable, not files already processed
|
|
Sets a base directory to look for and put all downloaded files in. For example, "Downloads"
|
|
Makes a file downloadable Returns checkFileSignature - if true then check the associated .sha1 to make sure it describes our file. checkFileSignature is useful to make sure a file wasn't externally modified by a hacker or a virus
|
|
Call this to use RakServerInterface on sends. Mutually exclusive with the other 2 overloads.
|
|
Call this to use RakClientInterface on sends. Mutually exclusive with the other 2 overloads.
|
|
Call this to use RakPeer on sends. Mutually exclusive with the other 2 overloads.
|
|
Set the ordering stream to send data on. Defaults to 0. Set this if you use ordered data for your game and don't want to hold up game data because of autopatcher file data
|
|
Removes access to a file previously set as downloadable.
|
|
|
|
Files of length >= this will be compressed.
|
|
Directory of files that are downloadable.
|
|
true if the downloadableFiles have been requested
|
|
Directory of files that are downloadable.
|
|
The directory to download into basically.
|
|
The ordering stream to use.
|
|
One of these 3 must be set in order to send data.
|
|
One of these 3 must be set in order to send data.
|
|
One of these 3 must be set in order to send data.
|