I recently ran into an issue with player's spamming & being generally trolls via pm scripts to avoid B3. The following changes were tested on an UrT server only, but should work anywhere. (The only sort of UrT/Q3A specific part will be pointed out). CAUTION: You are modifying python files if you follow this, you need to make sure that the whitespace/tabbing at the start of lines is the correct amount, and you can't substitute tabs for spaces or vice versa. Please keep this in mind.
If anyone wants me to work this up into the config file, and submit a pull request I can do that, but for now here's the quick and dirty manual changes. This isn't really a plugin release, but it doesn't deserve it's own plugin, it really is just a modification of an offical one. Again, if anyone wants I can work up a proper github pull, or someone can just copy it into git themselves.
Open up b3/plugins/censor.py go to around line 76, it should look like this;
self.registerEvent(b3.events.EVT_CLIENT_SAY)
self.registerEvent(b3.events.EVT_CLIENT_TEAM_SAY)
self.registerEvent(b3.events.EVT_CLIENT_NAME_CHANGE)
self.registerEvent(b3.events.EVT_CLIENT_AUTH)
add the line " self.registerEvent(b3.events.EVT_CLIENT_PRIVATE_SAY)" afterwards, spacing is important (it is python after all), make sure it's spaced out the same as the lines above. So it now should look like this;
self.registerEvent(b3.events.EVT_CLIENT_SAY)
self.registerEvent(b3.events.EVT_CLIENT_TEAM_SAY)
self.registerEvent(b3.events.EVT_CLIENT_NAME_CHANGE)
self.registerEvent(b3.events.EVT_CLIENT_AUTH)
self.registerEvent(b3.events.EVT_CLIENT_PRIVATE_SAY)
Now the only other change we need to make, is in the same file, scroll down to what had been line 170, now should be 171 or so, is had looked like;
elif len(event.data) > self._ignoreLength:
if event.type == b3.events.EVT_CLIENT_SAY or \
event.type == b3.events.EVT_CLIENT_TEAM_SAY:
change it to look like this;
elif len(event.data) > self._ignoreLength:
if event.type == b3.events.EVT_CLIENT_SAY or \
event.type == b3.events.EVT_CLIENT_TEAM_SAY or \
(event.type == b3.events.EVT_CLIENT_PRIVATE_SAY and event.client.id != event.target.id):
Now the above part includes a work around for the way that Q3A based games & B3 handle private messages, I'm not sure if other games work like this, but in Q3A based things, a private message (/tell) will look to b3 as a message to the recipient, and a message to yourself, so I had to add filtering to make sure that if it was sending to itself to ignore it, otherwise it was warning twice as often as it should. If someone could confirm how B3 handles PM's in other games I could change that. This is all you need to do to make the censor plugin watch what people say in pm's. It does mean though that your admins may need to be more careful about warn removing for what looks like bot screw ups, because the bot is now watching things the admin can't see without an outside tool (like echelon).
The procedure for the spam plugin is much the same, open b3/plugins/spamcontrol.py go to line 39 or so, it should look like this;
self.registerEvent(b3.events.EVT_CLIENT_SAY)
self.registerEvent(b3.events.EVT_CLIENT_TEAM_SAY)
change it to be;
self.registerEvent(b3.events.EVT_CLIENT_SAY)
self.registerEvent(b3.events.EVT_CLIENT_TEAM_SAY)
self.registerEvent(b3.events.EVT_CLIENT_PRIVATE_SAY)
Now this next change is again needed for UrT at least, it probably won't hurt the other parsers, but it may be unneccessary. Go to line 80, it sould look like this;
if not event.client or event.client.maxLevel >= self._modLevel:
return
last_message_time = event.client.var(self, 'last_message_time', self.console.time()).value
change it to;
if not event.client or event.client.maxLevel >= self._modLevel:
return
if event.type == b3.events.EVT_CLIENT_PRIVATE_SAY and event.client.id == event.target.id:
return
last_message_time = event.client.var(self, 'last_message_time', self.console.time()).value
and now spamcontrol is watching pm's. It should be noted that since the change as I wrote with the Q3A mod in mind, on both these plugins means that it doesn't matter what people /tell them selves, both for spamming or censor, which is not necessarily a bad thing, as who cares? No one else can see these messages.