From 78a87a1311a58c524e1be68339a84055dbba8b8c Mon Sep 17 00:00:00 2001 From: Eldin Zenderink Date: Thu, 21 Jun 2018 14:53:19 +0200 Subject: [PATCH] v2.1.0 Support for multiple frameworks: .net45, .net46, .net47 ,.net core 2.0, .net core 2.1 Renamed a few things. --- SimpleIRCLib.sln | 2 +- SimpleIRCLib/DCCClient.cs | 34 ++++---- SimpleIRCLib/DCCEventArgs.cs | 2 +- SimpleIRCLib/IrcClient.cs | 108 +++++++++++++----------- SimpleIRCLib/IrcCommands.cs | 54 ++++++------ SimpleIRCLib/Properties/AssemblyInfo.cs | 39 --------- SimpleIRCLib/SimpleIRC.cs | 41 ++++----- SimpleIRCLib/SimpleIRCLib.csproj | 74 +++++----------- 8 files changed, 148 insertions(+), 206 deletions(-) delete mode 100644 SimpleIRCLib/Properties/AssemblyInfo.cs diff --git a/SimpleIRCLib.sln b/SimpleIRCLib.sln index fde0a79..6a498c7 100644 --- a/SimpleIRCLib.sln +++ b/SimpleIRCLib.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.27428.2005 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleIRCLib", "SimpleIRCLib\SimpleIRCLib.csproj", "{3D881A50-DB1A-464E-A51E-4CE5EB8BD5F1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleIRCLib", "SimpleIRCLib\SimpleIRCLib.csproj", "{3D881A50-DB1A-464E-A51E-4CE5EB8BD5F1}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IrcLibTest", "IrcLibTest\IrcLibTest.csproj", "{27C58F1A-4851-4A5B-85F7-C387971543DA}" ProjectSection(ProjectDependencies) = postProject diff --git a/SimpleIRCLib/DCCClient.cs b/SimpleIRCLib/DCCClient.cs index 8e52af9..1b8635e 100644 --- a/SimpleIRCLib/DCCClient.cs +++ b/SimpleIRCLib/DCCClient.cs @@ -42,7 +42,7 @@ public class DCCClient /// /// Port of server of file location /// - public string NewIp { get; set; } + public string NewIP{ get; set; } /// /// Progress from 0-100 (%) /// @@ -196,7 +196,7 @@ private bool ParseData(string dccString) string[] thaimportantnumbers = dccString.Split('"')[2].Trim().Split(' '); if (thaimportantnumbers[0].Contains(":")) { - NewIp = thaimportantnumbers[0]; + NewIP= thaimportantnumbers[0]; } else { @@ -206,7 +206,7 @@ private bool ParseData(string dccString) OnDccDebugMessage?.Invoke(this, new DCCDebugMessageArgs("DCCClient1: PARSING FOLLOWING IPBYTES: " + thaimportantnumbers[0], "DCC PARSER")); string ipAddress = UInt64ToIPAddress(Int64.Parse(thaimportantnumbers[0])); - NewIp = ipAddress; + NewIP= ipAddress; } catch { @@ -215,7 +215,7 @@ private bool ParseData(string dccString) } OnDccDebugMessage?.Invoke(this, - new DCCDebugMessageArgs("DCCClient1: IP PARSED: " + NewIp, "DCC PARSER")); + new DCCDebugMessageArgs("DCCClient1: IP PARSED: " + NewIP, "DCC PARSER")); NewPortNum = int.Parse(thaimportantnumbers[1]); NewFileSize = Int64.Parse(thaimportantnumbers[2]); @@ -231,7 +231,7 @@ private bool ParseData(string dccString) if (dccString.Split(' ')[3].Contains(":")) { - NewIp = dccString.Split(' ')[3]; + NewIP= dccString.Split(' ')[3]; } else { @@ -242,7 +242,7 @@ private bool ParseData(string dccString) OnDccDebugMessage?.Invoke(this, new DCCDebugMessageArgs("DCCClient2: PARSING FOLLOWING IPBYTES DIRECTLY: " + dccString.Split(' ')[3], "DCC PARSER")); string ipAddress = UInt64ToIPAddress(Int64.Parse(dccString.Split(' ')[3])); - NewIp = ipAddress; + NewIP= ipAddress; } catch { @@ -251,7 +251,7 @@ private bool ParseData(string dccString) } } OnDccDebugMessage?.Invoke(this, - new DCCDebugMessageArgs("DCCClient2: IP PARSED: " + NewIp, "DCC PARSER")); + new DCCDebugMessageArgs("DCCClient2: IP PARSED: " + NewIP, "DCC PARSER")); NewPortNum = int.Parse(dccString.Split(' ')[4]); NewFileSize = Int64.Parse(dccString.Split(' ')[5]); return true; @@ -269,7 +269,7 @@ private bool ParseData(string dccString) if (thaimportantnumbers[0].Contains(":")) { - NewIp = thaimportantnumbers[0]; + NewIP= thaimportantnumbers[0]; } else { @@ -279,7 +279,7 @@ private bool ParseData(string dccString) OnDccDebugMessage?.Invoke(this, new DCCDebugMessageArgs("DCCClient3: PARSING FOLLOWING IPBYTES DIRECTLY: " + thaimportantnumbers[0], "DCC PARSER")); string ipAddress = UInt64ToIPAddress(Int64.Parse(thaimportantnumbers[0])); - NewIp = ipAddress; + NewIP= ipAddress; } catch { @@ -289,7 +289,7 @@ private bool ParseData(string dccString) OnDccDebugMessage?.Invoke(this, - new DCCDebugMessageArgs("DCCClient3: IP PARSED: " + NewIp, "DCC PARSER")); + new DCCDebugMessageArgs("DCCClient3: IP PARSED: " + NewIP, "DCC PARSER")); NewPortNum = int.Parse(thaimportantnumbers[1]); NewFileSize = Int64.Parse(thaimportantnumbers[2]); return true; @@ -302,7 +302,7 @@ private bool ParseData(string dccString) if (dccString.Split(' ')[6].Contains(":")) { - NewIp = dccString.Split(' ')[6]; + NewIP= dccString.Split(' ')[6]; } else { try @@ -311,7 +311,7 @@ private bool ParseData(string dccString) OnDccDebugMessage?.Invoke(this, new DCCDebugMessageArgs("DCCClient4: PARSING FOLLOWING IPBYTES DIRECTLY: " + dccString.Split(' ')[6], "DCC PARSER")); string ipAddress = UInt64ToIPAddress(Int64.Parse(dccString.Split(' ')[6])); - NewIp = ipAddress; + NewIP= ipAddress; } catch { @@ -321,7 +321,7 @@ private bool ParseData(string dccString) } OnDccDebugMessage?.Invoke(this, - new DCCDebugMessageArgs("DCCClient4: IP PARSED: " + NewIp, "DCC PARSER")); + new DCCDebugMessageArgs("DCCClient4: IP PARSED: " + NewIP, "DCC PARSER")); NewPortNum = int.Parse(dccString.Split(' ')[7]); NewFileSize = Int64.Parse(dccString.Split(' ')[8]); return true; @@ -391,7 +391,7 @@ public void Downloader() new DCCDebugMessageArgs("File does not exist yet, start connection \n ", "DCC DOWNLOADER")); //start connection with tcp server - using (TcpClient dltcp = new TcpClient(NewIp, NewPortNum)) + using (TcpClient dltcp = new TcpClient(NewIP, NewPortNum)) { using (NetworkStream dlstream = dltcp.GetStream()) { @@ -651,11 +651,11 @@ private string ReverseIp(string ip) { OnDccDebugMessage?.Invoke(this, new DCCDebugMessageArgs("DCCClient: converting ip: " + ip, "DCC IP PARSER")); - string newip = parts[3] + "." + parts[2] + "." + parts[1] + "." + parts[0]; + string NewIP= parts[3] + "." + parts[2] + "." + parts[1] + "." + parts[0]; OnDccDebugMessage?.Invoke(this, - new DCCDebugMessageArgs("DCCClient: to: " + newip, "DCC IP PARSER")); + new DCCDebugMessageArgs("DCCClient: to: " + NewIP, "DCC IP PARSER")); - return newip; + return NewIP; } else { OnDccDebugMessage?.Invoke(this, diff --git a/SimpleIRCLib/DCCEventArgs.cs b/SimpleIRCLib/DCCEventArgs.cs index e1fd54a..eea498f 100644 --- a/SimpleIRCLib/DCCEventArgs.cs +++ b/SimpleIRCLib/DCCEventArgs.cs @@ -31,7 +31,7 @@ public DCCEventArgs(DCCClient currentClient) DccString = currentClient.NewDccString; FileName = currentClient.NewFileName; FileSize = currentClient.NewFileSize; - Ip = currentClient.NewIp; + Ip = currentClient.NewIP; Port = currentClient.NewPortNum; Pack = currentClient.PackNum; Bot = currentClient.BotName; diff --git a/SimpleIRCLib/IrcClient.cs b/SimpleIRCLib/IrcClient.cs index 3fd8312..9d95eb3 100644 --- a/SimpleIRCLib/IrcClient.cs +++ b/SimpleIRCLib/IrcClient.cs @@ -39,11 +39,11 @@ public class IrcClient /// /// Port of irc server to connect to /// - private int _newPort; + private int _NewPort; /// /// Username to register on irc server /// - private string _newUsername; + private string _NewUsername; /// /// Password to connect to a secured irc server /// @@ -55,7 +55,7 @@ public class IrcClient /// /// List with channels seperated with ',' to join when connecting to IRC server /// - private string _newChannels; + private string _NewChannelss; /// /// timeout before throwing timeout errors (using OnDebugMessage) /// @@ -75,7 +75,7 @@ public class IrcClient /// /// for checking if client has started listening to the server /// - private bool _isClientRunning; + private bool _IsClientRunning; /// /// packnumber used to initialize dccclient downloader /// @@ -127,7 +127,7 @@ public class IrcClient public IrcClient() { _isConnectionEstablised = false; - _isClientRunning = false; + _IsClientRunning = false; } /// @@ -146,12 +146,12 @@ public void SetConnectionInformation(string ip, string username, string channels DCCClient dccClient, string downloadDirectory, int port = 0, string password = "", int timeout = 3000, bool enableSSL = true) { _newIp = ip; - _newPort = port; - _newUsername = username; + _NewPort = port; + _NewUsername = username; _newPassword = password; - _newChannels = channels; + _NewChannelss = channels; _isConnectionEstablised = false; - _isClientRunning = false; + _IsClientRunning = false; _timeOut = timeout; _downloadDirectory = downloadDirectory; _dccClient = dccClient; @@ -161,7 +161,7 @@ public void SetConnectionInformation(string ip, string username, string channels { if (port == 0) { - port = 6697; + _NewPort = 6697; } else if (port != 6697) { OnDebugMessage?.Invoke(this, new IrcDebugMessageEventArgs("PORT: " + port.ToString() + " IS NOT COMMONLY USED FOR TLS/SSL CONNECTIONS, PREFER TO USE 6697 FOR SSL!", "SETUP WARNING")); @@ -171,7 +171,7 @@ public void SetConnectionInformation(string ip, string username, string channels { if (port == 0) { - port = 6667; + _NewPort = 6667; } else if (port < 6665 && port > 6669) { @@ -186,6 +186,7 @@ public void SetConnectionInformation(string ip, string username, string channels /// Path to directory (creates it if it does not exist) public void SetDownloadDirectory(string downloadDirectory) { + OnDebugMessage?.Invoke(this, new IrcDebugMessageEventArgs("SET DOWNLOAD DIRECTORY: " + downloadDirectory, "SETTING DOWNLOAD DIRECTORY")); _downloadDirectory = downloadDirectory; } @@ -271,7 +272,7 @@ public bool QuitConnect() public void StartReceivingChat() { - _tcpClient = new TcpClient(_newIp, _newPort); + _tcpClient = new TcpClient(_newIp, _NewPort); int timeout = 0; while (!_tcpClient.Connected) @@ -286,48 +287,59 @@ public void StartReceivingChat() } - if (!_enableSSL) - { - _networkStream = _tcpClient.GetStream(); Thread.Sleep(500); - _streamReader = new StreamReader(_networkStream); - _streamWriter = new StreamWriter(_networkStream); - _ircCommands = new IrcCommands(_networkStream); - } - else + try { - _networkSStream = new SslStream(_tcpClient.GetStream()); - _networkSStream.AuthenticateAsClient(_newIp); - _streamReader = new StreamReader(_networkSStream); - _streamWriter = new StreamWriter(_networkSStream); - _ircCommands = new IrcCommands(_networkSStream); - } + if (!_enableSSL) + { + _networkStream = _tcpClient.GetStream(); Thread.Sleep(500); + _streamReader = new StreamReader(_networkStream); + _streamWriter = new StreamWriter(_networkStream); + _ircCommands = new IrcCommands(_networkStream); + } + else + { + _networkSStream = new SslStream(_tcpClient.GetStream()); + _networkSStream.AuthenticateAsClient(_newIp); + _streamReader = new StreamReader(_networkSStream); + _streamWriter = new StreamWriter(_networkSStream); + _ircCommands = new IrcCommands(_networkSStream); + } - _isConnectionEstablised = true; - OnDebugMessage?.Invoke(this, new IrcDebugMessageEventArgs("CONNECTED TO TCP SOCKET", "IRC SETUP")); + _isConnectionEstablised = true; + OnDebugMessage?.Invoke(this, new IrcDebugMessageEventArgs("CONNECTED TO TCP SOCKET", "IRC SETUP")); - if (_newPassword.Length > 0) - { - if (!_ircCommands.SetPassWord(_newPassword)) + + + if (_newPassword.Length > 0) + { + if (!_ircCommands.SetPassWord(_newPassword)) + { + OnDebugMessage?.Invoke(this, new IrcDebugMessageEventArgs(_ircCommands.GetErrorMessage(), "IRC SETUP ERROR")); + _isConnectionEstablised = false; + } + } + Debug.WriteLine("Joining channels: " + _NewChannelss); + if (!_ircCommands.JoinNetwork(_NewUsername, _NewChannelss)) { OnDebugMessage?.Invoke(this, new IrcDebugMessageEventArgs(_ircCommands.GetErrorMessage(), "IRC SETUP ERROR")); _isConnectionEstablised = false; } } - Debug.WriteLine("Joining channels: " + _newChannels); - if (!_ircCommands.JoinNetwork(_newUsername, _newChannels)) + catch (Exception ex) { - OnDebugMessage?.Invoke(this, new IrcDebugMessageEventArgs(_ircCommands.GetErrorMessage(), "IRC SETUP ERROR")); - _isConnectionEstablised = false; + OnDebugMessage?.Invoke(this, new IrcDebugMessageEventArgs(ex.ToString(), "IRC SETUP")); } + + if (_isConnectionEstablised) { OnDebugMessage?.Invoke(this, new IrcDebugMessageEventArgs("CONNECTED TO IRC SERVER", "IRC SETUP")); - + _stopTask = false; Task.Run(() => ReceiveChat()); } } @@ -351,7 +363,7 @@ private void ReceiveChat() Dictionary> usersPerChannelDictionary = new Dictionary>(); - _isClientRunning = true; + _IsClientRunning = true; _isConnectionEstablised = true; while (!_stopTask) { @@ -428,7 +440,7 @@ private void ReceiveChat() }; } - if (ircData.Contains("DCC SEND") && ircData.Contains(_newUsername)) + if (ircData.Contains("DCC SEND") && ircData.Contains(_NewUsername)) { _dccClient.StartDownloader(ircData, _downloadDirectory, _bot, _packNumber, this); } @@ -439,11 +451,11 @@ private void ReceiveChat() //:irc.x2x.cc 353 RoflHerp = #RareIRC :RoflHerp @MrRareie try { - string channel = ircData.Split(new[] { " " + _newUsername + " ="}, StringSplitOptions.None)[1].Split(':')[0].Replace(" ", string.Empty); - string userListFullString = ircData.Split(new[] { " " + _newUsername + " =" }, StringSplitOptions.None)[1].Split(':')[1]; + string channel = ircData.Split(new[] { " " + _NewUsername + " ="}, StringSplitOptions.None)[1].Split(':')[0].Replace(" ", string.Empty); + string userListFullString = ircData.Split(new[] { " " + _NewUsername + " =" }, StringSplitOptions.None)[1].Split(':')[1]; - if (!channel.Contains(_newUsername) && !channel.Contains("=")) + if (!channel.Contains(_NewUsername) && !channel.Contains("=")) { string[] users = userListFullString.Split(' '); if (usersPerChannelDictionary.ContainsKey(channel)) @@ -453,7 +465,7 @@ private void ReceiveChat() foreach (string name in users) { - if (!name.Contains(_newUsername)) + if (!name.Contains(_NewUsername)) { currentUsers.Add(name); } @@ -501,7 +513,7 @@ private void ReceiveChat() QuitConnect(); } } - _isClientRunning = false; + _IsClientRunning = false; } @@ -564,7 +576,7 @@ public bool SendMessageToAll(string input) if (input.Split(' ').Length > 0) { string channels = input.Split(' ')[1]; - _newChannels += channels; + _NewChannelss += channels; return WriteIrc("JOIN " + channels); } else @@ -582,7 +594,7 @@ public bool SendMessageToAll(string input) } else { - return WriteIrc("PRIVMSG " + _newChannels + " :" + input); + return WriteIrc("PRIVMSG " + _NewChannelss + " :" + input); } @@ -651,7 +663,7 @@ public bool SendMessageToChannel(string input, string channel) if (input.Split(' ').Length > 0) { string channels = input.Split(' ')[1]; - _newChannels += channels; + _NewChannelss += channels; return WriteIrc("JOIN " + channels); } else @@ -698,7 +710,7 @@ public bool GetUsersInChannel(string channel = "") return WriteIrc("NAMES " + channel); } else { - return WriteIrc("NAMES " + _newChannels); + return WriteIrc("NAMES " + _NewChannelss); } } @@ -780,7 +792,7 @@ public bool IsConnectionEstablished() /// true or false depending if the client is running or not public bool IsClientRunning() { - return _isClientRunning; + return _IsClientRunning; } } diff --git a/SimpleIRCLib/IrcCommands.cs b/SimpleIRCLib/IrcCommands.cs index 9aa6bd6..03c0c7e 100644 --- a/SimpleIRCLib/IrcCommands.cs +++ b/SimpleIRCLib/IrcCommands.cs @@ -138,27 +138,30 @@ public bool JoinNetwork(string user, string channels) try { string ircData = _reader.ReadLine(); - Debug.WriteLine("Got response: " + ircData); - - if (ircData.Contains("PING")) + if (ircData != null) { - string pingID = ircData.Split(':')[1]; - _writer.WriteLine("PONG :" + pingID); - _writer.Flush(); - } + if (ircData.Contains("PING")) + { + string pingID = ircData.Split(':')[1]; + _writer.WriteLine("PONG :" + pingID); + _writer.Flush(); + } - if (CheckMessageForError(ircData)) - { - Debug.WriteLine("Checking 266 = " + _responseNumber.ToString()); - if (_responseNumber == 266) + if (CheckMessageForError(ircData)) { - return JoinChannel(channels, user); + if (_responseNumber == 266) + { + return JoinChannel(channels, user); + } } } + Thread.Sleep(1); } catch (Exception e) { - + + Debug.WriteLine("RECEIVED: " + e.ToString()); + return false; } } } @@ -175,24 +178,25 @@ public bool JoinChannel(string channels, string username) _writer.WriteLine("JOIN " + channels + Environment.NewLine); _writer.Flush(); - Debug.WriteLine("Joining channel: " + _channels) ; while (true) { string ircData = _reader.ReadLine(); - Debug.WriteLine("Response: " + ircData); - if (ircData.Contains("PING")) + if (ircData != null) { - string pingID = ircData.Split(':')[1]; - _writer.WriteLine("PONG :" + pingID); - _writer.Flush(); - } + if (ircData.Contains("PING")) + { + string pingID = ircData.Split(':')[1]; + _writer.WriteLine("PONG :" + pingID); + _writer.Flush(); + } - if (ircData.Contains(username) && ircData.Contains("JOIN")) - { - return true; + if (ircData.Contains(username) && ircData.Contains("JOIN")) + { + return true; + } } - + Thread.Sleep(1); } } @@ -220,10 +224,8 @@ public bool SetNickName(string nickname) public bool CheckMessageForError(string message) { string codeString = message.Split(' ')[1].Trim(); - Debug.WriteLine("CODE: " + codeString); if (int.TryParse(codeString, out _responseNumber)) { - Debug.WriteLine("parsed number: " + _responseNumber.ToString()); foreach (string errorMessage in RFC1459Codes.ListWithErrors) { if (errorMessage.Contains(codeString)) diff --git a/SimpleIRCLib/Properties/AssemblyInfo.cs b/SimpleIRCLib/Properties/AssemblyInfo.cs deleted file mode 100644 index 56142d8..0000000 --- a/SimpleIRCLib/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Resources; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SimpleIRCLib")] -[assembly: AssemblyDescription("A simplistic library designed for IRC in combination with .NET")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SimpleIRCLib")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3d881a50-db1a-464e-a51e-4ce5eb8bd5f1")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.*")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: NeutralResourcesLanguage("")] - diff --git a/SimpleIRCLib/SimpleIRC.cs b/SimpleIRCLib/SimpleIRC.cs index ae97f1e..0cbb4b4 100644 --- a/SimpleIRCLib/SimpleIRC.cs +++ b/SimpleIRCLib/SimpleIRC.cs @@ -15,27 +15,27 @@ public class SimpleIRC /// /// Ip address of irc server /// - private string _newIP { get; set; } + public string NewIP{ get; set; } /// /// Port of irc server to connect to /// - private int _newPort { get; set; } + public int NewPort { get; set; } /// /// Username to register on irc server /// - private string _newUsername { get; set; } + public string NewUsername { get; set; } /// /// List with channels seperated with ',' to join when connecting to IRC server /// /// Password to connect to a secured irc server /// - private string _newPassword { get; set; } + public string NewPassword { get; set; } /// /// download directory used for DCCClient.cs /// - private string _downloadDir { get; set; } + public string DownloadDir { get; set; } /// /// Irc Client for sending and receiving messages to a irc server @@ -52,12 +52,12 @@ public class SimpleIRC /// public SimpleIRC() { - _newIP = ""; - _newPort = 0; - _newUsername = ""; - _newPassword = ""; - _newChannels = ""; - _downloadDir = ""; + NewIP= ""; + NewPort = 0; + NewUsername = ""; + NewPassword = ""; + NewChannels = ""; + DownloadDir = ""; IrcClient = new IrcClient(); DccClient = new DCCClient(); } @@ -75,14 +75,14 @@ public SimpleIRC() /// Timeout, optional parameter, where default value is 3000 milliseconds, the maximum time before a server needs to answer, otherwise errors are thrown. public void SetupIrc(string ip, string username, string channels, int port = 0, string password = "", int timeout = 3000, bool enableSSL = true) { - _newIP = ip; - _newPort = port; - _newUsername = username; - _newPassword = password; - _newChannels = channels; - _downloadDir = ""; + NewIP= ip; + NewPort = port; + NewUsername = username; + NewPassword = password; + NewChannels = channels; + DownloadDir = ""; - IrcClient.SetConnectionInformation(ip, username, channels, DccClient, _downloadDir, port, password, timeout, enableSSL); + IrcClient.SetConnectionInformation(ip, username, channels, DccClient, DownloadDir, port, password, timeout, enableSSL); } @@ -92,7 +92,8 @@ public void SetupIrc(string ip, string username, string channels, int port = 0, /// Requires a path to a directory of type string as parameter. public void SetCustomDownloadDir(string downloaddir) { - _downloadDir = downloaddir; + DownloadDir = downloaddir; + IrcClient.SetDownloadDirectory(downloaddir); } /// diff --git a/SimpleIRCLib/SimpleIRCLib.csproj b/SimpleIRCLib/SimpleIRCLib.csproj index 3de0918..1656d6c 100644 --- a/SimpleIRCLib/SimpleIRCLib.csproj +++ b/SimpleIRCLib/SimpleIRCLib.csproj @@ -1,58 +1,24 @@ - - - + + - Debug - AnyCPU - {3D881A50-DB1A-464E-A51E-4CE5EB8BD5F1} - Library - Properties - SimpleIRCLib - SimpleIRCLib - v4.5.2 - 512 + netcoreapp2.1;netcoreapp2.0;net47;net46;net45; + true + 2.1.0 + Eldin Zenderink + None + A easy to use, easy to implent, IRC library with DCC (Download) support for C#. +See for more information: +https://github.com/EldinZenderink/SimpleIRCLib + https://github.com/EldinZenderink/SimpleIRCLib + https://github.com/EldinZenderink/SimpleIRCLib/blob/master/LICENSE + https://github.com/EldinZenderink/SimpleIRCLib + GitHub + C# IRC DCC PROTOCOL irc protocol simple + -- Now supports multiple frameworks such as: .net45 to .net47 & core 2.0 & core 2.1 - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\SimpleIRCLib.xml - - - false - - - - - + - - - - - - - - + - - - \ No newline at end of file + +