unixfox / grafana-stratusnetwork

Scripts and programs for generating the grafana dashboard for the Minecraft server Stratus Network
https://graph.unixfox.eu
6 stars 0 forks source link

Better way to detect end of match #41

Open unixfox opened 5 years ago

unixfox commented 5 years ago

Currently the portion of code that detect the end of the match is an ugly long regex: https://github.com/unixfox/grafana-stratusnetwork/blob/master/bot.js#L197 I need to find a better way to detect that end of the match. Currently the regex doesn't detect Blue Team wins!


Shouldn't trigger on everything that have wins! before like this: https://i.imgur.com/wKNvq3Z.png

Siceth commented 5 years ago

Does PGM change server properties at match end? If so, mineflayer's GAME event might work. Alternatively, you could listen for the game end sound effect via the SOUNDEFFECTHEARD event.

unixfox commented 5 years ago

Mmh good ideas right there but the issue tho is that I've to know the name of the team or the player that won but it's actually good ideas because I could combine that way to detect the end of the match with a simpler regex that parse the chat to fetch the name of the team or the player! Anyway thanks for your contribution, I'll try to check what's the best way for implementation.