Skip to content

Commit

Permalink
Add KSP
Browse files Browse the repository at this point in the history
  • Loading branch information
Nebual committed Jan 11, 2022
1 parent 5a2f228 commit 45de7a2
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
17 changes: 17 additions & 0 deletions game-api/src/games/ksp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const axios = require("axios");
const GenericDockerManager = require("./docker");
const { debugLog } = require("../cliArgs");

module.exports = class KSPManager extends GenericDockerManager {
async getPlayers() {
try {
const { data } = await axios.get(
"http://localhost:8900"
);
return data[0].CurrentState.CurrentPlayers.map((name) => ({name}));
} catch (e) {
debugLog("ksp getPlayers error", e);
return false;
}
}
};
23 changes: 23 additions & 0 deletions game-setups/ksp/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: '3.3'
services:
lunamultiplayer:
image: lunamultiplayer:local
build:
context: ./repo/
dockerfile: ./Dockerfile_Server
args:
# set to desired version, available versions: https://github.com/LunaMultiplayer/LunaMultiplayer/releases
# may be unused now?
- LMP_VERSION=0.28.0
container_name: ksp
environment:
- TZ=PST
ports:
- '8800:8800/udp'
- '8900:8900'
volumes:
- '/servers/ksp/volume/Config:/LMPServer/Config'
- '/servers/ksp/volume/Universe:/LMPServer/Universe'
- '/servers/ksp/volume/Plugins:/LMPServer/Plugins'
- '/servers/ksp/volume/logs:/LMPServer/logs'
restart: unless-stopped
Binary file added ui/static/icons/ksp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 45de7a2

Please sign in to comment.