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

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

            _sessions.Remove(session);
        }
Exemple #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);
        }