VoiceChat
A class in Root.Township, Alta.Voice.
Client voice chat mute logic: who you can hear (everyone, friends or no one) plus your own muted players list, applied to Vivox. Does nothing on Linux.
- Listed in Networking and servers
- Inherits or implements
IVoiceChat - Documented in Connection messages
Constructors
| Member | What it is |
|---|---|
VoiceChat() | Creates a VoiceChat with default values. |
Fields
2 private and internal fields
| Member | What it is |
|---|---|
private static Logger logger | Class logger. |
private IVivoxMutedPlayerStore mutedStore | Your muted user ids, kept in PlayerPrefs. |
Properties
| Member | What it is |
|---|---|
VoiceChatScope AudibleScope { get; private set; } | Who you can hear. Starts at Everyone. |
Methods
6 private and internal methods
| Member | What it is |
|---|---|
private void NewPlayerCreated(Player player) | Applies the mute state for a player as they're added. |
private void OnFriendStatusUpdated(int player, bool isFriend) | Reapplies the mute state when a friendship changes, which matters in friends scope. |
private void OnPlayerJoinedChannel(IParticipant player) | Applies the mute state when someone joins the Vivox channel, reading their user id from the account name. |
private void OnVivoxClientCreated(VivoxClient client) | Hooks the client's player joined channel event. |
private void SyncMuteStateForPlayer(int userID) | Mutes the user in Vivox if the scope excludes them or you muted them, else unmutes. Skipped on Linux and in the editor. |
private void UpdateMuteAllPlayers() | Applies the mute state for every other player. |