This document summarizes the work I did during Google Summer of Code 2017 with the MovingBlocks organization.
The final product is a web and mobile administration interface for Terasology servers; the original idea comes from this issue.
Here are basic usage instructions. A video showing the process is also available here.
The most straightforward way to set up a Terasology server with FacadeServer, the project I worked on for GSoC, is to use the Docker image. Here is a quick step-by-step guide:
- Install Docker (if it's not already installed on the machine you want to use). From this page there are instructions for the various operating systems and cloud computing platforms.
- In your shell, execute
docker pull gianlucanitti/terasologyfacadeserver
. This will download the binary image and may take some time. - When the
docker pull
command returns, you can start the server withdocker run -p 8080:8080 -p 25777:25777 -d gianlucanitti/terasologyfacadeserver
. A couple of notes:- The two
-p
arguments expose the network ports for the web server (8080) and for the Terasology game server (25777) to the host machine (and the external world, if allowed by your firewall). Without them, it wouldn't be possible to connect to the server. - The
-d
switch is optional. If present, the server will start detached from the shell so that you can leave the shell/terminal without stopping it.
- The two
- If you used the
-d
switch, the command will pring a long string which is the ID of the started Docker container and return. You can then view the server's log withdocker logs <container-id>
or stop it withdocker stop <container-id>
, replacing<containder-id>
with the string printed by thedocker run
command. If you started without the-d
switch, the server's log will be printed to the standard output, and the server can be stopped withCTRL+C
.
Note that the Docker image is packaged without any additional module, so no default game is started and you cannot directly connect to the server using the regular game client; you first need to connect to it using the web interface, install the modules you want to use and start a game.
Alternatively, you can run it from a development environment. In this case, you need to clone the main Terasology repository, then obtain FacadeServer's source by running ./gradlew fetchFacadeServer
and switching to the develop
branch of FacadeServer by running cd facades/Server && git checkout develop && cd ../..
. At this point, you can use ./gradlew jar facades:Server:run
to compile everything and start the server.
The latest (at the time of GSoC 2017 ending) version of the client is hosted at http://utility.terasology.org:8000/. Once you have a running server, you can replace "localhost" in the "Server WebSocket address" field in the web interface with your server's IP address to connect to it (not necessary if the server is running on the same machine you are using to browse the web interace).
Alternatively, you can follow the instructions in the client's README to build from source the mobile application or your local instance of the web application.
The code I wrote spans across these repositories:
I sent the following Pull Requests to MovingBlocks/FacadeServer:
- Run the game engine (merged)
- Authentication management (merged)
- Resource management (merged)
- Games resource (merged)
- Modules install resource (merged)
- Add resources to obtain or modify server's MOTD and port (merged)
- Manage administrative permissions (merged)
- REST methods (open)
I submitted this pull request to the main Terasology repository, which contains changes which I needed to implement parts of FacadeServer: Refactor module installation code to decouple UI (SelectModulesScreen) from logic.
This repository on my personal GitHub account contain the front-end client application: https://github.com/gianluca-nitti/FacadeServer-frontend.
- The commits after
1633d18
on themaster
branch of my terasology-key-server repository, which is a tool to help users in carrying their Terasology client identity certificates across various clients (a running instance is availavble here), has been done during the GSoC work period to adapt it to be used in the web and mobile application too (in addition to the Terasology game client). - I made this very small pull request to the MovingBlocks/meta-server respository.
Click here to play the youtube video
Huge thanks go to my mentors Martin Steiger and Tobias Nett, the MovingBlocks organization admin Rasmus Praestholm and the whole MovingBlocks community for supporting my work and to Google for organizing GSoC.