{"id":21527155,"url":"https://github.com/gpittarelli/node-ssq","last_synced_at":"2025-04-09T23:34:39.372Z","repository":{"id":3676947,"uuid":"4746465","full_name":"gpittarelli/node-ssq","owner":"gpittarelli","description":"A Node.JS library for sending Source Server Queries (SSQ) to source engine powered game servers (TF2, L4D, etc.).","archived":false,"fork":false,"pushed_at":"2013-08-30T16:05:57.000Z","size":130,"stargazers_count":22,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T01:24:02.696Z","etag":null,"topics":["nodejs","source-engine","ssq-requests","tf2"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gpittarelli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-06-22T01:44:09.000Z","updated_at":"2023-07-16T11:23:42.000Z","dependencies_parsed_at":"2022-08-19T01:00:29.184Z","dependency_job_id":null,"html_url":"https://github.com/gpittarelli/node-ssq","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpittarelli%2Fnode-ssq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpittarelli%2Fnode-ssq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpittarelli%2Fnode-ssq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gpittarelli%2Fnode-ssq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gpittarelli","download_url":"https://codeload.github.com/gpittarelli/node-ssq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247773732,"owners_count":20993634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nodejs","source-engine","ssq-requests","tf2"],"created_at":"2024-11-24T01:47:57.774Z","updated_at":"2025-04-09T23:34:39.341Z","avatar_url":"https://github.com/gpittarelli.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"node-ssq\n========\n\nA Node.JS library for sending Source Server Queries (SSQ) to source engine\npowered game servers (TF2, L4D, etc.).\n\nI recommend glancing over the following Valve dev wiki page about SSQ:\n\nhttps://developer.valvesoftware.com/wiki/Server_queries\n\n## WARNING\nI created this library and shortly after didn't need it anymore. It\nshould work fine, but has not been aggresively tested.\n\n## Known issue\nSome long messages may be split into chunks or compressed.\nNeither of these modes are currently supported. If you see an error like:\n\n    SSQ response used unsupported split packet mode.\n\nthen you're out of luck. Currently I only get this message when\nrequesting the rules list from some servers.\n\n## API\nThe API is very simple. All functions are passed a server string\n(dotted quad ipv4 address or domain name), a port number, and a callback\nfunction that takes an error as the first parameter and the returned data\nas the second parameter.\n\nAll the below examples assume this library is imported as `ssq`:\n\n    var ssq = require('node-ssq');\n\n### Request timeout\n\n    ssq.set_timeout(1500);\n\nSets the timeout in milliseconds (ms) for all SSQ requests (Default:\n2000ms, available as ssq.DEFAULT_TIMEOUT). Because SSQ requests are\nsent over UDP instead of TCP, timeouts are the only way of determining\nif a request has failed.\n\nNote: If data that comes in after a timeout has expired will be\nsilently dropped.\n\n### Ping\n\n    ssq.ping('1.23.45.67', 1337, function (err, data) {});\n\nPings the server. *This message has been deprecated by Valve, and doesn't serve\nmuch of a use...*\n\n### Server info\n\n    ssq.info('1.23.45.67', 1337, function (err, data) {});\n\nReturns a single object with a lot of data about the server.\n\n    { netver: 17,\n      servername: 'Reddit Unofficial Gaming Community - East Coast',\n      map: 'pl_upward',\n      gamedirectory: 'tf',\n      gamedescription: 'Team Fortress',\n      appid: 440,\n      numplayers: 23,\n      maxplayers: 24,\n      numbots: 0,\n      servertype: 'd',\n      os: 'l',\n      password: 0,\n      vacsecured: 1,\n      gameversion: '1.2.1.0',\n      EDF: 177,\n\n      // The following properties are each individually optional\n      port: 27015,\n      steamID: \u003cBuffer 02 e4 1e 81 af 0c 40 01\u003e,\n      sourceTV: { port: 27020, name: 'SourceTV' },\n      keywords: '_registered,alltalk,east,nocrits,nodmgspread,payload,reddit,replays,rugc',\n      gameID: \u003cBuffer b8 01 00 00 00 00 00 00\u003e }\n\nMost of these values should be self explanatory.\n\nThe **EDF** value is a flag for the optional values. You shouldn't need to look at this flag yourself.\n\n**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.\n\n### Players list\n\n    ssq.players('1.23.45.67', 1337, function (err, data) {});\n\nReturns an array of players. Sample data:\n\n    [{ index: 0,\n       name: 'Sample Name',\n       score: 2,\n       duration: 267.5876159667969 }, ...]\n\nNote that the **index** attribute seems to always be 0, and the **duration** is in seconds.\n\n### Server rules\n\n    ssq.rules('1.23.45.67', 1337, function (err, data) {});\n\nReturns an array of server rules. Sample data:\n\n    [{ name: 'sv_cheats', value: '1'}, ...]\n\n### Get challenge\n\n    ssq.get_challenge('1.23.45.67', 1337, function (err, data) {});\n\nQueries the server for a challenge number, used by some of the requests. This\nmethod probably won't be needed by anybody, but is provided for completeness\nof the SSQ API.\n\n    \u003cBuffer b8 a4 c3 0f\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgpittarelli%2Fnode-ssq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgpittarelli%2Fnode-ssq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgpittarelli%2Fnode-ssq/lists"}