New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@rivet-gg/plugin-colyseus-server

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rivet-gg/plugin-colyseus-server

Rivet + Colyseus Server Plugin

latest
Source
npmnpm
Version
0.2.1
Version published
Maintainers
2
Created
Source

🔩 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

  • Create a game on the Rivet Developer Dashboard
  • Install the Rivet CLI
  • Run rivet init --recommend to link your game

Running

  • Run the server in one terminal: yarn run test-server
  • Copy the token from the line that starts with "[Rivet] Token:"
  • 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.

Keywords

rivet

FAQs

Package last updated on 05 Mar 2024

Related posts