Skip to content

Commit

Permalink
Added some logs
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlementlegen committed Jul 20, 2018
1 parent dde2145 commit 3fa30f2
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
9 changes: 6 additions & 3 deletions Warframe Fixer/Warframe Fixer/Model/SteamFileManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ public void FixFile(string steamId)
{
_fileModel.SteamId64 = steamId;
var text = _fileModel.TransformText();
//ShutdownSteamInstance();
//System.IO.File.WriteAllText(_filePath, text);
//StartSteamInstance();
ShutdownSteamInstance();
Logger.Log("Patching Steam file at [" + _filePath + "]");
System.IO.File.WriteAllText(_filePath, text);
StartSteamInstance();
}

/// <summary>
Expand All @@ -53,6 +54,7 @@ public void FixFile(string steamId)
private void ShutdownSteamInstance()
{
var processes = Process.GetProcessesByName("Steam");
Logger.Log("Shutting down any Steam running instances");
if (processes.Length > 0)
{
foreach (var process in processes)
Expand All @@ -67,6 +69,7 @@ private void ShutdownSteamInstance()

private void StartSteamInstance()
{
Logger.Log("Trying to restart Steam client");
if (!string.IsNullOrEmpty(_steamExePath))
Process.Start(_steamExePath);
}
Expand Down
1 change: 1 addition & 0 deletions Warframe Fixer/Warframe Fixer/Model/SteamPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class SteamPatcher : IPatcher

public bool Patch()
{
Logger.Log("Trying to fetch SteamID64 for user " + SteamId);
Task.Run(() => FetchSteamId64()).Wait();
_fileManager.FixFile(SteamId64);
return true;
Expand Down
2 changes: 1 addition & 1 deletion Warframe Fixer/Warframe Fixer/ViewModel/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public MainViewModel(IDataService dataService, IPatcher patcher)
WelcomeTitle = item.Title;
});
_patcher = patcher;
Logger.Log("Hello, Tenno.");
Logger.Log("Welcome, Tenno.");
_cancelToken = _cancelTokenSource.Token;
}

Expand Down
22 changes: 22 additions & 0 deletions Warframe Fixer/Warframe Fixer/Warframe Fixer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -140,6 +155,13 @@
<LastGenOutput>SteamFileModel.cs</LastGenOutput>
</Content>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down

0 comments on commit 3fa30f2

Please sign in to comment.