PlayEveryWare / eos_plugin_for_unity

Repository for PlayEveryWare's EOS Plugin for Unity, bringing the functionality of Epic Online Services to the Unity Game Engine.
https://eospluginforunity.playeveryware.com
277 stars 53 forks source link

(Voice/Audio) EOS_RTC_BlockParticipant seems to be missing from this plugin #852

Closed Ermelious closed 3 weeks ago

Ermelious commented 1 month ago

Is your feature request related to a problem? Please describe. I'm trying to add in the feature to Block a specified remote participant in the Lobby in the voice channel. The functionality seems to be missing, I don't see it in EOSLobbyManager nor RTCAudioInterface.

Here's the functionality: https://dev.epicgames.com/docs/api-ref/functions/eos-rtc-block-participant It's from: https://dev.epicgames.com/docs/game-services/real-time-communication-interface/voice/using-voice In the Mute section. From my understanding, with BlockParticipant, each lobby member have the power to block any member in the Lobby that they do not want to hear or converse with. I'm not sure if this would apply to everyone or for themselves only. E.g if Participant A blocks Participant B, will Participant C still hear Participant B?

May I check where or how do I access BlockParticipant? Or is it missing because Playeveryware is on an older version of the SDK that does not have this feature?

Describe the solution you'd like To be able to call the BlockParticipant feature which seems to be in the EOS C# SDK as seen in the document.

Additional context image

paulhazen commented 1 month ago

Hi @Ermelious. I'll look into this and get back to you soon regarding how to add this functionality - and with an estimate of when we might have this functionality baked into the released version of the plugin.

Ermelious commented 1 month ago

Hi @Ermelious. I'll look into this and get back to you soon regarding how to add this functionality - and with an estimate of when we might have this functionality baked into the released version of the plugin.

Thank you! Anticipating this feature as it is pretty useful for each player to have the freedom to block annoying players from talking in the game.

arthur740212 commented 4 weeks ago

Hello, it looks like the ticket is reopened. I do remember responding to this ticket that the BlockParticipant lives in RTCInterface. Were you able to find the function and use it?

Ermelious commented 4 weeks ago

Hello, it looks like the ticket is reopened. I do remember responding to this ticket that the BlockParticipant lives in RTCInterface. Were you able to find the function and use it?

Hello, I've implemented it as an extension for EOSLobbyManager (Should I commit/implement this directly to EOSLobbyManager instead? Come to think of it, it would be better if I submit a PR/commit it in because, as seen below, the RTCState is modified to have the isBlocked flag/variable). Just in case, I've submitted a PR with a modified version of the above in EOSLobbyManager: https://github.com/PlayEveryWare/eos_plugin_for_unity/pull/872

The feature seems to be working from initial tests:

public static void BlockTargetRTCParticipant(this EOSLobbyManager eosLobbyManager, bool status, ProductUserId targetUserId, OnLobbyCallback blockRTCParticipantComplete)
    {
        RTCInterface rtcHandle = EOSManager.Instance.GetEOSRTCInterface();
        RTCAudioInterface rtcAudioHandle = rtcHandle.GetAudioInterface();

        BlockParticipantOptions blockParticipantOptions = new BlockParticipantOptions()
        {
            LocalUserId = EOSManager.Instance.GetProductUserId(),
            RoomName = eosLobbyManager.GetCurrentLobby().RTCRoomName,
            ParticipantId = targetUserId,
            Blocked = status
        };

        rtcHandle.BlockParticipant(ref blockParticipantOptions, blockRTCParticipantComplete, OnRTCBlockParticipantCompleted);
    }

EOSLobbyManager.cs

    /// <summary>
    /// Class represents RTC State (Voice) of a Lobby
    /// </summary>

    public class LobbyRTCState
    {
        // Is this person currently connected to the RTC room?
        public bool IsInRTCRoom = false;

        // Is this person currently talking (audible sounds from their audio output)
        public bool IsTalking = false;

        // We have locally muted this person (others can still hear them)
        public bool IsLocalMuted = false;

        // Has this person muted their own audio output (nobody can hear them)
        public bool IsAudioOutputDisabled = false;

        // Are we currently muting this person?
        public bool MuteActionInProgress = false;

        // Has this person enabled press to talk
        public bool PressToTalkEnabled = false;

        // We have locally blocked this person from receiving and sending audio
        public bool isBlocked = false;
    }
paulhazen commented 3 weeks ago

Hey @Ermelious - just for context and clarity: We have "resolved" this issue in that the PR you opened that addressed the issue was merged into the development branch, however in keeping with GitHub best practices, etc. We are leaving it marked "open" until it is merged into the stable branch.