Exemple #1
0
        public void Handle(Join cmd)
        {
            var firstTimeJoined = members.Add(cmd.User);
            if (firstTimeJoined)
                Send(cmd.User, string.Format("{1} joined the room {0} ...", Id, cmd.User));

            IObserverCollection connections;
            if (!online.TryGetValue(cmd.User, out connections))
            {
                connections = new ObserverCollection();
                online.Add(cmd.User, connections);
            }

            connections.Add(cmd.Client);
        }
Exemple #2
0
        public void Handle(Join cmd)
        {
            var firstTimeJoined = members.Add(cmd.User);

            if (firstTimeJoined)
            {
                Send(cmd.User, string.Format("{1} joined the room {0} ...", Id, cmd.User));
            }

            IObserverCollection connections;

            if (!online.TryGetValue(cmd.User, out connections))
            {
                connections = new ObserverCollection();
                online.Add(cmd.User, connections);
            }

            connections.Add(cmd.Client);
        }
Exemple #3
0
 Task On(Join x) => Send(x.Room, $"{Id} joined the room {x.Room} ...");
Exemple #4
0
 Task On(Join x)   => Send(x.Room, $"{Id} joined the room {x.Room} ...");