Skip to main content

LanServer

readonly record struct

Represents one "open to LAN" announcement received from a Minecraft world.

Declaration​

public readonly record struct LanServer
NamespaceMcProtoNet
AssemblyMcProtoNet.dll
Sourcesrc/McProtoNet/Lan/LanServer.cs#L16 ↗

Remarks​

The announcement carries only the port. The address is that of the sender, so the endpoint to connect to is LanServer.EndPoint.

Constructors​

SignatureDescription
LanServer(IPEndPoint Source, string Motd, int Port)Represents one "open to LAN" announcement received from a Minecraft world.

LanServer(IPEndPoint, string, int)​

public LanServer(IPEndPoint Source, string Motd, int Port)

Represents one "open to LAN" announcement received from a Minecraft world.

The announcement carries only the port. The address is that of the sender, so the endpoint to connect to is LanServer.EndPoint.

Parameters: Source (IPEndPoint), Motd (string), Port (int)

Properties​

SignatureDescription
IPEndPoint EndPointGets the endpoint the announced world listens on, built from the sender's address and the announced port.
string MotdThe text between [MOTD] and [/MOTD], still containing section-sign color codes.
int PortThe TCP port the world listens on.
IPEndPoint SourceThe address and source port the announcement came from.

EndPoint​

public IPEndPoint EndPoint { get; }

Gets the endpoint the announced world listens on, built from the sender's address and the announced port.

Returns: IPEndPoint

Motd​

public string Motd { get; init; }

The text between [MOTD] and [/MOTD], still containing section-sign color codes.

Returns: string

Port​

public int Port { get; init; }

The TCP port the world listens on.

Returns: int

Source​

public IPEndPoint Source { get; init; }

The address and source port the announcement came from.

Returns: IPEndPoint