public void RemoveClient(LiveClientSide client) { if (clients.Contains(client)) { clients.Remove(client); } }
public void AddClient(LiveClientSide client) { if (clients.Contains(client)) { return; } clients.Add(client); }
public void Send(string msg, string clientID) { LiveClientSide Client = GetClientByID(clientID); if (Client == null) { Debug.Error(string.Format("指定的客户端ID不存在:{0}", clientID)); return; } Send(msg, Client.Client); }
public LiveClientSide GetClientBySocket(Socket socket) { LiveClientSide client = null; foreach (LiveClientSide ls in clients) { if (ls.Client == socket) { client = ls; break; } } return(client); }
public LiveClientSide GetClientByPort(string ip, int port) { LiveClientSide client = null; foreach (LiveClientSide ls in clients) { if (ls.IP == ip && ls.Port == port) { client = ls; break; } } return(client); }