0.1.1 • Published 7 months ago
@djwoodz/satisfactory-dedicated-server-query-port-probe v0.1.1
Satisfactory Dedicated Server Query Port Probe
A zero dependency Node.js library for probing the query port of a Satisfactory Dedicated Server.
Installation
npm i @djwoodz/satisfactory-dedicated-server-query-port-probe
Example Usage
// import module
const { probe } = require('@djwoodz/satisfactory-dedicated-server-query-port-probe');
// probe using await
const data = await probe('127.0.0.1', 15777, 10000);
console.log(data);
// probe using .then()
probe('127.0.0.1', 15777, 10000)
.then((data) => {
console.log(data);
});
Example Response
{
id: 1, // the message id
protocolVersion: 0, // the protocol version
clientData: 1681304201371n, // the unique data sent to the server (timestamp)
serverState: 'Game ongoing', // the state of the server
serverVersion: 211839, // the version of the server
queryPort: 15777 // the query port of the server
}
API
probe(address, port, timeout) ⇒ Promise
Requests data from a Satisfactory Dedicated Server's Query Port
Returns: Promise - Promise object that represents Query Port data
Param | Type | Default | Description |
---|---|---|---|
address | string | '127.0.0.1' | The address of the Satisfactory Dedicated Server (hostname or IP) |
port | number | string | 15777 | The Query Port number of the Satisfactory Dedicated Server |
timeout | number | string | 10000 | The timeout for the request (milliseconds) |