WorldServerDetails - jimdroberts/FishMMO GitHub Wiki

Description

Serializable class containing details about a world server in FishMMO, including name, address, status, and player count. Used for server selection, status display, and network communication regarding available world servers.


API Access

Fields

  • public string Name

    Name of the world server.

  • public DateTime LastPulse

    Timestamp of the last server heartbeat or status update.

  • public string Address

    IP address or hostname of the server.

  • public ushort Port

    Port number for the server.

  • public int CharacterCount

    Number of characters currently on the server.

  • public bool Locked

    Indicates whether the server is locked (not accepting new connections).


Basic Usage

Setup

  1. Create a WorldServerDetails instance and populate its fields with the server's information.
  2. Use the class to display server status, filter available servers, or send server details over the network.

Example

// Example 1: Creating a world server details object
WorldServerDetails server = new WorldServerDetails {
    Name = "World 1",
    LastPulse = DateTime.UtcNow,
    Address = "world1.fishmmo.com",
    Port = 7777,
    CharacterCount = 120,
    Locked = false
};
// Use server object in server list or status display

Best Practices

  • Update the LastPulse field regularly to reflect the server's current status.
  • Use the Locked field to prevent new connections when the server is under maintenance or full.
  • Validate all fields before displaying or transmitting server details to ensure accuracy.
⚠️ **GitHub.com Fallback** ⚠️