# 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 AutopatcherServer:

List of all members.

## Public Member Functions
void | StartThreads (int numThreads, AutopatcherRepositoryInterface **sqlConnectionPtrArray)
void | SetUploadSendParameters (PacketPriority _priority, char _orderingChannel)
void | SetFileListTransferPlugin (FileListTransfer *flt)
void | Clear (void)
| Clear buffered input and output.
virtual void | OnAttach (void)
virtual void | OnDetach (void)
virtual void | Update (void)
| Update is called every time a packet is checked for .
virtual PluginReceiveResult | OnReceive (Packet *packet)
virtual void | OnClosedConnection (SystemAddress systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason)

## Detailed Description

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

## Member Function Documentation

virtual void AutopatcherServer::OnAttach | ( | void |  | ) | `[virtual]`

Called when the interface is attached

Parameters:

  `[in]` | peer | the instance of RakPeer that is calling Receive

Reimplemented from PluginInterface2.

virtual void AutopatcherServer::OnClosedConnection | ( | 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 PluginInterface2.

virtual void AutopatcherServer::OnDetach | ( | void |  | ) | `[virtual]`

Called when the interface is detached

Parameters:

  `[in]` | peer | the instance of RakPeer that is calling Receive

Reimplemented from PluginInterface2.

virtual PluginReceiveResult 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 PluginInterface2.

void 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 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 AutopatcherServer::StartThreads | ( | int | numThreads,
|  | 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

Parameters:

  `[in]` | numThreads | number of threads to run. Recommended 1-4
  `[in]` | sqlConnectionPtrArray | List of pointers to AutopatcherRepositoryInterface, equal to number of threads. C++ note: Don't just cast a derived class array, you need to take the address of each item

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

- d:/RakNet-3.x/DependentExtensions/Autopatcher/AutopatcherServer.h