SemoxyMC / Server

The backend code for Semoxy
GNU General Public License v3.0
0 stars 0 forks source link

Console Message Changes #20

Open xImAnton opened 3 years ago

xImAnton commented 3 years ago

The concept of Console Messages will be extended to Events.

Remove console messages from server object

add extra endpoint GET /server/<id>/events for retrieving events. Query Parameters:

Store messages in extra collection

a general event looks like this:

{
  "_id": "1247753",
  "timestamp": 123456789,
  "type": "EventType",
  "data": {},
  "serverRun": "start event id",
  "server": "server id"
}
Event Types Name Description Data
SERVER_START A server just started {}
PLAYER_UPDATE a place joined or left {"name": "player name", "action": "JOIN/LEAVE"}

more events can be added

Better Event Detection

The console message format may differ for different server softwares and plugins. There are two ways to detect events anyway.

Custom Regex

in the advanced settings for a server, custom detection regexes could be set for different events.

Plugins

For popular server softwares like spigot or forge, plugins could be written to report the specific events per http to Semoxy.

To verify that the events come from our plugin, a token can be passed in argv or a separate file that is sent by the plugin and verified by the api.

The right plugin for the software can be installed via a checkbox on server creation or later on in the settings.

xImAnton commented 3 years ago

implemented except for external event providers and custom regex manipulation