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

Apply word filtering rules to usernames on player connect #533

Merged
merged 2 commits into from
May 26, 2024

Conversation

Gcommer
Copy link
Contributor

@Gcommer Gcommer commented May 25, 2024

Rather than adding much specialized handling I just treat a connect event as a chat message with the player's name in it. This is a bit annoying since it shows up on the site's chat log, but I suppose it could be a good log to protect against users changing their names a lot (in an attempt to hide something offensive). Followups could hide those messages from showing up on the site.

While testing on my server, I realized that automatic actions on chat messages didn't seem to be working at all (maybe I'm missing some setup?). I fixed that here by having chat_usecase listen to chat_repository's WarningChan.

Another new change here is that we kick based off of the server id and player id from the log event instead of doing a lookup by steamid. This is pretty necessary as it's very unlikely we'll have gotten a status update from the server before the connect event... This also fixes an issue where users could avoid auto-kicks for chat messages if they said something offensive very shortly after joining a server.

There's a small loophole, that we don't check usernames continuously... So if an offensive username joins while the gbans server is restarting they'll get to stay in the server.

Fixes #435

@leighmacdonald
Copy link
Owner

Looks good. I believe your are correct in your assertion that the warning were not firing, so its great you got that working. Will test it out late today when i get a chance.

@leighmacdonald
Copy link
Owner

Works great, thanks!

@leighmacdonald leighmacdonald merged commit 6b2bc26 into leighmacdonald:master May 26, 2024
8 checks passed
@Gcommer Gcommer deleted the usernames branch May 26, 2024 15:10
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.

Check player names on connect against filtered words
2 participants