Add length check to IsValidPlayerName.

Also check for the maximum allowed length in IsValidPlayerName, and
rework the code internally a biAdd length check to IsValidPlayerName.

Also check for the maximum allowed length in IsValidPlayerName, and
rework the code internally a bit.