public void OnStopSpectating(BanchoStopSpectatingArgs args) { if (args.pr?.Spectator == null) { return; } var opr = args.pr.Spectator.BoundPresence; opr += new FellowSpectatorLeft(args.pr.User.Id); opr.Spectator.Broadcast(new SpectatorLeft(args.pr.User.Id)); opr.Spectator.Left(args.pr); opr.Spectator.SpecChannel.LeaveChannel(args.pr); args.pr += new ChannelRevoked(opr.Spectator.SpecChannel); args.pr.Spectator = null; if (opr.Spectator.JoinedUsers > 0) { return; } opr.Spectator.Left(opr); opr.Spectator.SpecChannel.LeaveChannel(opr); opr += new ChannelRevoked(opr.Spectator.SpecChannel); opr.Spectator = null; }
public void OnStopSpectating(BanchoStopSpectatingArgs args) { if (args.Pr?.Spectator == null) { return; } var opr = args.Pr.Spectator.Host; opr.Push(new FellowSpectatorLeft(args.Pr.User.Id)); opr.Spectator.Push(new SpectatorLeft(args.Pr.User.Id)); opr.Spectator.Leave(args.Pr); opr.Spectator.Channel.Leave(args.Pr); args.Pr.Push(new ChannelRevoked(opr.Spectator.Channel)); args.Pr.Spectator = null; if (opr.Spectator.SpectatorCount > 0) { return; } opr.Spectator.Leave(opr); opr.Spectator.Channel.Leave(opr); opr.Push(new ChannelRevoked(opr.Spectator.Channel)); opr.Spectator = null; }