public void Set(CopyPlayerSanctionByIndexOptions other)
 {
     if (other != null)
     {
         m_ApiVersion  = SanctionsInterface.CopyplayersanctionbyindexApiLatest;
         TargetUserId  = other.TargetUserId;
         SanctionIndex = other.SanctionIndex;
     }
 }
Пример #2
0
        /// <summary>
        /// Copies an active player sanction.
        /// You must call QueryActivePlayerSanctions first to retrieve the data from the service backend.
        /// On success, <see cref="Release" /> must be called on OutSanction to free memory.
        /// <seealso cref="QueryActivePlayerSanctions" />
        /// <seealso cref="Release" />
        /// </summary>
        /// <param name="options">Structure containing the input parameters</param>
        /// <param name="outSanction">The player sanction data for the given index, if it exists and is valid</param>
        /// <returns>
        /// <see cref="Result.Success" /> if the information is available and passed out in OutSanction
        /// <see cref="Result.InvalidParameters" /> if you pass a null pointer for the out parameter
        /// <see cref="Result.NotFound" /> if the player achievement is not found
        /// </returns>
        public Result CopyPlayerSanctionByIndex(CopyPlayerSanctionByIndexOptions options, out PlayerSanction outSanction)
        {
            System.IntPtr optionsAddress = new System.IntPtr();
            Helper.TryMarshalSet <CopyPlayerSanctionByIndexOptionsInternal, CopyPlayerSanctionByIndexOptions>(ref optionsAddress, options);

            var outSanctionAddress = System.IntPtr.Zero;

            var funcResult = EOS_Sanctions_CopyPlayerSanctionByIndex(InnerHandle, optionsAddress, ref outSanctionAddress);

            Helper.TryMarshalDispose(ref optionsAddress);

            if (Helper.TryMarshalGet <PlayerSanctionInternal, PlayerSanction>(outSanctionAddress, out outSanction))
            {
                EOS_Sanctions_PlayerSanction_Release(outSanctionAddress);
            }

            return(funcResult);
        }