gemidyne / microtf2

A custom gamemode for Team Fortress 2 - Players compete against each other to get the most points by playing a series of rapid fire microgames in order to win the round!
https://www.gemidyne.com/projects/microtf2
GNU General Public License v2.0
30 stars 16 forks source link

antiflood.smx from native SM interferes with Typing boss game #232

Closed FlaminSarge closed 2 years ago

FlaminSarge commented 2 years ago

Describe the bug antiflood.smx, the native SourceMod chat flood prevention plugin, seems to interfere with the Bossgame7, as users that get limited can't put in answers (Bossgame7 doesn't even see their chat messages as antiflood catches them beforehand). The cvar controlling this behavior is sm_flood_time.

Expected behavior Ideally, players that are still alive during Bossgame7 will not be affected by sm_flood_time, but those that are not alive would still be limited. Potentially achievable by hooking the flood-related forwards in Bossgame7 and overriding the result for living players.

Screenshots If applicable, add screenshots to help explain the bug

Do you know what version of the gamemode this bug occurred on?

Additional info N/A

safalin1 commented 2 years ago

Thanks for catching this one. I have started implementing the OnClientFloodCheck forward within Bossgame7 to override the check result. I need to test, but I have a gut feeling I might not be able to override antiflood's check result this way (looking at SM's ChatTriggers.cpp looks like it's using ET_Event so returning highest return value). I'm hoping I am wrong though!

The fallback would be to read the cvar, set it to 0 whilst bossgame7 runs, then set it back to what it originally was.

I'll comment the result here - I am looking to put this into master first then dev so the bugfix isn't waiting on the release of v6

safalin1 commented 2 years ago

I have tested using the forwards, but returning false in OnClientFloodCheck does not allow the gamemode to override the flood check. I am going to release v5.2.2 shortly which uses the convar method to fix this issue

safalin1 commented 2 years ago

Fixed in v5.2.2