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
Example: messageFilter.SetAutoAddNewConnectionsToFilter(0); 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 See Samples/MessageFilter for a complete sample. See MessageFilter.h for a complete list of all documented functions and parameters. |
See Also |
Index |