SLikeNet 0.1.3

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

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes
CloudComputing
Plugins

Contains the CloudClient and CloudServer plugins. More...

## Classes

class | SLNet::CloudClient
| Performs Post() and Get() operations on CloudMemoryServer. More...
class | SLNet::CloudClientCallback
class | SLNet::CloudAllocator
struct | SLNet::CloudKey
struct | SLNet::CloudQuery
struct | SLNet::CloudQueryRow
struct | SLNet::CloudQueryResult
class | SLNet::CloudServerQueryFilter
| Zero or more instances of CloudServerQueryFilter can be attached to CloudServer to restrict client queries All attached instances of CloudServerQueryFilter on each corresponding operation, from all directly connected clients If any attached instance returns false for a given operation, that operation is silently rejected. More...
class | SLNet::CloudServer
| Stores client data, and allows cross-server communication to retrieve this data. More...
struct | SLNet::CloudServer::BufferedGetResponseFromServer
struct | SLNet::CloudServer::CloudData
struct | SLNet::CloudServer::CloudDataList
struct | SLNet::CloudServer::CloudQueryWithAddresses
struct | SLNet::CloudServer::GetRequest
struct | SLNet::CloudServer::KeySubscriberID
struct | SLNet::CloudServer::RemoteCloudClient
struct | SLNet::CloudServer::RemoteServer

## Detailed Description

Contains the CloudClient and CloudServer plugins.

The CloudServer plugins operates on requests from the CloudClient plugin. The servers are in a fully connected mesh topology, which the clients are connected to any server. Clients can interact with each other by posting and subscribing to memory updates, without being directly connected or even knowing about each other.

## Class Documentation

class SLNet::CloudClient

Performs Post() and Get() operations on CloudMemoryServer.

A CloudClient is a computer connected to one or more servers in a cloud configuration. Operations by one CloudClient can be received and subscribed to by other instances of CloudClient, without those clients being connected, even on different servers.

Definition at line 46 of file CloudClient.h.

Inheritance diagram for SLNet::CloudClient:

### Public Member Functions

| CloudClient ()
virtual | ~CloudClient ()
virtual void | SetDefaultCallbacks (CloudAllocator *_allocator, CloudClientCallback *_callback)
| Set the default callbacks for OnGetReponse(), OnSubscriptionNotification(), and OnSubscriptionDataDeleted()
virtual void | Post (CloudKey *cloudKey, const unsigned char *data, uint32_t dataLengthBytes, RakNetGUID systemIdentifier)
| Uploads data to the cloud.
virtual void | Release (DataStructures::List< CloudKey > &keys, RakNetGUID systemIdentifier)
| Releases one or more data previously uploaded with Post()
virtual bool | Get (CloudQuery *cloudQuery, RakNetGUID systemIdentifier)
| Gets data from the cloud.
virtual bool | Get (CloudQuery *cloudQuery, DataStructures::List< RakNetGUID > &specificSystems, RakNetGUID systemIdentifier)
virtual bool | Get (CloudQuery *cloudQuery, DataStructures::List< CloudQueryRow * > &specificSystems, RakNetGUID systemIdentifier)
virtual void | Unsubscribe (DataStructures::List< CloudKey > &keys, RakNetGUID systemIdentifier)

Unsubscribe from updates previously subscribed to using Get() with the CloudQuery::subscribeToResults set to true The keys and specificSystems parameters are logically treated as AND when checking subscriptions on the server The overload that does not take specificSystems unsubscribes to all passed keys, regardless of system You cannot unsubscribe specific systems when previously subscribed to updates from any system. To do this, first Unsubscribe() from all systems, and call Get() with the specificSystems parameter explicilty listing the systems you want to subscribe to.

virtual void | Unsubscribe (DataStructures::List< CloudKey > &keys, DataStructures::List< RakNetGUID > &specificSystems, RakNetGUID systemIdentifier)
virtual void | Unsubscribe (DataStructures::List< CloudKey > &keys, DataStructures::List< CloudQueryRow * > &specificSystems, RakNetGUID systemIdentifier)
virtual void | OnGetReponse (Packet *packet, CloudClientCallback *_callback=0, CloudAllocator *_allocator=0)
| Call this when you get ID_CLOUD_GET_RESPONSE If callback or allocator are 0, the default callbacks passed to SetDefaultCallbacks() are used.
virtual void | OnGetReponse (CloudQueryResult *cloudQueryResult, Packet *packet, CloudAllocator *_allocator=0)
| Call this when you get ID_CLOUD_GET_RESPONSE Different form of OnGetReponse that returns to a structure that you pass, instead of using a callback You are responsible for deallocation with this form If allocator is 0, the default callback passed to SetDefaultCallbacks() are used.
virtual void | OnSubscriptionNotification (Packet *packet, CloudClientCallback *_callback=0, CloudAllocator *_allocator=0)
| Call this when you get ID_CLOUD_SUBSCRIPTION_NOTIFICATION If callback or allocator are 0, the default callbacks passed to SetDefaultCallbacks() are used.
virtual void | OnSubscriptionNotification (bool *wasUpdated, CloudQueryRow *row, Packet *packet, CloudAllocator *_allocator=0)
| Call this when you get ID_CLOUD_SUBSCRIPTION_NOTIFICATION Different form of OnSubscriptionNotification that returns to a structure that you pass, instead of using a callback You are responsible for deallocation with this form If allocator is 0, the default callback passed to SetDefaultCallbacks() are used.
virtual void | DeallocateWithDefaultAllocator (CloudQueryResult *cloudQueryResult)
| If you never specified an allocator, and used the non-callback form of OnGetReponse(), deallocate cloudQueryResult with this function.
virtual void | DeallocateWithDefaultAllocator (CloudQueryRow *row)
| If you never specified an allocator, and used the non-callback form of OnSubscriptionNotification(), deallocate row with this function.
Public Member Functions inherited from SLNet::PluginInterface2
| PluginInterface2 ()
virtual | ~PluginInterface2 ()
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 void | OnRakPeerStartup (void)
| Called when RakPeer is initialized.
virtual void | OnRakPeerShutdown (void)
| Called when RakPeer is shutdown.
virtual void | OnClosedConnection (const SystemAddress &systemAddress, RakNetGUID rakNetGUID, PI2_LostConnectionReason lostConnectionReason)
virtual void | OnNewConnection (const SystemAddress &systemAddress, RakNetGUID rakNetGUID, bool isIncoming)
virtual void | OnFailedConnectionAttempt (Packet *packet, PI2_FailedConnectionAttemptReason failedConnectionAttemptReason)
virtual bool | UsesReliabilityLayer (void) const
virtual void | OnDirectSocketSend (const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress)
virtual void | OnDirectSocketReceive (const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress)
virtual void | OnReliabilityLayerNotification (const char *errorMessage, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress, bool isError)
virtual void | OnInternalPacket (InternalPacket *internalPacket, unsigned frameNumber, SystemAddress remoteSystemAddress, SLNet::TimeMS time, int isSend)
virtual void | OnAck (unsigned int messageNumber, SystemAddress remoteSystemAddress, SLNet::TimeMS time)
virtual void | OnPushBackPacket (const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress)
RakPeerInterface * | GetRakPeerInterface (void) const
RakNetGUID | GetMyGUIDUnified (void) const
void | SetRakPeerInterface (RakPeerInterface *ptr)
void | SetTCPInterface (TCPInterface *ptr)

### Protected Member Functions

PluginReceiveResult | OnReceive (Packet *packet)
Protected Member Functions inherited from SLNet::PluginInterface2
void | SendUnified (const SLNet::BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast)
void | SendUnified (const char *data, const int length, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast)
bool | SendListUnified (const char **data, const int *lengths, const int numParameters, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast)
Packet * | AllocatePacketUnified (unsigned dataSize)
void | PushBackPacketUnified (Packet *packet, bool pushAtHead)
void | DeallocPacketUnified (Packet *packet)

### Protected Attributes

CloudClientCallback * | callback
CloudAllocator * | allocator
CloudAllocator | unsetDefaultAllocator
Protected Attributes inherited from SLNet::PluginInterface2
RakPeerInterface * | rakPeerInterface
TCPInterface * | tcpInterface

#### Constructor & Destructor Documentation

SLNet::CloudClient::CloudClient | ( |  | ) |

virtual SLNet::CloudClient::~CloudClient | ( |  | ) |

virtual

#### Member Function Documentation

virtual void SLNet::CloudClient::DeallocateWithDefaultAllocator | ( | CloudQueryResult * | cloudQueryResult | ) |

virtual

If you never specified an allocator, and used the non-callback form of OnGetReponse(), deallocate cloudQueryResult with this function.

virtual void SLNet::CloudClient::DeallocateWithDefaultAllocator | ( | CloudQueryRow * | row | ) |

virtual

If you never specified an allocator, and used the non-callback form of OnSubscriptionNotification(), deallocate row with this function.

virtual bool SLNet::CloudClient::Get | ( | CloudQuery * | cloudQuery,
|  | RakNetGUID | systemIdentifier
| ) |  |

virtual

Gets data from the cloud.

For a given query containing one or more keys, return data that matches those keys. The values will be returned in the ID_CLOUD_GET_RESPONSE packet, which should be passed to OnGetReponse() and will invoke CloudClientCallback::OnGet() CloudQuery::startingRowIndex is used to skip the first n values that would normally be returned.. CloudQuery::maxRowsToReturn is used to limit the number of rows returned. The number of rows returned may also be limited by CloudServer::SetMaxBytesPerDownload(); CloudQuery::subscribeToResults if set to true, will cause ID_CLOUD_SUBSCRIPTION_NOTIFICATION to be returned to us when any of the keys in the query are updated or are deleted. ID_CLOUD_GET_RESPONSE will be returned even if subscribing to the result list. Only later updates will return ID_CLOUD_SUBSCRIPTION_NOTIFICATION. Calling Get() with CloudQuery::subscribeToResults false, when you are already subscribed, does not remove the subscription. Use Unsubscribe() for this. Resubscribing using the same CloudKey but a different or no specificSystems overwrites the subscribed systems for those keys.

Parameters

  [in] | cloudQuery | One or more keys, and optional parameters to perform with the Get
  [in] | systemIdentifier | A remote system running CloudServer that we are already connected to.
  [in] | specificSystems | It is possible to get or subscribe to updates only for specific uploading CloudClient instances. Pass the desired instances here. The overload that does not have the specificSystems parameter is treated as subscribing to all updates from all clients.

virtual bool SLNet::CloudClient::Get | ( | CloudQuery * | cloudQuery,
|  | DataStructures::List< RakNetGUID > & | specificSystems,
|  | RakNetGUID | systemIdentifier
| ) |  |

virtual

virtual bool SLNet::CloudClient::Get | ( | CloudQuery * | cloudQuery,
|  | DataStructures::List< CloudQueryRow * > & | specificSystems,
|  | RakNetGUID | systemIdentifier
| ) |  |

virtual

virtual void SLNet::CloudClient::OnGetReponse | ( | Packet * | packet,
|  | CloudClientCallback * | _callback = `0`,
|  | CloudAllocator * | _allocator = `0`
| ) |  |

virtual

Call this when you get ID_CLOUD_GET_RESPONSE If callback or allocator are 0, the default callbacks passed to SetDefaultCallbacks() are used.

Parameters

  [in] | packet | Packet structure returned from RakPeerInterface
  [in] | _callback | Callback to be called from the function containing output parameters. If 0, default is used.
  [in] | _allocator | Allocator to be used to allocate data. If 0, default is used.

virtual void SLNet::CloudClient::OnGetReponse | ( | CloudQueryResult * | cloudQueryResult,
|  | Packet * | packet,
|  | CloudAllocator * | _allocator = `0`
| ) |  |

virtual

Call this when you get ID_CLOUD_GET_RESPONSE Different form of OnGetReponse that returns to a structure that you pass, instead of using a callback You are responsible for deallocation with this form If allocator is 0, the default callback passed to SetDefaultCallbacks() are used.

Parameters

  [out] | cloudQueryResult | A pointer to a structure that will be filled out with data
  [in] | packet | Packet structure returned from RakPeerInterface
  [in] | _allocator | Allocator to be used to allocate data. If 0, default is used.

PluginReceiveResult SLNet::CloudClient::OnReceive | ( | Packet * | packet | ) |

protectedvirtual

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 SLNet::PluginInterface2.

virtual void SLNet::CloudClient::OnSubscriptionNotification | ( | Packet * | packet,
|  | CloudClientCallback * | _callback = `0`,
|  | CloudAllocator * | _allocator = `0`
| ) |  |

virtual

Call this when you get ID_CLOUD_SUBSCRIPTION_NOTIFICATION If callback or allocator are 0, the default callbacks passed to SetDefaultCallbacks() are used.

Parameters

  [in] | packet | Packet structure returned from RakPeerInterface
  [in] | _callback | Callback to be called from the function containing output parameters. If 0, default is used.
  [in] | _allocator | Allocator to be used to allocate data. If 0, default is used.

virtual void SLNet::CloudClient::OnSubscriptionNotification | ( | bool * | wasUpdated,
|  | CloudQueryRow * | row,
|  | Packet * | packet,
|  | CloudAllocator * | _allocator = `0`
| ) |  |

virtual

Call this when you get ID_CLOUD_SUBSCRIPTION_NOTIFICATION Different form of OnSubscriptionNotification that returns to a structure that you pass, instead of using a callback You are responsible for deallocation with this form If allocator is 0, the default callback passed to SetDefaultCallbacks() are used.

Parameters

  [out] | wasUpdated | If true, the row was updated. If false, it was deleted. result will contain the last value just before deletion
  [out] | row | A pointer to a structure that will be filled out with data
  [in] | packet | Packet structure returned from RakPeerInterface
  [in] | _allocator | Allocator to be used to allocate data. If 0, default is used.

virtual void SLNet::CloudClient::Post | ( | CloudKey * | cloudKey,
|  | const unsigned char * | data,
|  | uint32_t | dataLengthBytes,
|  | RakNetGUID | systemIdentifier
| ) |  |

virtual

Uploads data to the cloud.

Data uploaded to the cloud will be stored by the server sent to, identified by systemIdentifier. As long as you are connected to this server, the data will persist. Queries for that data by the Get() operation will return the RakNetGUID and SystemAddress of the uploader, as well as the data itself. Furthermore, if any clients are subscribed to the particular CloudKey passed, those clients will get update notices that the data has changed Passing data with the same cloudKey more than once will overwrite the prior value. This call will silently fail if CloudServer::SetMaxUploadBytesPerClient() is exceeded

Parameters

  [in] | cloudKey | Identifies the data being uploaded
  [in] | data | A pointer to data to upload. This pointer does not need to persist past the call
  [in] | dataLengthBytes | The length in bytes of data
  [in] | systemIdentifier | A remote system running CloudServer that we are already connected to.

virtual void SLNet::CloudClient::Release | ( | DataStructures::List< CloudKey > & | keys,
|  | RakNetGUID | systemIdentifier
| ) |  |

virtual

Releases one or more data previously uploaded with Post()

If a remote system has subscribed to one or more of the keys uploaded, they will get ID_CLOUD_SUBSCRIPTION_NOTIFICATION notifications containing the last value uploaded before deletions

Parameters

  [in] | cloudKey | Identifies the data to release. It is possible to remove uploads from multiple Post() calls at once.
  [in] | systemIdentifier | A remote system running CloudServer that we are already connected to.

virtual void SLNet::CloudClient::SetDefaultCallbacks | ( | CloudAllocator * | _allocator,
|  | CloudClientCallback * | _callback
| ) |  |

virtual

Set the default callbacks for OnGetReponse(), OnSubscriptionNotification(), and OnSubscriptionDataDeleted()

Pointers to CloudAllocator and CloudClientCallback can be stored by the system if desired. If a callback is not provided to OnGetReponse(), OnSubscriptionNotification(), OnSubscriptionDataDeleted(), the callback passed here will be used instead.

Parameters

  [in] | _allocator | An instance of CloudAllocator
  [in] | _callback | An instance of CloudClientCallback

virtual void SLNet::CloudClient::Unsubscribe | ( | DataStructures::List< CloudKey > & | keys,
|  | RakNetGUID | systemIdentifier
| ) |  |

virtual

Unsubscribe from updates previously subscribed to using Get() with the CloudQuery::subscribeToResults set to true The keys and specificSystems parameters are logically treated as AND when checking subscriptions on the server The overload that does not take specificSystems unsubscribes to all passed keys, regardless of system You cannot unsubscribe specific systems when previously subscribed to updates from any system. To do this, first Unsubscribe() from all systems, and call Get() with the specificSystems parameter explicilty listing the systems you want to subscribe to.

virtual void SLNet::CloudClient::Unsubscribe | ( | DataStructures::List< CloudKey > & | keys,
|  | DataStructures::List< RakNetGUID > & | specificSystems,
|  | RakNetGUID | systemIdentifier
| ) |  |

virtual

virtual void SLNet::CloudClient::Unsubscribe | ( | DataStructures::List< CloudKey > & | keys,
|  | DataStructures::List< CloudQueryRow * > & | specificSystems,
|  | RakNetGUID | systemIdentifier
| ) |  |

virtual

#### Member Data Documentation

CloudAllocator* SLNet::CloudClient::allocator

protected

Definition at line 147 of file CloudClient.h.

CloudClientCallback* SLNet::CloudClient::callback

protected

Definition at line 146 of file CloudClient.h.

CloudAllocator SLNet::CloudClient::unsetDefaultAllocator

protected

Definition at line 149 of file CloudClient.h.

class SLNet::CloudClientCallback

Parses ID_CLOUD_GET_RESPONSE and ID_CLOUD_SUBSCRIPTION_NOTIFICATION in a convenient callback form

Definition at line 154 of file CloudClient.h.

### Public Member Functions

| CloudClientCallback ()
virtual | ~CloudClientCallback ()
virtual void | OnGet (SLNet::CloudQueryResult *result, bool *deallocateRowsAfterReturn)
| Called in response to ID_CLOUD_GET_RESPONSE.
virtual void | OnSubscriptionNotification (SLNet::CloudQueryRow *result, bool wasUpdated, bool *deallocateRowAfterReturn)
| Called in response to ID_CLOUD_SUBSCRIPTION_NOTIFICATION.

#### Constructor & Destructor Documentation

SLNet::CloudClientCallback::CloudClientCallback | ( |  | ) |

inline

Definition at line 157 of file CloudClient.h.

virtual SLNet::CloudClientCallback::~CloudClientCallback | ( |  | ) |

inlinevirtual

Definition at line 158 of file CloudClient.h.

#### Member Function Documentation

virtual void SLNet::CloudClientCallback::OnGet | ( | SLNet::CloudQueryResult * | result,
|  | bool * | deallocateRowsAfterReturn
| ) |  |

inlinevirtual

Called in response to ID_CLOUD_GET_RESPONSE.

Parameters

  [out] | result | Contains the original query passed to Get(), and a list of rows returned.
  [out] | deallocateRowsAfterReturn | CloudQueryResult::rowsReturned will be deallocated after the function returns by default. Set to false to not deallocate these pointers. The pointers are allocated through CloudAllocator.

Definition at line 163 of file CloudClient.h.

virtual void SLNet::CloudClientCallback::OnSubscriptionNotification | ( | SLNet::CloudQueryRow * | result,
|  | bool | wasUpdated,
|  | bool * | deallocateRowAfterReturn
| ) |  |

inlinevirtual

Called in response to ID_CLOUD_SUBSCRIPTION_NOTIFICATION.

Parameters

  [out] | result | Contains the row updated
  [out] | wasUpdated | If true, the row was updated. If false, it was deleted. result will contain the last value just before deletion
  [out] | deallocateRowAfterReturn | result will be deallocated after the function returns by default. Set to false to not deallocate these pointers. The pointers are allocated through CloudAllocator.

Definition at line 169 of file CloudClient.h.

class SLNet::CloudAllocator

Allocates CloudQueryRow and the row data. Override to use derived classes or different allocators

Definition at line 33 of file CloudCommon.h.

Inheritance diagram for SLNet::CloudAllocator:

### Public Member Functions

| CloudAllocator ()
virtual | ~CloudAllocator ()
virtual CloudQueryRow * | AllocateCloudQueryRow (void)
| Allocate a row.
virtual void | DeallocateCloudQueryRow (CloudQueryRow *row)
| Free a row.
virtual unsigned char * | AllocateRowData (uint32_t bytesNeededForData)
| Allocate CloudQueryRow::data.
virtual void | DeallocateRowData (void *data)
| Free CloudQueryRow::data.

#### Constructor & Destructor Documentation

SLNet::CloudAllocator::CloudAllocator | ( |  | ) |

inline

Definition at line 36 of file CloudCommon.h.

virtual SLNet::CloudAllocator::~CloudAllocator | ( |  | ) |

inlinevirtual

Definition at line 37 of file CloudCommon.h.

#### Member Function Documentation

virtual CloudQueryRow* SLNet::CloudAllocator::AllocateCloudQueryRow | ( | void |  | ) |

virtual

Allocate a row.

virtual unsigned char* SLNet::CloudAllocator::AllocateRowData | ( | uint32_t | bytesNeededForData | ) |

virtual

Allocate CloudQueryRow::data.

virtual void SLNet::CloudAllocator::DeallocateCloudQueryRow | ( | CloudQueryRow * | row | ) |

virtual

Free a row.

virtual void SLNet::CloudAllocator::DeallocateRowData | ( | void * | data | ) |

virtual

Free CloudQueryRow::data.

struct SLNet::CloudKey

Serves as a key to identify data uploaded to or queried from the server.

Definition at line 51 of file CloudCommon.h.

### Public Member Functions

| CloudKey ()
| CloudKey (SLNet::RakString _primaryKey, uint32_t _secondaryKey)
| ~CloudKey ()
void | Serialize (bool writeToBitstream, BitStream *bitStream)

### Public Attributes

SLNet::RakString | primaryKey
uint32_t | secondaryKey
| Identifies the secondary key. This is intended to be a subcategory enumeration, such as PLAYER_LIST or RUNNING_SCORES.

#### Constructor & Destructor Documentation

SLNet::CloudKey::CloudKey | ( |  | ) |

inline

Definition at line 53 of file CloudCommon.h.

SLNet::CloudKey::CloudKey | ( | SLNet::RakString | _primaryKey,
|  | uint32_t | _secondaryKey
| ) |  |

inline

Definition at line 54 of file CloudCommon.h.

SLNet::CloudKey::~CloudKey | ( |  | ) |

inline

Definition at line 55 of file CloudCommon.h.

#### Member Function Documentation

void SLNet::CloudKey::Serialize | ( | bool | writeToBitstream,
|  | BitStream * | bitStream
| ) |  |

#### Member Data Documentation

SLNet::RakString SLNet::CloudKey::primaryKey

Identifies the primary key. This is intended to be a major category, such as the name of the application Must be non-empty

Definition at line 59 of file CloudCommon.h.

uint32_t SLNet::CloudKey::secondaryKey

Identifies the secondary key. This is intended to be a subcategory enumeration, such as PLAYER_LIST or RUNNING_SCORES.

Definition at line 62 of file CloudCommon.h.

struct SLNet::CloudQuery

Data members used to query the cloud

Definition at line 73 of file CloudCommon.h.

### Public Member Functions

| CloudQuery ()
void | Serialize (bool writeToBitstream, BitStream *bitStream)

### Public Attributes

DataStructures::List< CloudKey > | keys
uint32_t | startingRowIndex
| If limiting the number of rows to return, this is the starting offset into the list. Has no effect unless maxRowsToReturn is > 0.
uint32_t | maxRowsToReturn
| Maximum number of rows to return. Actual number may still be less than this. Pass 0 to mean no-limit.
bool | subscribeToResults
| If true, automatically get updates as the results returned to you change. Unsubscribe with CloudMemoryClient::Unsubscribe()

#### Constructor & Destructor Documentation

SLNet::CloudQuery::CloudQuery | ( |  | ) |

inline

Definition at line 75 of file CloudCommon.h.

#### Member Function Documentation

void SLNet::CloudQuery::Serialize | ( | bool | writeToBitstream,
|  | BitStream * | bitStream
| ) |  |

#### Member Data Documentation

DataStructures::List<CloudKey> SLNet::CloudQuery::keys

List of keys to query. Must be at least of length 1. This query is run on uploads from all clients, and those that match the combination of primaryKey and secondaryKey are potentially returned If you pass more than one key at a time, the results are concatenated so if you need to differentiate between queries then send two different queries

Definition at line 80 of file CloudCommon.h.

uint32_t SLNet::CloudQuery::maxRowsToReturn

Maximum number of rows to return. Actual number may still be less than this. Pass 0 to mean no-limit.

Definition at line 86 of file CloudCommon.h.

uint32_t SLNet::CloudQuery::startingRowIndex

If limiting the number of rows to return, this is the starting offset into the list. Has no effect unless maxRowsToReturn is > 0.

Definition at line 83 of file CloudCommon.h.

bool SLNet::CloudQuery::subscribeToResults

If true, automatically get updates as the results returned to you change. Unsubscribe with CloudMemoryClient::Unsubscribe()

Definition at line 89 of file CloudCommon.h.

struct SLNet::CloudQueryRow

Definition at line 96 of file CloudCommon.h.

### Public Member Functions

void | Serialize (bool writeToBitstream, BitStream *bitStream, CloudAllocator *allocator)

### Public Attributes

CloudKey | key
| Key used to identify this data.
unsigned char * | data
| Data uploaded.
uint32_t | length
| Length of data uploaded.
SystemAddress | serverSystemAddress
| System address of server that is holding this data, and the client is connected to.
SystemAddress | clientSystemAddress
| System address of client that uploaded this data.
RakNetGUID | serverGUID
| RakNetGUID of server that is holding this data, and the client is connected to.
RakNetGUID | clientGUID
| RakNetGUID of client that uploaded this data.

#### Member Function Documentation

void SLNet::CloudQueryRow::Serialize | ( | bool | writeToBitstream,
|  | BitStream * | bitStream,
|  | CloudAllocator * | allocator
| ) |  |

#### Member Data Documentation

RakNetGUID SLNet::CloudQueryRow::clientGUID

RakNetGUID of client that uploaded this data.

Definition at line 117 of file CloudCommon.h.

SystemAddress SLNet::CloudQueryRow::clientSystemAddress

System address of client that uploaded this data.

Definition at line 111 of file CloudCommon.h.

unsigned char* SLNet::CloudQueryRow::data

Data uploaded.

Definition at line 102 of file CloudCommon.h.

CloudKey SLNet::CloudQueryRow::key

Key used to identify this data.

Definition at line 99 of file CloudCommon.h.

uint32_t SLNet::CloudQueryRow::length

Length of data uploaded.

Definition at line 105 of file CloudCommon.h.

RakNetGUID SLNet::CloudQueryRow::serverGUID

RakNetGUID of server that is holding this data, and the client is connected to.

Definition at line 114 of file CloudCommon.h.

SystemAddress SLNet::CloudQueryRow::serverSystemAddress

System address of server that is holding this data, and the client is connected to.

Definition at line 108 of file CloudCommon.h.

struct SLNet::CloudQueryResult

Definition at line 124 of file CloudCommon.h.

### Public Member Functions

void | Serialize (bool writeToBitstream, BitStream *bitStream, CloudAllocator *allocator)
void | SerializeHeader (bool writeToBitstream, BitStream *bitStream)
void | SerializeNumRows (bool writeToBitstream, uint32_t &numRows, BitStream *bitStream)
void | SerializeCloudQueryRows (bool writeToBitstream, uint32_t &numRows, BitStream *bitStream, CloudAllocator *allocator)

### Public Attributes

CloudQuery | cloudQuery
| Query originally passed to Download()
DataStructures::List < CloudQueryRow * > | rowsReturned
| Results returned from query. If there were multiple keys in CloudQuery::keys then see resultKeyIndices.
DataStructures::List< uint32_t > | resultKeyIndices
bool | subscribeToResults
| Whatever was passed to CloudClient::Get() as CloudQuery::subscribeToResults.

#### Member Function Documentation

void SLNet::CloudQueryResult::Serialize | ( | bool | writeToBitstream,
|  | BitStream * | bitStream,
|  | CloudAllocator * | allocator
| ) |  |

void SLNet::CloudQueryResult::SerializeCloudQueryRows | ( | bool | writeToBitstream,
|  | uint32_t & | numRows,
|  | BitStream * | bitStream,
|  | CloudAllocator * | allocator
| ) |  |

void SLNet::CloudQueryResult::SerializeHeader | ( | bool | writeToBitstream,
|  | BitStream * | bitStream
| ) |  |

void SLNet::CloudQueryResult::SerializeNumRows | ( | bool | writeToBitstream,
|  | uint32_t & | numRows,
|  | BitStream * | bitStream
| ) |  |

#### Member Data Documentation

CloudQuery SLNet::CloudQueryResult::cloudQuery

Query originally passed to Download()

Definition at line 127 of file CloudCommon.h.

DataStructures::List<uint32_t> SLNet::CloudQueryResult::resultKeyIndices

If there were multiple keys in CloudQuery::keys, then each key is processed in order and the result concatenated to rowsReturned The starting index of each query is written to resultKeyIndices For example, if CloudQuery::keys had 4 keys, returning 3 rows, 0, rows, 5 rows, and 12 rows then resultKeyIndices would be 0, 3, 3, 8

Definition at line 136 of file CloudCommon.h.

DataStructures::List<CloudQueryRow*> SLNet::CloudQueryResult::rowsReturned

Results returned from query. If there were multiple keys in CloudQuery::keys then see resultKeyIndices.

Definition at line 130 of file CloudCommon.h.

bool SLNet::CloudQueryResult::subscribeToResults

Whatever was passed to CloudClient::Get() as CloudQuery::subscribeToResults.

Definition at line 139 of file CloudCommon.h.

class SLNet::CloudServerQueryFilter

Zero or more instances of CloudServerQueryFilter can be attached to CloudServer to restrict client queries All attached instances of CloudServerQueryFilter on each corresponding operation, from all directly connected clients If any attached instance returns false for a given operation, that operation is silently rejected.

Definition at line 48 of file CloudServer.h.

### Public Member Functions

| CloudServerQueryFilter ()
virtual | ~CloudServerQueryFilter ()
virtual bool | OnPostRequest (RakNetGUID clientGuid, SystemAddress clientAddress, CloudKey key, uint32_t dataLength, const char *data)=0
virtual bool | OnReleaseRequest (RakNetGUID clientGuid, SystemAddress clientAddress, DataStructures::List< CloudKey > &cloudKeys)=0
virtual bool | OnGetRequest (RakNetGUID clientGuid, SystemAddress clientAddress, CloudQuery &query, DataStructures::List< RakNetGUID > &specificSystems)=0
virtual bool | OnUnsubscribeRequest (RakNetGUID clientGuid, SystemAddress clientAddress, DataStructures::List< CloudKey > &cloudKeys, DataStructures::List< RakNetGUID > &specificSystems)=0

#### Constructor & Destructor Documentation

SLNet::CloudServerQueryFilter::CloudServerQueryFilter | ( |  | ) |

inline

Definition at line 51 of file CloudServer.h.

virtual SLNet::CloudServerQueryFilter::~CloudServerQueryFilter | ( |  | ) |

inlinevirtual

Definition at line 52 of file CloudServer.h.

#### Member Function Documentation

virtual bool SLNet::CloudServerQueryFilter::OnGetRequest | ( | RakNetGUID | clientGuid,
|  | SystemAddress | clientAddress,
|  | CloudQuery & | query,
|  | DataStructures::List< RakNetGUID > & | specificSystems
| ) |  |

pure virtual

Called when a local client wants to query data If you return false, the client will get no response at all

Returns
  true to allow, false to reject

virtual bool SLNet::CloudServerQueryFilter::OnPostRequest | ( | RakNetGUID | clientGuid,
|  | SystemAddress | clientAddress,
|  | CloudKey | key,
|  | uint32_t | dataLength,
|  | const char * | data
| ) |  |

pure virtual

Called when a local client wants to post data

Returns
  true to allow, false to reject

virtual bool SLNet::CloudServerQueryFilter::OnReleaseRequest | ( | RakNetGUID | clientGuid,
|  | SystemAddress | clientAddress,
|  | DataStructures::List< CloudKey > & | cloudKeys
| ) |  |

pure virtual

Called when a local client wants to release data that it has previously uploaded

Returns
  true to allow, false to reject

virtual bool SLNet::CloudServerQueryFilter::OnUnsubscribeRequest | ( | RakNetGUID | clientGuid,
|  | SystemAddress | clientAddress,
|  | DataStructures::List< CloudKey > & | cloudKeys,
|  | DataStructures::List< RakNetGUID > & | specificSystems
| ) |  |

pure virtual

Called when a local client wants to stop getting updates for data If you return false, the client will keep getting updates for that data

Returns
  true to allow, false to reject

class SLNet::CloudServer

Stores client data, and allows cross-server communication to retrieve this data.

Definition at line 75 of file CloudServer.h.

Inheritance diagram for SLNet::CloudServer:

### Public Member Functions

| CloudServer ()
virtual | ~CloudServer ()
void | SetMaxUploadBytesPerClient (uint64_t bytes)
| Max bytes a client can upload Data in excess of this value is silently ignored defaults to 0 (unlimited)
void | SetMaxBytesPerDownload (uint64_t bytes)
| Max bytes returned by a download. If the number of bytes would exceed this amount, the returned list is truncated However, if this would result in no rows downloaded, then one row will be returned.
void | AddServer (RakNetGUID systemIdentifier)
| Add a server, which is assumed to be connected in a fully connected mesh to all other servers and also running the CloudServer plugin The other system must also call AddServer before getting the subscription data, or it will be rejected. Sending a message telling the other system to call AddServer(), followed by calling AddServer() locally, would be sufficient for this to work.
void | RemoveServer (RakNetGUID systemIdentifier)
| Removes a server added through AddServer()
void | GetRemoteServers (DataStructures::List< RakNetGUID > &remoteServersOut)
void | Clear (void)
| Frees all memory. Does not remove query filters.
void | ForceExternalSystemAddress (SystemAddress forcedAddress)
| Report the specified SystemAddress to client queries, rather than what RakPeer reads. This is useful if you already know your public IP This only applies to future updates, so call it before updating to apply to all queries.
void | AddQueryFilter (CloudServerQueryFilter *filter)
| Adds a callback called on each query. If all filters returns true for an operation, the operation is allowed. If the filter was already added, the function silently fails.
void | RemoveQueryFilter (CloudServerQueryFilter *filter)
| Removes a callback added with AddQueryFilter() The instance is not deleted, only unreferenced. It is up to the user to delete the instance, if necessary.
void | RemoveAllQueryFilters (void)
| Removes all instances of CloudServerQueryFilter added with AddQueryFilter(). The instances are not deleted, only unreferenced. It is up to the user to delete the instances, if necessary.
Public Member Functions inherited from SLNet::PluginInterface2
| PluginInterface2 ()
virtual | ~PluginInterface2 ()
virtual void | OnAttach (void)
| Called when the interface is attached.
virtual void | OnDetach (void)
| Called when the interface is detached.
virtual void | OnRakPeerStartup (void)
| Called when RakPeer is initialized.
virtual void | OnNewConnection (const SystemAddress &systemAddress, RakNetGUID rakNetGUID, bool isIncoming)
virtual void | OnFailedConnectionAttempt (Packet *packet, PI2_FailedConnectionAttemptReason failedConnectionAttemptReason)
virtual bool | UsesReliabilityLayer (void) const
virtual void | OnDirectSocketSend (const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress)
virtual void | OnDirectSocketReceive (const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress)
virtual void | OnReliabilityLayerNotification (const char *errorMessage, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress, bool isError)
virtual void | OnInternalPacket (InternalPacket *internalPacket, unsigned frameNumber, SystemAddress remoteSystemAddress, SLNet::TimeMS time, int isSend)
virtual void | OnAck (unsigned int messageNumber, SystemAddress remoteSystemAddress, SLNet::TimeMS time)
virtual void | OnPushBackPacket (const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress)
RakPeerInterface * | GetRakPeerInterface (void) const
RakNetGUID | GetMyGUIDUnified (void) const
void | SetRakPeerInterface (RakPeerInterface *ptr)
void | SetTCPInterface (TCPInterface *ptr)

### Protected Member Functions

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)
virtual void | OnRakPeerShutdown (void)
| Called when RakPeer is shutdown.
virtual void | OnPostRequest (Packet *packet)
virtual void | OnReleaseRequest (Packet *packet)
virtual void | OnGetRequest (Packet *packet)
virtual void | OnUnsubscribeRequest (Packet *packet)
virtual void | OnServerToServerGetRequest (Packet *packet)
virtual void | OnServerToServerGetResponse (Packet *packet)
void | WriteCloudQueryRowFromResultList (unsigned int i, DataStructures::List< CloudData * > &cloudDataResultList, DataStructures::List< CloudKey > &cloudKeyResultList, BitStream *bsOut)
void | WriteCloudQueryRowFromResultList (DataStructures::List< CloudData * > &cloudDataResultList, DataStructures::List< CloudKey > &cloudKeyResultList, BitStream *bsOut)
void | ReleaseSystem (RakNetGUID clientAddress)
void | ReleaseKeys (RakNetGUID clientAddress, DataStructures::List< CloudKey > &keys)
void | NotifyClientSubscribersOfDataChange (CloudData *cloudData, CloudKey &key, DataStructures::OrderedList< RakNetGUID, RakNetGUID > &subscribers, bool wasUpdated)
void | NotifyClientSubscribersOfDataChange (CloudQueryRow *row, DataStructures::OrderedList< RakNetGUID, RakNetGUID > &subscribers, bool wasUpdated)
void | NotifyServerSubscribersOfDataChange (CloudData *cloudData, CloudKey &key, bool wasUpdated)
void | ProcessAndTransmitGetRequest (GetRequest *getRequest)
void | ProcessCloudQueryWithAddresses (CloudServer::CloudQueryWithAddresses &cloudQueryWithAddresses, DataStructures::List< CloudData * > &cloudDataResultList, DataStructures::List< CloudKey > &cloudKeyResultList)
void | SendUploadedAndSubscribedKeysToServer (RakNetGUID systemAddress)
void | SendUploadedKeyToServers (CloudKey &cloudKey)
void | SendSubscribedKeyToServers (CloudKey &cloudKey)
void | RemoveUploadedKeyFromServers (CloudKey &cloudKey)
void | RemoveSubscribedKeyFromServers (CloudKey &cloudKey)
void | OnSendUploadedAndSubscribedKeysToServer (Packet *packet)
void | OnSendUploadedKeyToServers (Packet *packet)
void | OnSendSubscribedKeyToServers (Packet *packet)
void | OnRemoveUploadedKeyFromServers (Packet *packet)
void | OnRemoveSubscribedKeyFromServers (Packet *packet)
void | OnServerDataChanged (Packet *packet)
void | GetServersWithUploadedKeys (DataStructures::List< CloudKey > &keys, DataStructures::List< RemoteServer * > &remoteServersWithData)
CloudServer::CloudDataList * | GetOrAllocateCloudDataList (CloudKey key, bool *dataRepositoryExists, unsigned int &dataRepositoryIndex)
void | UnsubscribeFromKey (RemoteCloudClient *remoteCloudClient, RakNetGUID remoteCloudClientGuid, unsigned int keySubscriberIndex, CloudKey &cloudKey, DataStructures::List< RakNetGUID > &specificSystems)
void | RemoveSpecificSubscriber (RakNetGUID specificSubscriber, CloudDataList *cloudDataList, RakNetGUID remoteCloudClientGuid)
Protected Member Functions inherited from SLNet::PluginInterface2
void | SendUnified (const SLNet::BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast)
void | SendUnified (const char *data, const int length, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast)
bool | SendListUnified (const char **data, const int *lengths, const int numParameters, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast)
Packet * | AllocatePacketUnified (unsigned dataSize)
void | PushBackPacketUnified (Packet *packet, bool pushAtHead)
void | DeallocPacketUnified (Packet *packet)

### Static Protected Member Functions

static int | KeyDataPtrComp (const RakNetGUID &key, CloudData *const &data)
static int | KeyDataListComp (const CloudKey &key, CloudDataList *const &data)
static int | KeySubscriberIDComp (const CloudKey &key, KeySubscriberID *const &data)
static int | RemoteServerComp (const RakNetGUID &key, RemoteServer *const &data)
static int | BufferedGetResponseFromServerComp (const RakNetGUID &key, BufferedGetResponseFromServer *const &data)
static int | GetRequestComp (const uint32_t &key, GetRequest *const &data)

### Protected Attributes

uint64_t | maxUploadBytesPerClient
uint64_t | maxBytesPerDowload
DataStructures::OrderedList < CloudKey, CloudDataList *, CloudServer::KeyDataListComp > | dataRepository
DataStructures::Hash < RakNetGUID, RemoteCloudClient *, 2048, RakNetGUID::ToUint32 > | remoteSystems
DataStructures::OrderedList < RakNetGUID, RemoteServer *, CloudServer::RemoteServerComp > | remoteServers
DataStructures::OrderedList < uint32_t, GetRequest *, CloudServer::GetRequestComp > | getRequests
SLNet::Time | nextGetRequestsCheck
uint32_t | nextGetRequestId
DataStructures::List < CloudServerQueryFilter * > | queryFilters
SystemAddress | forceAddress
Protected Attributes inherited from SLNet::PluginInterface2
RakPeerInterface * | rakPeerInterface
TCPInterface * | tcpInterface

## Additional Inherited Members

Private Member Functions inherited from SLNet::CloudAllocator
| CloudAllocator ()
virtual | ~CloudAllocator ()
virtual CloudQueryRow * | AllocateCloudQueryRow (void)
| Allocate a row.
virtual void | DeallocateCloudQueryRow (CloudQueryRow *row)
| Free a row.
virtual unsigned char * | AllocateRowData (uint32_t bytesNeededForData)
| Allocate CloudQueryRow::data.
virtual void | DeallocateRowData (void *data)
| Free CloudQueryRow::data.

#### Constructor & Destructor Documentation

SLNet::CloudServer::CloudServer | ( |  | ) |

virtual SLNet::CloudServer::~CloudServer | ( |  | ) |

virtual

#### Member Function Documentation

void SLNet::CloudServer::AddQueryFilter | ( | CloudServerQueryFilter * | filter | ) |

Adds a callback called on each query. If all filters returns true for an operation, the operation is allowed. If the filter was already added, the function silently fails.

Parameters

  [in] | filter | An externally allocated instance of CloudServerQueryFilter. The instance must remain valid until it is removed with RemoveQueryFilter() or RemoveAllQueryFilters()

void SLNet::CloudServer::AddServer | ( | RakNetGUID | systemIdentifier | ) |

Add a server, which is assumed to be connected in a fully connected mesh to all other servers and also running the CloudServer plugin The other system must also call AddServer before getting the subscription data, or it will be rejected. Sending a message telling the other system to call AddServer(), followed by calling AddServer() locally, would be sufficient for this to work.

Note
  This sends subscription data to the other system, using RELIABLE_ORDERED on channel 0

Parameters

  [in] | systemIdentifier | Identifier of the remote system

static int SLNet::CloudServer::BufferedGetResponseFromServerComp | ( | const RakNetGUID & | key,
|  | BufferedGetResponseFromServer *const & | data
| ) |  |

staticprotected

void SLNet::CloudServer::Clear | ( | void |  | ) |

Frees all memory. Does not remove query filters.

void SLNet::CloudServer::ForceExternalSystemAddress | ( | SystemAddress | forcedAddress | ) |

Report the specified SystemAddress to client queries, rather than what RakPeer reads. This is useful if you already know your public IP This only applies to future updates, so call it before updating to apply to all queries.

Parameters

  [in] | forcedAddress | The systmeAddress to return in queries. Use UNASSIGNED_SYSTEM_ADDRESS (default) to use what RakPeer returns

CloudServer::CloudDataList* SLNet::CloudServer::GetOrAllocateCloudDataList | ( | CloudKey | key,
|  | bool * | dataRepositoryExists,
|  | unsigned int & | dataRepositoryIndex
| ) |  |

protected

void SLNet::CloudServer::GetRemoteServers | ( | DataStructures::List< RakNetGUID > & | remoteServersOut | ) |

Return list of servers added with AddServer()

Parameters

  [out] | remoteServers | List of servers added

static int SLNet::CloudServer::GetRequestComp | ( | const uint32_t & | key,
|  | GetRequest *const & | data
| ) |  |

staticprotected

void SLNet::CloudServer::GetServersWithUploadedKeys | ( | DataStructures::List< CloudKey > & | keys,
|  | DataStructures::List< RemoteServer * > & | remoteServersWithData
| ) |  |

protected

static int SLNet::CloudServer::KeyDataListComp | ( | const CloudKey & | key,
|  | CloudDataList *const & | data
| ) |  |

staticprotected

static int SLNet::CloudServer::KeyDataPtrComp | ( | const RakNetGUID & | key,
|  | CloudData *const & | data
| ) |  |

staticprotected

static int SLNet::CloudServer::KeySubscriberIDComp | ( | const CloudKey & | key,
|  | KeySubscriberID *const & | data
| ) |  |

staticprotected

void SLNet::CloudServer::NotifyClientSubscribersOfDataChange | ( | CloudData * | cloudData,
|  | CloudKey & | key,
|  | DataStructures::OrderedList< RakNetGUID, RakNetGUID > & | subscribers,
|  | bool | wasUpdated
| ) |  |

protected

void SLNet::CloudServer::NotifyClientSubscribersOfDataChange | ( | CloudQueryRow * | row,
|  | DataStructures::OrderedList< RakNetGUID, RakNetGUID > & | subscribers,
|  | bool | wasUpdated
| ) |  |

protected

void SLNet::CloudServer::NotifyServerSubscribersOfDataChange | ( | CloudData * | cloudData,
|  | CloudKey & | key,
|  | bool | wasUpdated
| ) |  |

protected

virtual void SLNet::CloudServer::OnClosedConnection | ( | const SystemAddress & | systemAddress,
|  | RakNetGUID | rakNetGUID,
|  | PI2_LostConnectionReason | lostConnectionReason
| ) |  |

protectedvirtual

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 SLNet::PluginInterface2.

virtual void SLNet::CloudServer::OnGetRequest | ( | Packet * | packet | ) |

protectedvirtual

virtual void SLNet::CloudServer::OnPostRequest | ( | Packet * | packet | ) |

protectedvirtual

virtual void SLNet::CloudServer::OnRakPeerShutdown | ( | void |  | ) |

protectedvirtual

Called when RakPeer is shutdown.

Reimplemented from SLNet::PluginInterface2.

virtual PluginReceiveResult SLNet::CloudServer::OnReceive | ( | Packet * | packet | ) |

protectedvirtual

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 SLNet::PluginInterface2.

virtual void SLNet::CloudServer::OnReleaseRequest | ( | Packet * | packet | ) |

protectedvirtual

void SLNet::CloudServer::OnRemoveSubscribedKeyFromServers | ( | Packet * | packet | ) |

protected

void SLNet::CloudServer::OnRemoveUploadedKeyFromServers | ( | Packet * | packet | ) |

protected

void SLNet::CloudServer::OnSendSubscribedKeyToServers | ( | Packet * | packet | ) |

protected

void SLNet::CloudServer::OnSendUploadedAndSubscribedKeysToServer | ( | Packet * | packet | ) |

protected

void SLNet::CloudServer::OnSendUploadedKeyToServers | ( | Packet * | packet | ) |

protected

void SLNet::CloudServer::OnServerDataChanged | ( | Packet * | packet | ) |

protected

virtual void SLNet::CloudServer::OnServerToServerGetRequest | ( | Packet * | packet | ) |

protectedvirtual

virtual void SLNet::CloudServer::OnServerToServerGetResponse | ( | Packet * | packet | ) |

protectedvirtual

virtual void SLNet::CloudServer::OnUnsubscribeRequest | ( | Packet * | packet | ) |

protectedvirtual

void SLNet::CloudServer::ProcessAndTransmitGetRequest | ( | GetRequest * | getRequest | ) |

protected

void SLNet::CloudServer::ProcessCloudQueryWithAddresses | ( | CloudServer::CloudQueryWithAddresses & | cloudQueryWithAddresses,
|  | DataStructures::List< CloudData * > & | cloudDataResultList,
|  | DataStructures::List< CloudKey > & | cloudKeyResultList
| ) |  |

protected

void SLNet::CloudServer::ReleaseKeys | ( | RakNetGUID | clientAddress,
|  | DataStructures::List< CloudKey > & | keys
| ) |  |

protected

void SLNet::CloudServer::ReleaseSystem | ( | RakNetGUID | clientAddress | ) |

protected

static int SLNet::CloudServer::RemoteServerComp | ( | const RakNetGUID & | key,
|  | RemoteServer *const & | data
| ) |  |

staticprotected

void SLNet::CloudServer::RemoveAllQueryFilters | ( | void |  | ) |

Removes all instances of CloudServerQueryFilter added with AddQueryFilter(). The instances are not deleted, only unreferenced. It is up to the user to delete the instances, if necessary.

void SLNet::CloudServer::RemoveQueryFilter | ( | CloudServerQueryFilter * | filter | ) |

Removes a callback added with AddQueryFilter() The instance is not deleted, only unreferenced. It is up to the user to delete the instance, if necessary.

Parameters

  [in] | filter | An externally allocated instance of CloudServerQueryFilter. The instance must remain valid until it is removed with RemoveQueryFilter() or RemoveAllQueryFilters()

void SLNet::CloudServer::RemoveServer | ( | RakNetGUID | systemIdentifier | ) |

Removes a server added through AddServer()

Parameters

  [in] | systemIdentifier | Identifier of the remote system

void SLNet::CloudServer::RemoveSpecificSubscriber | ( | RakNetGUID | specificSubscriber,
|  | CloudDataList * | cloudDataList,
|  | RakNetGUID | remoteCloudClientGuid
| ) |  |

protected

void SLNet::CloudServer::RemoveSubscribedKeyFromServers | ( | CloudKey & | cloudKey | ) |

protected

void SLNet::CloudServer::RemoveUploadedKeyFromServers | ( | CloudKey & | cloudKey | ) |

protected

void SLNet::CloudServer::SendSubscribedKeyToServers | ( | CloudKey & | cloudKey | ) |

protected

void SLNet::CloudServer::SendUploadedAndSubscribedKeysToServer | ( | RakNetGUID | systemAddress | ) |

protected

void SLNet::CloudServer::SendUploadedKeyToServers | ( | CloudKey & | cloudKey | ) |

protected

void SLNet::CloudServer::SetMaxBytesPerDownload | ( | uint64_t | bytes | ) |

Max bytes returned by a download. If the number of bytes would exceed this amount, the returned list is truncated However, if this would result in no rows downloaded, then one row will be returned.

Parameters

  [in] | bytes | Max bytes a client can download from a single Get(). 0 means unlimited.

void SLNet::CloudServer::SetMaxUploadBytesPerClient | ( | uint64_t | bytes | ) |

Max bytes a client can upload Data in excess of this value is silently ignored defaults to 0 (unlimited)

Parameters

  [in] | bytes | Max bytes a client can upload. 0 means unlimited.

void SLNet::CloudServer::UnsubscribeFromKey | ( | RemoteCloudClient * | remoteCloudClient,
|  | RakNetGUID | remoteCloudClientGuid,
|  | unsigned int | keySubscriberIndex,
|  | CloudKey & | cloudKey,
|  | DataStructures::List< RakNetGUID > & | specificSystems
| ) |  |

protected

virtual void SLNet::CloudServer::Update | ( | void |  | ) |

protectedvirtual

Update is called every time a packet is checked for .

Reimplemented from SLNet::PluginInterface2.

void SLNet::CloudServer::WriteCloudQueryRowFromResultList | ( | unsigned int | i,
|  | DataStructures::List< CloudData * > & | cloudDataResultList,
|  | DataStructures::List< CloudKey > & | cloudKeyResultList,
|  | BitStream * | bsOut
| ) |  |

protected

void SLNet::CloudServer::WriteCloudQueryRowFromResultList | ( | DataStructures::List< CloudData * > & | cloudDataResultList,
|  | DataStructures::List< CloudKey > & | cloudKeyResultList,
|  | BitStream * | bsOut
| ) |  |

protected

#### Member Data Documentation

DataStructures::OrderedList<CloudKey, CloudDataList*, CloudServer::KeyDataListComp> SLNet::CloudServer::dataRepository

protected

Definition at line 214 of file CloudServer.h.

SystemAddress SLNet::CloudServer::forceAddress

protected

Definition at line 336 of file CloudServer.h.

DataStructures::OrderedList<uint32_t, GetRequest*, CloudServer::GetRequestComp> SLNet::CloudServer::getRequests

protected

Definition at line 298 of file CloudServer.h.

uint64_t SLNet::CloudServer::maxBytesPerDowload

protected

Definition at line 147 of file CloudServer.h.

uint64_t SLNet::CloudServer::maxUploadBytesPerClient

protected

Definition at line 147 of file CloudServer.h.

uint32_t SLNet::CloudServer::nextGetRequestId

protected

Definition at line 301 of file CloudServer.h.

SLNet::Time SLNet::CloudServer::nextGetRequestsCheck

protected

Definition at line 299 of file CloudServer.h.

DataStructures::List<CloudServerQueryFilter*> SLNet::CloudServer::queryFilters

protected

Definition at line 334 of file CloudServer.h.

DataStructures::OrderedList<RakNetGUID, RemoteServer*, CloudServer::RemoteServerComp> SLNet::CloudServer::remoteServers

protected

Definition at line 260 of file CloudServer.h.

DataStructures::Hash<RakNetGUID, RemoteCloudClient*, 2048, RakNetGUID::ToUint32> SLNet::CloudServer::remoteSystems

protected

Definition at line 232 of file CloudServer.h.

struct SLNet::CloudServer::BufferedGetResponseFromServer

Definition at line 262 of file CloudServer.h.

### Public Member Functions

void | Clear (CloudAllocator *allocator)

### Public Attributes

RakNetGUID | serverAddress
CloudQueryResult | queryResult
bool | gotResult

#### Member Function Documentation

void SLNet::CloudServer::BufferedGetResponseFromServer::Clear | ( | CloudAllocator * | allocator | ) |

#### Member Data Documentation

bool SLNet::CloudServer::BufferedGetResponseFromServer::gotResult

Definition at line 268 of file CloudServer.h.

CloudQueryResult SLNet::CloudServer::BufferedGetResponseFromServer::queryResult

Definition at line 267 of file CloudServer.h.

RakNetGUID SLNet::CloudServer::BufferedGetResponseFromServer::serverAddress

Definition at line 266 of file CloudServer.h.

struct SLNet::CloudServer::CloudData

Definition at line 152 of file CloudServer.h.

### Public Member Functions

| CloudData ()
| ~CloudData ()
bool | IsUnused (void) const
void | Clear (void)

### Public Attributes

unsigned char | stackData [CLOUD_SERVER_DATA_STACK_SIZE]
unsigned char * | allocatedData
unsigned char * | dataPtr
uint32_t | dataLengthBytes
bool | isUploaded
SystemAddress | serverSystemAddress
| System address of server that is holding this data, and the client is connected to.
SystemAddress | clientSystemAddress
| System address of client that uploaded this data.
RakNetGUID | serverGUID
| RakNetGUID of server that is holding this data, and the client is connected to.
RakNetGUID | clientGUID
| RakNetGUID of client that uploaded this data.
DataStructures::OrderedList < RakNetGUID, RakNetGUID > | specificSubscribers

#### Constructor & Destructor Documentation

SLNet::CloudServer::CloudData::CloudData | ( |  | ) |

inline

Definition at line 154 of file CloudServer.h.

SLNet::CloudServer::CloudData::~CloudData | ( |  | ) |

inline

Definition at line 155 of file CloudServer.h.

References _FILE_AND_LINE_, and rakFree_Ex.

#### Member Function Documentation

void SLNet::CloudServer::CloudData::Clear | ( | void |  | ) |

inline

Definition at line 157 of file CloudServer.h.

References _FILE_AND_LINE_, and rakFree_Ex.

bool SLNet::CloudServer::CloudData::IsUnused | ( | void |  | ) | const

inline

Definition at line 156 of file CloudServer.h.

#### Member Data Documentation

unsigned char* SLNet::CloudServer::CloudData::allocatedData

Definition at line 160 of file CloudServer.h.

RakNetGUID SLNet::CloudServer::CloudData::clientGUID

RakNetGUID of client that uploaded this data.

Definition at line 175 of file CloudServer.h.

SystemAddress SLNet::CloudServer::CloudData::clientSystemAddress

System address of client that uploaded this data.

Definition at line 169 of file CloudServer.h.

uint32_t SLNet::CloudServer::CloudData::dataLengthBytes

Definition at line 162 of file CloudServer.h.

unsigned char* SLNet::CloudServer::CloudData::dataPtr

Definition at line 161 of file CloudServer.h.

bool SLNet::CloudServer::CloudData::isUploaded

Definition at line 163 of file CloudServer.h.

RakNetGUID SLNet::CloudServer::CloudData::serverGUID

RakNetGUID of server that is holding this data, and the client is connected to.

Definition at line 172 of file CloudServer.h.

SystemAddress SLNet::CloudServer::CloudData::serverSystemAddress

System address of server that is holding this data, and the client is connected to.

Definition at line 166 of file CloudServer.h.

DataStructures::OrderedList<RakNetGUID, RakNetGUID> SLNet::CloudServer::CloudData::specificSubscribers

When the key data changes from this particular system, notify these subscribers This list mutually exclusive with CloudDataList::nonSpecificSubscribers

Definition at line 179 of file CloudServer.h.

unsigned char SLNet::CloudServer::CloudData::stackData[CLOUD_SERVER_DATA_STACK_SIZE]

Definition at line 159 of file CloudServer.h.

struct SLNet::CloudServer::CloudDataList

Definition at line 185 of file CloudServer.h.

### Public Member Functions

bool | IsUnused (void) const
bool | IsNotUploaded (void) const
bool | RemoveSubscriber (RakNetGUID g)

### Public Attributes

unsigned int | uploaderCount
unsigned int | subscriberCount
CloudKey | key
DataStructures::OrderedList < RakNetGUID, CloudData *, CloudServer::KeyDataPtrComp > | keyData
DataStructures::OrderedList < RakNetGUID, RakNetGUID > | nonSpecificSubscribers

#### Member Function Documentation

bool SLNet::CloudServer::CloudDataList::IsNotUploaded | ( | void |  | ) | const

inline

Definition at line 188 of file CloudServer.h.

bool SLNet::CloudServer::CloudDataList::IsUnused | ( | void |  | ) | const

inline

Definition at line 187 of file CloudServer.h.

bool SLNet::CloudServer::CloudDataList::RemoveSubscriber | ( | RakNetGUID | g | ) |

inline

Definition at line 189 of file CloudServer.h.

#### Member Data Documentation

CloudKey SLNet::CloudServer::CloudDataList::key

Definition at line 203 of file CloudServer.h.

DataStructures::OrderedList<RakNetGUID, CloudData*, CloudServer::KeyDataPtrComp> SLNet::CloudServer::CloudDataList::keyData

Definition at line 206 of file CloudServer.h.

DataStructures::OrderedList<RakNetGUID, RakNetGUID> SLNet::CloudServer::CloudDataList::nonSpecificSubscribers

When the key data changes from any system, notify these subscribers This list mutually exclusive with CloudData::specificSubscribers

Definition at line 210 of file CloudServer.h.

unsigned int SLNet::CloudServer::CloudDataList::subscriberCount

Definition at line 202 of file CloudServer.h.

unsigned int SLNet::CloudServer::CloudDataList::uploaderCount

Definition at line 202 of file CloudServer.h.

struct SLNet::CloudServer::CloudQueryWithAddresses

Definition at line 271 of file CloudServer.h.

### Public Member Functions

void | Serialize (bool writeToBitstream, BitStream *bitStream)

### Public Attributes

CloudQuery | cloudQuery
DataStructures::List< RakNetGUID > | specificSystems

#### Member Function Documentation

void SLNet::CloudServer::CloudQueryWithAddresses::Serialize | ( | bool | writeToBitstream,
|  | BitStream * | bitStream
| ) |  |

#### Member Data Documentation

CloudQuery SLNet::CloudServer::CloudQueryWithAddresses::cloudQuery

Definition at line 274 of file CloudServer.h.

DataStructures::List<RakNetGUID> SLNet::CloudServer::CloudQueryWithAddresses::specificSystems

Definition at line 275 of file CloudServer.h.

struct SLNet::CloudServer::GetRequest

Definition at line 281 of file CloudServer.h.

### Public Member Functions

void | Clear (CloudAllocator *allocator)
bool | AllRemoteServersHaveResponded (void) const

### Public Attributes

CloudQueryWithAddresses | cloudQueryWithAddresses
SLNet::Time | requestStartTime
uint32_t | requestId
RakNetGUID | requestingClient
DataStructures::OrderedList < RakNetGUID, BufferedGetResponseFromServer *, CloudServer::BufferedGetResponseFromServerComp > | remoteServerResponses

#### Member Function Documentation

bool SLNet::CloudServer::GetRequest::AllRemoteServersHaveResponded | ( | void |  | ) | const

void SLNet::CloudServer::GetRequest::Clear | ( | CloudAllocator * | allocator | ) |

#### Member Data Documentation

CloudQueryWithAddresses SLNet::CloudServer::GetRequest::cloudQueryWithAddresses

Definition at line 285 of file CloudServer.h.

DataStructures::OrderedList<RakNetGUID, BufferedGetResponseFromServer*, CloudServer::BufferedGetResponseFromServerComp> SLNet::CloudServer::GetRequest::remoteServerResponses

Definition at line 295 of file CloudServer.h.

uint32_t SLNet::CloudServer::GetRequest::requestId

Definition at line 291 of file CloudServer.h.

RakNetGUID SLNet::CloudServer::GetRequest::requestingClient

Definition at line 293 of file CloudServer.h.

SLNet::Time SLNet::CloudServer::GetRequest::requestStartTime

Definition at line 288 of file CloudServer.h.

struct SLNet::CloudServer::KeySubscriberID

Definition at line 216 of file CloudServer.h.

Class Members
CloudKey | key |
OrderedList< RakNetGUID, RakNetGUID > | specificSystemsSubscribedTo |

struct SLNet::CloudServer::RemoteCloudClient

Definition at line 224 of file CloudServer.h.

### Public Member Functions

bool | IsUnused (void) const

### Public Attributes

DataStructures::OrderedList < CloudKey, CloudKey, CloudKeyComp > | uploadedKeys
DataStructures::OrderedList < CloudKey, KeySubscriberID *, CloudServer::KeySubscriberIDComp > | subscribedKeys
uint64_t | uploadedBytes

#### Member Function Documentation

bool SLNet::CloudServer::RemoteCloudClient::IsUnused | ( | void |  | ) | const

inline

Definition at line 226 of file CloudServer.h.

#### Member Data Documentation

DataStructures::OrderedList<CloudKey,KeySubscriberID*,CloudServer::KeySubscriberIDComp> SLNet::CloudServer::RemoteCloudClient::subscribedKeys

Definition at line 229 of file CloudServer.h.

uint64_t SLNet::CloudServer::RemoteCloudClient::uploadedBytes

Definition at line 230 of file CloudServer.h.

DataStructures::OrderedList<CloudKey,CloudKey,CloudKeyComp> SLNet::CloudServer::RemoteCloudClient::uploadedKeys

Definition at line 228 of file CloudServer.h.

struct SLNet::CloudServer::RemoteServer

Definition at line 244 of file CloudServer.h.

Class Members
bool | gotSubscribedAndUploadedKeys |
RakNetGUID | serverAddress |
OrderedList< CloudKey, CloudKey, CloudKeyComp > | subscribedKeys |
OrderedList< CloudKey, CloudKey, CloudKeyComp > | uploadedKeys |
bool | workingFlag |