GSOC 2018 Final Report
The original proposal can be found here
Over the past three months, a lot of improvements to the server facade have been made. New features provide easy ways to administrate the server remotely, and regular players can even look at a map of the world.
All of the main goals were accomplished over the summer. The implementation details ended up being different for a few things, such as the world map resource originally intending to use the AWT facade when it ended up as a custom implementation. For the system resource, after a quick Google search while writing the proposal I thought the SIGAR library would work, but after some discussion it was determined that the OSHI library fit better.
Some other parts of the project changed completely. My original idea with packing the server facade was to simply add some launch scripts and not much else. Instead, that goal became larger and ended up with the server facade being put into the omega distribution. Also, the stretch goal of getting the world map to display ended up being relatively easy due to the usage of a custom system.
After some consideration, it was decided that some of the stretch goals were not really useful, so I decided to throw them out. One of them was to make a chat bridge between the server facade's chat system and an user's discord server. I thought that this would be too much work for the average user to set up, and it wouldn't really be very useful because users can already chat remotely using the console tab in the web frontend. A search feature for commands and settings was also considered, but thrown out because of limited usefulness. There were a couple of other goals that were either pointless or unreasonable.
Code
FacadeServer Backend
resources (new features):
Screenshots are in the frontend section below.
This PR added a resource to the backend that shows the status of the machine the server is on. It collects information on the CPU usage, the total RAM and JVM memory used, and the server’s uptime.
An HTTP GET method for the console resource was added. It gets a list of console commands that is filtered to only include commands that can be run on a server without using a client.
Before this PR, users were either an admin or not an admin. The changes here make it so that an user can be designated as an admin with limited authority. This allows a specific person to only be able to manage users, for example, without being able to cheat with console commands.
This resource makes it possible to get a top-down 2D view of the world map from the web frontend. The frontend tells the backend where to look in the world to generate the map, then an image is generated with the world’s blocks and converted to a base64 string to be displayed by the frontend.
Being able to blacklist players is important in servers, so this PR added a place to use that functionality. Blacklist/whitelist functionality is already in the engine; this resource just calls the methods in the engine.
This PR modifies the console resource to make it so that invalid commands (ones that cannot be run on a server) are unable to execute. Instead of executing an incorrect command, an error is thrown explaining that the command is invalid.
----
packaging:
To make the server facade more visible, it was added to the Omega game distribution that is obtained by the launcher and by direct downloads. This particular PR modified the FacadeServer jar file to work outside of the development environment. It also added launch scripts that use the correct command-line arguments to have the game run correctly in a headless environment.
Just a minor fix to the last PR, where I fixed the location of the launch scripts.
This final fix added a jar file that was required to run, yet not considered a dependency to the FacadeServer jar classpath. After this fix, the server facade can now be run correctly from within the Omega distribution.
After the changes to the FacadeServer jar, it could now be run correctly, and this PR modifies how the Omega distribution is built to include the jar and its launch scripts.
----
documentation and unit tests:
Documentation for classes was somewhat lacking, so I decided that it would be easier for me and anyone else who might work on the server facade in the future to have at least a bit of documentation for every important class.
After I added all the new features, I wanted to add unit tests for them.
FacadeServer Frontend
Frontend for resources:
The home screen now displays the system status.
The admin permission system needed a place to be modified at, so this PR adds some buttons to configure permissions.
To be useful, the world map needed a place to receive inputs and be displayed.
The blacklist and whitelist can be modified using the frontend interface.
UI improvements:
This very simple PR adds a button to log out of the server, and what it actually does is refresh the page. It works.
This PR improves console UX to autocomplete commands upon pressing tab, like most consoles do. It also makes the command execute upon pressing enter.
Some console commands are useful for regular administration, such as kicking a user, but it would be easier for the average user to click on a graphical button. This PR adds such buttons.
This small PR added some much-needed polish to the frontend.
Future Goals
The frontend currently could use more polish. Some stretch goals are left unfinished, such as adding a better way to chat using the frontend without the console and updating the version of ReactXP in the frontend to get access to the force focus method for the console execution box. Server logs (including chat logs) should also be accessible through the frontend. It’s possible that ideas for other features/bug fixes/UX improvements come up in the future as well. The user experience could probably be streamlined a bit as well.
Related issues: