예제 #1
0
 internal void AcceptConnectionRequest(string remoteEndpointId, byte[] payload,
                                       NativeMessageListenerHelper listener)
 {
     C.NearbyConnections_AcceptConnectionRequest(SelfPtr(), remoteEndpointId, payload,
                                                 new UIntPtr((ulong)payload.Length), listener.AsPointer());
 }
예제 #2
0
 internal void SendConnectionRequest(string name, string remoteEndpointId, byte[] payload,
                                     Action <long, NativeConnectionResponse> callback, NativeMessageListenerHelper listener)
 {
     C.NearbyConnections_SendConnectionRequest(
         SelfPtr(),
         name,
         remoteEndpointId,
         payload,
         new UIntPtr((ulong)payload.Length),
         InternalConnectResponseCallback,
         Callbacks.ToIntPtr <long, NativeConnectionResponse>(
             callback, NativeConnectionResponse.FromPointer),
         listener.AsPointer());
 }
예제 #3
0
 internal void SendConnectionRequest(string name, string remoteEndpointId, byte[] payload, Action <long, NativeConnectionResponse> callback, NativeMessageListenerHelper listener)
 {
     if (< > f__mg$cache5 == null)
     {
 internal void AcceptConnectionRequest(string remoteEndpointId, byte[] payload,
                                   NativeMessageListenerHelper listener)
 {
     C.NearbyConnections_AcceptConnectionRequest(SelfPtr(), remoteEndpointId, payload,
         new UIntPtr((ulong)payload.Length), listener.AsPointer());
 }
 internal void SendConnectionRequest(string name, string remoteEndpointId, byte[] payload,
                                 Action<long, NativeConnectionResponse> callback, NativeMessageListenerHelper listener)
 {
     C.NearbyConnections_SendConnectionRequest(
         SelfPtr(),
         name,
         remoteEndpointId,
         payload,
         new UIntPtr((ulong)payload.Length),
         InternalConnectResponseCallback,
         Callbacks.ToIntPtr<long, NativeConnectionResponse>(
             callback, NativeConnectionResponse.FromPointer),
         listener.AsPointer());
 }
예제 #6
0
 internal void SendConnectionRequest(string name, string remoteEndpointId, byte[] payload, Action <long, NativeConnectionResponse> callback, NativeMessageListenerHelper listener)
 {
     NearbyConnections.NearbyConnections_SendConnectionRequest(base.SelfPtr(), name, remoteEndpointId, payload, new UIntPtr((ulong)payload.Length), new NearbyConnectionTypes.ConnectionResponseCallback(NearbyConnectionsManager.InternalConnectResponseCallback), Callbacks.ToIntPtr <long, NativeConnectionResponse>(callback, new Func <IntPtr, NativeConnectionResponse>(NativeConnectionResponse.FromPointer)), listener.AsPointer());
 }
        private static NativeMessageListenerHelper ToMessageListener(IMessageListener listener)
        {
            listener = new OnGameThreadMessageListener(listener);

            var helper = new NativeMessageListenerHelper();
            helper.SetOnMessageReceivedCallback(
                (localClientId, endpointId, data, isReliable) => listener.OnMessageReceived(
                    endpointId, data, isReliable));
            helper.SetOnDisconnectedCallback((localClientId, endpointId) =>
            listener.OnRemoteEndpointDisconnected(endpointId));

            return helper;
        }