public void Set(AcceptConnectionOptions other)
 {
     if (other != null)
     {
         m_ApiVersion = P2PInterface.AcceptconnectionApiLatest;
         LocalUserId  = other.LocalUserId;
         RemoteUserId = other.RemoteUserId;
         SocketId     = other.SocketId;
     }
 }
Пример #2
0
        /// <summary>
        /// Accept connections from a specific peer. If this peer has not attempted to connect yet, when they do, they will automatically be accepted.
        /// </summary>
        /// <param name="options">Information about who would like to accept a connection, and which connection</param>
        /// <returns>
        /// <see cref="Result" />::<see cref="Result.Success" /> - if the provided data is valid
        /// <see cref="Result" />::<see cref="Result.InvalidParameters" /> - if the provided data is invalid
        /// </returns>
        public Result AcceptConnection(AcceptConnectionOptions options)
        {
            System.IntPtr optionsAddress = new System.IntPtr();
            Helper.TryMarshalSet <AcceptConnectionOptionsInternal, AcceptConnectionOptions>(ref optionsAddress, options);

            var funcResult = EOS_P2P_AcceptConnection(InnerHandle, optionsAddress);

            Helper.TryMarshalDispose(ref optionsAddress);

            return(funcResult);
        }
Пример #3
0
        /// <summary>
        /// 短縮 AcceptConnection
        /// </summary>
        /// <param name="p2p">P2PInterface</param>
        /// <param name="localUserId">ログインユーザーID</param>
        /// <param name="remoteUserId">送信元ユーザーID</param>
        /// <param name="socketName">ソケット名</param>
        public static void AcceptConnection(this P2PInterface p2p, ProductUserId localUserId, ProductUserId remoteUserId, string socketName)
        {
            var accOp = new AcceptConnectionOptions
            {
                LocalUserId  = localUserId,
                RemoteUserId = remoteUserId,
                SocketId     = new SocketId
                {
                    SocketName = socketName
                },
            };

            var result = p2p.AcceptConnection(accOp);

            if (result != Result.Success)
            {
                Debug.LogError($"error {DebugTools.GetClassMethodName()}:{result}");
            }
        }