LanServer
readonly record struct
Represents one "open to LAN" announcement received from a Minecraft world.
Declaration
public readonly record struct LanServer
| Namespace | McProtoNet |
| Assembly | McProtoNet.dll |
| Source | src/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
| Signature | Description |
|---|---|
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
| Signature | Description |
|---|---|
IPEndPoint EndPoint | Gets the endpoint the announced world listens on, built from the sender's address and the announced port. |
string Motd | The text between [MOTD] and [/MOTD], still containing section-sign color codes. |
int Port | The TCP port the world listens on. |
IPEndPoint Source | The 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