Lua API
On this page

ClientFilter

Inherits from

A client filter, used for sending messages to a filtered set of clients. If a rule is not specified (like not setting a tag list), the rule is ignored.

Fields:

ClientTypes ClientType[]

read only

The types of clients to filter by. Specifying multiple tags checks that the client is of one of the specified types.

FilterType ClientFilterType

read only

The type of logic to apply to this filter. AND means all specified rules must be matched by the client. OR means if any specified rule is matched the client will be included.

Ids number[]

read only

A list of client ids to filter by

Tags string[]

read only

A list of client tags to filter by. Specifying multiple tags means the client must have at least one of the tags (not all).

Constructors:

New() :

Create a new client filter. Empty filters match all clients.

New(clientType: ClientType) :

Create a new client filter that matches clients of the specified type.

Parameters:
NameTypeDefaultSummary
clientTypeClientType

The client type to match

New(clientTypes: ClientType[]) :

Create a new client filter that includes any clients with any of the specified types.

Parameters:
NameTypeDefaultSummary
clientTypesClientType[]

The client types to match

New(id: number) :

Create a new client filter that matches a specific client id.

Parameters:
NameTypeDefaultSummary
idnumber

The client id to match

New(ids: number[]) :

Create a new client filter that includes any clients with an id in the list.

Parameters:
NameTypeDefaultSummary
idsnumber[]

A list of ids to match

New(tag: string) :

Create a new client filter that matches a specified tag.

Parameters:
NameTypeDefaultSummary
tagstring

That tag to match

New(tags: string[]) :

Create a new client filter that includes any clients with any of the specified tags.

Parameters:
NameTypeDefaultSummary
tagsstring[]

The tags to match

New(ids: number[], tags: string[], clientTypes: ClientType[], filterType: ClientFilterType) :

Create a new client filter and optionally specify ids, tags, client types, and logic type for multiple defined rules. Leaving any of these as null / empty will ignore that specific rule.

Parameters:
NameTypeDefaultSummary
idsnumber[]

A list of ids to match against

tagsstring[]

A list of tags to match against. Specifying multiple tags will check that the client includes any of these tags.

clientTypesClientType[]

A list of client types to match against. Specifying multiple type will check that the client is a type contained in this list.

filterTypeClientFilterType

The type of logic to apply to this filter. AND means all specified rules must be matched by the client. OR means if any specified rule is matched the client will be included.

Methods:

GetPropertyKeys() : string[]

Returns a list of strings of all public property / field names. Useful for reflection on UserData in lua scripts

Returns:string[]

HasRules() : boolean

Check if this filter has any rules specified

Returns:boolean

ToString() : string

Returns a string that represents the current object.

Returns:string