bluap Report post Posted June 28, 2008 (edited) I've just fixed a crash-the-client bug in new_character.c. Acelon reported that if you attempt to create a character with the maximum length name, the client crashed. This turned out to be because the server rejects the name causing the client to attempt a reconnect. The reconnect caused a recursive call to draw_scene(). I've fixed the recursion and put in some error reporting as the error when was not reported before. The question is why can you type a name larger than the server will accept? .... The server reports that the maximum length for a character name is 15. The test for typing the new character name used "> MAX_USERNAME_LENGTH" but MAX_USERNAME_LENGTH is defined as 16. Therefore you could enter names of length of 16 or 17. I've changed the code to use ">=MAX_USERNAME_LENGTH" but this is still one too many. May be the extra char is for storing the `\0' and we should use ">=MAX_USERNAME_LENGTH-1" but here's a complication. At the login screen you can happy type 17 characters for your name. Using 17 appears to be reject by the server, however using 16 you get a "player does not exist" error. Does that mean 16 character names are really OK. Both put characters past the input box limits. So should MAX_USERNAME_LENGTH be set to 15? Should 16 character login names be allowed? Should we leave MAX_USERNAME_LENGTH set to 16 and test ">=MAX_USERNAME_LENGTH-1" for user input? Any thoughts? Edited June 28, 2008 by bluap Share this post Link to post Share on other sites
bkc56 Report post Posted June 28, 2008 Any thoughts?There have long been problems with people using long names (like "lochnesslobster"). Sometimes the names are fine, sometimes they fail in commands. I don't remember which commands (might be buddy list related) but the problems have been around "forever". I always figured it was coding inconsistencies (max_length vs max_length-1 or > vs >=). In order to fix this, the define and every usage of the define will need to be checked for consistent usage and testing conditions. Share this post Link to post Share on other sites