Skip to content

Commit f78a813

Browse files
committed
port tolerance documentation
1 parent 5becc2c commit f78a813

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,21 @@ import type { InfoQuery, InfoQueryOptions } from 'eimspyr'
6767
type InfoQueryOptions = {
6868
address: string
6969
port: number
70+
portTolerance?: number
7071
timeout?: number
7172
}
7273
```
7374
75+
#### Port error tolerance
76+
77+
Queries that are inaccurate by up to `1` port number are allowed by default. This is useful for situations where interchangeable RCON and query ports are desired for convenience. Regardless of the inaccuracy of the provided port number, the true port of the request is included in the `InfoQuery` response at `request.port`.
78+
79+
For example, Valheim's joinable in-game port (RCON) is `1` less than the query port number (i.e.: `rcon: 999` and `query: 1000`). It is usually not possible to query RCON ports without manually incrementing to find the query port number, but this incrementing is solved automatically by default, allowing all ports seen in-game and in the Steam server browser to be "queried" as-is.
80+
81+
Provide a number to the optional `portTolerance` property to change the port offset, which should equal the known distance commonly found between a game's RCON and query ports (usually `1`).
82+
83+
_Set to `0` for best performance._
84+
7485
#### Timeout
7586
7687
Queries time out at `3000` milliseconds (3 seconds) by default. This duration can be shortened or extended by providing a replacement `number` in milliseconds to the optional `timeout` property.

0 commit comments

Comments
 (0)