0.5.1 • Published 10 months ago

jsplanet v0.5.1

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
10 months ago

JsPlanet

JsPlanet is a Javascript controller written in TypeScript for Trackmania 2020 dedicated server.

Usage

// Import the controller
import { JsPlanet } from "jsplanet";

// Instantiate the controller
const jsPlanet = new JsPlanet("localhost", 5000, "SuperAdmin", "SuperAdmin");

jsPlanet.on("ready", () => {
  console.log("JsPlanet is ready to use.");

  // Send a message to all players
  jsPlanet.chatManager.send("Controller has started.");
});

jsPlanet.on("race", (checkpoint) =>
  console.log(
    `${checkpoint.player.nickname} has finished in ${checkpoint.time} ms.`,
  ),
);

// Connect JsPlanet to the Trackmania Xml-RPC server
await jsPlanet.connect();

Contributing

Ensure a supported NodeJS version is installed with Yarn and install dependencies with Yarn.

Trackmania dev server

Ensure Docker is installed, copy .env.example to .env and fulfill it. Start a Trackmania development server with docker compose by running

docker compose -f compose.dev.yml up --build

License

MIT

0.5.1

10 months ago

0.5.0

10 months ago

0.4.3

10 months ago

0.4.2

11 months ago

0.4.1

11 months ago

0.4.0

11 months ago

0.3.0

11 months ago

0.2.0

11 months ago

0.1.1

11 months ago

0.1.0

11 months ago