Skip to content

Grab info about currently running Sub Rosa servers.

Notifications You must be signed in to change notification settings

jdbool/sub-rosa-servers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sub-rosa-servers

Grab info about currently running Sub Rosa servers. Simple Promise API that gives you an array of server objects.

Installation

npm install sub-rosa-servers

Example

const getServers = require('sub-rosa-servers');

// Usage
const servers = await getServers();
for (const server of servers) {
  if (server.players > 0) {
    console.log(`${server.players} people playing on ${server.name}!`);
  }
}

Server Object

Key Type Description
address string IP of the server (x.x.x.x)
port number
latency number Response time in milliseconds
name string Public server title
version number Ex. 35
build string Ex. 'b'
passworded boolean
gameType number Ex. 3 = round
players number How many people are connected
maxPlayers number
identifier number Unique ID the server assigns to itself, stored in server.srk. Not guaranteed to be unique because people copy/paste files.
clientCompatability number Hidden build number used to indicate which clients can join this server — it appears red and unclickable in the list if it isn't the same as the client's
buffer Buffer Raw binary ping response from the server

About

Grab info about currently running Sub Rosa servers.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published