Skip to content

Commit

Permalink
Merge pull request #150 from Asnivor/dev
Browse files Browse the repository at this point in the history
0.5.7.1 merge into master
  • Loading branch information
Asnivor authored Jul 19, 2017
2 parents 2da08ae + f43e091 commit aaa819e
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 38 deletions.
10 changes: 5 additions & 5 deletions MedLaunch/Classes/GameLauncher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -509,28 +509,28 @@ public string GetCommandLineArguments()
baseStr += "-netplay.port " + Validate(Server.netplay__port.ToString()) + sep;
}

// add password and gamekey fields from id 100
// add password and gamekey fields from Server row

// password
if (ServerOveride.netplay__password == null || ServerOveride.netplay__password.Trim() == "")
if (Server.netplay__password == null || Server.netplay__password.Trim() == "")
{
// no password set - apply blank
baseStr += "-netplay.password \"\"" + sep;
}
else
{
baseStr += "-netplay.password " + Validate(ServerOveride.netplay__password) + sep;
baseStr += "-netplay.password " + Validate(Server.netplay__password) + sep;
}

// gamekey
if (ServerOveride.netplay__gamekey == null || ServerOveride.netplay__gamekey.Trim() == "")
if (Server.netplay__gamekey == null || Server.netplay__gamekey.Trim() == "")
{
// no gamekey set - set blank
baseStr += "-netplay.gamekey \"\"" + sep;
}
else
{
baseStr += "-netplay.gamekey " + Validate(ServerOveride.netplay__gamekey) + sep;
baseStr += "-netplay.gamekey " + Validate(Server.netplay__gamekey) + sep;
}

}
Expand Down
2 changes: 2 additions & 0 deletions MedLaunch/Classes/IO/Archiving.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ public void ExtractArchive(string destinationDirectory)

entry.WriteToDirectory(destinationDirectory, new SharpCompress.Readers.ExtractionOptions() { Overwrite = true });
}
archive.Dispose();
}
}

Expand All @@ -230,6 +231,7 @@ public void ExtractArchiveZipOverwrite(string destinationDirectory)

entry.WriteToDirectory(destinationDirectory, new SharpCompress.Readers.ExtractionOptions() { Overwrite = true });
}
archive.Dispose();
}
}

Expand Down
2 changes: 2 additions & 0 deletions MedLaunch/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7327,6 +7327,8 @@ xmlns:il="clr-namespace:Microsoft.Expression.Interactivity.Layout;assembly=Micro
<ComboBoxItem Tag="superscope">Super Scope</ComboBoxItem>
</ComboBox>

<Label Grid.ColumnSpan="2" Grid.Row="6">(Emulated Ports 3-8 are GAMEPAD Only)</Label>

<!--
<Label Name="cfglbl_snes__input__port3" Grid.Column="0" Grid.Row="6">Port 3 Input Device</Label>
<ComboBox x:Name="cfg_snes__input__port3" SelectedValuePath="Tag" Grid.Column="1" Grid.Row="6">
Expand Down
69 changes: 39 additions & 30 deletions MedLaunch/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1960,12 +1960,9 @@ private void btnPathMednafen_Click(object sender, RoutedEventArgs e)

if (path.SelectedPath != "")
{
string strPath = path.SelectedPath;



string strPath = path.SelectedPath;
tbPathMednafen.Text = strPath;

Paths.SaveMednafenPath(strPath);
UpdateCheckMednafen();
}

Expand Down Expand Up @@ -3577,6 +3574,9 @@ public bool DownloadMednafenNoAsync()
/* start download and extraction of latest compatible mednafen version */
Versions ver = new Versions();

ProgressBar pb = new ProgressBar();
pb.IsIndeterminate = true;

string downloadsFolder = System.AppDomain.CurrentDomain.BaseDirectory + @"Data\Updates";
System.IO.Directory.CreateDirectory(downloadsFolder);

Expand Down Expand Up @@ -3653,38 +3653,47 @@ public async void UpdateMednafenToLatest(bool isStartup)

// try the download

using (var wc = new CustomWebClient())
await Task.Run(() =>
{
wc.Proxy = null;
wc.Timeout = 2000;
try
// delete the update locally if it already exists
if (File.Exists(downloadsFolder + "\\" + fName))
{
wc.DownloadFile(url, downloadsFolder + "\\" + fName);
}
catch
{
controller.SetMessage("The request timed out - please try again");
await Task.Delay(2000);
await controller.CloseAsync();
wc.Dispose();
return;
File.Delete(downloadsFolder + "\\" + fName);
}
finally


using (var wc = new CustomWebClient())
{
wc.Dispose();
wc.Proxy = null;
wc.Timeout = 2000;
try
{
wc.DownloadFile(url, downloadsFolder + "\\" + fName);
}
catch
{
controller.SetMessage("The request timed out - please try again");
Task.Delay(2000);
controller.CloseAsync();
wc.Dispose();
return;
}
finally
{
wc.Dispose();
}
}
}

// extract download to current mednafen folder
string meddir = Paths.GetPaths().mednafenExe;

Archiving arch = new Archiving(downloadsFolder + "\\" + fName);
try
{
arch.ExtractArchiveZipOverwrite(meddir);
}
catch { }
// extract download to current mednafen folder
string meddir = Paths.GetPaths().mednafenExe;

Archiving arch = new Archiving(downloadsFolder + "\\" + fName);
try
{
arch.ExtractArchiveZipOverwrite(meddir);
}
catch { }
});

await controller.CloseAsync();
}
Expand Down
13 changes: 13 additions & 0 deletions MedLaunch/Models/Paths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ public static void SavePathSettings(TextBox tbPathMednafen, TextBox tbPathGb, Te
SetPaths(paths);
}

public static void SaveMednafenPath(string path)
{
Paths paths = Paths.GetPaths();
paths.mednafenExe = path;
SaveToDatabase(new List<Paths> { paths });
}

public static bool isMednafenPathValid()
{
bool pathWorking = false;
Expand Down Expand Up @@ -258,6 +265,12 @@ public static void InitM()
gs.bypassConfig = true;
GlobalSettings.SetGlobals(gs);
}

else
{
gs.bypassConfig = true;
GlobalSettings.SetGlobals(gs);
}
}

// if option is selected make a backup of the mednafen config file
Expand Down
4 changes: 2 additions & 2 deletions MedLaunch/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,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("0.5.7.0")]
[assembly: AssemblyFileVersion("0.5.7.0")]
[assembly: AssemblyVersion("0.5.7.1")]
[assembly: AssemblyFileVersion("0.5.7.1")]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

**MedLaunch** is a .NET (Windows only) front-end for the excellent [Mednafen](http://mednafen.fobby.net/) multi-system emulator.

Latest Version: 0.5.7.0
Latest Version: 0.5.7.1
Compatible with Mednafen: 0.9.39.x - 0.9.45.x

Documentation: Please see the [REQUIREMENTS](https://medlaunch.info/documentation/en/introduction/requirements) and [QUICK SETUP GUIDE](https://medlaunch.info/documentation/en/introduction/quick-setup-guide) documentation portal pages.
Expand Down

0 comments on commit aaa819e

Please sign in to comment.