Skip to content

Commit

Permalink
Updated libraries and changed affected code where necessary. (#2)
Browse files Browse the repository at this point in the history
Downgraded smartglass target framework to netstandard20 (for UWP compatibility)

Co-authored-by: tuxuser <462620+tuxuser@users.noreply.github.com>
  • Loading branch information
queequac and tuxuser authored Aug 25, 2020
1 parent f1cd9f2 commit e0d416e
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 28 deletions.
12 changes: 2 additions & 10 deletions SmartGlass.Cli/AuthenticateCommand.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using NClap.Metadata;
using NClap.Repl;

using XboxWebApi;
using XboxWebApi.Authentication;
using XboxWebApi.Authentication.Model;

Expand Down Expand Up @@ -34,12 +30,8 @@ public override async Task<CommandResult> ExecuteAsync(CancellationToken cancel)

AuthenticationService authService = new AuthenticationService(response);

authService.Authenticate();

using (FileStream fs = File.Open(TokenFilePath, FileMode.Create))
{
authService.DumpToFile(fs);
}
await authService.AuthenticateAsync();
await authService.DumpToJsonFileAsync(TokenFilePath);
}
catch (Exception e)
{
Expand Down
9 changes: 3 additions & 6 deletions SmartGlass.Cli/BroadcastCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,11 @@ public override async Task<CommandResult> ExecuteAsync(CancellationToken cancel)
{
using (FileStream fs = File.Open(TokenFilePath, FileMode.Open))
{
AuthService = AuthenticationService.LoadFromFile(fs);
AuthService.Authenticate();
AuthService = await AuthenticationService.LoadFromJsonFileStream(fs);
await AuthService.AuthenticateAsync();
}

using (FileStream fs = File.Open(TokenFilePath, FileMode.Create))
{
AuthService.DumpToFile(fs);
}
await AuthService.DumpToJsonFileAsync(TokenFilePath);
}

Console.WriteLine($"Connecting to {Hostname}...");
Expand Down
9 changes: 3 additions & 6 deletions SmartGlass.Cli/ConnectCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,11 @@ public override async Task<CommandResult> ExecuteAsync(CancellationToken cancel)
{
using (FileStream fs = File.Open(TokenFilePath, FileMode.Open))
{
AuthService = AuthenticationService.LoadFromFile(fs);
AuthService.Authenticate();
AuthService = await AuthenticationService.LoadFromJsonFileStream(fs);
await AuthService.AuthenticateAsync();
}

using (FileStream fs = File.Open(TokenFilePath, FileMode.Create))
{
AuthService.DumpToFile(fs);
}
await AuthService.DumpToJsonFileAsync(TokenFilePath);
}

Console.WriteLine($"Connecting to {Hostname}...");
Expand Down
6 changes: 3 additions & 3 deletions SmartGlass.Cli/SmartGlass.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ProjectReference Include="..\SmartGlass\SmartGlass.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NClap" Version="2.3.6" />
<PackageReference Include="Tx.Network" Version="2.1.1" />
<PackageReference Include="OpenXbox.XboxWebApi" Version="0.2.4" />
<PackageReference Include="NClap" Version="3.0.0" />
<PackageReference Include="Tx.Network" Version="3.0.3" />
<PackageReference Include="OpenXbox.XboxWebApi" Version="0.3.0" />
</ItemGroup>
</Project>
7 changes: 5 additions & 2 deletions SmartGlass.Tests/SmartGlass.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@

<ItemGroup>
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion SmartGlass/SmartGlass.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageId>OpenXbox.SmartGlass</PackageId>
<Authors>Joel Day, Team OpenXbox</Authors>
<Description>Xbox One SmartGlass/Arcadia client library for .NET</Description>
Expand Down

0 comments on commit e0d416e

Please sign in to comment.