Join / Leave Channel

You can have up to 10 channels in a login session with Vivox Voice and Text Chat. You can have only one 3D Positional channel at any point and time though. For example you can have

  • 9 Non-positional channels, 1 3D positional

  • 10 Non-Positional Channels, 0 3D positional

3D positional channels are meant for 3D games because you need to send Vector3 values to Vivox

You can have up to <= 200 people in a channel (Non-positional / 3DPositional)

circle-info

If you are an Enterprise customer, you can use the Large 3D channels setting for 3D Positional channels to have up to 2,000 players. Check out Vivox Documentation arrow-up-rightfor more info

Inherit from EasyManager.cs

using EasyCodeForVivox;

public class VivoxManager : EasyManager
{

}

Inject EasyChannel

using EasyCodeForVivox;
using EasyCodeForVivox.Extensions;
using UnityEngine;
using VivoxUnity;
using Zenject;

public class VivoxChannel : MonoBehaviour
{
    EasyChannel _channel;

    [Inject]
    public void Initialize(EasyChannel channel)
    {
        _channel = channel;
    }
}
circle-info

The following examples use the same method 2 methods but in different ways. I will break down the method parameters of each method before explaining how to use them

JoinChannel

Type
Parameter
Explanation

string

userName

The name of the user joining the channel

string

channelName

The name of the channel to join. If it does not exist Vivox will create it

bool

includeVoice

Should this channel have Audio/Voice chat capabilities

bool

includeText

Should this channel have Text chat capabilities

bool

switchTransmission

Should the player stop transmitting any Audio/Voice/Text in other channels and Only transmit to this channel. Overrides the current LoginSession SetTransmissionModearrow-up-right settings

ChannelType

channelType

What type of channelarrow-up-right should this be?

bool

joinMuted

(Optionalarrow-up-right) Should the user join the channel muted. Defaults to false

Channel3DProperties

channel3DProperties

(Optionalarrow-up-right) The settings for a 3d Positional channel. If 3d settingsarrow-up-right are included for a channel that isn't 3d, the settings are ignored. Defaults to Vivox Recommended 3d settings

JoinChannelRegion - Used for large scale games - Vivox Documentationarrow-up-right

Type
Parameter
Explanation

string

userName

The name of the user joining the channel

string

channelName

The name of the channel to join. If it does not exist Vivox will create it

string

matchRegion

The region (Vivox also calls this a shardarrow-up-right) of the server your player is closest to.

string

matchHash

A hashed value (Unique Id) of the match's name all players in the same channel/channels are connected to

bool

includeVoice

Should this channel have Audio/Voice chat capabilities

bool

includeText

Should this channel have Text chat capabilities

bool

switchTransmission

Should the player stop transmitting any Audio/Voice/Text in other channels and only transmit to this channel. Overrides the current LoginSession SetTransmissionModearrow-up-right settings

ChannelType

channelType

What type of channelarrow-up-right should this be?

bool

joinMuted

(Optionalarrow-up-right) Should the user join the channel muted. Defaults to false

Channel3DProperties

channel3DProperties

(Optionalarrow-up-right) The settings for a 3d Positional channel. If 3d settingsarrow-up-right are included for a channel that isn't 3d, the settings are ignored. Defaults to Vivox Recommended 3d settings

Joining an Echo Channel

This type of channel is used for Mic testing. Check out this blog post for more infoarrow-up-right

  • Joins the player "username" to an Echo channel called "echo".

  • Audio is activated in channel so the player can test their mic.

  • Since "username" is the only player in the channel, Text capabilities are turned off.

  • Transmission is switched to the current channel which overrides any previous settings set in the current LoginSession (This means only Audio/Voice/Text will transmit through this Echo channel and no other channel).

  • Channel type chosen is Echo channel.

  • Join muted is set to false because we want the player to hear themselves speaking so they can test their mic

  • No 3d Settings are created/added because it is not a 3d channel

EasyManager

EasyChannel

Joining a Non-Positional (Conference) Channel

This type of channel is normal chat - Vivox Documentationarrow-up-right

  • Joins the player "username" to a NonPositional (Conference) channel called "chat".

  • Audio is activated in channel so the player can talk to other players.

  • Text capabilities are turned on so player can chat with other players.

  • Transmission is not switched to current channel. Any previous settings set in the current LoginSession will be persisted.

  • Channel type chosen is NonPositional channel.

  • Join muted is set to false because we want the player to hear other players in channel as soon as they join

  • No 3d Settings are created/added because it is not a 3d channel

EasyManager

EasyChannel

Joining a 3D Channel

This type of channel is for 3d video games where Audio/Voice and Text capabilities are based on how close you are to other players. - Vivox Documentationarrow-up-right

  • Joins the player "username" to a 3DPositional channel called "3D".

  • Audio is activated in channel so the player can talk to other players.

  • Text capabilities are turned off because I don't want players text/chat to be lost/discarded if they aren't close to each other on the map. I also don't want everyone to be able to text each other, only squads can text within their squad (use NonPositional Channel).

  • Transmission is not switched to current channel. Any previous settings set in the current LoginSession will be persisted.

  • Channel type chosen is 3DPositional channel.

  • Join muted is set to false because we want the player to hear other players in channel as soon as they join

  • I have created 3d Settings with the default values that Vivox recommends, and I am passing in the settings so when the 3d channel is created it will apply my chosen settings.

EasyManager

EasyChannel

Joining a 3D Channel in Specific Region

This is used for large scale games or when using multiple channels such as 3DPositional (for all players) and NonPositional (for squad members). Vivox Documentationarrow-up-right

  • Joins the player "username" to a 3DPositional channel called "3D".

  • I am assigning the Match Region to "NA" which is the continent codearrow-up-right for North America. You can also use country codesarrow-up-right ("US" for United States) if you know which country your players are in. You can also do "us-west-1" or "us-east-1" like AWS (Amazon Web Services) does if you are separating players by their location closest to your servers. I do not know what regions Vivox servers are in, but they handle the sharding for you as long you use consistent Region identifiers for all matches in that region Vivox will handle the sharding for you. Check out this SlideDeckarrow-up-right (Slide 8) for more info

  • I am using a Match Hash of the lobby id/match name (identifier). My example is for demo purposes and not production ready code. This should be a unique value for every game session. If using Unity's Lobby Service you can use the Lobby Id which is a unique value for the current match all players are connected to

triangle-exclamation
  • Audio is activated in channel so the player can talk to other players.

  • Text capabilities are turned off because I don't want players text/chat to be lost/discarded if they aren't close to each other on the map. I also don't want everyone to be able to text each other, only squads can text within their squad (use NonPositional Channel).

  • Transmission is not switched to current channel. Any previous settings set in the current LoginSession will be persisted.

  • Channel type chosen is 3DPositional channel.

  • Join muted is set to false because we want the player to hear other players in channel as soon as they join

  • I have created 3d Settings with the default values that Vivox recommends, and I am passing in the settings so when the 3d channel is created it will apply my chosen settings.

circle-info
circle-info

Lobby Namespaces

using Unity.Services.Lobbies;

using Unity.Services.Lobbies.Models;

EasyManager

EasyChannel

Joining a NonPositional Channel in Specific Region

This is used for large scale games or when using multiple channels such as 3DPositional (for all players) and NonPositional (for squad members). Vivox Documentationarrow-up-right

  • Joins the player "username" to a NonPositional channel called "squad1".

  • I am assigning the Match Region to "NA" which is the continent codearrow-up-right for North America. You can also use country codesarrow-up-right ("US" for United States) if you know which country your players are in. You can also do "us-west-1" or "us-east-1" like AWS (Amazon Web Services) does if you are separating players by their location closest to your servers. I do not know what regions Vivox servers are in, but they handle the sharding for you as long you use consistent Region identifiers for all matches in that region Vivox will handle the sharding for you. Check out this SlideDeckarrow-up-right (Slide 8) for more info

  • I am using a Match Hash of the lobby id/match name (identifier). My example is for demo purposes and not production ready code. This should be a unique value for every game session. If using Unity's Lobby Service you can use the Lobby Id which is a unique value for the current match all players are connected to

triangle-exclamation
  • Audio is activated in channel so the player can talk to their squad members.

  • Text capabilities are turned on so player can chat with their squad members.

  • Transmission is not switched to current channel. Any previous settings set in the current LoginSession will be persisted.

  • Channel type chosen is NonPositional channel.

  • Join muted is set to false because we want the player to hear their squad members in channel as soon as they join

  • No 3d Settings are created/added because it is not a 3d channel

circle-info

EasyManager

EasyChannel

Last updated