Skip to content

Commit

Permalink
1.4.0 Release
Browse files Browse the repository at this point in the history
Added drag n drop to the window, fixed the "+" sign #19  , fixed the
multiple network adapter thingy #20 .
  • Loading branch information
miltoncandelero committed Jan 11, 2017
1 parent ffa64d9 commit a419ebb
Show file tree
Hide file tree
Showing 10 changed files with 176 additions and 42 deletions.
3 changes: 2 additions & 1 deletion Boop/CsHTTPServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ public void Listen()
bool done = false;
IPAddress ipAddress = Dns.GetHostEntry(Dns.GetHostName()).AddressList[0];

listener = new TcpListener(portNum);
//listener = new TcpListener(portNum);
listener = new TcpListener(IPAddress.Any,portNum);

listener.Start();

Expand Down
124 changes: 91 additions & 33 deletions Boop/Form1.Designer.cs

Large diffs are not rendered by default.

71 changes: 69 additions & 2 deletions Boop/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

namespace Boop
{

public partial class Form1 : Form
{
CsHTTPServer HTTPServer;
Expand Down Expand Up @@ -73,7 +74,7 @@ private void CheckForUpdates()
this.Invoke((MethodInvoker)delegate
{
lblUpdates.Enabled = false;
lblUpdates.Text = "No updates availables";
lblUpdates.Text = "No updates available";
});
}
}
Expand Down Expand Up @@ -188,6 +189,14 @@ private void btnBoop_Click(object sender, EventArgs e)
{
//Try catch will go away in the future. Left in case somebody still has trouble with the server.

if (NetUtil.IPv4.iIPIndex == -1)
{
MessageBox.Show("Your computer is not connected to a network!" + Environment.NewLine + "If you connected your computer after opening Boop, please restart Boop", "No local network detected", MessageBoxButtons.OK, MessageBoxIcon.Error);
//Added red boxes to point out the errors.
return;
}


try
{
//#endif
Expand Down Expand Up @@ -261,9 +270,11 @@ private void btnBoop_Click(object sender, EventArgs e)
setStatusLabel("Sending the file list...");

String message = "";

foreach (var CIA in FilesToBoop)
{
message += NetUtil.IPv4.Local + ":8080/" + Uri.EscapeUriString(Path.GetFileName(CIA)) + "\n";
message += NetUtil.IPv4.Local + ":8080/" + System.Web.HttpUtility.UrlEncode(Path.GetFileName(CIA)) + "\n";
//message += NetUtil.IPv4.Local + ":8080/" + Uri.EscapeUriString(Path.GetFileName(CIA)) + "\n";
}

//boop the info to the 3ds...
Expand Down Expand Up @@ -314,6 +325,8 @@ static byte[] AppendTwoByteArrays(byte[] arrayA, byte[] arrayB) //Aux function t

private void Form1_Load(object sender, EventArgs e)
{
cboLocalIP.DataSource = Dns.GetHostEntry(Dns.GetHostName()).AddressList.DefaultIfEmpty(IPAddress.Loopback).Where(ip => ip.AddressFamily == AddressFamily.InterNetwork).Select(ip => ip.ToString()).ToArray();

lblImageVersion.Text = UpdateChecker.GetCurrentVersion();
this.Text = "Boop " + UpdateChecker.GetCurrentVersion();
new Task(CheckForUpdates).Start(); //Async check for updates
Expand All @@ -322,6 +335,50 @@ private void Form1_Load(object sender, EventArgs e)
txt3DS.Enabled = !chkGuess.Checked;
}

private void Form1_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
e.Effect = DragDropEffects.Copy;
}
else
{
e.Effect = DragDropEffects.None;
}
}


private void Form1_DragDrop(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{

List<String> Boops = new List<String>(); //Initialize a temporal list.

string[] filePaths = (string[])(e.Data.GetData(DataFormats.FileDrop));
foreach (string arg in filePaths)
{

if (System.IO.File.Exists(arg)) //Is it a file?
{
if (Path.GetExtension(arg) == ".cia" || Path.GetExtension(arg) == ".tik") //Is it a supported file?
{
Boops.Add(arg); //Add it.
}
}

}

if (Boops.Count > 0) //If we had any supported file
{
lvFileList.Items.Clear();
FilesToBoop = Boops.ToArray(); //Set them
ProcessFilenames(); //Add them to the list.
}

}
}

private void enableControls(bool enabled)
{
btnBoop.Enabled = enabled;
Expand Down Expand Up @@ -395,5 +452,15 @@ private void lvFileList_SelectedIndexChanged(object sender, EventArgs e)
//Pls no touching the snek list.
lvFileList.SelectedIndices.Clear();
}

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
NetUtil.IPv4.iIPIndex = cboLocalIP.SelectedIndex;
}

private void lblPCIP_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
MessageBox.Show("Although the server opens for ALL networks, we need to send only ONE IP address to your 3DS." +Environment.NewLine+ "The program used to pick the first IP and most of the times it grabbed the correct one... and sometimes failed miserably." + Environment.NewLine + "If you are connected to more than one network make sure your IP adress is right.", "Do you even network bro?", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
3 changes: 3 additions & 0 deletions Boop/Form1.resx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>133, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>63</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
Expand Down
4 changes: 3 additions & 1 deletion Boop/MyServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ public MyServer(int thePort, string theFolder): base(thePort)
public override void OnResponse(ref HTTPRequestStruct rq, ref HTTPResponseStruct rp)
{
string path = this.Folder + rq.URL.Replace("/",@"\");
path = path.Replace("%20", " ");

//path = HttpUtility.UrlDecode(path); WOT??
//path = path.Replace("%20", " ");


if (Directory.Exists(path))
Expand Down
5 changes: 4 additions & 1 deletion Boop/NetUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@

namespace Boop
{

namespace NetUtil
{
class IPv4
{

public static int iIPIndex = -1;
//Known Nintendo Mac adresses
public static readonly List<string> Nontendo = new List<string> { "E84ECE", "E0E751", "E00C7F", "D86BF7", "CCFB65", "CC9E00", "B8AE6E", "A4C0E1", "A45C27", "9CE635", "98B6E9", "8CCDE8", "8C56C5", "7CBB8A", "78A2A0", "58BDA3", "40F407", "40D28A", "34AF2C", "2C10C1", "182A7B", "002709", "002659", "0025A0", "0024F3", "002444", "00241E", "0023CC", "002331", "0022D7", "0022AA", "00224C", "0021BD", "002147", "001FC5", "001F32", "001EA9", "001E35", "001DBC", "001CBE", "001BEA", "001B7A", "001AE9", "0019FD", "00191D", "0017AB", "001656", "0009BF" };



/// <summary>
/// Dups the result of arp -a into a list of a really neat struct.
/// Not the cleanest way but it works for me.
Expand Down Expand Up @@ -78,7 +81,7 @@ public static string GetFirst3DS()
/// <remarks>Returns your computer's Loopback if no Network detected.</remarks>
public static string Local
{
get { return Dns.GetHostEntry(Dns.GetHostName()).AddressList.DefaultIfEmpty(IPAddress.Loopback).FirstOrDefault(ip => ip.AddressFamily == AddressFamily.InterNetwork).ToString(); }
get { return Dns.GetHostEntry(Dns.GetHostName()).AddressList.DefaultIfEmpty(IPAddress.Loopback).Where(ip => ip.AddressFamily == AddressFamily.InterNetwork).ElementAt(iIPIndex).ToString(); }
}


Expand Down
4 changes: 2 additions & 2 deletions Boop/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]
[assembly: AssemblyVersion("1.4.0.0")]
[assembly: AssemblyFileVersion("1.4.0.0")]
Binary file modified Boop/obj/Debug/DesignTimeResolveAssemblyReferences.cache
Binary file not shown.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Boop
***Become a friend of the snek***

Current release: **1.2.0**
Current release: **1.4.0**

Boop is a C# implementation of the [servefiles.py from FBI](https://github.com/Steveice10/FBI/tree/2.4.5/servefiles)

Expand All @@ -18,5 +18,5 @@ Enough talk! Take me to the [download page!](https://github.com/miltoncandelero/

## Screenshot:

![Snek Screenshot](/Screenshot1.2.PNG?raw=true "Boop v1.1.0")
![Snek Screenshot](/Screenshot1.2.PNG?raw=true "Boop v1.4.0")

Binary file modified Screenshot1.2.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a419ebb

Please sign in to comment.