Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@gianluca-nitti
Last active August 28, 2017 09:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gianluca-nitti/80cef8062b0cc15a734c28943943676a to your computer and use it in GitHub Desktop.
Save gianluca-nitti/80cef8062b0cc15a734c28943943676a to your computer and use it in GitHub Desktop.

Google Summer of Code 2017 final report

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.

Usage instructions

Here are basic usage instructions. A video showing the process is also available here.

Server

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 with docker 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.
  • 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 with docker logs <container-id> or stop it with docker stop <container-id>, replacing <containder-id> with the string printed by the docker 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 with CTRL+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.

Client

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.

Code

The code I wrote spans across these repositories:

MovingBlocks/FacadeServer

I sent the following Pull Requests to MovingBlocks/FacadeServer:

MovingBlocks/Terasology

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.

gianluca-nitti/FacadeServer-frontend

This repository on my personal GitHub account contain the front-end client application: https://github.com/gianluca-nitti/FacadeServer-frontend.

Other

  • The commits after 1633d18 on the master 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.

Other relevant links

Demonstrational video

Click here to play the youtube video
IMAGE ALT TEXT HERE

Thanks and credits

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment