コード例 #1
0
        void LobbyController_OnOpen(object sender, OnClientConnectArgs e)
        {
#if DEBUG
            Debug.WriteLine(e.Controller.ClientGuid);
#endif
            this.GameId = e.Controller.GetParameter("gameId");
        }
コード例 #2
0
        /// <summary>
        /// When a client connects create a new PeerConnection and send the information the the client
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="onClientConnectArgs"></param>
        private void _OnOpen(object sender, OnClientConnectArgs onClientConnectArgs)
        {
            IPresence user = new Presence {Online = true, UserName = "******", Id = this.PersistentId};
            //Update user
            if (Core.Utility.Storage.Repository<Guid, IPresence>.ContainsKey(this.PersistentId))
            {
                user = Core.Utility.Storage.Repository<Guid, IPresence>.GetById(user.Id);                
                if (this.HasParameterKey("username"))
                    user.UserName = this.GetParameter("username");                               
            }
            SavePresence(user);
            var others = Core.Utility.Storage.Repository<Guid, IPresence>.Find(p => p.Id != user.Id);
            Composable.GetExport<IXLogger>().Information("Others {@a}",others);
            this.Invoke(others,"allusers");

            // Get the context from a parameter if it exists
            var context = Guid.NewGuid();

            if (this.HasParameterKey("ctx"))
            {
                var p = this.GetParameter("ctx");
                context = Guid.Parse(p);
            }

            Peer = new PeerConnection
            {
                Context = context,
                PeerId = ConnectionId
            };

            this.Invoke(Peer, Events.Context.Created);                        
        }
コード例 #3
0
        void Client_OnOpen(object sender, OnClientConnectArgs e)
        {
            SelectedTypes = Notification.AllTypes;

            // Send all available notification types to the client when s/he connects. No need to ask for them.
            this.Send(SelectedTypes, "allTypes");
        }
コード例 #4
0
 void wss_OnServerClientConnection(object sender, OnClientConnectArgs e)
 {
     Debug.WriteLine("");
     Debug.WriteLine("Connected");
     Debug.WriteLine("Handler: "+ ((IXBaseSocket)sender).Alias);
     Debug.WriteLine("ClientGuid: "+ e.XNode.ClientGuid);
     Debug.WriteLine("");
 }
コード例 #5
0
ファイル: CustomBroker.cs プロジェクト: sami-akriche/WebRTC
 /// <summary>
 /// When a client connects create a new PeerConnection and send the information the the client
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="onClientConnectArgs"></param>
 private void _OnOpen(object sender, OnClientConnectArgs onClientConnectArgs)
 {
     Peer = new PeerConnection
     {
         Context = this.ProtocolInstance.Parameters.ContainsKey("ctx") ? Guid.Parse(this.ProtocolInstance.Parameters["ctx"]) : Guid.NewGuid(),
         PeerId  = ClientGuid
     };
 }
コード例 #6
0
 /// <summary>
 /// When a client connects create a new PeerConnection and send the information the the client
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="onClientConnectArgs"></param>
 private void _OnOpen(object sender, OnClientConnectArgs onClientConnectArgs)
 {
     Peer = new PeerConnection
     {
         Context = Guid.NewGuid(),
         PeerId  = ClientGuid
     };
 }
コード例 #7
0
 void wss_OnServerClientConnection(object sender, OnClientConnectArgs e)
 {
     Debug.WriteLine("");
     Debug.WriteLine("Connected");
     Debug.WriteLine("Handler: " + ((IXBaseSocket)sender).Alias);
     Debug.WriteLine("ClientGuid: " + e.XNode.ClientGuid);
     Debug.WriteLine("");
 }
コード例 #8
0
 /// <summary>
 /// When a client connects create a new PeerConnection and send the information the the client
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="onClientConnectArgs"></param>
 private void _OnOpen(object sender, OnClientConnectArgs onClientConnectArgs)
 {
     Peer = new PeerConnection
     {
         Context = Guid.NewGuid(),
         PeerId = ConnectionId
     };            
 }
コード例 #9
0
        /// <summary>
        /// When a client connects create a new PeerConnection and send the information the the client
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="onClientConnectArgs"></param>
        private void _OnOpen(object sender, OnClientConnectArgs onClientConnectArgs)
        {
            IPresence user = new Presence {
                Online = true, UserName = "******", Id = this.PersistentId
            };

            //Update user
            if (Core.Utility.Storage.Repository <Guid, IPresence> .ContainsKey(this.PersistentId))
            {
                user = Core.Utility.Storage.Repository <Guid, IPresence> .GetById(user.Id);

                if (this.HasParameterKey("username"))
                {
                    user.UserName = this.GetParameter("username");
                }
            }
            SavePresence(user);
            var others = Core.Utility.Storage.Repository <Guid, IPresence> .Find(p => p.Id != user.Id);

            Composable.GetExport <IXLogger>().Information("Others {@a}", others);
            this.Invoke(others, "allusers");

            // Get the context from a parameter if it exists
            var context = Guid.NewGuid();

            if (this.HasParameterKey("ctx"))
            {
                var p = this.GetParameter("ctx");
                context = Guid.Parse(p);
            }

            Peer = new PeerConnection
            {
                Context = context,
                PeerId  = ConnectionId
            };

            this.Invoke(Peer, Events.Context.Created);
        }
コード例 #10
0
ファイル: CustomBroker.cs プロジェクト: BIGGANI/WebRTC
 /// <summary>
 /// When a client connects create a new PeerConnection and send the information the the client
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="onClientConnectArgs"></param>
 private void _OnOpen(object sender, OnClientConnectArgs onClientConnectArgs)
 {
     Peer = new PeerConnection
     {
         Context = this.ProtocolInstance.Parameters.ContainsKey("ctx") ? Guid.Parse(this.ProtocolInstance.Parameters["ctx"]) : Guid.NewGuid(),
         PeerId = ClientGuid
     };
 }
コード例 #11
0
 void wss_OnServerClientConnection(object sender, OnClientConnectArgs e)
 {
     try
     {
         Debug.WriteLine("");
         Debug.WriteLine("Connected");
         Debug.WriteLine("Handler: " + ((IXBaseSocket)sender).Alias);
         Debug.WriteLine("ClientGuid: " + e.Client.ClientGuid);
         Debug.WriteLine("");
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.Message);
         Debug.WriteLine(ex.StackTrace);
     }
 }
コード例 #12
0
 void SampleController_OnOpen(object sender, OnClientConnectArgs e)
 {
     //Send connected topic to client that connected.
     //Just passing a anonymous object with info about the client, but it can be anything serializable..
     this.Send(new { this.ClientGuid, this.StorageGuid }, "connected");
 }
コード例 #13
0
 void SampleController_OnOpen(object sender, OnClientConnectArgs e)
 {
     //Send connected topic to client that connected.
     //Just passing a anonymous object with info about the client, but it can be anything serializable..
     this.Invoke(new { this.ConnectionId, this.Context.PersistentId }, "connected");
 }
コード例 #14
0
 private void OnClientConnect(object sender, OnClientConnectArgs e)
 {
     //stop the timer if the client ACK
     this.ProtocolInstance.OnPing += (s, args) => mAckTimer.Stop();//protocol instance is null until someone connects
 }
コード例 #15
0
 private void OnOnReopen(object sender, OnClientConnectArgs onClientConnectArgs)
 {
 }
コード例 #16
0
        /// <summary>
        /// When a client connects create a new PeerConnection and send the information the the client
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="onClientConnectArgs"></param>
        private void _OnOpen(object sender, OnClientConnectArgs onClientConnectArgs)
        {
            // Get the context from a parameter if it exists
            var context = Guid.NewGuid();

            if (this.HasParameterKey("ctx"))
            {
                var p = this.GetParameter("ctx");
                context = Guid.Parse(p);
            }

            Peer = new PeerConnection
            {
                Context = context,
                PeerId = ConnectionId
            };

            this.Invoke(Peer, Events.Context.Created);
        }
コード例 #17
0
 void StockController_OnOpen(object sender, OnClientConnectArgs e)
 {
     //Send to available stocks to the client when he/she´s connected. No need to ask for them.
     this.Invoke(Model.StockTicker.Stocks.Values, "allStocks");
 }
コード例 #18
0
 void StockController_OnOpen(object sender, OnClientConnectArgs e)
 {
     //Send to available stocks to the client when he/she´s connected. No need to ask for them.
     this.Invoke(Model.StockTicker.Stocks.Values, "allStocks");
 }