Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul scorebot; support editing messages in the webhook service; m… #946

Merged
merged 4 commits into from
Feb 18, 2025

Conversation

cemathey
Copy link
Collaborator

  • Overhauls scorebot
  • Updates the webhook service to support editing messages
  • Updates the compose templates to use a docker volume for the new scorebot
    • This is backwards compatible; I tried it both ways but for new installs/anyone who updates it will cut down on their docker filesystems growing because of the layered filesystem docker uses for changes
  • Updates entrypoint.sh to port legacy scorebot public stat URL/webhook URLs, we can remove this in a few releases
  • get_scorebot_config is still available as an endpoint so people can easily get their old settings
  • Renames rcon.scoreboard.py to rcon.player_stats.py to be more clear (and I wanted to use the scoreboard name
  • The new scorebot system is scoreboard to differentiate/make troubleshooting easier when supporting users
  • There are some miscellaneous code formatting changes and I also improved some miscellaneous typing here and there

So legacy scorebot used a single message and didn't contain a map rotation.

This splits the message into three sections, the header/game state, map rotation and player stats to help get around inherent Discord API limitations on message length/etc. This allows people to show off more player stats if they prefer.

It's very customizable; people can turn off individual sections/translate text for the different sections.

It also now works internally with an RCON instance instead of making requests through the docker network; the only mandatory settings are a public stats port, and at least one webhook URL which should be easier for users to configure.

I tested this locally and it seems to work just fine.

image
image
image

Copy link
Collaborator

@FlorianSW FlorianSW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Comments are just reminders to add some notes to the release notes of the next release to ensure people take over necessary changes to their files they might have copied.

command=python -m rcon.scorebot
environment=LOGGING_FILENAME=scorebot_%(ENV_SERVER_NUMBER)s.log
startretries=24
[program:scoreboard]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When doing a release, this should be explicitly mentioned. Some people (including me) have their "own" supervisord.conf, where they need to make these changes well

@@ -63,6 +66,7 @@ x-supervisor: &supervisor
- ./logs:/logs/
- ./supervisor_data:/data
- ./config:/config/
- scoreboard_db:/scoreboard_db
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another thing that needs to be documented, people are supposed to copy-paste this file iirc.

@@ -122,6 +122,27 @@ class Faction(pydantic.BaseModel):
name: str
team: Team

if TYPE_CHECKING:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, I didn't know about that :)

@cemathey cemathey merged commit 90e9aeb into master Feb 18, 2025
3 checks passed
@cemathey cemathey deleted the feat/scorebot_overhaul branch February 18, 2025 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants