RakNet  4.0
Public Member Functions | Protected Member Functions | List of all members
RakNet::CloudServer Class Reference

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

#include <CloudServer.h>

Inheritance diagram for RakNet::CloudServer:
RakNet::PluginInterface2 RakNet::CloudAllocator

Public Member Functions

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 RakNet::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, RakNet::TimeMS time, int isSend)
 
virtual void OnAck (unsigned int messageNumber, SystemAddress remoteSystemAddress, RakNet::TimeMS time)
 
virtual void OnPushBackPacket (const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress)
 

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.
 

Additional Inherited Members

- Private Member Functions inherited from RakNet::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.
 

Detailed Description

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

Member Function Documentation

void RakNet::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]filterAn externally allocated instance of CloudServerQueryFilter. The instance must remain valid until it is removed with RemoveQueryFilter() or RemoveAllQueryFilters()
void RakNet::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]systemIdentifierIdentifier of the remote system
void RakNet::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]forcedAddressThe systmeAddress to return in queries. Use UNASSIGNED_SYSTEM_ADDRESS (default) to use what RakPeer returns
void RakNet::CloudServer::GetRemoteServers ( DataStructures::List< RakNetGUID > &  remoteServersOut)

Return list of servers added with AddServer()

Parameters
[out]remoteServersList of servers added
virtual void RakNet::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]systemAddressThe system whose connection was closed
[in]rakNetGuidThe guid of the specified system
[in]lostConnectionReasonHow the connection was closed: manually, connection lost, or notification of disconnection

Reimplemented from RakNet::PluginInterface2.

virtual PluginReceiveResult RakNet::CloudServer::OnReceive ( Packet packet)
protectedvirtual

OnReceive is called for every packet.

Parameters
[in]packetthe 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::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]filterAn externally allocated instance of CloudServerQueryFilter. The instance must remain valid until it is removed with RemoveQueryFilter() or RemoveAllQueryFilters()
void RakNet::CloudServer::RemoveServer ( RakNetGUID  systemIdentifier)

Removes a server added through AddServer()

Parameters
[in]systemIdentifierIdentifier of the remote system
void RakNet::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]bytesMax bytes a client can download from a single Get(). 0 means unlimited.
void RakNet::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]bytesMax bytes a client can upload. 0 means unlimited.

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