penberg / multiplayer-matchmaker

A multiplayer on-line game matchmaking server.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiplayer Matchmaker

This project implements a multiplayer matchmaking server for games with ChiselStrike.

Getting Started

To get going, run:

npm run dev

Which starts a local development server of the multiplayer matchmaker.

To start a matchmaking process, run:

curl -d '{"username": "alice"}' localhost:8080/dev/match 

The query returns the session the player is queued for:

{
  "id": "a2f27ea0-295d-4c4c-be86-af27081d50fb",
  "serverAddr": "10.0.1.1:1000",
  "state": "MATCHMAKING",
  "requiredPlayers": 2,
  "players": [
    "alice"
  ]
}

To complete the matchmaking, run:

curl -d '{"username": "bob"}' localhost:8080/dev/match 

The query returns the completed session:

{
  "id": "a2f27ea0-295d-4c4c-be86-af27081d50fb",
  "serverAddr": "10.0.1.1:1000",
  "state": "DONE",
  "requiredPlayers": 2,
  "players": [
    "alice",
    "bob"
  ]
}

To see all complete sessions, run:

curl "localhost:8080/dev/sessions?.state=DONE"

To delete completed sessions, run:

curl -X DELETE "localhost:8080/dev/sessions?.state=DONE"

Deploying

You can build a Docker image of the multiplayer matchmaker with:

docker build . --tag multiplayer-matchmaker

About

A multiplayer on-line game matchmaking server.

License:MIT License


Languages

Language:TypeScript 92.6%Language:Dockerfile 7.4%