feat: Player Connect/Disconnect History
Closed this issue · 2 comments
Feature Request
It should be possible to send notifications in a discord channel whenever a player connects or disconnects from a server.
Preferred Solution
This could be implemented by remembering the previous server player response and creating a diff with the current one. Players that are no longer in the list disconnected. Players that weren't in the previous list but are in the current one joined recently.
It should be possible to enable player activity tracking on a per server basis using the /update-server
command. It's probably also a good idea to ask for a different channel to post these logs to. This could be done by passing a discord channel-id to the /update-server
command.
Known Limitations
This approach does not track player activity in real time and is limited by the bot.update-delay
. By default server information is only fetched every 30 seconds. If a player connects and disconnects within these 30 seconds, no activity would be logged. This is acceptable.
With the introduction of the v-rising-discord-bot-companion there's a new solution for this issue:
- the v-rising-discord-bot-companion could keep track of
PlayerConnect
andPlayerDisconnect
events for a certain amount of time (lets say 5 minutes) and expose that event list as a new http endpoint -> DarkAtra/v-rising-discord-bot-companion#4 - this bot could then use query said endpoint to obtain all the events and display them accordingly in a discord channel of choice
For this to work, the bot still has to track the timestamp of the last successful retrieval of connect/discconect events so that it does not post events more than once, but the main benefit would be that this solution is not bound to the bot.update-delay
anymore (as long as the vrising server does persist events long enough).