From 424f4ef571d2c602bb202405a50d9c4df9882607 Mon Sep 17 00:00:00 2001 From: Nikolay Kostov Date: Thu, 13 Oct 2016 17:26:43 +0300 Subject: [PATCH] Version 1.4.2. Advertising system changed from AdMediator to AdControl because AdMediator is no longer supported by Microsoft. --- .../BundleArtifacts/Upload/arm.txt | 3 +- .../BundleArtifacts/Upload/x64.txt | 3 +- .../BundleArtifacts/Upload/x86.txt | 3 +- .../BundleArtifacts/arm.txt | 4 +- .../BundleArtifacts/x64.txt | 4 +- .../BundleArtifacts/x86.txt | 4 +- .../Santase.UI.WindowsUniversal/MainPage.xaml | 8 ++-- .../MainPage.xaml.cs | 47 +++++++++++++++++++ .../Package.appxmanifest | 2 +- .../Properties/AssemblyInfo.cs | 4 +- .../Santase.UI.WindowsUniversal.csproj | 5 +- .../Santase.UI.WindowsUniversal/_pkginfo.txt | 2 +- 12 files changed, 67 insertions(+), 22 deletions(-) diff --git a/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/Upload/arm.txt b/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/Upload/arm.txt index 89c28c0..e75bb69 100644 --- a/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/Upload/arm.txt +++ b/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/Upload/arm.txt @@ -1 +1,2 @@ -MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\ARM\Release\Upload\Santase.UI.WindowsUniversal_1.4.1.0_ARM.appx +MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\ARM\Release\Upload\Santase.UI.WindowsUniversal_1.4.2.0_ARM.appx +SymbolPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.2.0\Santase.UI.WindowsUniversal_1.4.2.0_ARM.appxsym diff --git a/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/Upload/x64.txt b/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/Upload/x64.txt index 35c0fc8..f51d0c0 100644 --- a/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/Upload/x64.txt +++ b/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/Upload/x64.txt @@ -1 +1,2 @@ -MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\x64\Release\Upload\Santase.UI.WindowsUniversal_1.4.1.0_x64.appx +MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\x64\Release\Upload\Santase.UI.WindowsUniversal_1.4.2.0_x64.appx +SymbolPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.2.0\Santase.UI.WindowsUniversal_1.4.2.0_x64.appxsym diff --git a/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/Upload/x86.txt b/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/Upload/x86.txt index 18fbaa6..a975c55 100644 --- a/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/Upload/x86.txt +++ b/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/Upload/x86.txt @@ -1 +1,2 @@ -MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\x86\Release\Upload\Santase.UI.WindowsUniversal_1.4.1.0_x86.appx +MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\x86\Release\Upload\Santase.UI.WindowsUniversal_1.4.2.0_x86.appx +SymbolPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.2.0\Santase.UI.WindowsUniversal_1.4.2.0_x86.appxsym diff --git a/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/arm.txt b/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/arm.txt index 6bfa780..5f461df 100644 --- a/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/arm.txt +++ b/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/arm.txt @@ -1,2 +1,2 @@ -MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\ARM\Release\Santase.UI.WindowsUniversal_1.4.1.0_ARM.appx -SymbolPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.1.0_Test\Santase.UI.WindowsUniversal_1.4.1.0_ARM.appxsym +MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\ARM\Release\Santase.UI.WindowsUniversal_1.4.2.0_ARM.appx +SymbolPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.2.0_Test\Santase.UI.WindowsUniversal_1.4.2.0_ARM.appxsym diff --git a/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/x64.txt b/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/x64.txt index 1dc2e1f..333c2a1 100644 --- a/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/x64.txt +++ b/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/x64.txt @@ -1,2 +1,2 @@ -MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\x64\Release\Santase.UI.WindowsUniversal_1.4.1.0_x64.appx -SymbolPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.1.0_Test\Santase.UI.WindowsUniversal_1.4.1.0_x64.appxsym +MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\x64\Release\Santase.UI.WindowsUniversal_1.4.2.0_x64.appx +SymbolPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.2.0_Test\Santase.UI.WindowsUniversal_1.4.2.0_x64.appxsym diff --git a/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/x86.txt b/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/x86.txt index 5305458..fc5f6fb 100644 --- a/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/x86.txt +++ b/Source/UI/Santase.UI.WindowsUniversal/BundleArtifacts/x86.txt @@ -1,2 +1,2 @@ -MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\x86\Release\Santase.UI.WindowsUniversal_1.4.1.0_x86.appx -SymbolPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.1.0_Test\Santase.UI.WindowsUniversal_1.4.1.0_x86.appxsym +MainPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\bin\x86\Release\Santase.UI.WindowsUniversal_1.4.2.0_x86.appx +SymbolPackage=C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.2.0_Test\Santase.UI.WindowsUniversal_1.4.2.0_x86.appxsym diff --git a/Source/UI/Santase.UI.WindowsUniversal/MainPage.xaml b/Source/UI/Santase.UI.WindowsUniversal/MainPage.xaml index e3b2298..1740c14 100644 --- a/Source/UI/Santase.UI.WindowsUniversal/MainPage.xaml +++ b/Source/UI/Santase.UI.WindowsUniversal/MainPage.xaml @@ -4,15 +4,14 @@ xmlns:local="using:Santase.UI.WindowsUniversal" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:universal="using:Microsoft.AdMediator.Universal" x:Class="Santase.UI.WindowsUniversal.MainPage" mc:Ignorable="d" Background="DarkGreen"> - + - + @@ -56,8 +55,7 @@ - - + diff --git a/Source/UI/Santase.UI.WindowsUniversal/MainPage.xaml.cs b/Source/UI/Santase.UI.WindowsUniversal/MainPage.xaml.cs index 4863f60..0756020 100644 --- a/Source/UI/Santase.UI.WindowsUniversal/MainPage.xaml.cs +++ b/Source/UI/Santase.UI.WindowsUniversal/MainPage.xaml.cs @@ -5,17 +5,26 @@ using System.Linq; using System.Threading.Tasks; + using Microsoft.Advertising.WinRT.UI; + using Santase.AI.SmartPlayer; using Santase.Logic.Cards; using Santase.Logic.GameMechanics; using Santase.Logic.Players; + using Windows.System.Profile; using Windows.UI.Core; using Windows.UI.Xaml; + using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Input; public sealed partial class MainPage { + private const string WApplicationId = "6118df2d-165d-41e3-8d27-c41e1a9b7747"; + private const string WAdUnitId = "247332"; + private const string MApplicationId = "5a691b07-171c-4390-a623-63dd1d3a1d47"; + private const string MAdUnitId = "247334"; + private readonly UiPlayer uiPlayer; private readonly SantaseGame game; @@ -24,10 +33,14 @@ public sealed partial class MainPage private readonly CardControl[] playerCardControls; + private AdControl adControl; + public MainPage() { this.InitializeComponent(); + this.InitializeAdControl(); + this.resultPersister = new TotalResultPersister(); this.TotalResult.Text = $"{this.resultPersister.PlayerScore}-{this.resultPersister.OtherPlayerScore}"; @@ -63,6 +76,39 @@ public MainPage() Task.Run(() => this.game.Start()); } + private void InitializeAdControl() + { + // Initialize the AdControl. + this.adControl = new AdControl + { + IsAutoRefreshEnabled = true, + HorizontalAlignment = HorizontalAlignment.Stretch, + VerticalAlignment = VerticalAlignment.Stretch + }; + + // For mobile device families, use the mobile ad unit info. + if (AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Mobile") + { + this.adControl.ApplicationId = MApplicationId; + this.adControl.AdUnitId = MAdUnitId; + this.adControl.Width = 480; + this.adControl.Height = 80; + } + else + { + this.adControl.ApplicationId = WApplicationId; + this.adControl.AdUnitId = WAdUnitId; + this.adControl.Width = 728; + this.adControl.Height = 90; + } + + this.adControl.SetValue(Grid.RowProperty, 3); + this.adControl.SetValue(Grid.ColumnProperty, 0); + this.adControl.SetValue(Grid.ColumnSpanProperty, 5); + + this.MainGrid.Children.Add(this.adControl); + } + private void PlayerCardTapped(object sender, TappedRoutedEventArgs eventArgs) { this.uiPlayer.Action(PlayerAction.PlayCard((sender as CardControl)?.Card)); @@ -117,6 +163,7 @@ private void UiPlayerOnRedrawPlayerPlayedCard(object sender, Card card) //// this.PlayerCard.SetCard(card); //// } }); + //// Task.Delay(2000); } diff --git a/Source/UI/Santase.UI.WindowsUniversal/Package.appxmanifest b/Source/UI/Santase.UI.WindowsUniversal/Package.appxmanifest index 6f38dc2..2f8023d 100644 --- a/Source/UI/Santase.UI.WindowsUniversal/Package.appxmanifest +++ b/Source/UI/Santase.UI.WindowsUniversal/Package.appxmanifest @@ -1,6 +1,6 @@  - + Santase diff --git a/Source/UI/Santase.UI.WindowsUniversal/Properties/AssemblyInfo.cs b/Source/UI/Santase.UI.WindowsUniversal/Properties/AssemblyInfo.cs index 7d5d112..df2cf94 100644 --- a/Source/UI/Santase.UI.WindowsUniversal/Properties/AssemblyInfo.cs +++ b/Source/UI/Santase.UI.WindowsUniversal/Properties/AssemblyInfo.cs @@ -23,6 +23,6 @@ // 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.4.1.0")] -[assembly: AssemblyFileVersion("1.4.1.0")] +[assembly: AssemblyVersion("1.4.2.0")] +[assembly: AssemblyFileVersion("1.4.2.0")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/Source/UI/Santase.UI.WindowsUniversal/Santase.UI.WindowsUniversal.csproj b/Source/UI/Santase.UI.WindowsUniversal/Santase.UI.WindowsUniversal.csproj index 08123ab..5df3876 100644 --- a/Source/UI/Santase.UI.WindowsUniversal/Santase.UI.WindowsUniversal.csproj +++ b/Source/UI/Santase.UI.WindowsUniversal/Santase.UI.WindowsUniversal.csproj @@ -11,7 +11,7 @@ Santase.UI.WindowsUniversal en-US UAP - 10.0.10586.0 + 10.0.14393.0 10.0.10240.0 14 512 @@ -187,9 +187,6 @@ - - Microsoft.AdMediator.Universal - Microsoft Advertising SDK for XAML diff --git a/Source/UI/Santase.UI.WindowsUniversal/_pkginfo.txt b/Source/UI/Santase.UI.WindowsUniversal/_pkginfo.txt index f173114..0d45ffd 100644 --- a/Source/UI/Santase.UI.WindowsUniversal/_pkginfo.txt +++ b/Source/UI/Santase.UI.WindowsUniversal/_pkginfo.txt @@ -1 +1 @@ -C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.1.0\Santase.UI.WindowsUniversal_1.4.1.0_x86_x64_arm.appxbundle +C:\Dev\2016\SantaseGameEngine\Source\UI\Santase.UI.WindowsUniversal\AppPackages\Santase.UI.WindowsUniversal_1.4.2.0\Santase.UI.WindowsUniversal_1.4.2.0_x86_x64_arm.appxbundle