I implement my custom onlinesusbsystem. And I meet some odd situations:
“IsLoggedIn” macro and “Show External Login UI” macro seems call different instance of same subsystem.
And this situation is not observered in development build.
At edtior start, the subsystem plugin module is loaded.
LogOnline: TR Module Startup!
LogOnline:Warning: IOnlineSubsystemPtr::CreateSubsystem
LogOnline:Warning: OSSModule addr::03aeb4c0
LogOnline:Display: FOnlineSubsystemTRNet::Init()
LogTemp:Warning: FOnlineIdentityTRNet::FOnlineIdentityTRNet()
LogOnline:Warning: This->Address 03BE1200
And when I start the game, the subsystem is created again
LogOnline:Warning: IOnlineSubsystemPtr::CreateSubsystem
LogOnline:Warning: OSSModule addr::03aeb4c0
LogOnline:Display: FOnlineSubsystemTRNet::Init()
LogTemp:Warning: FOnlineIdentityTRNet::FOnlineIdentityTRNet()
LogOnline:Warning: This->Address 285DB000
// called by system
LogOnline:Warning: This->Address 285DB000
LogOnline:Warning: GetUniquePlayerId() : LocalUserNum 0
LogOnline:Warning: This->Address 285DB000
LogOnline:Warning: GetUniquePlayerId() : LocalUserNum 0
// This is call from IsLoggedIn
LogOnline:Warning: This->Address 03BE1200
LogOnline:Warning: GetLoginStatus() : LocalUserNum: 0
LogOnline:Warning: This->Address 03BE1200
LogOnline:Warning: GetUniquePlayerId() : LocalUserNum 0
// This is call from "Show External Login UI"
LogOnline:Warning: This->Address 285DB000
LogOnline:Warning: GetUniquePlayerId() : LocalUserNum 0
Hello ,
You mention that this doesn’t happen in development. Does this only happen in PIE? If it’s not happening in packaged games and Standalone Window mode, then this is most likely caused by how PIE works. It’s a bit different and doesn’t use the instances that are already in the editor, even though they still exist. It instead runs the construction script upon hitting play and uses the instances generated that way. This can cause some odd behavior such as what you are seeing. Standalone and packaged builds are separate processes entirely and only contain what it was created when they started instead of the previous instances still existing.
Yes, it only happens in play in editor.
But this makes some problem, the “IsLoggedIn” macro always get wrong response in Editor because “Show External Login UI” macro use another instance for login.
I will try rebuild unreal source with the plugin as internal module
We haven’t heard from you in a while, . Were you able to try what you mentioned in your previous comment? What were the results? I’m interested to know if you were able to fix the issue. In the meantime, I’ll be marking this as resolved for tracking purposes.
Sorry for late response. Built-in Plugin (put the plugin in editor source) and Built-in module (add into UE4Game.Build.cs [PrivateDependencyModuleNames or DynamicallyLoadedModuleNames] and UE4Game.Target.cs and UE4Editor.Target.cs ) still shows same behavior.
After observer the callstack. The problems seems because submodule and plugin is dll in editor.
ShowExternalUI : CoreUObject.dll → OnlineSubSystemUtils.dll → MYSubmodule.dll
ISLogged : CoreUBoject.dll → U4Editor-Engine.dll → MYSubmodule.dll
Because U4Editor and OnlineSubSystemUtils not share memory, so the OnlineSubsytem singleton is created twice.
Maybe the U4EEditor-Engine should just pass function to OnlineSubSystemUtils to ensure same memory space
Hello ,
I’m leaving this comment to let you know that we’re still looking into this issue and trying to find the cause. I’ll get back to you as soon as I know something.
Hi ,
It is normal for a new online subsystem instance to be created for each PIE instance that starts, but you should be able to access one instance consistently from within a PIE world. What is the actual object that’s printing its address in your provided log, on the “This->Address” lines? If your subsystem module is implemented like the ones provided with the engine, the identity interface and the external UI interface are separate objects, and I would expect them to have different addresses.