Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Cannot Receive Text Messages on a channel after reconnecting (can still send)

Discussion in 'Vivox (Voice & Text Chat)' started by dmo_unity347, Jul 15, 2022.

  1. dmo_unity347

    dmo_unity347

    Joined:
    Jun 1, 2021
    Posts:
    10
    I am running into a lot of issues with recieving text on Positional Audio channels. When 2 users are connected to the same channel and one disconnects and rejoins (without logging out) the user that reconnects won't have any participants in their channel session.

    When they send a message to the channel other users receive it but are unable to receive messages on the channel

    Scenario:

    1) Client A Joins Channel A
    2) Client B Joins Channel A
    3) Client A Disconnects from Channel A
    4) Client A Joins Channel A
    5) Client B sends text message to Channel A
    6) Client A does not recieve text message

    When debugging the state of the ChannelSession on Client A I can see that they have no participants except themselves.

    Is there anything special I have to do when reconnecting? My code for join/quit is the same as the examples in the documentation
     
    Last edited: Jul 15, 2022
  2. dmo_unity347

    dmo_unity347

    Joined:
    Jun 1, 2021
    Posts:
    10
    Update:

    After turning on debug logs in the `VivoxConfig` it appears that Client A does indeed receive the message from the channel, but the
    Code (CSharp):
    1. channelSession.MessageLog.AfterItemAdded
    event is not invoked

    Here is the log (sanitized):

    Code (CSharp):
    1. <message id="xxxxxx" type="groupchat" lang="en" to=".xxx-xx-dev.xxx.@mt1s.vivox.com/xxx" ua="Vivox-SDK-5.14.1.32884.a1388c13M" from="confctl-d-xxxx-xx-dev.xxxxx!p-64-10-1.000-1@mt1s.vivox.com/xxx-xxx.v.xxxxx"><body>xxxx:0:f</body><m xmlns="urn:vivox:presence"><display_name>xxxxx</display_name></m></message>
     
  3. dmo_unity347

    dmo_unity347

    Joined:
    Jun 1, 2021
    Posts:
    10
    Update 2: The same code works for non positional channels.

    I noticed text doesn't work on positional channels if a user's position is not set. Are there other quirks to be aware of?
     
  4. dylan_unity3d

    dylan_unity3d

    Unity Technologies

    Joined:
    Nov 12, 2019
    Posts:
    73
    Hi @dmo_unity347,
    When joining a positional channel, the user is basically put into a kind of limbo state until a position has been set for them. This makes sure there is no race condition where a user might appear in the positional space before being set to their proper location by the developer. In most cases, the game/application starts setting the user's position as soon as they are in the channel.

    Similar to hearing other participants in the positional channel, text messages are limited to the same range. As participants move in and out of range, you will see participant added and removed events.

    Please let me know setting Client A to a position that is within range for Client B does not solve your issue.

    Dylan