Esempio n. 1
0
        public void Unregister()
        {
            //doesn't matter on user Id, in case of comparing users, callback is enought
            var newUser = new Client(ClientCallback, "");

            AllConnectedUsers.Remove(newUser);
        }
Esempio n. 2
0
        public string Register(string name)
        {
            var newUser = new Client(ClientCallback, Guid.NewGuid().ToString("N"));

            //try to remove if already exist (etc. in the case user try to connect from the same machine  and his unregister was't made properly)
            AllConnectedUsers.Remove(newUser);

            AllConnectedUsers.Add(newUser);
            return(newUser.Id);
        }