Fix inconsistencies with buffer sizes for player names.
Found any I could not using MAX_NAME_LENGTH and changed them to use it. I think that we should increase MAX_NAME_LENGTH to 128 for CS:GO at some point as that's what it uses internally. (Presumably to get the client's full multibyte name from Steam without truncation mid-codepoint which can happen in other games. Steam's max is 32 characters if I remember correctly, but allows multibyte chars).
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
stock FormatUserLogText(client, String:buffer[], maxlength)
|
||||
{
|
||||
decl String:auth[32];
|
||||
decl String:name[40];
|
||||
decl String:name[MAX_NAME_LENGTH];
|
||||
|
||||
new userid = GetClientUserId(client);
|
||||
if (!GetClientAuthString(client, auth, sizeof(auth)))
|
||||
@@ -107,7 +107,7 @@ stock int SearchForClients(const char[] pattern, int[] clients, int maxClients)
|
||||
if (pattern[0] == '#') {
|
||||
int input = StringToInt(pattern[1]);
|
||||
if (!input) {
|
||||
char name[65];
|
||||
char name[MAX_NAME_LENGTH];
|
||||
for (int i=1; i<=MaxClients; i++) {
|
||||
if (!IsClientInGame(i))
|
||||
continue;
|
||||
@@ -126,7 +126,7 @@ stock int SearchForClients(const char[] pattern, int[] clients, int maxClients)
|
||||
}
|
||||
}
|
||||
|
||||
char name[65];
|
||||
char name[MAX_NAME_LENGTH];
|
||||
for (int i=1; i<=MaxClients; i++)
|
||||
{
|
||||
if (!IsClientInGame(i))
|
||||
|
||||
Reference in New Issue
Block a user