Oculus VR, Inc.

 Message Filter Overview

Limit incoming messages by category

With client/server topologies, you do not usually want any system to send any message. For example, perhaps only the server can send kill messages. Or perhaps you want to segment players into stages, where players who have logged on but not yet provided their password cannot yet send game messages. The message filter is designed to deal with these situations automatically.

The MessageFilter plugin defines categories of users by 'filterSet' which is just a numerical identifier supplied by the user. For example, you may have one filter set for newly connected systems, and another for authenticated systems. For each filter set you can

  1. Automatically add new connections
  2. Allow RPC calls
  3. Limit what messages, or ranges of messages, can be received, and what actions to take if this condition is violated (kick/ban/notify)
  4. Delete them

Example:

messageFilter.SetAutoAddNewConnectionsToFilter(0);
messageFilter.SetAllowMessageID(true, ID_USER_PACKET_ENUM, ID_USER_PACKET_ENUM, 0);
messageFilter.SetAllowMessageID(true, ID_USER_PACKET_ENUM+1, ID_USER_PACKET_ENUM+1, 1);

This setup would automatically add all new connections to filter set 0, and only allow the message ID_USER_PACKET_ENUM to arrive. It would also create a new filter set, with the filterSet id 1, that only allowed ID_USER_PACKET_ENUM+1 to arrive.

Messages that are always allowed (filtering them has no effect):

ID_CONNECTION_LOST
ID_DISCONNECTION_NOTIFICATION
ID_NEW_INCOMING_CONNECTION
ID_CONNECTION_REQUEST_ACCEPTED
ID_CONNECTION_ATTEMPT_FAILED
ID_NO_FREE_INCOMING_CONNECTIONS
ID_RSA_PUBLIC_KEY_MISMATCH
ID_CONNECTION_BANNED
ID_INVALID_PASSWORD
ID_MODIFIED_PACKET
ID_PONG
ID_ALREADY_CONNECTED
ID_ADVERTISE_SYSTEM
ID_REMOTE_DISCONNECTION_NOTIFICATION
ID_REMOTE_CONNECTION_LOST
ID_REMOTE_NEW_INCOMING_CONNECTION
ID_DOWNLOAD_PROGRESS

See Samples/MessageFilter for a complete sample. See MessageFilter.h for a complete list of all documented functions and parameters.

See Also
Index