public SwitchboardInvitation(SwitchboardSession session, User user) { Session = session; Id = _counter++; User = user; Key = AuthenticationService.CreateChallengeString(); }
public SwitchboardSession CreateSession(User creator) { SwitchboardSession session = new SwitchboardSession(this, creator); _sessions.Add(session); return(session); }
public void EndSession(SwitchboardSession session) { if (session.Connections.Count > 0) { // TODO: Something? } _sessions.Remove(session); }
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); }