Editing Filters
Filters are described with a crude and simple language which looks a lot like BASIC. Each filter consists of lines which all have the following form:
a [if x op y] goto b
where:
a is the line number (1-9999)
x is a variable or a constant
op is a compare operation
y is a variable or a constant
b is the line number to jump to if comparison is true
x and y:
If in quotes "example", means a constant value, without quotes, a server info value or one of the builtin keys (servertype, ip, port, address, hostname, country, region, map, game, ping, flux, pl).
op:
| == | : strings match (case sensitive)
| != | : strings don't match (case sensitive)
| ~== | : strings match (case insensitive)
| ~!= | : strings don't match (case insensitive)
| < | : less than
| <= | : less than or equal
| > | : greater than
| >= | : greater than or equal
| & | : bitwise AND
| !& | : inverted bitwise AND
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
Wildcards can be used in string compares, ? matches any single character, * matches any number of any characters.
servertype is a two/tree letter code (QW, Q2, Q3, HL, TR, UT, KP, SOF, RS)
country is the two letter ISO code (see countries.txt)
region is a bit field:
| EUROPE | 1
| NORTHAMERICA | 2
| SOUTHAMERICA | 4
| AFRICA | 8
| ASIA | 16
| AUSTRALIA | 32
| NORTHERNEUROPE | 64
| SOUTHERNEUROPE | 128
| WESTERNEUROPE | 256
| EASTERNEUROPE | 512
| CENTRALEUROPE | 1024
| SCANDINAVIA | 2048
| CENTRALAMERICA | 4096
| CARIBBEAN | 8192
| NORTHERNAFRICA | 16384
| SOUTHERNAFRICA | 32768
| MIDDLEEAST | 65536
| FAREAST | 131072
| OCEANIA | 262144
| IBERIANPENINSULA | 524288
| BALTIC | 1048576
| BENELUX | 2097152
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
|
|---|
goto b can also be replaced by keep or remove, which ends the filter processing.
If the filter ends without keep or remove, keep is assumed.
For examples see filters.txt.