CharacterCreateResult - jimdroberts/FishMMO GitHub Wiki

Description

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.


API Access

Fields

  • 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.

Basic Usage

Setup

  1. Use this enum to represent the result of character creation attempts.
  2. Assign the appropriate value based on the outcome of the character creation process.

Example

// 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
}

Best Practices

  • 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.
⚠️ **GitHub.com Fallback** ⚠️