General purpose backend for multiplayer board/card games
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Hamcha 932ed7b204 Don't update room after removing it! 6 months ago
client/bot Let's make everything a single big package 7 months ago
lobby Let's make everything a single big package 7 months ago
room Don't update room after removing it! 6 months ago
.drone.yml Make gopath a shared volume bind 6 months ago
.gitignore Update ubuntu box, use docker "caching" thingie 8 months ago
.vagrantplugins Add JoinRoom implementation 7 months ago
Caddyfile caddy: Fix websocket proxying 7 months ago
Dockerfile.builder Does this work? WHO KNOWS 7 months ago
Dockerfile.publish Can't use /app there 7 months ago
Dockerfile.service-run Not-as-terrible docker config 7 months ago
LICENSE Add license 7 months ago
README.md Add .drone.yml 7 months ago
Vagrantfile Does this work? WHO KNOWS 7 months ago
cardgage.go REFACTOR EVERYTHING (wip) 7 months ago
docker-compose.yml Aliases should not be needed 7 months ago
go.mod Update moa 7 months ago
go.sum Update moa 7 months ago

README.md

Cardgage

Build Status

Cardgage is a (very unfinished) set of microservices built on top of moa aimed at creating a fully featured back-end for multiplayer board/card games.

Goals

Cardgage aims to:

  • Provide a lobby system to let players create and join rooms, either as players or spectators
  • Provide a communication system for low volume real-time interaction, with all interactions stored allowing games to be replayed
  • Allow for pluggable rule engines to transform the backend into an authoritative server for one or more games

Installation

Option 1. Set up a development environment

docker-compose up --force-recreate --build

Option 2. Build with Vagrant

A Vagrantfile is provided to easily build and deploy a dev environment on platforms without docker, like Windows.

First, the ugly: you need a plugin.

vagrant plugin install vagrant-docker-compose

After that, setup/run the VM with vagrant up and build the project with vagrant build.

Other things

Go 1.12 or newer required

The API gateway uses httputil.ReverseProxy, which doesn’t support websockets before Go 1.12. This is technically a non-issue since golang:alpine takes the newest golang out there (which is 1.12 at the time of writing) but if you are rolling your own infrastructure you should keep this in mind.

Build custom caddy container (optional)

For the official server we keep metrics via Prometheus amongst other things, so we need a custom docker build:

docker build --build-arg plugins=prometheus,cors,git -t mcg-caddy github.com/abiosoft/caddy-docker.git

Re-building the builder

If go.mod changes you need to re-build the builder, there is a command for that:

vagrant make-builder

Re-building api gateway

If your docker build of apigateway is outdated, you can rebuild it by just calling

vagrant ssh -c "cd /vagrant; docker-compose build"

This will take a while.

Re-compiling protobuf files

You will need:

  • protoc

cd into the appropriate folder (<servicename>/proto) and run

protoc --go_out=plugins=grpc:. <service>.proto