Skip to content

fixed name length bug, and 2v2 timer change#24

Open
tommy-mor wants to merge 1 commit intosapphonie:masterfrom
tommy-mor:master
Open

fixed name length bug, and 2v2 timer change#24
tommy-mor wants to merge 1 commit intosapphonie:masterfrom
tommy-mor:master

Conversation

@tommy-mor
Copy link

name length bug was where in 2v2, super long names would cut off on the hud and you couldn't see the score. now, we doubled the buffer for all names, so that shouldn't ever be a problem. we tested with some long names.

we also changed the behavior for 2v2, for the 2v2 cup. previously, it would start a 3-2-1-fight timer for every round, now it just does that for the beginning round. This is mostly an aesthetic preference, but we got some complaints about it, and prefer it this way.

@sapphonie
Copy link
Owner

sapphonie commented Jul 29, 2024

Can you describe how long names would cut off, like with a screenshot? This doesn't make sense, SourceMod defines MAX_NAME_LENGTH == 128 in clients.inc:

#define MAX_NAME_LENGTH 128 /**< Maximum buffer required to store a client name */

, there shouldn't be any way to overfill that, as GetClientName should never return something over that size. Digging a little deeper...

@sapphonie
Copy link
Owner

sapphonie commented Jul 29, 2024

Buffers need to be >256:

Format(client_name, sizeof(client_name), "%s and %s", client_name, client_teammate_name);
Format(foe_name, sizeof(foe_name), "%s and %s", foe_name, foe_teammate_name);

Max name size of 128 on each client would overflow client/foe_name

@tommy-mor
Copy link
Author

yeah theres a lot of places where theres more than just player names beign put in buffers. like the score:

Format(report, sizeof(report), "%s\n%N and %N : %d", report, red_f1, red_f2, g_iArenaScore[arena_index][SLOT_ONE]);
, theres like 4 things being put into the one buffer. I don't have a screenshot but it was a common bug, don't have pc rn to replicate but the bottom of score would be cut off

@sapphonie
Copy link
Owner

sapphonie commented Jul 29, 2024

You can kick it to 300 or 512 for the buffers and ideally I'd prefer you put that timer behavior in a cvar. If you want it'd be feasible to truncate client names as well, I don't know if anyone actually wants to read 128 characters of a clients name, could probably cap it at 32, 48, 64, something like that, with %.32s syntax in Format etc

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.

2 participants