Announcement

Collapse
No announcement yet.

Unreal Engine 4 is available for Win10 UWP app dev now

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [MENTION=494622]jsyarrow[/MENTION] - Is there an easy way using existing API's to add a player to the StatisticManager?

    Code:
    StatisticManager::AddLocalUser(LiveContext->User);
    As you know before that line can be executed some setup is required:

    Code:
    if (!LiveSubsystem)
        return false;
    
    const FOnlineIdentityLivePtr Identity = LiveSubsystem->GetIdentityLive();
    if (!Identity.IsValid())
        return false;
    
    const FUniqueNetIdLive UserLive(Player.Get());
    Windows::Xbox::System::User^ XBoxUser = Identity->GetUserForUniqueNetId(UserLive);
    if (!XBoxUser)
        return false;
    
    XboxLiveContext^ LiveContext = LiveSubsystem->GetLiveContext(XBoxUser);
    if (LiveContext == nullptr)
        return false;
    
    StatisticManager^ mgr = StatisticManager::SingletonInstance;
    if (mgr == nullptr)
        return false;
    
    mgr->AddLocalUser(LiveContext->User);
    What I would like to do, after the user logs in and a valid FUniqueNetId is returned, is add the PlayerId to the StatMgr.

    Is there an easy way to go about this?

    Comment


      Originally posted by Jerry.Richards View Post
      Is there an easy way to go about this?
      More thinking aloud: you could perhaps register a handler for the Windows::Xbox::System::User::SignInCompleted event. There's a User property on the event args for that which you can convert to the type expected by AddLocalUser via the helper XSAPIUserFromSystemUser.

      Comment


        Informational Note: I'm trying to debug the XSAPI by following this link:
        https://github.com/Microsoft/xbox-li...nrt-uwp-source

        Comment


          Originally posted by jsyarrow View Post
          More thinking aloud: you could perhaps register a handler for the Windows::Xbox::System::User::SignInCompleted event. There's a User property on the event args for that which you can convert to the type expected by AddLocalUser via the helper XSAPIUserFromSystemUser.
          That does sound nice. For now, I have it in the FOnlineLeaderboardsLive constructor:

          Code:
              Windows::Xbox::System::User::SignInCompleted += ref new
                  Windows::Foundation::EventHandler<EraAdapter::Windows::Xbox::System::SignInCompletedEventArgs^>(
                      [=](Platform::Object^, EraAdapter::Windows::Xbox::System::SignInCompletedEventArgs^ args)
              {
                  StatisticManager^ mgr = StatisticManager::SingletonInstance;
                  if (mgr == nullptr) return;
          
                  mgr->AddLocalUser(args->User->XSAPIUserFromShimUser(args->User));
              });
          Last edited by Jerry.Richards; 07-13-2017, 05:20 PM.

          Comment


            After updating to VS 15.2 I can no longer build my project. I'm getting the following error:

            Code:
            failed on 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcpackages\platform.winmd'
            'The system cannot find the path specified.'
            By chance do you know of a fix for this?

            Comment


              I believe my latest commit will help, but per my comments on the associated issue there's a deeper problem that we're selecting the 2015 toolchain despite requesting 2017 on the command line.

              Comment


                Originally posted by jsyarrow View Post
                I believe my latest commit will help, but per my comments on the associated issue there's a deeper problem that we're selecting the 2015 toolchain despite requesting 2017 on the command line.
                Thank you [MENTION=494622]jsyarrow[/MENTION] for working on this. I'm trying your last commit now. . .

                [EDIT]
                Using the latest commit with VS 2017 (ver 15.2) I was presented with the Retarget dialog:

                Click image for larger version

Name:	RetargetSolution.jpg
Views:	1
Size:	88.0 KB
ID:	1131148

                After the retargeting the Project Name is labeled slightly different (notice the Visual Studio 2015):

                Click image for larger version

Name:	ProjectLabel.jpg
Views:	1
Size:	26.0 KB
ID:	1131149
                Last edited by Jerry.Richards; 07-14-2017, 09:30 PM.

                Comment


                  [MENTION=494622]jsyarrow[/MENTION] - Thank you again for the update. I'm happy to report that I am able to build Visual Studio Win and UWP versions of my game without any errors. Tomorrow I should have time to test packaging as well.

                  Btw, will the project name with Visual Studio 2015 appended to it (Win64 version) have any ill effect? The UWP project displays as normal.

                  Comment


                    I'm getting the following error message when trying to login to any of my test user accounts on Win10.

                    Click image for larger version

Name:	Win10Error.png
Views:	1
Size:	16.7 KB
ID:	1131230

                    I've setup the sandbox correctly through Device Portal, and can login to the account fine through the XboxLiveAccountTool.

                    Comment


                      On XB1 I'm getting a fatal error on boot. Specifically inside XboxLiveContext->RealTimeActivityService->Activate() which is called from FOnlineSubsystemLive::GetLiveContext().

                      The callstack -

                      Code:
                                      
                                     msvcr110.dll!_invoke_watson(const wchar_t * pszExpression, const wchar_t * pszFunction, const wchar_t * pszFile, unsigned int nLine, unsigned __int64 pReserved) Line 129              C++
                                     vccorlib110.dll!__abi_FailFast() Line 18   C++
                                     Microsoft.Xbox.Services.dll!`Xbox::Services::Tournaments::__ITournamentServicePublicNonVirtuals::TournamentService:: [Microsoft::Xbox::Services::Tournaments::__ITournamentServicePublicNonVirtuals]::__abi_Microsoft_Xbox_Services_Tournaments___ITournamentServicePublicNonVirtuals____abi_GetTournamentsAsync'::`1'::catch$1()                C++
                                     msvcr110.dll!_CallSettingFrame() Line 51               Unknown
                                     msvcr110.dll!__CxxCallCatchBlock(_EXCEPTION_RECORD * pExcept) Line 1265     C++
                                     ntdll.dll!RcConsolidateFrames ()               Unknown
                                     Microsoft.Xbox.Services.dll!Microsoft::Xbox::Services::Tournaments::TournamentService::[Microsoft::Xbox::Services::Tournaments::__ITournamentServicePublicNonVirtuals]::__abi_Microsoft_Xbox_Services_Tournaments___ITournamentServicePublicNonVirtuals____abi_GetTournamentsAsync(Microsoft::Xbox::Services::Tournaments::TournamentRequest ^ request, Windows::Foundation::IAsyncOperation<Microsoft::Xbox::Services::Tournaments::TournamentRequestResult ^> ^ * __abi_returnValue)        C++
                                     XboxOne-Debug.exe!Microsoft::Xbox::Services::RealTimeActivity::__IRealTimeActivityServicePublicNonVirtuals::Activate() C++
                      >             XboxOne-Debug.exe!FOnlineSubsystemLive::GetLiveContext(Windows::Xbox::System::User ^ LiveUser) Line 711                C++
                                     XboxOne-Debug.exe!FSessionMessageRouter::SubscribeToMultiplayerEvents(Windows::Xbox::System::User ^ SubscribingUser) Line 138                C++
                                     XboxOne-Debug.exe!FSessionMessageRouter::FSessionMessageRouter(FOnlineSubsystemLive * InSubsystem) Line 108   C++
                                     XboxOne-Debug.exe!SharedPointerInternals::TIntrusiveReferenceController<FSessionMessageRouter>::TIntrusiveReferenceController<FSessionMessageRouter><FOnlineSubsystemLive * __ptr64 const>(FOnlineSubsystemLive * const && <Args_0>) Line 129  C++
                                     XboxOne-Debug.exe!SharedPointerInternals::NewIntrusiveReferenceController<FSessionMessageRouter,FOnlineSubsystemLive * __ptr64 const>(FOnlineSubsystemLive * const && <Args_0>) Line 180  C++
                                     XboxOne-Debug.exe!MakeShared<FSessionMessageRouter,1,FOnlineSubsystemLive * __ptr64 const>(FOnlineSubsystemLive * const && <Args_0>) Line 1678    C++
                                     XboxOne-Debug.exe!FOnlineSubsystemLive::Init() Line 419             C++
                      Looks like it's something to do with the Tournament subsystem. Not something we need for this game actually, but I'm not sure how to turn it off...

                      Comment


                        [MENTION=828801]Sparkash[/MENTION] - as I recall 80860003 was caused by a mismatch between service and client side configuration of the application. I suspect this is not a Creators Program title? In which case make sure to leave that box unchecked in the Project Settings. Also make sure that your build is turning out an AppxManifest.xml with Package/Identity/Name and Package/Identity/Publisher values that exactly match Dev Center. If you have the latest version of the code then there are now dedicated fields for these in the UWP Project Settings page (Packaging section, Advanced display); if not specified, or on older versions of the source, these come from the Project Name and Company Distinguished Name in general project settings.

                        XDK title issues are best dealt with through private support channels.
                        [MENTION=5350]Jerry.Richards[/MENTION] - the 2015 suffix shouldn't be a problem. It's just indicating that the projects are in 2015 format. For UE projects this is independent of which toolset is used when building. If you want to switch everything to 2017 format and toolset you can re-run GenerateProjectFiles with -2017 on the command line.

                        Comment


                          Originally posted by jsyarrow View Post
                          the 2015 suffix shouldn't be a problem. It's just indicating that the projects are in 2015 format. For UE projects this is independent of which toolset is used when building. If you want to switch everything to 2017 format and toolset you can re-run GenerateProjectFiles with -2017 on the command line.
                          Good to know. On a separate issue, I'm trying to debug the XSAPI and REST code, which are DLL's, and have them added to my VS Solution:
                          https://github.com/Microsoft/xbox-li...nrt-uwp-source

                          My build output is: <Game>\Binaries\UWP64\AppX\Engine\Plugins\Online\XboxOne\OnlineSubsystemLive\ThirdParty\XSAPI\UWP.2017.07.20170710.01\lib\x64\v140\release
                          After pressing F5 in VS the REST DLL is overwritten from the script:

                          Click image for larger version

Name:	Build.01.jpg
Views:	1
Size:	71.4 KB
ID:	1131243

                          How can I disable the overwriting? Possibly rename the source folder

                          Also, I noticed that the source folder already has the PDB present for both DLL's:
                          Engine\Plugins\Online\XboxOne\OnlineSubsystemLive\ThirdParty\XSAPI\UWP.2017.07.20170710.01\lib\x64\v140\Release
                          Click image for larger version

Name:	Build.02.jpg
Views:	1
Size:	57.2 KB
ID:	1131244

                          Are these coming from a Microsoft Server?

                          [EDIT]
                          I see the D appended to the REST DLL (cpprestd_uwp_2_9.*).
                          Last edited by Jerry.Richards; 07-17-2017, 02:44 PM.

                          Comment


                            I am trying to make the HDR changes to work in in UWP. The HDR implementation seems to rely on the AMD_AGS and the NVAPI libraries. These were giving me linker errors for UWP. I found an "amd_ags_uwp_x64.lib" library which fixes my errors for AMD_AGS but I have not been able to find a replacement library for NVAPI. The linker errors are complaining about a few functions in NVAPI, including "NvAPI_DISP_GetDisplayIdByDisplayName", "NvAPI_GetErrorMessage" and "NvAPI_Disp_GetHdrCapabilities" which I believe are needed to detect if an NVIDIA card can support HDR. Has anyone tried this? Is there something I could use to replace nvapi64.lib for UWP?

                            Comment


                              Files inside the Binaries/UWPxx/AppX directory are deployed by Visual Studio. It does this based on the {project_name}.build.appxrecipe file, which UBT creates (see UWPDeploy.GeneratePackageAppXRecipe). You're likely to have a hard time preventing VS from doing the copy as part of deployment, so your best bets would either be to get your self-built binaries into the recipe, or else run without re-deploying.

                              For the former: easiest is probably to change the definition of XSAPISubDir in OnlineSubsystemLive.build.cs to point at a directory where your dlls live (make sure it's a subdir of the plugin).
                              For the latter: make no code changes, build-and-run your game as normal, copy in your edited dlls, then instead of debugging again normally go to the Visual Studio Debug menu, select Other Debug Targets -> Debug Installed App Package..., then choose your game from the list offered.

                              Note that the cpprest dll is manually loaded - it lives in a path that is not searched by the normal UWP dll location rules - and as such you're going to have to change OnlineSubsystemLive.build.cs no matter what to account for the 'd' suffix. Though I should also say that if you find yourself debugging much inside cpprest you're probably off in the weeds.

                              Comment


                                Originally posted by jsyarrow View Post
                                Files inside the Binaries/UWPxx/AppX directory are deployed by Visual Studio... You're likely to have a hard time preventing VS from doing the copy as part of deployment, so your best bets would either be to get your self-built binaries into the recipe, or else run without re-deploying.
                                Yes, I found that out Instead, I added the projects to my solution and directed the output to the original location:
                                MICROSOFT_UWP_UNREAL\Engine\Plugins\Online\XboxOne\OnlineSubsystemLive\ThirdParty\XSAPI\UWP.2017.07.20170710.01\lib\x64\v140\Release

                                This approach appears to partially work in that the correct DLL's are present but I believe debugging is a problem.

                                Originally posted by jsyarrow View Post
                                For the latter: make no code changes, build-and-run your game as normal, copy in your edited dlls, then instead of debugging again normally go to the Visual Studio Debug menu, select Other Debug Targets -> Debug Installed App Package..., then choose your game from the list offered.
                                I stumbled onto the Debug Installed App Package, which does seem useful. . .at the moment though debugging isn't working for me: https://github.com/MICROSOFT-XBOX-AT...EAL/issues/129


                                Originally posted by jsyarrow View Post
                                Note that the cpprest dll is manually loaded - it lives in a path that is not searched by the normal UWP dll location rules - and as such you're going to have to change OnlineSubsystemLive.build.cs no matter what to account for the 'd' suffix. Though I should also say that if you find yourself debugging much inside cpprest you're probably off in the weeds.
                                Thank you for the note.

                                Comment

                                Working...
                                X