#include <MessageFilter.h>
Inheritance diagram for MessageFilter:

Public Member Functions | ||||
| void | SetAutoAddNewConnectionsToFilter (int filterSetID) | |||
| void | SetAllowMessageID (bool allow, int messageIDStart, int messageIDEnd, int filterSetID) | |||
| void | SetAllowRPC (bool allow, const char *functionName, int filterSetID) | |||
| void | SetActionOnDisallowedMessage (bool kickOnDisallowed, bool banOnDisallowed, RakNetTime banTimeMS, int filterSetID) | |||
| void | SetDisallowedMessageCallback (int filterSetID, void *userData, void(*invalidMessageCallback)(RakPeerInterface *peer, SystemAddress systemAddress, int filterSetID, void *userData, unsigned char messageID)) | |||
| void | SetTimeoutCallback (int filterSetID, void *userData, void(*invalidMessageCallback)(RakPeerInterface *peer, SystemAddress systemAddress, int filterSetID, void *userData)) | |||
| void | SetFilterMaxTime (int allowedTimeMS, bool banOnExceed, RakNetTime banTimeMS, int filterSetID) | |||
| int | GetSystemFilterSet (SystemAddress systemAddress) | |||
| void | SetSystemFilterSet (SystemAddress systemAddress, int filterSetID) | |||
| unsigned | GetSystemCount (int filterSetID) const | |||
| SystemAddress | GetSystemByIndex (int filterSetID, unsigned index) | |||
| unsigned | GetFilterSetCount (void) const | |||
| int | GetFilterSetIDByIndex (unsigned index) | |||
| void | DeleteFilterSet (int filterSetID) | |||
| ||||
| virtual void | OnAttach (RakPeerInterface *peer) | |||
| virtual void | OnDetach (RakPeerInterface *peer) | |||
| virtual void | OnShutdown (RakPeerInterface *peer) | |||
| virtual void | Update (RakPeerInterface *peer) | |||
| virtual PluginReceiveResult | OnReceive (RakPeerInterface *peer, Packet *packet) | |||
| virtual void | OnCloseConnection (RakPeerInterface *peer, SystemAddress systemAddress) | |||
| void MessageFilter::SetAutoAddNewConnectionsToFilter | ( | int | filterSetID | ) |
Automatically add all new systems to a particular filter Defaults to -1
| [in] | filterSetID | Which filter to add new systems to. <0 for do not add. |
| void MessageFilter::SetAllowMessageID | ( | bool | allow, | |
| int | messageIDStart, | |||
| int | messageIDEnd, | |||
| int | filterSetID | |||
| ) |
Allow a range of message IDs Always allowed by default: ID_CONNECTION_REQUEST_ACCEPTED through ID_DOWNLOAD_PROGRESS Usually you specify a range to make it easier to add new enumerations without having to constantly refer back to this function.
| [in] | allow | True to allow this message ID, false to disallow. By default, all messageIDs except the noted types are disallowed. This includes messages from other plugins! |
| [in] | messageIDStart | The first ID_* message to allow in the range. Inclusive. |
| [in] | messageIDEnd | The last ID_* message to allow in the range. Inclusive. |
| [in] | filterSetID | A user defined ID to represent a filter set. If no filter with this ID exists, one will be created with default settings. |
| void MessageFilter::SetAllowRPC | ( | bool | allow, | |
| const char * | functionName, | |||
| int | filterSetID | |||
| ) |
Allow an RPC function, by name
| [in] | allow | True to allow an RPC call with this function name, false to disallow. All RPCs are disabled by default. |
| [in] | functionName | the function name of the RPC call. Must match the function name exactly, including case. |
| [in] | filterSetID | A user defined ID to represent a filter set. If no filter with this ID exists, one will be created with default settings. |
| void MessageFilter::SetActionOnDisallowedMessage | ( | bool | kickOnDisallowed, | |
| bool | banOnDisallowed, | |||
| RakNetTime | banTimeMS, | |||
| int | filterSetID | |||
| ) |
What action to take on a disallowed message. You can kick or not. You can add them to the ban list for some time By default no action is taken. The message is simply ignored. param[in] 0 for permanent ban, >0 for ban time in milliseconds.
| [in] | kickOnDisallowed | kick the system that sent a disallowed message. |
| [in] | banOnDisallowed | ban the system that sent a disallowed message. See banTimeMS for the ban duration |
| [in] | banTimeMS | Passed to the milliseconds parameter of RakPeer::AddToBanList. |
| [in] | filterSetID | A user defined ID to represent a filter set. If no filter with this ID exists, one will be created with default settings. |
| void MessageFilter::SetDisallowedMessageCallback | ( | int | filterSetID, | |
| void * | userData, | |||
| void(*)(RakPeerInterface *peer, SystemAddress systemAddress, int filterSetID, void *userData, unsigned char messageID) | invalidMessageCallback | |||
| ) |
Set a user callback to be called on an invalid message for a particular filterSet
| [in] | filterSetID | A user defined ID to represent a filter set. If no filter with this ID exists, one will be created with default settings. |
| [in] | userData | A pointer passed with the callback |
| [in] | invalidMessageCallback | A pointer to a C function to be called back with the specified parameters. |
| void MessageFilter::SetTimeoutCallback | ( | int | filterSetID, | |
| void * | userData, | |||
| void(*)(RakPeerInterface *peer, SystemAddress systemAddress, int filterSetID, void *userData) | invalidMessageCallback | |||
| ) |
Set a user callback to be called when a user is disconnected due to SetFilterMaxTime
| [in] | filterSetID | A user defined ID to represent a filter set. If no filter with this ID exists, one will be created with default settings. |
| [in] | userData | A pointer passed with the callback |
| [in] | invalidMessageCallback | A pointer to a C function to be called back with the specified parameters. |
| void MessageFilter::SetFilterMaxTime | ( | int | allowedTimeMS, | |
| bool | banOnExceed, | |||
| RakNetTime | banTimeMS, | |||
| int | filterSetID | |||
| ) |
Limit how long a connection can stay in a particular filterSetID. After this time, the connection is kicked and possibly banned. By default there is no limit to how long a connection can stay in a particular filter set.
| [in] | allowedTimeMS | How many milliseconds to allow a connection to stay in this filter set. |
| [in] | banOnExceed | True or false to ban the system, or not, when allowedTimeMS is exceeded |
| [in] | banTimeMS | Passed to the milliseconds parameter of RakPeer::AddToBanList. |
| [in] | filterSetID | A user defined ID to represent a filter set. If no filter with this ID exists, one will be created with default settings. |
| int MessageFilter::GetSystemFilterSet | ( | SystemAddress | systemAddress | ) |
Get the filterSetID a system is using. Returns -1 for none.
| [in] | systemAddress | The system we are referring to |
| void MessageFilter::SetSystemFilterSet | ( | SystemAddress | systemAddress, | |
| int | filterSetID | |||
| ) |
Assign a system to a filter set. Systems are automatically added to filter sets (or not) based on SetAutoAddNewConnectionsToFilter() This function is used to change the filter set a system is using, to add it to a new filter set, or to remove it from all existin filter sets.
| [in] | systemAddress | The system we are referring to |
| [in] | filterSetID | A user defined ID to represent a filter set. If no filter with this ID exists, one will be created with default settings. If -1, the system will be removed from all filter sets. |
| unsigned MessageFilter::GetSystemCount | ( | int | filterSetID | ) | const |
Returns the number of systems subscribed to a particular filter set Using anything other than -1 for filterSetID is slow, so you should store the returned value.
| [in] | filterSetID | The filter set to limit to. Use -1 for none (just returns the total number of filter systems in that case). |
| SystemAddress MessageFilter::GetSystemByIndex | ( | int | filterSetID, | |
| unsigned | index | |||
| ) |
Returns a system subscribed to a particular filter set,by index. index should be between 0 and the GetSystemCount(filterSetID)-1;
| [in] | filterSetID | The filter set to limit to. Use -1 for none (just indexes all the filtered systems in that case). |
| [in] | index | A number between 0 and GetSystemCount(filterSetID)-1; |
| unsigned MessageFilter::GetFilterSetCount | ( | void | ) | const |
Returns the total number of filter sets.
| int MessageFilter::GetFilterSetIDByIndex | ( | unsigned | index | ) |
Returns the ID of a filter set, by index
| [in] | An | index between 0 and GetFilterSetCount()-1 inclusive |
| void MessageFilter::DeleteFilterSet | ( | int | filterSetID | ) |
| [in] | filterSetID | The ID of the filter set to delete. |
Delete a FilterSet. All systems formerly subscribed to this filter are now unrestricted.
| void MessageFilter::OnAttach | ( | RakPeerInterface * | peer | ) | [virtual] |
Called when the interface is attached
| [in] | peer | the instance of RakPeer that is calling Receive |
Reimplemented from PluginInterface.
| void MessageFilter::OnDetach | ( | RakPeerInterface * | peer | ) | [virtual] |
Called when the interface is detached
| [in] | peer | the instance of RakPeer that is calling Receive |
Reimplemented from PluginInterface.
| void MessageFilter::OnShutdown | ( | RakPeerInterface * | peer | ) | [virtual] |
Called when RakPeer is shutdown
| [in] | peer | the instance of RakPeer that is calling Receive |
Reimplemented from PluginInterface.
| void MessageFilter::Update | ( | RakPeerInterface * | peer | ) | [virtual] |
Update is called every time a packet is checked for .
| [in] | peer | - the instance of RakPeer that is calling Receive |
Reimplemented from PluginInterface.
| PluginReceiveResult MessageFilter::OnReceive | ( | RakPeerInterface * | peer, | |
| Packet * | packet | |||
| ) | [virtual] |
OnReceive is called for every packet.
| [in] | peer | the instance of RakPeer that is calling Receive |
| [in] | packet | the packet that is being returned to the user |
Reimplemented from PluginInterface.
| void MessageFilter::OnCloseConnection | ( | RakPeerInterface * | peer, | |
| SystemAddress | systemAddress | |||
| ) | [virtual] |
Called when a connection is dropped because the user called RakPeer::CloseConnection() for a particular system
| [in] | peer | the instance of RakPeer that is calling Receive |
| [in] | systemAddress | The system whose connection was closed |
Reimplemented from PluginInterface.
1.5.1-p1