private void updateOutput(Object StateInfo = null) { API.Log(API.LogType.Debug, "Teamspeak.ddl: UpdateOutput"); currentUser = QueryRunner.SendWhoAmI(); if (!currentUser.IsErroneous) { string channelpath = QueryRunner.GetChannelConnectionInfo().Path; //look for / not preceded by \ string[] paths = Regex.Split(channelpath, @"(?<![\\])/"); ChannelName = paths[paths.Length - 1].Replace(@"\/", "/").Replace("[cspacer]", String.Empty).Trim(); clients = QueryRunner.GetClientList(); lock (ThreadLocker) { ChannelClientList = new Dictionary <uint, ClientListEntry>(); StringBuilder channelcl = new StringBuilder(); foreach (ClientListEntry client in clients.Values) { if (client.ChannelId == currentUser.ChannelId) { ChannelClientList.Add(client.ClientId, client); channelcl.AppendLine(client.Nickname); } } ChannelClients = channelcl.ToString(); } //API.Log(API.LogType.Debug, "Teamspeak.ddl: UpdateOutput" + "\r\n" + ChannelName + "\r\n" + ChannelClients); } else { //API.Log(API.LogType.Debug, "Teamspeak.ddl: UpdateOutput CurrentUser Error"); Disconnect(); } }