public void Set(GetNextReceivedPacketSizeOptions other) { if (other != null) { m_ApiVersion = P2PInterface.GetnextreceivedpacketsizeApiLatest; LocalUserId = other.LocalUserId; RequestedChannel = other.RequestedChannel; } }
/// <summary> /// Gets the size of the packet that will be returned by ReceivePacket for a particular user, if there is any available /// packets to be retrieved. /// </summary> /// <param name="options">Information about who is requesting the size of their next packet</param> /// <param name="outPacketSizeBytes">The amount of bytes required to store the data of the next packet for the requested user</param> /// <returns> /// <see cref="Result" />::<see cref="Result.Success" /> - If OutPacketSizeBytes was successfully set and there is data to be received /// <see cref="Result" />::<see cref="Result.InvalidParameters" /> - If input was invalid /// <see cref="Result" />::<see cref="Result.NotFound" /> - If there are no packets available for the requesting user /// </returns> public Result GetNextReceivedPacketSize(GetNextReceivedPacketSizeOptions options, out uint outPacketSizeBytes) { System.IntPtr optionsAddress = new System.IntPtr(); Helper.TryMarshalSet <GetNextReceivedPacketSizeOptionsInternal, GetNextReceivedPacketSizeOptions>(ref optionsAddress, options); outPacketSizeBytes = Helper.GetDefault <uint>(); var funcResult = EOS_P2P_GetNextReceivedPacketSize(InnerHandle, optionsAddress, ref outPacketSizeBytes); Helper.TryMarshalDispose(ref optionsAddress); return(funcResult); }
/// <summary> /// 短縮 GetNextReceivedPacketSize /// </summary> /// <param name="p2p">P2PInterface</param> /// <param name="localUserId">ログインユーザーID</param> /// <param name="requestedChannel">チャンネルID</param> public static uint GetNextReceivedPacketSize(this P2PInterface p2p, ProductUserId localUserId, byte requestedChannel) { var sizeOp = new GetNextReceivedPacketSizeOptions { LocalUserId = localUserId, RequestedChannel = requestedChannel }; uint size; var result = p2p.GetNextReceivedPacketSize(sizeOp, out size); if (result != Result.Success) { // メッセージが無くてもエラーになるので非表示 //Debug.LogError($"error {DebugTools.GetClassMethodName()}:{result}"); } return(size); }
/// <summary> /// Short GetNextReceivedPacketSize /// </summary> /// <param name="p2p">P2PInterface</param> /// <param name="localUserId">Login user id</param> /// <param name="requestedChannel">channel id</param> public static uint GetNextReceivedPacketSize(this P2PInterface p2p, ProductUserId localUserId, byte requestedChannel) { var sizeOp = new GetNextReceivedPacketSizeOptions { LocalUserId = localUserId, RequestedChannel = requestedChannel }; uint size; var result = p2p.GetNextReceivedPacketSize(sizeOp, out size); if (result != Result.Success) { // It is an error even if there is no message, so it is hidden //Debug.LogError($"error {DebugTools.GetClassMethodName()}:{result}"); } return(size); }