ServerConnectionType - jimdroberts/FishMMO GitHub Wiki

Description

Represents the type of server connection the client is currently using. Used to track connection state transitions in the client for FishMMO.


API Access

Fields

  • None

    No active server connection.

  • Login

    Connected to the login server.

  • ConnectingToWorld

    Connecting to the world server (transition state).

  • World

    Connected to the world server.

  • Scene

    Connected to a specific scene server.


Basic Usage

Setup

  1. Use ServerConnectionType to track and manage the client's current server connection state.
  2. Assign or check the enum value as needed in client logic to handle connection transitions.

Example

// Example 1: Checking connection type
if (client.CurrentConnectionType == ServerConnectionType.World)
{
    // Handle world server logic
}

// Example 2: Setting connection type
client.CurrentConnectionType = ServerConnectionType.Login;

Best Practices

  • Use this enum to clearly define and manage connection states in the client.
  • Update the connection type appropriately during server transitions to ensure correct client behavior.
  • Avoid using magic numbers; always use the named enum values for clarity.
⚠️ **GitHub.com Fallback** ⚠️