CharacterCreateResult - jimdroberts/FishMMO GitHub Wiki
Defines the result types for character creation attempts, indicating success or specific failure reasons. Used to communicate the outcome of character creation requests between client and server.
-
public enum CharacterCreateResult : byte
Result types for character creation attempts.
- Success: Character creation succeeded.
- TooMany: Too many characters exist for this account.
- InvalidCharacterName: Character name is invalid (e.g., contains forbidden characters or is empty).\n - CharacterNameTaken: Character name is already taken by another player.
- InvalidSpawn: Spawn location or spawner is invalid.
- Use this enum to represent the result of character creation attempts.
- Assign the appropriate value based on the outcome of the character creation process.
// Example: Handling character creation result
CharacterCreateResult result = CharacterCreateResult.Success;
if (result == CharacterCreateResult.Success) {
// Proceed with game logic
} else if (result == CharacterCreateResult.CharacterNameTaken) {
// Notify user that the name is taken
}
- Always check the result value after a character creation attempt.
- Provide clear feedback to users based on the specific failure reason.
- Keep the enum values synchronized between client and server for consistency.