MantisBT - Zandronum
View Issue Details
0001861Zandronum[All Projects] Suggestionpublic2014-06-26 14:242014-06-29 20:38
AlienOverlord 
 
normalminoralways
closeddenied 
1.2 
 
0001861: Increasing MAXPLAYERNAME
Recently I bumped into this issue for like 6th time and well, it felt bad.
So I suggest these two things to be done (can code them myself, if Torr accepts):
 - increasing MAXPLAYERNAME to 128+3 (yes, that huge number)
 - adding a new check in V_CleanPlayerName to limit actual name length to the current value (well, almost current value: 32 characters), excluding color control characters; that is so people don't abuse the feature above to play with 128 character long nicks.

This will mainly help people that use custom colors in their names, as for such colors one control sequence takes minimum of 4 characters (\c, [, letter, ]) and in existing popular packs up to 6 characters.

Although that'll be most noticeable, this will affect people that use system colors as well, enabling them to for example use smoother transitions.
No tags attached.
Issue History
2014-06-26 14:24AlienOverlordNew Issue
2014-06-26 18:28LeonardNote Added: 0009753
2014-06-26 18:29LeonardNote Edited: 0009753bug_revision_view_page.php?bugnote_id=9753#r5203
2014-06-26 21:00CatastropheNote Added: 0009756
2014-06-26 22:53WatermelonNote Added: 0009760
2014-06-27 19:21DuskNote Added: 0009763
2014-06-27 19:23DuskNote Edited: 0009763bug_revision_view_page.php?bugnote_id=9763#r5211
2014-06-27 19:23DuskNote Edited: 0009763bug_revision_view_page.php?bugnote_id=9763#r5212
2014-06-29 12:48AlienOverlordNote Added: 0009781
2014-06-29 12:48AlienOverlordNote Edited: 0009781bug_revision_view_page.php?bugnote_id=9781#r5234
2014-06-29 12:48AlienOverlordNote Edited: 0009781bug_revision_view_page.php?bugnote_id=9781#r5235
2014-06-29 14:03WatermelonNote Added: 0009783
2014-06-29 14:11AlienOverlordNote Added: 0009784
2014-06-29 14:33Edward-sanNote Added: 0009785
2014-06-29 15:11ZzZomboNote Added: 0009786
2014-06-29 16:39DuskSeveritymajor => minor
2014-06-29 20:38DuskNote Added: 0009795
2014-06-29 20:38DuskStatusnew => closed
2014-06-29 20:38DuskResolutionopen => denied

Notes
(0009753)
Leonard   
2014-06-26 18:28   
(edited on: 2014-06-26 18:29)
I already thought about not counting the color characters for the name limit and I think it would be very useful.
For the newtextcolor wad I'm sure a ton of people already hit the limit just because of the colors.
Even with only "Leonard" I can max use 4/5 different custom colors before hitting the limit.

(0009756)
Catastrophe   
2014-06-26 21:00   
If what you're trying to say is that the current 32 character limit should NOT include the additional text needed to add colors (such as \cm), then I agree. This becomes especially noticeable when using custom color wads.
(0009760)
Watermelon   
2014-06-26 22:53   
I'm personally fine with extending it, though IDK if Carn has littered Zan with MAXPLAYERSNAME + 3 + 1 (making it a lot harder to find bugs)

I believe it should be capped at 32 characters, but upped to 32 * 3 to allow color for each letter. Since names are restricted to changing only every 30 sec, bandwidth wouldn't be really an issue.
(0009763)
Dusk   
2014-06-27 19:21   
(edited on: 2014-06-27 19:23)
Ideally netname should be an FString but considering the wonderful code practice of our upstream we cannot really do that.

EDIT: Hmm. In recent ZDoom versions userinfo_t is a TMap<FName,FBaseCVar *> derivative and the public netname field has been replaced by GetName:
const char *GetName() const
{
    return *static_cast<FStringCVar *>(*CheckKey(NAME_Name));
}


(0009781)
AlienOverlord   
2014-06-29 12:48   
> I believe it should be capped at 32 characters, but upped to 32 * 3 to allow color for each letter.
Well this is basically what I said. The only difference is that I wanted it to be capped at 32 and upped to 32 * 4.

Also just saying, right now it's not capped to 32. It's capped to 31 due to Carn being dum dum. Quote from d_player.h:

// [BC] Allow longer names since we can now colorize them and stuff.
// [BB] "+3" so that playernames can always be terminated by "\\c-"
#define MAXPLAYERNAME 31+3


(0009783)
Watermelon   
2014-06-29 14:03   
Quote
Well this is basically what I said. The only difference is that I wanted it to be capped at 32 and upped to 32 * 4.

Why *4 instead of *3?
(0009784)
AlienOverlord   
2014-06-29 14:11   
Quote
Why *4 instead of *3?

Because the number looks nicer :)
(0009785)
Edward-san   
2014-06-29 14:33   
... I'd say "16*4+3", because, uh, is it there a name which should have more than 16 characters (without counting the color control chars)?
(0009786)
ZzZombo   
2014-06-29 15:11   
Yes? "[myclan] mr. twister" is 20 characters long.
(0009795)
Dusk   
2014-06-29 20:38   
closing after developer discussion: bumping MAXPLAYERNAME is unnecessary and if someone bumps into the buffer limit using color codes they should consider using a simpler color scheme.