Illegal Room Name

4 replies [Last post]
Firework
User offline. Last seen 5 years 50 weeks ago. Offline
Joined: 2013-01-11
Posts: 34

When creating a new room and the name is invalid, Hedgewars gives an "Illegal room name" error, but it doesn't say why the name is invalid (too long?, invalid character?).

Two suggestions:

1) When typing the name, ensure that the text field is limited to the maximum number of characters, so the user immediately knows if the name being typed is too long.

2) If validation fails, say why the name has failed, so it can be easily corrected by the user. It isn't immediately obvious what characters are/are not allowed in a room name.

Wuzzy
Wuzzy's picture
User offline. Last seen 26 weeks 6 days ago. Offline
Joined: 2012-06-20
Posts: 1304

Personally, I think the real solution would be to allow more characters, maybe even the whole Unicode range? Okay, you could still disallow some really special characters, like NUL, etc.

Hi, I am a Hedgewars developer. Smile

nemo
nemo's picture
User offline. Last seen 21 weeks 1 day ago. Offline
Joined: 2009-01-28
Posts: 1861

Wuzzy, the character limitation is not unicode related, but more about bugs in older clients. Once people stop using those clients, the character constraint can be lifted.

Also, the length thing is amusingly unicode related. We need to make the frontend field do a byte count limit in a semi smart way that doesn't screw up multibyte. Probably by just letting 'em type, but adding some warning text once it gets too long. We may be able to drop the illegal char restriction by the time we get that into a release.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

sheepluva
sheepluva's picture
User offline. Last seen 1 week 2 days ago. Offline
Joined: 2009-07-18
Posts: 563

nemo allegedly wrote:

Wuzzy, the character limitation is not unicode related, but more about bugs in older clients. Once people stop using those clients, the character constraint can be lifted.

The only bug I know was with regexp in OWN nickname.
So we could easily remove the check for NICK if PROTO number stated after is newer than last bugged version's PROTO number.

Since the bug won't be triggered if only other players have regexp chars in their names.

Only problem there might be the order of messages.
Since it's
> NICK
< NICK
> PROTO
< PROTO

so when PROTOcol number is known, it's probably to late to ask for a new nickname, so we'd have to disconnect the user with an invalid-name message.

But that might be how it's already done anyway, dunno.

  sheepluva <- me  my code stats -> 
a Hedgewars Developer


   <- where I'm from  what I speak -> 

nemo
nemo's picture
User offline. Last seen 21 weeks 1 day ago. Offline
Joined: 2009-01-28
Posts: 1861

Yeah, the most recent bug was more limited than the prior one. Prior one was more serious.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]