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

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