https://github.com/penberg/multiplayer-matchmaker
A multiplayer on-line game matchmaking server.
https://github.com/penberg/multiplayer-matchmaker
matchmaking server
Last synced: 6 months ago
JSON representation
A multiplayer on-line game matchmaking server.
- Host: GitHub
- URL: https://github.com/penberg/multiplayer-matchmaker
- Owner: penberg
- License: mit
- Created: 2022-10-18T11:33:01.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-19T09:24:11.000Z (over 3 years ago)
- Last Synced: 2025-03-25T07:51:13.965Z (11 months ago)
- Topics: matchmaking, server
- Language: TypeScript
- Homepage:
- Size: 10.7 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Multiplayer Matchmaker
This project implements a multiplayer matchmaking server for games with [ChiselStrike](http://github.com/chiselstrike/chiselstrike/).
## Getting Started
To get going, run:
```console
npm run dev
```
Which starts a local development server of the multiplayer matchmaker.
To start a matchmaking process, run:
```console
curl -d '{"username": "alice"}' localhost:8080/dev/match
```
The query returns the session the player is queued for:
```json
{
"id": "a2f27ea0-295d-4c4c-be86-af27081d50fb",
"serverAddr": "10.0.1.1:1000",
"state": "MATCHMAKING",
"requiredPlayers": 2,
"players": [
"alice"
]
}
```
To complete the matchmaking, run:
```console
curl -d '{"username": "bob"}' localhost:8080/dev/match
```
The query returns the completed session:
```json
{
"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:
```console
curl "localhost:8080/dev/sessions?.state=DONE"
```
To delete completed sessions, run:
```console
curl -X DELETE "localhost:8080/dev/sessions?.state=DONE"
```
## Deploying
You can build a Docker image of the multiplayer matchmaker with:
```console
docker build . --tag multiplayer-matchmaker
```