Example #1
0
        internal void ExecuteMute(ushort clientId, bool isMute)
        {
            VoicePlugin.Log("{0} {1}", isMute ? "Muting" : "Unmuting", clientId);
            List <ushort> clients;

            clients = new List <ushort>();
            clients.Add(clientId);
            clients.Add(0);
            if (isMute)
            {
                Check(Functions.requestMuteClients(ID, clients.ToArray(), ""));
            }
            else
            {
                Check(Functions.requestUnmuteClients(ID, clients.ToArray(), ""));
            }
        }
Example #2
0
        internal void DoMuteActions()
        {
            var clientCurrentChannel = LocalClient.CurrentChannel;

            if (clientCurrentChannel != IngameChannel)
            {
                if (!CanLeaveIngameChannel && !AllowedOutGameChannels.Contains(clientCurrentChannel))
                {
                    VoicePlugin.Log("Timer: Local Client left ingame channel while inGame");
                    LocalClient.JoinChannel(IngameChannel, IngameChannelPassword);
                }
                else
                { // client may be in this channel when ingame. Make sure people are unmuted here
                    GetChannel(clientCurrentChannel).UnmuteAll();
                    return;
                }
            }

            string        retcode = "";
            List <ushort> clients;

            if (_MutedClients.Count > 0)
            {
                clients = new List <ushort>(_MutedClients.ToArray());
                clients.Add(0);
                Log("Timer: Muting  {0}: {1}", clients.Count, string.Join(",", clients));
                Check(Functions.requestMuteClients(ID, clients.ToArray(), retcode));
            }
            if (_UnmutedClients.Count > 0)
            {
                clients = new List <ushort>(_UnmutedClients.ToArray());
                clients.Add(0);
                Log("Timer: Unmuting  {0}: {1}", clients.Count, string.Join(",", clients));
                Check(Functions.requestUnmuteClients(ID, clients.ToArray(), retcode));
            }
        }
Example #3
0
 internal void JoinChannel(ulong newChannel, string password = "")
 {
     if (ID != Connection.LocalClientId)
     {
         return;
     }
     Log("{0} Joining channel {1}", ID, newChannel);
     if (newChannel == Connection.IngameChannel)
     {
         Check(Functions.requestClientMove(Connection.ID, ID, newChannel, password, VoicePlugin.GetReturnCode(PluginReturnCode.JOINCHANNEL_INGAME)));
     }
     else
     {
         Check(Functions.requestClientMove(Connection.ID, ID, newChannel, password, VoicePlugin.GetReturnCode(PluginReturnCode.JOINCHANNEL)));
     }
 }
Example #4
0
 internal static void Log(string str, params object[] args)
 {
     VoicePlugin.Log(str, args);
 }