Notes |
|
|
THIS! How has it taken so long for someone to consider colour code not being counted towards name length... |
|
|
(0014413)
|
Dusk
|
2016-02-10 14:52
|
|
This one is actually more difficult than in ZDoom since existing code inherited from Skulltag still uses fixed-size char arrays that rely on the length limit.
And in any case an absolute length limit must exist because this string gets sent over the network. What I guess we could do is set a fixed name length limit (say 24 chars for instance) and an absolute length limit of 3x that (72) for color codes that is harder to actually reach, even with longer form colors such as the ones provided by NewTextColors.pk3. The former limit would thus be the actual restricting name length and the 72 char limit as a technical maximum. |
|
|
(0014415)
|
Leonard
|
2016-02-10 15:41
(edited on: 2016-02-10 15:47) |
|
I totally forgot about this ticket.
I actually did this a few months ago but I forgot about it because I started working on other stuff.
Basically I did exactly what you said dusk, I had the MAXPLAYERNAME define be the actual character limit and a new define "MAXPLAYERNAMECHAR" which was the string limit.
I also realised the char arrays zandronum uses were problematic so I actually resized all of the ones that used the player's name in any way (by searching for each GetName() instance).
I'll attach the original patch I made if that helps but it may need some testing.
EDIT: Couldn't figure out how to attach on the tracker so here's a link.
|
|
|
(0014424)
|
Dusk
|
2016-02-11 17:41
|
|
Hmm, interesting. Though I wonder if we could instead expend the effort to using FStrings in the affected code. |
|
|
(0014487)
|
Dusk
|
2016-02-23 22:37
|
|
|
|
|
I'll revive this sometime in the near future. |
|
|
|
In 3.1, colour codes are no longer included in the length of a player's name, meaning players can use more complex colour schemes without hitting the 32-character limit, even when using the new text colours.
Ask Dusk suggested before, there's an absolute limit for how long a name can actually be, including the colour codes (96 characters long). However, this limit should be hard to reach under normal use, and primarily exists so that names aren't too big when sent across the network. |
|
|
|
Verified that this works correctly online. |
|