ServerConnectionType - jimdroberts/FishMMO GitHub Wiki
Represents the type of server connection the client is currently using. Used to track connection state transitions in the client for FishMMO.
-
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.
- Use
ServerConnectionType
to track and manage the client's current server connection state. - Assign or check the enum value as needed in client logic to handle connection transitions.
// Example 1: Checking connection type
if (client.CurrentConnectionType == ServerConnectionType.World)
{
// Handle world server logic
}
// Example 2: Setting connection type
client.CurrentConnectionType = ServerConnectionType.Login;
- 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.