Updates GSOC 2018 - Improving the Server Facade

Inei1

Member
Contributor
Name: Improving the Server Facade

Summary: The server facade made in GSoC 2017 by @gianluca_n could use some improvements. The end goal for this project is to make the server facade easy to setup and use for end-users, while also adding some useful features.
Mentors: @gianluca_n, @Arpit Kamboj, Valkyrie, GabrielXia
Student: Neil Moon; @Inei on Slack, @Inei1 on forums and Github
GitHub: https://github.com/MovingBlocks/FacadeServer
Project Board: https://github.com/orgs/MovingBlocks/projects/14
Communication: #gsoc2018-serverapi on slack; 1:00pm-2:00pm PDT (8:00pm-9:00pm UTC)
Devlog: https://inei1.github.io/GSoC-2018-Devlog/
 
Last edited:

Inei1

Member
Contributor
Update for week 1, May 19, 2018

What have you achieved in the last week?
Finished my finals, wrote some code for the facadeserver frontend, did some experimenting with the launcher, considered options for packaging the server facade, worked on adding CPU/RAM/possibly more to the REST API with SIGAR library.
What are you currently working on?
Finalizing using SIGAR for the REST API, looking into how to use the launcher to get the server facade, looking into how to add the server facade to omega distributions.
What problems are you currently facing?
Nothing other than the blocker below.
Is anything blocking you from making progress?
The Jenkins build for the server facade is currently failing, blocking me from packaging the server facade better.
List of PRs and opened/closed Issues
https://github.com/MovingBlocks/FacadeServer-frontend/pull/2
Something else
More details can be found here.
 

Inei1

Member
Contributor
Update for week 2, May 26, 2018

What have you achieved in the last week?
Added system information to REST API, added a frontend for the system information, and added some backend javadoc.
What are you currently working on?
Autocomplete for console commands and backend javadoc.
What problems are you currently facing?
Nothing.
Is anything blocking you from making progress?
The Jenkins build is still failing, but it looks like it is very close to working.
List of PRs and opened/closed Issues
https://github.com/MovingBlocks/FacadeServer-frontend/pull/3
https://github.com/MovingBlocks/FacadeServer/pull/13
Something else
More details can be found here.
 

Inei1

Member
Contributor
Update for week 3, June 3, 2018
What have you achieved in the last week?
Added a console autocomplete and worked on packaging.
What are you currently working on?
Improving the frontend by adding an easy interface for some console commands.
What problems are you currently facing?
Packaging and gradle are things I've never really done before, so progress on them is slow.
Is anything blocking you from making progress?
No.
List of PRs and opened/closed Issues
https://github.com/MovingBlocks/FacadeServer-frontend/pull/4
https://github.com/MovingBlocks/FacadeServer/pull/16
https://github.com/MovingBlocks/FacadeServer/pull/15 (in progress)
Something else
More details can be found here.
 

Inei1

Member
Contributor
Update for week 4, June 9, 2018
What have you achieved in the last week?
Frontend for some user management commands and work on adding a permission system for admins.
What are you currently working on?
Finishing up the admin permission system and finishing packaging the facade server.
What problems are you currently facing?
None.
Is anything blocking you from making progress?
No.
List of PRs and opened/closed Issues
https://github.com/MovingBlocks/FacadeServer-frontend/pull/6
https://github.com/MovingBlocks/FacadeServer-frontend/pull/7 (in progress)
https://github.com/MovingBlocks/FacadeServer/pull/17 (in progress)
Something else
More details can be found here.
 

Inei1

Member
Contributor
Update for week 5, June 16, 2018
What have you achieved in the last week?
Almost finished the admin permission system and came up with a working test of the packaging the server facade.
What are you currently working on?
Next week will mark the beginning of my work on the AWT facade.
What problems are you currently facing?
None.
Is anything blocking you from making progress?
No.
List of PRs and opened/closed Issues
https://github.com/MovingBlocks/FacadeServer-frontend/pull/7
https://github.com/MovingBlocks/FacadeServer/pull/17
Something else
More details (and a summary of my work since the beginning of GSOC) can be found here.
 

Inei1

Member
Contributor
Update for week 6, June 23, 2018
What have you achieved in the last week?
Completely finished the admin permission system, worked on packaging, did some experimentation for displaying the world from within the FacadeServer frontend.
What are you currently working on?
Getting the world map resource to work and also finishing up packaging.
What problems are you currently facing?
I am trying to figure out how to get the color (or texture) of a block in the world.
Is anything blocking you from making progress?
No.
List of PRs and opened/closed Issues
https://github.com/MovingBlocks/FacadeServer-frontend/pull/7 (merged)
https://github.com/MovingBlocks/FacadeServer/pull/17 (merged)
https://github.com/MovingBlocks/FacadeServer/pull/18 (opened and merged)
https://github.com/MovingBlocks/FacadeServer/pull/15 (worked on)
Something else
More details can be found here.
 

Inei1

Member
Contributor
Update for week 7, June 30, 2018
What have you achieved in the last week?
Worked a bit on packaging and made a working version of the world map.
What are you currently working on?
Expanding the world map and fixing bugs with it.
What problems are you currently facing?
Nothing.
Is anything blocking you from making progress?
No.
List of PRs and opened/closed Issues
https://github.com/MovingBlocks/FacadeServer/pull/20 (opened and merged)
https://github.com/MovingBlocks/FacadeServer/pull/21 (opened)
https://github.com/MovingBlocks/FacadeServer-frontend/pull/8 (opened)
https://github.com/MovingBlocks/FacadeServer/pull/15 (finally merged!)
https://github.com/Terasology/Index/pull/2 (opened)
Something else
More details can be found here.
 

Inei1

Member
Contributor
Update for week 8, July 7, 2018
What have you achieved in the last week?
Made progress on the world map.
What are you currently working on?
Making it possible to view the world map without logging in with a regular client.
What problems are you currently facing?
I don't really know how I should go about loading the blocks without having a local player.
Is anything blocking you from making progress?
No.
List of PRs and opened/closed Issues
https://github.com/MovingBlocks/FacadeServer/pull/21 (worked on)
https://github.com/MovingBlocks/FacadeServer-frontend/pull/8 (worked on)
Something else
More details can be found here.
 

Inei1

Member
Contributor
Update for week 9, July 14, 2018
What have you achieved in the last week?
Finished almost everything for the world map and completed a majority of the work for the blacklist and whitelist integration.
What are you currently working on?
Getting the POST/DELETE methods to work correctly for the blacklist and whitelist resources.
What problems are you currently facing?
None.
Is anything blocking you from making progress?
No.
List of PRs and opened/closed Issues
https://github.com/MovingBlocks/FacadeServer/pull/21 (worked on)
https://github.com/MovingBlocks/FacadeServer-frontend/pull/8 (worked on)
https://github.com/MovingBlocks/FacadeServer/pull/22 (opened)
https://github.com/MovingBlocks/FacadeServer-frontend/pull/9 (opened)
Something else
More details can be found here.
 

Inei1

Member
Contributor
Update for week 10, July 21, 2018
What have you achieved in the last week?
Finished the last bit of work for the world map, worked a bit on the blacklist/whitelist, and improved console UX by removing commands that don't work on the server.
What are you currently working on?
The blacklist/whitelist prompt dialog doesn't seem to refresh correctly, so I am working on fixing it
What problems are you currently facing?
None.
Is anything blocking you from making progress?
No.
List of PRs and opened/closed Issues
https://github.com/MovingBlocks/FacadeServer/pull/21 (worked on and merged)
https://github.com/MovingBlocks/FacadeServer-frontend/pull/8 (merged)
https://github.com/MovingBlocks/FacadeServer/pull/22 (worked on)
https://github.com/MovingBlocks/FacadeServer-frontend/pull/9 (worked on)
https://github.com/MovingBlocks/FacadeServer/pull/24 (opened)
https://github.com/MovingBlocks/FacadeServer-frontend/pull/10 (opened)
https://github.com/MovingBlocks/FacadeServer/pull/23 (opened and merged)
Something else
More details can be found here.
 

Inei1

Member
Contributor
Update for week 11, July 28, 2018
What have you achieved in the last week?
Worked a bit on everything from last week, wrote a few unit tests, and lots of personal stuff that kept me from working on this project.
What are you currently working on?
Adding unit tests to the rest of my code.
What problems are you currently facing?
None.
Is anything blocking you from making progress?
No.
List of PRs and opened/closed Issues
https://github.com/Terasology/Index/pull/2 (merged)
https://github.com/MovingBlocks/FacadeServer/pull/22 (merged)
https://github.com/MovingBlocks/FacadeServer-frontend/pull/9 (worked on and merged)
https://github.com/MovingBlocks/FacadeServer/pull/24 (worked on)
https://github.com/MovingBlocks/FacadeServer-frontend/pull/10 (closed)
https://github.com/MovingBlocks/FacadeServer/pull/25 (opened)
Something else
More details can be found here.
 

Inei1

Member
Contributor
Update for week 12, August 4, 2018
What have you achieved in the last week?
Finished writing the unit tests, finished all the mandatory parts of the project.
What are you currently working on?
Nothing right now, I plan on doing
What problems are you currently facing?
None.
Is anything blocking you from making progress?
No.
List of PRs and opened/closed Issues
https://github.com/MovingBlocks/FacadeServer/pull/24 (merged)
https://github.com/MovingBlocks/FacadeServer/pull/25 (worked on)
Something else
More details can be found here.
 

Inei1

Member
Contributor
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.
SystemResource.PNG

The admin permission system needed a place to be modified at, so this PR adds some buttons to configure permissions.
AdminPermissions.PNG

To be useful, the world map needed a place to receive inputs and be displayed.
WorldMapImage.PNG

The blacklist and whitelist can be modified using the frontend interface.
BlacklistWhitelistManagement.PNG

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.
LogoutButton.PNG


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.
UserManagement.PNG

AddPermissionPrompt.png


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:
 

Attachments

Last edited:
Top