some sorta server manager/orchestrator prototype
- Java 98.4%
- Shell 1.6%
| .bsp | ||
| .idea | ||
| gradle/wrapper | ||
| src/main/java/de/kentoj/scrow/crown | ||
| templates | ||
| .gitignore | ||
| build.gradle.kts | ||
| gradlew | ||
| gradlew.bat | ||
| README.md | ||
| settings.gradle.kts | ||
TODO
- replications could use port 25566, causing the lobby server to fail
crown
receives commands from a nats channel, creates/destroys servers based on templates.
deploying a server
nats -s "$HOST_NATS" request crown.deploy-server '{"template":"<template name, e.g lobby>"}'
templates
templates are directories at ./templates
run script
- executable file
./run - the
SERVER_HANDLEenvironment variable is the handle given by crown. it can be used to send commands to crown. - argv[1] aka $1 aka the first argument passed to the run script, is the port assigned to the server. The run script MUST make the server run on that port.
replicas
if the file ./replicas exists and contains a base10 number > 0,
crown will deploy as many replicas as specified and make sure they respawn after exiting.
priority
the optional file ./priority can overwrite the default priority(i.e 0) of the template.
If the template has > 0 replicas, crown will start templates with a higher priority first.
env
- HOST_NATS e.g
nats://172.17.0.1:4222