public virtual void StartOrJoinPresentation(SocketSubscription sender, TextMessage message) { var cmd = message.ToCommand<StartOrJoinPresentation>(); var presentation = Presentations.GetPresentationByName(cmd.Name); if(presentation == null) OnStartPresentation(cmd, sender); else OnJoinPresentation(presentation, sender); }
public virtual void ChangeSlide(SocketSubscription sender, TextMessage message) { var cmd = message.ToCommand<ChangeSlide>(); var presentation = Presentations.GetPresentationIfPresenter(sender); if (presentation == null) return; if(presentation.Presenter.ChangeSlide(cmd.NewSlide)) sender.Server.BroadCastEvent( presentation.GetAttendees().Select(a => a.Subscription), new SlideChanged { NewSlide = cmd.NewSlide }); }