Class NetMessage
Inheritance
System.Object
NetMessage
Assembly: Eco.Shared.dll
Syntax
public static class NetMessage : Object
Fields
DiscoveryRequest
Declaration
public const byte DiscoveryRequest = 11
Field Value
Type |
Description |
System.Byte |
|
DiscoveryResponse
Declaration
public const byte DiscoveryResponse = 12
Field Value
Type |
Description |
System.Byte |
|
FragmentedMessage
Declaration
public const byte FragmentedMessage = 10
Field Value
Type |
Description |
System.Byte |
|
NatIntroduction
Declaration
public const byte NatIntroduction = 13
Field Value
Type |
Description |
System.Byte |
|
NatIntroductionConfirmed
Declaration
public const byte NatIntroductionConfirmed = 15
Field Value
Type |
Description |
System.Byte |
|
NatIntroductionConfirmRequest
Declaration
public const byte NatIntroductionConfirmRequest = 16
Field Value
Type |
Description |
System.Byte |
|
NatPunchMessage
Declaration
public const byte NatPunchMessage = 14
Field Value
Type |
Description |
System.Byte |
|
Ping
Declaration
public const byte Ping = 5
Field Value
Type |
Description |
System.Byte |
|
PingReply
Declaration
public const byte PingReply = 6
Field Value
Type |
Description |
System.Byte |
|
ReceiveHostInfo
Declaration
public const byte ReceiveHostInfo = 4
Field Value
Type |
Description |
System.Byte |
|
ReceiveOfficialServer
Declaration
public const byte ReceiveOfficialServer = 8
Field Value
Type |
Description |
System.Byte |
|
RegisterHost
Declaration
public const byte RegisterHost = 0
Field Value
Type |
Description |
System.Byte |
|
RegisterHostReply
Declaration
public const byte RegisterHostReply = 9
Field Value
Type |
Description |
System.Byte |
|
RelayAck
Declaration
public const byte RelayAck = 253
Field Value
Type |
Description |
System.Byte |
|
RelayConnect
Declaration
public const byte RelayConnect = 252
Field Value
Type |
Description |
System.Byte |
|
RelayIntroduce
Declaration
public const byte RelayIntroduce = 251
Field Value
Type |
Description |
System.Byte |
|
RelayRegister
Declaration
public const byte RelayRegister = 250
Field Value
Type |
Description |
System.Byte |
|
RequestHostInfo
Declaration
public const byte RequestHostInfo = 2
Field Value
Type |
Description |
System.Byte |
|
RequestHostList
Declaration
public const byte RequestHostList = 1
Field Value
Type |
Description |
System.Byte |
|
RequestIntroduction
Declaration
public const byte RequestIntroduction = 3
Field Value
Type |
Description |
System.Byte |
|
RequestOfficialList
Declaration
public const byte RequestOfficialList = 7
Field Value
Type |
Description |
System.Byte |
|
Methods
BroadcastPacket(IUdpServer, NetworkEvent, BSONObject)
Broadcasts netEvent
with payload
to all connected clients.
Declaration
public static void BroadcastPacket(this IUdpServer peer, NetworkEvent netEvent, BSONObject payload)
Parameters
DecodePacket(ReadOnlySpan<Byte>)
Declaration
public static ReceivedNetworkPacket DecodePacket(ReadOnlySpan<byte> message)
Parameters
Type |
Name |
Description |
System.ReadOnlySpan<System.Byte> |
message |
|
Returns
Disconnect(IUdpClient, String, Boolean)
Declaration
public static void Disconnect(this IUdpClient client, string byeMessage, bool causedByError = false)
Parameters
Type |
Name |
Description |
IUdpClient |
client |
|
System.String |
byeMessage |
|
System.Boolean |
causedByError |
|
Disconnect(IUdpServer, Object, String, Boolean)
Declaration
public static void Disconnect(this IUdpServer server, object connection, string byeMessage, bool disconectedByException = false)
Parameters
Type |
Name |
Description |
IUdpServer |
server |
|
System.Object |
connection |
|
System.String |
byeMessage |
|
System.Boolean |
disconectedByException |
|
DisconnectWithAddingToQueue(IUdpServer, Object, String, Int32)
Declaration
public static void DisconnectWithAddingToQueue(this IUdpServer server, object connection, string byeMessage, int queuePosition)
Parameters
Type |
Name |
Description |
IUdpServer |
server |
|
System.Object |
connection |
|
System.String |
byeMessage |
|
System.Int32 |
queuePosition |
|
EncodePacket(MemoryStream, NetworkEvent, BSONValue)
Encodes payload
as network packet for netEvent
.
Declaration
public static void EncodePacket(this MemoryStream message, NetworkEvent netEvent, BSONValue payload)
Parameters
SendDiscoveryRequest(IUnconnectedUdpPeer, IPEndPoint)
Declaration
public static void SendDiscoveryRequest(this IUnconnectedUdpPeer peer, IPEndPoint endPoint)
Parameters
SendDiscoveryResponse(IUnconnectedUdpPeer, IPEndPoint, String)
Declaration
public static void SendDiscoveryResponse(this IUnconnectedUdpPeer peer, IPEndPoint endPoint, string strangeWorldCloudData)
Parameters
Type |
Name |
Description |
IUnconnectedUdpPeer |
peer |
|
System.Net.IPEndPoint |
endPoint |
|
System.String |
strangeWorldCloudData |
|
SendPacket(IUdpClient, NetworkEvent, BSONObject)
Sends netEvent
with payload
through the peer
(to the server).
Declaration
public static void SendPacket(this IUdpClient peer, NetworkEvent netEvent, BSONObject payload)
Parameters
SendPacket(IUdpPeer, NetworkEvent, BSONValue, Object)
Encodes payload
and sends netEvent
with it's data to connection
(may be obtained from Connected).
Declaration
public static void SendPacket(this IUdpPeer peer, NetworkEvent netEvent, BSONValue payload, object connection)
Parameters
SendPingReply(IUnconnectedUdpPeer, IPEndPoint, Guid, Double)
Declaration
public static void SendPingReply(this IUnconnectedUdpPeer peer, IPEndPoint endPoint, Guid serverId, double sendTime)
Parameters
Type |
Name |
Description |
IUnconnectedUdpPeer |
peer |
|
System.Net.IPEndPoint |
endPoint |
|
System.Guid |
serverId |
|
System.Double |
sendTime |
|
SendPingRequest(IUnconnectedUdpPeer, IPEndPoint)
Declaration
public static void SendPingRequest(this IUnconnectedUdpPeer peer, IPEndPoint endPoint)
Parameters
SendPingRequest(IUnconnectedUdpPeer, IPEndPoint, Double)
Declaration
public static void SendPingRequest(this IUnconnectedUdpPeer peer, IPEndPoint endPoint, double sendTime)
Parameters
Type |
Name |
Description |
IUnconnectedUdpPeer |
peer |
|
System.Net.IPEndPoint |
endPoint |
|
System.Double |
sendTime |
|
Shutdown(IUdpServer, String)
Declaration
public static void Shutdown(this IUdpServer server, string reason)
Parameters
Type |
Name |
Description |
IUdpServer |
server |
|
System.String |
reason |
|