ChannelAddress - jimdroberts/FishMMO GitHub Wiki

Description

Serializable struct representing a network channel address in FishMMO, including IP address, port, and scene handle. Used for network communication and scene management to identify and connect to specific scenes or channels.


API Access

Fields

  • public string Address

    IP address or hostname of the channel.

  • public ushort Port

    Port number for the channel.

  • public int SceneHandle

    Handle or identifier for the associated scene.


Basic Usage

Setup

  1. Create a ChannelAddress struct and populate its fields with the desired address, port, and scene handle.
  2. Use the struct when sending or receiving network messages that require channel or scene identification.

Example

// Example 1: Creating a channel address for a scene
ChannelAddress address = new ChannelAddress {
    Address = "127.0.0.1",
    Port = 7777,
    SceneHandle = 1
};
// Use address in network connection logic

Best Practices

  • Always provide valid IP addresses and port numbers to avoid connection issues.
  • Use unique scene handles to distinguish between different scenes or channels.
  • Serialize and deserialize the struct properly when sending over the network.
⚠️ **GitHub.com Fallback** ⚠️