0.1.1 • Published 7 months ago

@djwoodz/satisfactory-dedicated-server-query-port-probe v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

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

ParamTypeDefaultDescription
addressstring'127.0.0.1'The address of the Satisfactory Dedicated Server (hostname or IP)
portnumber | string15777The Query Port number of the Satisfactory Dedicated Server
timeoutnumber | string10000The timeout for the request (milliseconds)