예제 #1
0
 public void RemoveClient(LiveClientSide client)
 {
     if (clients.Contains(client))
     {
         clients.Remove(client);
     }
 }
예제 #2
0
 public void AddClient(LiveClientSide client)
 {
     if (clients.Contains(client))
     {
         return;
     }
     clients.Add(client);
 }
예제 #3
0
        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);
        }
예제 #4
0
        public LiveClientSide GetClientBySocket(Socket socket)
        {
            LiveClientSide client = null;

            foreach (LiveClientSide ls in clients)
            {
                if (ls.Client == socket)
                {
                    client = ls;
                    break;
                }
            }
            return(client);
        }
예제 #5
0
        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);
        }