@rivet-gg/plugin-colyseus-server
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

🔩 Rivet Colyseus Plugin

Plugin to Colyseus for easy development with Rivet.

Example

See a more detailed example here.

import { listen } from "../src/index";

export default listen({
	async initializeGameServer(gameServer) {
		gameServer.define("chat", ChatRoom).enableRealtimeListing();
	},
});

Running Test Server

The test server is used for manual testing for development. For more comprehensive examples, check out the Colyseus examples repo.

Project setup

  1. Create a game on the Rivet Developer Dashboard
  2. Install the Rivet CLI
  3. Run rivet init --recommend to link your game

Running

  1. Run the server in one terminal: yarn run test-server
  2. Copy the token from the line that starts with "[Rivet] Token:"
  3. Run the test client here

FAQ

What happened to initializeExpress?

Rivet game servers run only game code and nothing else. We support deploying static content with Rivet CDN.

If you need to run a custom API server, take a look at Fly.io or Railway.

Why not use the existing MatchMakerDriver?

The provided MatchMakerDriver interface by Colyseus is too rigid to use in conjunction with Rivet. Under the hood, Colyseus will use LocalDriver for the matchmaker.

We hope to eventually merge a more flexible matchmaking interface in to Colyseus in order to cleanly interface with the Rivet matchmaker.

Package Sidebar

Install

npm i @rivet-gg/plugin-colyseus-server

Homepage

rivet.gg/

Weekly Downloads

2

Version

0.2.1

License

MIT

Unpacked Size

14.9 kB

Total Files

8

Last publish

Collaborators

  • angelonfira
  • nathanflurry