All Projects → gpittarelli → node-ssq

gpittarelli / node-ssq

Licence: other
A Node.JS library for sending Source Server Queries (SSQ) to source engine powered game servers (TF2, L4D, etc.).

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to node-ssq

leysourceengineclient
A source engine network client implementation based on some of my reversing work with basic functionality ( joining servers, talking, receiving/sending voicedata etc. ). Made this & reversed netchan to learn about Sources networking.
Stars: ✭ 122 (+510%)
Mutual labels:  tf2, source-engine
CallAdmin
CallAdmin is a multilingual sourcemod plugin which provides in-game report functionality
Stars: ✭ 52 (+160%)
Mutual labels:  tf2, source-engine
ShaderCompile
Standalone shadercompile, that doesn't depend on valve libraries and supports x64
Stars: ✭ 33 (+65%)
Mutual labels:  source-engine
steam community market
Get item prices and volumes from the Steam Community Market using Python 3
Stars: ✭ 24 (+20%)
Mutual labels:  tf2
Lambda
A custom Source Engine level editor written in Go
Stars: ✭ 34 (+70%)
Mutual labels:  source-engine
rcon
Source RCON client for command line
Stars: ✭ 111 (+455%)
Mutual labels:  source-engine
NextBot
A Git-based fork of Valve's NextBot code.
Stars: ✭ 30 (+50%)
Mutual labels:  source-engine
Unity-Source-Tools
Plugin to import resources from the Source engine in Unity3D.
Stars: ✭ 102 (+410%)
Mutual labels:  source-engine
Awesome-Tensorflow2
基于Tensorflow2开发的优秀扩展包及项目
Stars: ✭ 45 (+125%)
Mutual labels:  tf2
fortress-royale
Team Fortress 2 battle royale gamemode
Stars: ✭ 48 (+140%)
Mutual labels:  tf2
io import vmf
A Valve Map Format (.vmf) and Valve Material Type (.vmt) importer for Blender.
Stars: ✭ 225 (+1025%)
Mutual labels:  source-engine
TF2-GAN
🐳 GAN implemented as Tensorflow 2.X
Stars: ✭ 61 (+205%)
Mutual labels:  tf2
valve-matchmaking-ip-ranges
Lists of locations & IP addresses of Valve servers
Stars: ✭ 69 (+245%)
Mutual labels:  tf2
tensorflow-ml-nlp-tf2
텐서플로2와 머신러닝으로 시작하는 자연어처리 (로지스틱회귀부터 BERT와 GPT3까지) 실습자료
Stars: ✭ 245 (+1125%)
Mutual labels:  tf2
MannVsMann
A plugin for Team Fortress 2 that brings Mann vs. Machine upgrades and mechanics to other gamemodes
Stars: ✭ 23 (+15%)
Mutual labels:  tf2
minGPT-TF
A minimal TF2 re-implementation of the OpenAI GPT training
Stars: ✭ 36 (+80%)
Mutual labels:  tf2
SuperZombieFortress
Custom Team Fortress 2 Gamemode, inspired from Left 4 Dead
Stars: ✭ 28 (+40%)
Mutual labels:  tf2
FreakFortressBat
No longer supported.
Stars: ✭ 32 (+60%)
Mutual labels:  tf2
pcdarts-tf2
PC-DARTS (PC-DARTS: Partial Channel Connections for Memory-Efficient Differentiable Architecture Search, published in ICLR 2020) implemented in Tensorflow 2.0+. This is an unofficial implementation.
Stars: ✭ 25 (+25%)
Mutual labels:  tf2
SourceRenderer
A tiny 3D engine that loads and renders Source engine maps - Also known as dreieck.exe
Stars: ✭ 32 (+60%)
Mutual labels:  source-engine

node-ssq

A Node.JS library for sending Source Server Queries (SSQ) to source engine powered game servers (TF2, L4D, etc.).

I recommend glancing over the following Valve dev wiki page about SSQ:

https://developer.valvesoftware.com/wiki/Server_queries

WARNING

I created this library and shortly after didn't need it anymore. It should work fine, but has not been aggresively tested.

Known issue

Some long messages may be split into chunks or compressed. Neither of these modes are currently supported. If you see an error like:

SSQ response used unsupported split packet mode.

then you're out of luck. Currently I only get this message when requesting the rules list from some servers.

API

The API is very simple. All functions are passed a server string (dotted quad ipv4 address or domain name), a port number, and a callback function that takes an error as the first parameter and the returned data as the second parameter.

All the below examples assume this library is imported as ssq:

var ssq = require('node-ssq');

Request timeout

ssq.set_timeout(1500);

Sets the timeout in milliseconds (ms) for all SSQ requests (Default: 2000ms, available as ssq.DEFAULT_TIMEOUT). Because SSQ requests are sent over UDP instead of TCP, timeouts are the only way of determining if a request has failed.

Note: If data that comes in after a timeout has expired will be silently dropped.

Ping

ssq.ping('1.23.45.67', 1337, function (err, data) {});

Pings the server. This message has been deprecated by Valve, and doesn't serve much of a use...

Server info

ssq.info('1.23.45.67', 1337, function (err, data) {});

Returns a single object with a lot of data about the server.

{ netver: 17,
  servername: 'Reddit Unofficial Gaming Community - East Coast',
  map: 'pl_upward',
  gamedirectory: 'tf',
  gamedescription: 'Team Fortress',
  appid: 440,
  numplayers: 23,
  maxplayers: 24,
  numbots: 0,
  servertype: 'd',
  os: 'l',
  password: 0,
  vacsecured: 1,
  gameversion: '1.2.1.0',
  EDF: 177,

  // The following properties are each individually optional
  port: 27015,
  steamID: <Buffer 02 e4 1e 81 af 0c 40 01>,
  sourceTV: { port: 27020, name: 'SourceTV' },
  keywords: '_registered,alltalk,east,nocrits,nodmgspread,payload,reddit,replays,rugc',
  gameID: <Buffer b8 01 00 00 00 00 00 00> }

Most of these values should be self explanatory.

The EDF value is a flag for the optional values. You shouldn't need to look at this flag yourself.

steamID and gameID are 64 bit values, so they are returned as node.js Buffer objects with 8 bytes. Note that all JavaScript numbers are 64-bit floating point numbers, with only 53 bits of precision, so 64 bit values should not be handled as primitive JavaScript numbers.

Players list

ssq.players('1.23.45.67', 1337, function (err, data) {});

Returns an array of players. Sample data:

[{ index: 0,
   name: 'Sample Name',
   score: 2,
   duration: 267.5876159667969 }, ...]

Note that the index attribute seems to always be 0, and the duration is in seconds.

Server rules

ssq.rules('1.23.45.67', 1337, function (err, data) {});

Returns an array of server rules. Sample data:

[{ name: 'sv_cheats', value: '1'}, ...]

Get challenge

ssq.get_challenge('1.23.45.67', 1337, function (err, data) {});

Queries the server for a challenge number, used by some of the requests. This method probably won't be needed by anybody, but is provided for completeness of the SSQ API.

<Buffer b8 a4 c3 0f>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].