Skip to content

Commit

Permalink
v2.1.0
Browse files Browse the repository at this point in the history
Support for multiple frameworks:
.net45, .net46, .net47 ,.net core 2.0, .net core 2.1

Renamed a few things.
  • Loading branch information
Eldin Zenderink committed Jun 21, 2018
1 parent 8978448 commit 78a87a1
Show file tree
Hide file tree
Showing 8 changed files with 148 additions and 206 deletions.
2 changes: 1 addition & 1 deletion SimpleIRCLib.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 17 additions & 17 deletions SimpleIRCLib/DCCClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class DCCClient
/// <summary>
/// Port of server of file location
/// </summary>
public string NewIp { get; set; }
public string NewIP{ get; set; }
/// <summary>
/// Progress from 0-100 (%)
/// </summary>
Expand Down Expand Up @@ -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
{
Expand All @@ -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
{
Expand All @@ -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]);

Expand All @@ -231,7 +231,7 @@ private bool ParseData(string dccString)

if (dccString.Split(' ')[3].Contains(":"))
{
NewIp = dccString.Split(' ')[3];
NewIP= dccString.Split(' ')[3];
}
else
{
Expand All @@ -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
{
Expand All @@ -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;
Expand All @@ -269,7 +269,7 @@ private bool ParseData(string dccString)

if (thaimportantnumbers[0].Contains(":"))
{
NewIp = thaimportantnumbers[0];
NewIP= thaimportantnumbers[0];
}
else
{
Expand All @@ -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
{
Expand All @@ -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;
Expand All @@ -302,7 +302,7 @@ private bool ParseData(string dccString)

if (dccString.Split(' ')[6].Contains(":"))
{
NewIp = dccString.Split(' ')[6];
NewIP= dccString.Split(' ')[6];
} else
{
try
Expand All @@ -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
{
Expand All @@ -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;
Expand Down Expand Up @@ -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())
{
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion SimpleIRCLib/DCCEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading

0 comments on commit 78a87a1

Please sign in to comment.