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

No bot impersonation in names #2276

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

necessarily-equal
Copy link
Contributor

@necessarily-equal necessarily-equal commented Oct 29, 2022

Closes #2125.

@necessarily-equal
Copy link
Contributor Author

If we're going to disallow [bot] in names, maybe it would be good to have some gui feedback on that. I am not bothered enough to do it to be honest.

@DolceTriade
Copy link
Member

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?

@@ -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;
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, used that

@sweet235
Copy link
Contributor

sweet235 commented Nov 1, 2022

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?

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:
I mean the regexp thing is a good idea in general. But maybe not to solve this problem.

@necessarily-equal necessarily-equal marked this pull request as draft November 1, 2022 10:00
@necessarily-equal necessarily-equal force-pushed the no-bot-impersonation-in-names branch 2 times, most recently from 7bb4a03 to 5c59bd5 Compare November 6, 2022 15:49
@necessarily-equal necessarily-equal marked this pull request as ready for review November 6, 2022 15:50
@DolceTriade
Copy link
Member

lgtm

{
const char *find = "[bot]";
const char *found;
const char *out_str;
Copy link
Contributor

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

Copy link
Contributor Author

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)

@slipher
Copy link
Contributor

slipher commented Nov 8, 2022

I just noticed you can chain together different forbidden constructs to get an illegal name... e.g. [bo//t]

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.

prevent players to use the [bot] icon at start of their name
4 participants