Skip to content

JavaScript/TypeScript version of bzfquery for Deno with no external dependencies. It can also be used as a library or from the command line.

License

Notifications You must be signed in to change notification settings

BZFlagCommunity/bzfquery.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bzfquery.js

GitHub release (latest by date) GitHub license Deno test CI

JavaScript (TypeScript) version of bzfquery with no external dependencies. Requires Deno to run. It can also be used as a library or from the command line.

Usage: deno run --allow-net bzfquery.ts host[:port]

Use in your code

import bzfquery from "https://deno.land/x/bzfquery/bzfquery.ts";

console.log(JSON.stringify(await bzfquery("bzflag.thenoah.dev", 5154), null, 2));

Use without downloading project:

deno install --allow-net https://deno.land/x/bzfquery/bzfquery.ts
bzfquery host[:port]

Stable documentation can be found here, and latest unstable docs here.

Types

Name Type
GameStyle "FFA" or "CTF" or "OFFA" or "Rabbit"
TeamName "Rogue" or "Red" or "Green" or "Blue" or "Purple" or "Observer" or "Rabbit" or "Hunter"

IBZFQuery

Property Type Extra Info
style GameStyle
options IGameOptions
teams ITeam[]
players IPlayer[]
maxPlayerScore number
maxTeamScore number
maxPlayers number
maxShots number
timeLimit number Measured in deciseconds
elapsedTime number Measured in deciseconds
shake false or {wins: number, timeout: number} timeout is in deciseconds

IGameOptions

Property Type
flags boolean
jumping boolean
inertia boolean
ricochet boolean
shaking boolean
antidote boolean
handicap boolean
noTeamKiils boolean

ITeam

Property Type Extra Info
name TeamName
players number
maxPlayers number
wins number (Optional) does not exist on Observer team
losses TeamName (Optional) does not exist on Observer team

IPlayer

Property Type Extra Info
team TeamName
wins number
losses number
tks number
callsign string
motto string May be an empty string