Photon Bolt Engine API
Networking Middleware
Public Member Functions | List of all members
Bolt.IEventFilter Interface Reference

Interface that can be implemented to create custom event filtering rules More...

Inheritance diagram for Bolt.IEventFilter:
Bolt.DefaultEventFilter

Public Member Functions

bool EventReceived (Event ev)
 Called when a new event is recieved More...
 

Detailed Description

Interface that can be implemented to create custom event filtering rules

Example: An event filter that blocks chat events from a chat restricted player

public class ChatEventFilter : IEventFilter {
public bool EventReceived(Event evt) {
if(chatRestrictedPlayerList.ContainsKey(evt.RaisedBy)) {
return false;
}
else return true;
}
}

Member Function Documentation

◆ EventReceived()

bool Bolt.IEventFilter.EventReceived ( Event  ev)

Called when a new event is recieved

Parameters
evThe event data
Returns
Whether to accept or reject the event