#include <RakClientInterface.h>
Inheritance diagram for RakClientInterface:
Public Member Functions | |
virtual | ~RakClientInterface () |
Destructor. | |
virtual bool | Connect (const char *host, unsigned short serverPort, unsigned short clientPort, unsigned int depreciated, int threadSleepTimer)=0 |
virtual void | Disconnect (unsigned int blockDuration, unsigned char orderingChannel=0)=0 |
virtual void | InitializeSecurity (const char *privKeyP, const char *privKeyQ)=0 |
virtual void | SetPassword (const char *_password)=0 |
virtual bool | HasPassword (void) const =0 |
virtual bool | Send (const char *data, const int length, PacketPriority priority, PacketReliability reliability, char orderingChannel)=0 |
virtual bool | Send (RakNet::BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel)=0 |
virtual Packet * | Receive (void)=0 |
virtual void | DeallocatePacket (Packet *packet)=0 |
virtual void | PingServer (void)=0 |
Send a ping to the server. | |
virtual void | PingServer (const char *host, unsigned short serverPort, unsigned short clientPort, bool onlyReplyOnAcceptingConnections)=0 |
virtual int | GetAveragePing (void)=0 |
Returns the average of all ping times read. | |
virtual int | GetLastPing (void) const =0 |
virtual int | GetLowestPing (void) const =0 |
virtual int | GetPlayerPing (const PlayerID playerId)=0 |
virtual void | StartOccasionalPing (void)=0 |
virtual void | StopOccasionalPing (void)=0 |
virtual bool | IsConnected (void) const =0 |
virtual unsigned int | GetSynchronizedRandomInteger (void) const =0 |
virtual bool | GenerateCompressionLayer (unsigned int inputFrequencyTable[256], bool inputLayer)=0 |
virtual bool | DeleteCompressionLayer (bool inputLayer)=0 |
virtual void | RegisterAsRemoteProcedureCall (char *uniqueID, void(*functionPointer)(RPCParameters *rpcParms))=0 |
virtual void | RegisterClassMemberRPC (char *uniqueID, void *functionPointer)=0 |
virtual void | UnregisterAsRemoteProcedureCall (char *uniqueID)=0 |
virtual bool | RPC (char *uniqueID, const char *data, unsigned int bitLength, PacketPriority priority, PacketReliability reliability, char orderingChannel, bool shiftTimestamp, NetworkID networkID, RakNet::BitStream *replyFromTarget)=0 |
virtual bool | RPC (char *uniqueID, RakNet::BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, bool shiftTimestamp, NetworkID networkID, RakNet::BitStream *replyFromTarget)=0 |
virtual void | SetTrackFrequencyTable (bool b)=0 |
virtual bool | GetSendFrequencyTable (unsigned int outputFrequencyTable[256])=0 |
virtual float | GetCompressionRatio (void) const =0 |
virtual float | GetDecompressionRatio (void) const =0 |
virtual void | AttachPlugin (PluginInterface *messageHandler)=0 |
virtual void | DetachPlugin (PluginInterface *messageHandler)=0 |
virtual RakNet::BitStream * | GetStaticServerData (void)=0 |
virtual void | SetStaticServerData (const char *data, const int length)=0 |
virtual RakNet::BitStream * | GetStaticClientData (const PlayerID playerId)=0 |
virtual void | SetStaticClientData (const PlayerID playerId, const char *data, const int length)=0 |
virtual void | SendStaticClientDataToServer (void)=0 |
virtual PlayerID | GetServerID (void) const =0 |
virtual PlayerID | GetPlayerID (void) const =0 |
virtual PlayerID | GetInternalID (void) const =0 |
Return the unique address identifier that represents you on the the network and is based on your local IP / portNote that unlike in previous versions, this is a struct and is not sequential. | |
virtual const char * | PlayerIDToDottedIP (const PlayerID playerId) const =0 |
virtual void | PushBackPacket (Packet *packet, bool pushAtHead)=0 |
virtual void | SetRouterInterface (RouterInterface *routerInterface)=0 |
For internal use only.
| |
virtual void | RemoveRouterInterface (RouterInterface *routerInterface)=0 |
For internal use only.
| |
virtual void | SetTimeoutTime (RakNetTime timeMS)=0 |
virtual bool | SetMTUSize (int size)=0 |
virtual int | GetMTUSize (void) const =0 |
virtual void | AllowConnectionResponseIPMigration (bool allow)=0 |
virtual void | AdvertiseSystem (const char *host, unsigned short remotePort, const char *data, int dataLength)=0 |
virtual RakNetStatisticsStruct *const | GetStatistics (void)=0 |
virtual void | ApplyNetworkSimulator (double maxSendBPS, unsigned short minExtraPing, unsigned short extraPingVariance)=0 |
virtual bool | IsNetworkSimulatorActive (void)=0 |
virtual PlayerIndex | GetPlayerIndex (void)=0 |
This is a user-interface class to act as a game client. All it does is implement some functionality on top of RakPeer. See the individual functions for what the class can do.
|
Sends a one byte message ID_ADVERTISE_SYSTEM to the remote unconnected system. This will tell the remote system our external IP outside the LAN along with some user data.
Implemented in RakClient. |
|
Allow or disallow connection responses from any IP. Normally this should be false, but may be necessary when connection to servers with multiple IP addresses.
Implemented in RakClient. |
|
Adds simulated ping and packet loss to the outgoing data flow. To simulate bi-directional ping and packet loss, you should call this on both the sender and the recipient, with half the total ping and maxSendBPS value on each. You can exclude network simulator code with the _RELEASE define to decrease code size
Implemented in RakClient. |
|
Attatches a Plugin interface to run code automatically on message receipt in the Receive call
Implemented in RakClient. |
|
Call this to connect the client to the specified host (ip or domain name) and server port. This is a non-blocking connection. You know the connection is successful when IsConnected() returns true or receive gets a packet with the type identifier ID_CONNECTION_REQUEST_ACCEPTED.
Implemented in RakClient. |
|
Call this to deallocate a packet returned by Receive when you are done handling it.
Implemented in RakClient. |
|
Delete the output or input layer as specified. This is not necessary to call and is only valuable for freeing memory.
Implemented in RakClient. |
|
Detaches a Plugin interface to run code automatically on message receipt
Implemented in RakClient. |
|
Stops the client, stops synchronized data, and resets all internal data. Does nothing if the client is not connected to begin wit
Implemented in RakClient. |
|
This is an optional function to generate the compression layer based on the input frequency table. If you want to use it you should call this twice - once with inputLayer as true and once as false. The frequency table passed here with inputLayer=true should match the frequency table on the recipient with inputLayer=false. Likewise, the frequency table passed here with inputLayer=false should match the frequency table on the recipient with inputLayer=true. Calling this function when there is an existing layer will overwrite the old layer.
Implemented in RakClient. |
|
Returns the compression ratio. A low compression ratio is good. Compression is for outgoing data
Implemented in RakClient. |
|
Returns the decompression ratio. A high decompression ratio is good. Decompression is for incoming data
Implemented in RakClient. |
|
Returns the last ping time read
Implemented in RakClient. |
|
Returns the lowest ping time read or -1 if none read yet
Implemented in RakClient. |
|
Returns the current MTU size
Implemented in RakClient. |
|
Return the player number the server has assigned to you.
Implemented in RakClient. |
|
Returns the last ping for the specified player. This information is broadcast by the server automatically In order to save bandwidth this information is updated only infrequently and only for the first 32 players
Implemented in RakClient. |
|
Returns the frequency of outgoing bytes into outputFrequencyTable. This is required to get a frequency table, which is used in GenerateCompressionLayer() The purpose is to save to file as either a master frequency table from a sample game session.
Implemented in RakClient. |
|
Return the player number of the server.
Implemented in RakClient. |
|
The client internally maintains a data struct that is automatically sent to the server on connection This is useful to contain data such as the player name. Access that struct with this function. Pass UNASSIGNED_PLAYER_ID for playerId to reference your internal data. A playerId value to access the data of another player. NOTE ** * If you change any data in the struct the server won't reflect this change unless you manually update it Do so by calling SendStaticClientDataToServer The data is entered as an array and stored and returned as a BitStream. Everytime you call GetStaticServerData it resets the read pointer to the start of the bitstream. To do multiple reads without reseting the pointer Maintain a pointer copy to the bitstream as in RakNet::BitStream *copy = ...->GetStaticServerData(...)=0; To store a bitstream, use the GetData() and GetNumberOfBytesUsed() methods of the bitstream for the 2nd and 3rd parameters Implemented in RakClient. |
|
The server internally maintains a data struct that is automatically sent to clients when the connect. This is useful to contain data such as the server name or message of the day. Access that struct with this function. The data is entered as an array and stored and returned as a BitStream. Everytime you call GetStaticServerData it resets the read pointer to the start of the bitstream. To do multiple reads without reseting the pointer Maintain a pointer copy to the bitstream as in RakNet::BitStream *copy = ...->GetStaticServerData(...)=0; To store a bitstream, use the GetData() and GetNumberOfBytesUsed() methods of the bitstream for the 2nd and 3rd parameters Note that the server may change at any time the data contents and/or its length!
Implemented in RakClient. |
|
Returns a structure containing a large set of network statistics for server You can map this data to a string using the C style StatisticsToString() function
Implemented in RakClient. |
|
Returns a number automatically synchronized between the server and client which randomly changes every 9 seconds. The time it changes is accurate to within a few ms and is best used to seed random number generators that you want to usually return the same output on all systems. Keep in mind thisisn't perfectly accurate as there is always a very small chance the numbers will by out of synch. You should should confine its use to visual effects or functionality that has a backup method to maintain synchronization. If you don't need this functionality and want to save the bandwidth callStopSynchronizedRandomInteger after starting the server
Implemented in RakClient. |
|
Returns true if a password was set, false otherwise
Implemented in RakClient. |
|
Can be called to use specific public RSA keys. (e and n) In order to prevent altered keys. Will return ID_RSA_PUBLIC_KEY_MISMATCH in a packet if a key has been altered.
Implemented in RakClient. |
|
Returns true if the client is connected to a responsive server
Implemented in RakClient. |
|
Returns if you previously called ApplyNetworkSimulator
Implemented in RakClient. |
|
Sends a ping request to a server we are not connected to. This will also initialize the networking system if it is not already initialized. You can stop the networking system by calling Disconnect() The final ping time will be encoded in the following sizeof(RakNetTime) bytes. (Default is 4 bytes - See __GET_TIME_64BIT in NetworkTypes.h You can specify if the server should only reply if it has an open connection or not This must be true for LAN broadcast server discovery on "255.255.255.255" or you will get replies from clients as well.
Implemented in RakClient. |
|
Returns the dotted IP address for the specified playerId
Implemented in RakClient. |
|
Put a packet back at the end of the receive queue in case you don't want to deal with it immediately
Implemented in RakClient. |
|
Gets a packet from the incoming packet queue. Use DeallocatePacket() to deallocate the packet after you are done with it. User-thread functions, such as RPC calls and the plugin function PluginInterface::Update occur here.
Implemented in RakClient. |
|
Sends a block of data to the specified system that you are connected to. This function only works while the connected (Use the Connect function).
Implemented in RakClient. |
|
Sends a block of data to the specified system that you are connected to. This function only works while the connected (Use the Connect function).
Implemented in RakClient. |
|
Send the static server data to the server The only time you need to call this function is to update clients that are already connected when you change the static server data by calling GetStaticServerData and directly modifying the object pointed to. Obviously if the connected clients don't need to know the new data you don't need to update them, so it's up to you The server must be active for this to have meaning Implemented in RakClient. |
|
Set the MTU per datagram. It's important to set this correctly - otherwise packets will be needlessly split, decreasing performance and throughput. Maximum allowed size is MAXIMUM_MTU_SIZE. Too high of a value will cause packets not to arrive at worst and be fragmented at best. Too low of a value will split packets unnecessarily. sa MTUSize.h
Implemented in RakClient. |
|
Set the password to use when connecting to a server. The password persists between connections.
Implemented in RakClient. |
|
Set Local statistical information for playId. Call this function when you receive statistical information from a client.
Implemented in RakClient. |
|
The server internally maintains a data struct that is automatically sent to clients when the connect. This is useful to contain data such as the server name or message of the day. Access that struct with this function. The data is entered as an array and stored and returned as a BitStream. Everytime you call GetStaticServerData it resets the read pointer to the start of the bitstream. To do multiple reads without reseting the pointer Maintain a pointer copy to the bitstream as in RakNet::BitStream *copy = ...->GetStaticServerData(...)=0; To store a bitstream, use the GetData() and GetNumberOfBytesUsed() methods of the bitstream for the 2nd and 3rd parameters Note that the server may change at any time the data contents and/or its length! Implemented in RakClient. |
|
Set the time, in MS, to use before considering ourselves disconnected after not being able to deliver a reliable packet Default time is 10,000 or 10 seconds in release and 30,000 or 30 seconds in debug.
Implemented in RakClient. |
|
Enables or disables frequency table tracking. This is required to get a frequency table, which is used in GenerateCompressionLayer() This value persists between connect calls and defaults to false (no frequency tracking)
Implemented in RakClient. |
|
Ping the server every so often. This is on by default. In games where you don't care about ping you can callStopOccasionalPing to save the bandwidth. This can be called anytime. Implemented in RakClient. |
|
Stop pinging the server every so often. The server is pinged by default. In games where you don't care about ping you can call this to save the bandwidth This will work anytime Implemented in RakClient. |