Jump to content

Home

Blank names glitch.


ck-killa

Recommended Posts

There is a code missing from Jedi Knight so that it allows you to make blank names. Here's how you do it.... /name "^7 " or /name "^7 ^7" or /name "^7^7^7^7 ^7". As long as there's a color, and a space after it, it will make a blank name.

 

I've been looking at ClientCleanName for a long time, and can barely make sense of it... well 70% of it I understand.

 

I've gone to a server called JawaScript which is hosted on the ModWooty mod. This mod has a fix to keep you safe from this exploit.

 

But here's what I think the fixed code should be written as...

 

If theres a color and space following it, rename them to padawan. However, if the color is in the MIDDLE of the name, ignore it.

 

Or, If the name is blank, or only has a space, but IGNORE colors all together.

 

I'm at a loss on how to write it though.

Link to comment
Share on other sites

I'd just make it so if a name doesn't have any letter of the alphabet or a digit, then not let them rename at all. If someone makes their entire name out of alt codes to replace letters of the real alphabet, then.. well to be honest I'd rather they just got kicked from the server xD

Link to comment
Share on other sites

I'd just make it so if a name doesn't have any letter of the alphabet or a digit, then not let them rename at all.

 

And you don't see a problem with that? What happens when they make a space in their name? Do you know coding, or are you just talking out loud? I'm really just waiting for ensiform to reply to this to see if he fixed it or not.

Link to comment
Share on other sites

did a quick look, and tested a fix i quickly thought up and it works :o

 

In g_client.c, in ClientCleanName() find:

if( !*p && ch == ' ' ) {

and replace it with:

if( (colorlessLen == 0 || !*p) && ch == ' ' ) {

Seems to work for me :)

 

Dude, thanks so much.

Link to comment
Share on other sites

I'm using:

 

void em_CleanName(char *name, char *out, int outlen)
{
qboolean valid = qfalse;

char *wp = out, *rp, *rap;    //write, read, and readahead

for(rp = name; *rp == ' '; rp++);   //eat leading spaces

while(*rp)
{
	if (*rp == '^') //oh no, we have a color code
	{
		for(rap = rp; *rap && *++rap == '^';*wp++ = '^');  //find the first non^

		if (*rap <= '7' && *rap >= '0' + !em_blacknames.integer)  //if it's a valid color code (between 7 and 1 if em_blacknames.integer is 0, 7 and 0 otherwise)
		{
			if (wp - out < outlen) *wp++ = *rp; //copy one ^
			if (wp - out < outlen) *wp++ = *rap;//as well as the number
		} else if (*rap != '8' && *rap != '9') {
			if (wp - out < outlen) *wp++ = *rp; //copy one ^
			if (wp - out < outlen) *wp++ = *rap;//as well as the letter
		}

		rp = rap;   //skip the color string... it has been written if it's a valid one
	}
	else
	{
		if (wp - out < outlen) *wp++ = *rp; //length checking... just to make sure we don't run over the edge of the out string and crash the server... o_O
	}

	if (*rp) rp++;  //read the next one if there is a next one... (a bad color string at the end will cause rp to point to the ending null char)
}

while(*--wp == ' ');	//from the end of the line, look backwards for the first non-space.
*++wp = 0;				//go back to the space and make a null character (this clips trailing spaces)

rp = out;
while(*rp)
{
	if (*rp != ' ' && *rp != '^') valid = qtrue;
	if (*rp == '^') rp++;
	if (*rp) rp++;
}
if (!valid) Q_strncpyz(out, "Padawan", outlen);		//if, after all that, we're left with nothing, name them Padawan
}

 

That's the modified XMOD version with the ^ fix + support to toggle ability to use ^0.

Link to comment
Share on other sites

And you don't see a problem with that? What happens when they make a space in their name? Do you know coding, or are you just talking out loud? I'm really just waiting for ensiform to reply to this to see if he fixed it or not.

 

Do you know English? It doesn't matter if there's a space in there, they can have alt codes as well as long as they have at LEAST one letter of the alphabet or a digit, and that will also ensure that the name is visible.

Link to comment
Share on other sites

Do you know English?

So far i've been speaking it the entire time sense i've registered here. So the answer is yes.

 

What im saying is, what would be wrong with YOUR code would be that if we made sure no spaces were used, if you use a space imbetween 2 characters, it would have screwed up. I'm just saying your logic is wrong.

Link to comment
Share on other sites

So far i've been speaking it the entire time sense i've registered here. So the answer is yes.

 

What im saying is, what would be wrong with YOUR code would be that if we made sure no spaces were used, if you use a space imbetween 2 characters, it would have screwed up. I'm just saying your logic is wrong.

 

You may be able to write, but you are definitely having trouble reading.

 

I said at least one character must be a letter of the alphabet or digit.

That is different to all characters having to be a letter of the alphabet or a digit.

Link to comment
Share on other sites

Actually I was contributing to the topic, and my way would work aswell. Judging by your reply I'm going to guess you've now figured out that what I was saying was right, and you're taking the "let's just stop this" approach. You brought this upon yourself in your second post accusing me of not knowing anything about what I'm doing, when I merely suggested a simple approach to fix this bug.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...