您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
27 行
1022 B
27 行
1022 B
using System.Runtime.InteropServices;
|
|
|
|
namespace Unity.Networking.Transport.Relay
|
|
{
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct RelayMessageConnectRequest
|
|
{
|
|
public const int Length = RelayMessageHeader.Length + RelayAllocationId.k_Length + 1 + RelayConnectionData.k_Length; // Header + AllocationId + ToConnectionDataLength + ToConnectionData;
|
|
|
|
public RelayMessageHeader Header;
|
|
|
|
public RelayAllocationId AllocationId;
|
|
public byte ToConnectionDataLength;
|
|
public RelayConnectionData ToConnectionData;
|
|
|
|
public static RelayMessageConnectRequest Create(RelayAllocationId allocationId, RelayConnectionData toConnectionData)
|
|
{
|
|
return new RelayMessageConnectRequest
|
|
{
|
|
Header = RelayMessageHeader.Create(RelayMessageType.ConnectRequest),
|
|
AllocationId = allocationId,
|
|
ToConnectionDataLength = 255,
|
|
ToConnectionData = toConnectionData,
|
|
};
|
|
}
|
|
}
|
|
}
|