Skip to main content

VivoxPlayerPrefsMutedPlayerStore

A internal class in Root.Township, Alta.Voice. Reach it through att-stubs' publicized assemblies or Harmony's AccessTools.

Client store of muted player IDs, saved as JSON in Unity PlayerPrefs under MutedPlayersKey. Loads on first use.

Constructors​

MemberWhat it is
VivoxPlayerPrefsMutedPlayerStore()Creates a VivoxPlayerPrefsMutedPlayerStore with default values.

Fields​

4 private and internal fields
MemberWhat it is
private bool hasLoadedWhether Load has run.
private static Logger loggerNLog logger for this class.
private readonly HashSet<int> mutedListBacking set for MutedList.
private const string mutedPlayersKeyThe PlayerPrefs key, "MutedPlayersKey".

Properties​

1 private and internal property
MemberWhat it is
private HashSet<int> MutedList { get; }The muted set, loading it on first access.

Methods​

MemberWhat it is
bool Add(int userId)Mutes a user ID and saves. Returns false if already muted.
bool Contains(int userId)Whether the user ID is muted.
bool Remove(int userId)Unmutes a user ID and saves. Returns false if it was not muted.
2 private and internal methods
MemberWhat it is
private void Load()Reads the muted list from PlayerPrefs; logs and keeps an empty list if parsing fails.
private void Save()Writes the muted list to PlayerPrefs as JSON.