0.5.1 • Published 2 months ago

jsplanet v0.5.1

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
2 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

2 months ago

0.5.0

2 months ago

0.4.3

3 months ago

0.4.2

3 months ago

0.4.1

3 months ago

0.4.0

3 months ago

0.3.0

3 months ago

0.2.0

3 months ago

0.1.1

3 months ago

0.1.0

3 months ago