Skip to content

byond_client is a Deno implementation of the byond topic protocol used for communicating between byond servers

License

Notifications You must be signed in to change notification settings

AshCorr/byond_client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

byond_client

byond_client is a Deno implementation of the byond topic protocol used for communicating between byond servers.

Import

Replace LATEST_VERSION with current latest version

import {
    ByondClient
} from "https://deno.land/x/byond_client@LATEST_VERSION/mod.ts";

Usage

const client = new ByondClient();

await client.connect({
    hostname: "game.yogstation.net",
    port: "4133"
});

// Basic Example: ?ping
const playersOnline = client.send("ping");
console.log(`Players Online: ${playersOnline}`);
/// Players Online: 47

// Using parameters and parsing Byond response: ?status&comms_key=SuperSecretPassword
const info = new URLSearchParams(await client.send("status", {
    comms_key: "SuperSecretPassword"
}));
console.log(`Current Gamemode: ${info.gamemode}`)
/// Current Gamemode: Shadowlings

client.close();

Todo

  1. Locking or Queuing topic requests for thread safety
  2. Connecting pooling
  3. Documentation

About

byond_client is a Deno implementation of the byond topic protocol used for communicating between byond servers

Resources

License

Stars

Watchers

Forks

Packages

No packages published