// Copyright Epic Games, Inc. All Rights Reserved. // This file is automatically generated. Changes to this file may be overwritten. namespace Epic.OnlineServices.P2P { /// /// Structure containing information about the data being sent and to which player /// public struct SendPacketOptions { /// /// The Product User ID of the local user who is sending this packet /// public ProductUserId LocalUserId { get; set; } /// /// The Product User ID of the Peer you would like to send a packet to /// public ProductUserId RemoteUserId { get; set; } /// /// The socket ID for data you are sending in this packet /// public SocketId? SocketId { get; set; } /// /// Channel associated with this data /// public byte Channel { get; set; } /// /// The data to be sent to the RemoteUser /// public System.ArraySegment Data { get; set; } /// /// If false and we do not already have an established connection to the peer, this data will be dropped /// public bool AllowDelayedDelivery { get; set; } /// /// Setting to control the delivery reliability of this packet /// public PacketReliability Reliability { get; set; } } [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)] internal struct SendPacketOptionsInternal : ISettable, System.IDisposable { private int m_ApiVersion; private System.IntPtr m_LocalUserId; private System.IntPtr m_RemoteUserId; private System.IntPtr m_SocketId; private byte m_Channel; private uint m_DataLengthBytes; private System.IntPtr m_Data; private int m_AllowDelayedDelivery; private PacketReliability m_Reliability; public ProductUserId LocalUserId { set { Helper.Set(value, ref m_LocalUserId); } } public ProductUserId RemoteUserId { set { Helper.Set(value, ref m_RemoteUserId); } } public SocketId? SocketId { set { Helper.Set(ref value, ref m_SocketId); } } public byte Channel { set { m_Channel = value; } } public System.ArraySegment Data { set { Helper.Set(value, ref m_Data, out m_DataLengthBytes); } } public bool AllowDelayedDelivery { set { Helper.Set(value, ref m_AllowDelayedDelivery); } } public PacketReliability Reliability { set { m_Reliability = value; } } public void Set(ref SendPacketOptions other) { m_ApiVersion = P2PInterface.SendpacketApiLatest; LocalUserId = other.LocalUserId; RemoteUserId = other.RemoteUserId; SocketId = other.SocketId; Channel = other.Channel; Data = other.Data; AllowDelayedDelivery = other.AllowDelayedDelivery; Reliability = other.Reliability; } public void Set(ref SendPacketOptions? other) { if (other.HasValue) { m_ApiVersion = P2PInterface.SendpacketApiLatest; LocalUserId = other.Value.LocalUserId; RemoteUserId = other.Value.RemoteUserId; SocketId = other.Value.SocketId; Channel = other.Value.Channel; Data = other.Value.Data; AllowDelayedDelivery = other.Value.AllowDelayedDelivery; Reliability = other.Value.Reliability; } } public void Dispose() { Helper.Dispose(ref m_LocalUserId); Helper.Dispose(ref m_RemoteUserId); Helper.Dispose(ref m_SocketId); Helper.Dispose(ref m_Data); } } }