private void SendMessage(string message, bool show = true) { if (EnableEncryption) { client.Send(Encoding.ASCII.GetBytes(ExchangeAgent.Encrypt(message))); if (show) { PrintLine("You : " + message + "\n", lo_message); } } else { client.Send(Encoding.ASCII.GetBytes(message)); if (show) { PrintLine("Unsecure : You : " + message + "\n", er_color); } } }
private void Send(string message, bool show = true) { if (EnableEncryption) { byte[] bytes = Encoding.UTF8.GetBytes(ExchangeAgent.Encrypt(message)); networkStream.Write(bytes, 0, bytes.Length); if (show) { PrintLine("You : " + message + "\n", color: lo_message); } } else { byte[] bytes = Encoding.UTF8.GetBytes(message); networkStream.Write(bytes, 0, bytes.Length); if (show) { PrintLine("Unsecure : You : " + message + "\n", color: er_color); } } }