コード例 #1
0
        public override Task OnDisconnected(bool stopCalled)
        {
            SLUser u = UserList.Where(x => x.ConnectionId == Context.ConnectionId).FirstOrDefault();

            if (u != null)
            {
                UserList.Remove(u);
            }

            return(base.OnDisconnected(stopCalled));
        }
コード例 #2
0
        public override Task OnConnected()
        {
            SLUser u = UserList.Where(x => x.ConnectionId == Context.ConnectionId).FirstOrDefault();

            if (u == null)
            {
                u = new SLUser()
                {
                    ConnectionId = Context.ConnectionId, UserId = 0, CompanyId = 0
                };
                UserList.Add(u);
            }
            return(base.OnConnected());
        }