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
No bot impersonation in names #2276
base: master
Are you sure you want to change the base?
No bot impersonation in names #2276
Conversation
|
If we're going to disallow |
|
At the very least, we need a cvar to enable/disable this behavior. Also, do you think it is worth it to extend this to a set of regexs as Sweet suggests? |
src/sgame/sg_client.cpp
Outdated
| @@ -750,6 +750,22 @@ static void G_ClientCleanName( const char *in, char *out, size_t outSize, gclien | |||
| invalid = true; | |||
| } | |||
|
|
|||
| if ( !(client->ent()->r.svFlags & SVF_BOT) ) | |||
| { | |||
| std::size_t index = 0; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q_stristr is what you want
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, used that
For the regexp thing, we would have to carefully choose a regexp variant and stick to it in the future. I'm not sure the regexp thing is a good idea, a better way of handling this might be to give each client explicit information about who is a bot. Edit: |
7bb4a03
to
5c59bd5
Compare
5c59bd5
to
bca8de7
Compare
|
lgtm |
| { | ||
| const char *find = "[bot]"; | ||
| const char *found; | ||
| const char *out_str; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't follow variable naming convention
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean it follows the existing convention of the function (out_string)
|
I just noticed you can chain together different forbidden constructs to get an illegal name... e.g. |
Closes #2125.