/// <summary>
        /// Default ctor
        /// </summary>
        public StreamingUnityServerPlugin()
        {
            // set up the command buffer
            EncodeAndTransmitCommand      = new CommandBuffer();
            EncodeAndTransmitCommand.name = PluginName + " Encoding";
            EncodeAndTransmitCommand.IssuePluginEvent(Native.GetRenderEventFunc(), 0);

            // create null checking wrappers that we can always call on the native side
            this.pinnedInputUpdate = new GenericDelegate <string> .Handler(this.OnInputUpdate);

            this.pinnedLog = new GenericDelegate <int, string> .Handler(this.OnLog);

            this.pinnedPeerConnect = new GenericDelegate <int, string> .Handler(this.OnPeerConnect);

            this.pinnedPeerDisconnect = new GenericDelegate <int> .Handler(this.OnPeerDisconnect);

            this.pinnedSignIn          = new GenericDelegate.Handler(this.OnSignIn);
            this.pinnedDisconnect      = new GenericDelegate.Handler(this.OnDisconnect);
            this.pinnedMessageFromPeer = new GenericDelegate <int, string> .Handler(this.OnMessageFromPeer);

            this.pinnedMessageSent = new GenericDelegate <int> .Handler(this.OnMessageSent);

            this.pinnedServerConnectionFailure = new GenericDelegate.Handler(this.OnServerConnectionFailure);
            this.pinnedSignalingChange         = new GenericDelegate <int> .Handler(this.OnSignalingChange);

            this.pinnedAddStream = new GenericDelegate <string> .Handler(this.OnAddStream);

            this.pinnedRemoveStream = new GenericDelegate <string> .Handler(this.OnRemoveStream);

            this.pinnedDataChannel = new GenericDelegate <string> .Handler(this.OnDataChannel);

            this.pinnedRenegotiationNeeded = new GenericDelegate.Handler(this.OnRenegotiationNeeded);
            this.pinnedIceConnectionChange = new GenericDelegate <int> .Handler(this.OnIceConnectionChange);

            this.pinnedIceGatheringChange = new GenericDelegate <int> .Handler(this.OnIceGatheringChange);

            this.pinnedIceCandidate = new GenericDelegate <string> .Handler(this.OnIceCandidate);

            this.pinnedIceConnectionReceivingChange = new GenericDelegate <bool> .Handler(this.OnIceConnectionReceivingChange);

            // marshal the callbacks across into native land
            Native.SetCallbackMap(this.pinnedInputUpdate,
                                  this.pinnedLog,
                                  this.pinnedPeerConnect,
                                  this.pinnedPeerDisconnect,
                                  this.pinnedSignIn,
                                  this.pinnedDisconnect,
                                  this.pinnedMessageFromPeer,
                                  this.pinnedMessageSent,
                                  this.pinnedServerConnectionFailure,
                                  this.pinnedSignalingChange,
                                  this.pinnedAddStream,
                                  this.pinnedRemoveStream,
                                  this.pinnedDataChannel,
                                  this.pinnedRenegotiationNeeded,
                                  this.pinnedIceConnectionChange,
                                  this.pinnedIceGatheringChange,
                                  this.pinnedIceCandidate,
                                  this.pinnedIceConnectionReceivingChange);
        }
示例#2
0
        /// <summary>
        /// Default ctor
        /// </summary>
        public StreamingUnityServerPlugin()
        {
            // create null checking wrappers that we can always call on the native side
            this.pinnedDataChannelMessage = new GenericDelegate <int, string> .Handler(this.OnDataChannelMessage);

            this.pinnedLog = new GenericDelegate <int, string> .Handler(this.OnLog);

            this.pinnedPeerConnect = new GenericDelegate <int, string> .Handler(this.OnPeerConnect);

            this.pinnedPeerDisconnect = new GenericDelegate <int> .Handler(this.OnPeerDisconnect);

            this.pinnedSignIn          = new GenericDelegate.Handler(this.OnSignIn);
            this.pinnedDisconnect      = new GenericDelegate.Handler(this.OnDisconnect);
            this.pinnedMessageFromPeer = new GenericDelegate <int, string> .Handler(this.OnMessageFromPeer);

            this.pinnedMessageSent = new GenericDelegate <int> .Handler(this.OnMessageSent);

            this.pinnedServerConnectionFailure = new GenericDelegate.Handler(this.OnServerConnectionFailure);
            this.pinnedSignalingChange         = new GenericDelegate <int> .Handler(this.OnSignalingChange);

            this.pinnedAddStream = new GenericDelegate <string> .Handler(this.OnAddStream);

            this.pinnedRemoveStream = new GenericDelegate <string> .Handler(this.OnRemoveStream);

            this.pinnedDataChannel = new GenericDelegate <string> .Handler(this.OnDataChannel);

            this.pinnedRenegotiationNeeded = new GenericDelegate.Handler(this.OnRenegotiationNeeded);
            this.pinnedIceConnectionChange = new GenericDelegate <int> .Handler(this.OnIceConnectionChange);

            this.pinnedIceGatheringChange = new GenericDelegate <int> .Handler(this.OnIceGatheringChange);

            this.pinnedIceCandidate = new GenericDelegate <string> .Handler(this.OnIceCandidate);

            this.pinnedIceConnectionReceivingChange = new GenericDelegate <bool> .Handler(this.OnIceConnectionReceivingChange);

            // marshal the callbacks across into native land
            Native.SetCallbackMap(this.pinnedDataChannelMessage,
                                  this.pinnedLog,
                                  this.pinnedPeerConnect,
                                  this.pinnedPeerDisconnect,
                                  this.pinnedSignIn,
                                  this.pinnedDisconnect,
                                  this.pinnedMessageFromPeer,
                                  this.pinnedMessageSent,
                                  this.pinnedServerConnectionFailure,
                                  this.pinnedSignalingChange,
                                  this.pinnedAddStream,
                                  this.pinnedRemoveStream,
                                  this.pinnedDataChannel,
                                  this.pinnedRenegotiationNeeded,
                                  this.pinnedIceConnectionChange,
                                  this.pinnedIceGatheringChange,
                                  this.pinnedIceCandidate,
                                  this.pinnedIceConnectionReceivingChange);
        }
示例#3
0
 public static extern void SetCallbackMap(GenericDelegate <string> .Handler onInputUpdate,
                                          GenericDelegate <int, string> .Handler onLog,
                                          GenericDelegate <int, string> .Handler onPeerConnect,
                                          GenericDelegate <int> .Handler onPeerDisconnect,
                                          GenericDelegate.Handler onSignIn,
                                          GenericDelegate.Handler onDisconnect,
                                          GenericDelegate <int, string> .Handler onMessageFromPeer,
                                          GenericDelegate <int> .Handler onMessageSent,
                                          GenericDelegate.Handler onServerConnectionFailure,
                                          GenericDelegate <int> .Handler onSignalingChange,
                                          GenericDelegate <string> .Handler onAddStream,
                                          GenericDelegate <string> .Handler onRemoveStream,
                                          GenericDelegate <string> .Handler onDataChannel,
                                          GenericDelegate.Handler onRenegotiationNeeded,
                                          GenericDelegate <int> .Handler onIceConnectionChange,
                                          GenericDelegate <int> .Handler onIceGatheringChange,
                                          GenericDelegate <string> .Handler onIceCandidate,
                                          GenericDelegate <bool> .Handler onIceConnectionReceivingChange);