MovingBlocks / FacadeServer

A headless facade that acts as a game host and provides web-based administration. Automation category: Terasology Facade. See https://forum.terasology.org/threads/facadeserver-headless-server-with-web-interface.1906
Apache License 2.0
4 stars 11 forks source link

Add resources to obtain or modify server's MOTD and port #6

Closed gianluca-nitti closed 7 years ago

gianluca-nitti commented 7 years ago

This code adds read and write support for two server configuration entries (the only ones meaningful for a server which I could find, actually): the network listen port and the Message Of The Day (MOTD).

The read access is public (everyone which connects to the server via HTTP or WebSocket can see the value of this settings without authenticating), while the write access requires authentication and requires the client's ID to be in the server admin list (which is, at the moment, stored in a JSON file containing an array of client IDs which has to be manually edited on the server and is read by this class; it's in the process of being improved for better management, allowing public access until a first client identity is generated, and allowing an admin to add other admins - but anyway this is another story for another pull request).

The frontend application already supports this feature. In the home tab you can see these infos (if the server is providing them) and from the Settings tab they can be edited (an error message will be shown if you try to save the changes without being authenticated, or if you are authenticated but not in the admin list).

gianluca-nitti commented 7 years ago

Just fixed the conflict caused by the merge of #5 in e6601cc.

msteiger commented 7 years ago

Thanks!