Exemplo n.º 1
0
 public SwitchboardInvitation(SwitchboardSession session, User user)
 {
     Session = session;
     Id      = _counter++;
     User    = user;
     Key     = AuthenticationService.CreateChallengeString();
 }
Exemplo n.º 2
0
        public SwitchboardSession CreateSession(User creator)
        {
            SwitchboardSession session = new SwitchboardSession(this, creator);

            _sessions.Add(session);
            return(session);
        }
Exemplo n.º 3
0
        public void EndSession(SwitchboardSession session)
        {
            if (session.Connections.Count > 0)
            {
                // TODO: Something?
            }

            _sessions.Remove(session);
        }
Exemplo n.º 4
0
        public bool BroadcastCommand(SwitchboardSession session, Command cmd, SwitchboardConnection ignore)
        {
            if (cmd.TrId != -1 && cmd.TrId != 0)
            {
                throw new ProtocolException("Only Asynchronous server commands can be sent.");
            }

            foreach (SwitchboardConnection conn in session.Connections)
            {
                if (conn != ignore)
                {
                    Send(conn, cmd);
                }
            }

            return(true);
        }