Lightweight Go WebSocket lobby, matchmaking, and game server launcher for the OpenChamp project. This repository contains the server components (Web API, WebSocket manager, port manager) and helper scripts used to run and develop locally.
Key folders
gameserver/— Where the Gameserver should be placed post-build and the game server image is built._scripts/— helper scripts for varoius operating systems setup and use this repository.
Prerequisites
- Go 1.20+ installed and available on PATH
- Podman (Windows/Linux) or Container (MacOS)
- Git for development workflow
Quick start
- Start Postgres Container with your engine
- Build the server:
cd <repo-root>
mkdir openchamp-server
go build -o openchamp-server ./...- Run the server:
.\openchamp-server- Ensure a Postgres instance is reachable and environment/config values are correct (
.env). Reviewconfig/config.gofor connection configuration and environment variable names. go run main.goto start the server
General Module information
- Manages the Database Connection and general configuration chagnes
- Manages the deployment and decommisioning of GameServers, Ports, and the ingame queue
- Handles the HTTP API requests
- WebSocket Manager (WSM) handles the active websocket connections between all users. (Definitely a bottleneck at scale, will be rewritten at some point)
- The
portmanagerpackage manages assigning available ports for spawned game server processes. Thegameserver/folder contains shipped binaries and helper scripts used by the project; keep these files if you rely on local process spawning.
Testing and validation
- Quick build check:
cd <repo-root>
go build ./...- There are no automated unit tests bundled currently; add tests under the relevant packages where you change behavior.
- Fork the repository and create feature branches (use descriptive names like
feature/upgrade-dborfix/session-leak). - Run
go build ./...and verify your changes compile before opening a PR. - Keep changes small and focused. Include a short description and rationale in your PR.
- Follow typical Go conventions (gofmt, idiomatic error handling). We recommend running
gofmt -w .before committing.
- If you have questions about running or developing the server, please open an issue on the repository with details and platform information (OS, Go version).
Thank you for being a part of the OpenChamp Community!