Skip to content

Latest commit

 

History

History
68 lines (54 loc) · 1.94 KB

File metadata and controls

68 lines (54 loc) · 1.94 KB

Satisfactory Dedicated Server Lightweight Query Probe

A zero dependency Node.js library for probing the Lightweight Query API of a Satisfactory Dedicated Server.

Installation

npm i @djwoodz/satisfactory-dedicated-server-lightweight-query-probe

Example Usage

// import module
const { probe } = require('@djwoodz/satisfactory-dedicated-server-lightweight-query-probe');
// probe using await
const data = await probe('127.0.0.1', 7777, 10000);
console.log(data);
// probe using .then()
probe('127.0.0.1', 7777, 10000)
  .then((data) => {
    console.log(data);
  });

Example Response

{
  protocolVersion: 1, // the protocol version
  clientData: 1726262591138n, // the unique data sent to the server (timestamp)
  serverState: 'Game ongoing', // the state of the server
  serverVersion: 366202, // the version of the server
  serverFlags: 0n, // the server flags
  subStates: [ // the sub states
    { id: 0, version: 17 },
    { id: 1, version: 1 },
    { id: 3, version: 5 },
    { id: 2, version: 1 }
  ],
  serverName: 'Satisfactory Server' // the server name
}

API

probe([address], [port], [timeout]) ⇒ Promise

Requests data from a Satisfactory Dedicated Server's Lightweight Query API

Returns: Promise - Promise object that represents Lightweight Query API data

Param Type Default Description
[address] string '127.0.0.1' The address of the Satisfactory Dedicated Server (hostname or IP)
[port] number | string 7777 The port number of the Satisfactory Dedicated Server
[timeout] number | string 10000 The timeout for the request (milliseconds)