RakNet::AutopatcherServer Class Reference

The server plugin for the autopatcher. Must be running for the client to get patches. More...

#include <AutopatcherServer.h>

Inheritance diagram for RakNet::AutopatcherServer:

RakNet::PluginInterface2 RakNet::FileListProgress

List of all members.

Classes

struct  ResultTypeAndBitstream

Public Member Functions

void StartThreads (int numThreads, int numSQLConnections, AutopatcherRepositoryInterface **sqlConnectionPtrArray)
void CacheMostRecentPatch (const char *applicationName)
void SetUploadSendParameters (PacketPriority _priority, char _orderingChannel)
void SetFileListTransferPlugin (FileListTransfer *flt)
void SetMaxConurrentUsers (unsigned int _maxConcurrentUsers)
void SetLoadManagementCallback (AutopatcherServerLoadNotifier *asumc)
void Clear (void)
 Clear buffered input and output.
virtual void OnAttach (void)
 Called when the interface is attached.
virtual void OnDetach (void)
 Called when the interface is detached.
virtual void Update (void)
 Update is called every time a packet is checked for .
virtual PluginReceiveResult OnReceive (Packet *packet)
virtual void OnClosedConnection (const SystemAddress &systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason)

Protected Member Functions

virtual void OnFilePushesComplete (SystemAddress systemAddress, unsigned short setID)
 This function is called when all files have been read and are being transferred to a remote system.
virtual void OnSendAborted (SystemAddress systemAddress)
 This function is called when a send to a system was aborted (probably due to disconnection).


Detailed Description

The server plugin for the autopatcher. Must be running for the client to get patches.

Member Function Documentation

void RakNet::AutopatcherServer::CacheMostRecentPatch ( const char *  applicationName  ) 

Load the most recent patch in memory and keep it there This can take a lot of memory, but greatly speeds up serving patches, since disk access is not incurred

Parameters:
[in] applicationName 0 means all, otherwise the name of the application to cache

virtual void RakNet::AutopatcherServer::OnClosedConnection ( const SystemAddress systemAddress,
RakNetGUID  rakNetGUID,
PI2_LostConnectionReason  lostConnectionReason 
) [virtual]

Called when a connection is dropped because the user called RakPeer::CloseConnection() for a particular system

Parameters:
[in] systemAddress The system whose connection was closed
[in] rakNetGuid The guid of the specified system
[in] lostConnectionReason How the connection was closed: manually, connection lost, or notification of disconnection

Reimplemented from RakNet::PluginInterface2.

virtual PluginReceiveResult RakNet::AutopatcherServer::OnReceive ( Packet packet  )  [virtual]

OnReceive is called for every packet.

Parameters:
[in] packet the packet that is being returned to the user
Returns:
True to allow the game and other plugins to get this message, false to absorb it

Reimplemented from RakNet::PluginInterface2.

void RakNet::AutopatcherServer::SetFileListTransferPlugin ( FileListTransfer flt  ) 

This plugin has a dependency on the FileListTransfer plugin, which it uses to actually send the files. So you need an instance of that plugin registered with RakPeerInterface, and a pointer to that interface should be passed here.

Parameters:
[in] flt A pointer to a registered instance of FileListTransfer

void RakNet::AutopatcherServer::SetLoadManagementCallback ( AutopatcherServerLoadNotifier *  asumc  ) 

Set a callback to get notifications of when user requests are queued and processed This is primarily of use to load balance the server

Parameters:
[in] asumc An externally allocated instance of AutopatcherServerLoadNotifier. Pass 0 to disable.

void RakNet::AutopatcherServer::SetMaxConurrentUsers ( unsigned int  _maxConcurrentUsers  ) 

This is the maximum number of users the patcher will service at one time (generally about equal to the number of downloads at once) If this limit is exceeded, the request packet will be put into a queue and serviced when slots are available Defaults to 0 (unlimited)

Parameters:
[in] maxConcurrentUsers Pass 0 for unlimited, otherwise the max users to serve at once

void RakNet::AutopatcherServer::SetUploadSendParameters ( PacketPriority  _priority,
char  _orderingChannel 
)

What parameters to use for the RakPeerInterface::Send() call when uploading files.

Parameters:
[in] _priority See RakPeerInterface::Send()
[in] _orderingChannel See RakPeerInterface::Send()

void RakNet::AutopatcherServer::StartThreads ( int  numThreads,
int  numSQLConnections,
AutopatcherRepositoryInterface **  sqlConnectionPtrArray 
)

DO THIS FIRST Implement to start the worker threads. Before this is called, no queries will be performed When this is called, AllocAutopatcherRepositoryInterface will be called with repositoryAllocationParameters The system works in three phases. 1. Get change list since a given date. This uses one of the worker threads. 2. If either running a full scan, or files have changed since a given date, get the list of patches. This uses one of the worker threads and does an intensive comparison of the hashes the client has vs. the files in the database 3. If the total amount of data to be sent exceeds DATABASE_READ_CHUNK_SIZE, defined in the cpp file, then the database will be read from incrementally during this download phase. This uses an sql connection object, which may or may not be also in use by one of the threads. If you have more sql connections than threads, this tends to prevent the same connection from being used to incrementally read files for a downloader, and to be used in a worker thread.

Parameters:
[in] numThreads Number of processing threads, which handles the CPU intensive tasks of generating a patch list and comparing files
[in] numSQLConnections Number of SQL connection objects passed to sqlConnectionPtrArray. Must be greater than or equal to numThreads
[in] sqlConnectionPtrArray List of pointers to AutopatcherRepositoryInterface. C++ note: Don't just cast a derived class array, you need to take the pointer address of each item


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

Generated on Wed Feb 1 13:33:48 2012 for RakNet by  doxygen 1.5.7.1