Table of Contents

Interface IServerAddressProvider

Namespace
FishMMO.Server.Core
Assembly
FishMMO.Server.dll

Interface for a service that provides server address information. Removes the responsibility from the Server class itself.

public interface IServerAddressProvider

Methods

TryGetServerIPAddress(out ServerAddress)

Attempts to get the server's IP address (either IPv4 or IPv6).

bool TryGetServerIPAddress(out ServerAddress address)

Parameters

address ServerAddress

When this method returns, contains the server address if found; otherwise, the default value.

Returns

bool

true if an IP address was found; otherwise, false.

TryGetServerIPv4AddressFromTransport(out ServerAddress)

Attempts to get the server's IPv4 address from the transport layer.

bool TryGetServerIPv4AddressFromTransport(out ServerAddress address)

Parameters

address ServerAddress

When this method returns, contains the IPv4 server address if found; otherwise, the default value.

Returns

bool

true if the IPv4 address was found; otherwise, false.

TryGetServerIPv6AddressFromTransport(out ServerAddress)

Attempts to get the server's IPv6 address from the transport layer.

bool TryGetServerIPv6AddressFromTransport(out ServerAddress address)

Parameters

address ServerAddress

When this method returns, contains the IPv6 server address if found; otherwise, the default value.

Returns

bool

true if the IPv6 address was found; otherwise, false.