Ejemplo n.º 1
0
        /// <summary>
        /// Adds a client to the clientList if its not in already.
        /// Also creates a chatHistory for the client.
        /// </summary>
        /// <param name="client"></param>
        public void AddClient(Client client) {
            if (_clientList == null)
                _clientList = new List<Client>();

            if(!_clientList.Any(clientObj => clientObj.PublicKeyHash == client.PublicKeyHash)) {
                _clientList.Add(client);
                AddChatHistory(client.PublicKeyHash, false);
            }
        }
Ejemplo n.º 2
0
 public void SendMessage(Client client, string message) {
     string encryptedMessage = SecurityManager.EncryptText(message, client.PublicKey);
     if(encryptedMessage != null) {
         SendMessage(client.PublicKeyHash, encryptedMessage);
     }
 }