replacement "_" for space in player name

Discussions about Coding and Scripting
User avatar
Barbie
Godlike
Posts: 2394
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

replacement "_" for space in player name

Post by Barbie » Wed Jan 19, 2022 1:19 am

I notice that if I try to login in a 469c server with only spaces in player name, the spaces are replaced by underscore. Does anyone know where in code that happens?
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett

Buggie
Godlike
Posts: 1489
Joined: Sat Mar 21, 2020 5:32 am

Re: replacement "_" for space in player name

Post by Buggie » Wed Jan 19, 2022 2:25 am

PlayerPawn.uc:

Code: Select all

exec function SetName( coerce string S )
{
	if ( Len(S) > 28 )
		S = left(S,28);
	ReplaceText(S, " ", "_");
	ChangeName(S);
	UpdateURL("Name", S, true);
	SaveConfig();
}