示例#1
0
        /// <summary>
        /// Sends a P2P packet to the specified user.
        /// This is a session-less API which automatically establishes NAT-traversing or Steam relay server connections.
        /// NOTE: The first packet send may be delayed as the NAT-traversal code runs.
        /// </summary>
        public static unsafe bool SendP2PPacket(SteamId steamid, byte[] data, int length = -1, int nChannel = 0, P2PSend sendType = P2PSend.Reliable)
        {
            if (length <= 0)
                length = data.Length;

            fixed(byte *p = data)
            {
                return(Internal.SendP2PPacket(steamid, (IntPtr)p, (uint)length, (P2PSend)sendType, nChannel));
            }
        }