cancel
Showing results for 
Search instead for 
Did you mean: 

Unreal Multiplayer issue Joining Session

Ham1ton
Level 3
Hi, I've posted this on the Unreal forums as well so if I get an answer there I will post it here. I've been developing a VR demo in Unreal 4.22 for the Quest for about a month with great success. It is a multiplayer shooter and I've been hosting on the Quest or Vive and have tested with 4 players, everything's great, until... Randomly about a week and a half ago, for some reason the Join Session node is not allowing the client to connect to the listen server anymore. When the client calls Join Session after finding the server, the Join Session node fire off and complete off the success pin as if everything is fine! except nothing happens...  I also setup a test in 4.23( of course following the instructions on this site) and am experiencing the same issue or issue where I connect to the listen server but it isn't the same instance of the server as the players cannot see each other inside the level. Has something changed recently regarding networking on the Quest? Is anyone else having multiplayer issue in Unreal recently? I feel like something changed and I just don't know about it.
20 REPLIES 20

unreal_architec
Level 2

Ham1ton said:

All glory and honor goes to Turtle Rock Studios for this workaround and much personal shame to those who messed it up to start with:

When we upgraded to UE4.23, we could no longer connect clients to servers. Upon investigating we found 2 problems:

UOculusNetDriver::LowLevelSend was modified to take an FInternetAddr pointer instead of an FString (due to the same change in UE4's NetDriver). The code was modified to convert that passed in FInternetAddr pointer into a string, calling FInternetAddrOculus's ToString method, which would just return the user's ID as a string instead of the correct "[id].oculus" connection string required by the SDK.

Either of these changes fixes it:

Change line 295 in NetDriverOculus.cpp (LowLevelSend) from:
FInternetAddrOculus OculusAddr(FURL(nullptr, *Address->ToString(false), ETravelType::TRAVEL_Absolute));
to
FInternetAddrOculus OculusAddr = *StaticCastSharedPtr(Address);

Change line 186 in IpAddressOculus.h (ToString) from:
return OculusId.ToString();
to
return FString::Printf(TEXT("%s.oculus"), *OculusId.ToString());



Unfortunately, this fix is only for the OculusOnlineSubsystem and not the standard OnlineSubsystem which some of us may be using.


hi Ham1ton and thank you for your full report of how to fix this issue

I do all of your levels to fix it but in lunching progress ue4 report this error and lunch failed. 

LogPlayLevel: Error:     C:/UnrealEngine-4.23/UnrealEngine-4.23/Engine/Plugins/Online/OnlineSubsystemOculus/Source/Private/OculusNetDriver.cpp(294,36):  error: no matching function for call to 'StaticCastSharedPtr'

do you have an idea

thank you very much

unreal_architec
Level 2

Ham1ton said:

All glory and honor goes to Turtle Rock Studios for this workaround and much personal shame to those who messed it up to start with:

When we upgraded to UE4.23, we could no longer connect clients to servers. Upon investigating we found 2 problems:

UOculusNetDriver::LowLevelSend was modified to take an FInternetAddr pointer instead of an FString (due to the same change in UE4's NetDriver). The code was modified to convert that passed in FInternetAddr pointer into a string, calling FInternetAddrOculus's ToString method, which would just return the user's ID as a string instead of the correct "[id].oculus" connection string required by the SDK.

Either of these changes fixes it:

Change line 295 in NetDriverOculus.cpp (LowLevelSend) from:
FInternetAddrOculus OculusAddr(FURL(nullptr, *Address->ToString(false), ETravelType::TRAVEL_Absolute));
to
FInternetAddrOculus OculusAddr = *StaticCastSharedPtr(Address);

Change line 186 in IpAddressOculus.h (ToString) from:
return OculusId.ToString();
to
return FString::Printf(TEXT("%s.oculus"), *OculusId.ToString());



Unfortunately, this fix is only for the OculusOnlineSubsystem and not the standard OnlineSubsystem which some of us may be using.


hi Ham1ton and thank you for your full report of how to fix this issue

I do all of your levels to fix it but in lunching progress ue4 report this error and lunch failed. 

LogPlayLevel: Error:     C:/UnrealEngine-4.23/UnrealEngine-4.23/Engine/Plugins/Online/OnlineSubsystemOculus/Source/Private/OculusNetDriver.cpp(294,36):  error: no matching function for call to 'StaticCastSharedPtr'

do you have an idea

thank you very much

tpg_sabibo00_qu
Level 4
I got the same error as @unreal.architecture.  This change enabled it to compile:
const FInternetAddrOculus OculusAddr = *StaticCastSharedPtr<const FInternetAddrOculus>(Address);

tpg_sabibo00_qu
Level 4

However, I made both changes and it didn't fix
anything.   I still have the same problem as the OP did.  Hosting from
Quest, I can find a session from the Rift, but joining never travels to
the new level...  is this working for you, @Ham1ton?

I've been trying to resolve this issue.  In the debugger, neither of those functions mentioned above is called when I try to join a session between a Quest and a Rift.  ?  Instead, it looks like it is calling FOnlineSessionOculus::GetResolvedConnectString().

In the StatelessConnectHandlerComponent::Tick, it just calls NotifyHandshakeBegin() over and over, and the state never changes to InitializedOnLocal.  It never connects.

VintageGreen
Level 5

This doesn't fix anything using 4.26 and the oculus build source of Unreal.

VintageGreen
Level 5


[2021.05.12-02.27.18:202][432]LogOnlineSession: OSS: Join session: traveling to 3928780467239151.oculus [2021.05.12-02.27.18:203][432]LogGameMode: Display: Match State Changed from InProgress to LeavingMap [2021.05.12-02.27.18:203][432]LogGameState: Match State Changed from InProgress to LeavingMap [2021.05.12-02.27.18:203][432]LogNet: Browse: 3928780467239151.oculus/Game/VirtualRealityBP/Maps/Map1 [2021.05.12-02.27.18:204][432]PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)

[2021.05.12-02.27.21:288][709]LogSlate: Slate User Unregistered. User Index 8

[2021.05.12-02.27.21:289][709]LogSlate: Slate User Destroyed. User Index 8, Is Virtual User: 1 [2021.05.12-02.27.21:289][709]LogSlate: Slate User Unregistered. User Index 8

[2021.05.12-02.27.23:906][944]LogSlate: New Slate User Created. User Index 8, Is Virtual User: 1 [2021.05.12-02.27.23:906][944]LogSlate: Slate User Registered. User Index 8, Is Virtual User: 1 [2021.05.12-02.27.27:738][288]LogOnlineSession: Warning: Oculus: Session (GameSession) already exists, can't join twice


it keeps trying to load the wrong level other headset

VintageGreen
Level 5

Join session doesn't work finds wrong map or doesn't see map hosted set to listen.

Headset #1

[2021.05.14-12.16.46:220][ 88]LogBlueprintUserMessages: [VRGameInstance_C_2147482596] Created Session Successful!
[2021.05.14-12.16.46:221][ 88]LogGameMode: Display: Match State Changed from InProgress to LeavingMap
[2021.05.14-12.16.46:221][ 88]LogGameState: Match State Changed from InProgress to LeavingMap
[2021.05.14-12.16.46:221][ 88]LogNet: Browse: /Game/VirtualRealityBP/Maps/map2?listen
[2021.05.14-12.16.46:231][ 88]LogHMD: FSplash::DoShow
[2021.05.14-12.16.46:231][ 88]LogLoad: LoadMap: /Game/VirtualRealityBP/Maps/map2?listen
[2021.05.14-11.24.11:314][815]LogWorld: Bringing World /Game/VirtualRealityBP/Maps/map2.map2 up for play (max tick rate 0) at 2021.05.14-07.24.11
[2021.05.14-11.24.11:315][815]LogWorld: Bringing up level for play took: 0.007358
[2021.05.14-11.24.11:355][815]LogOnlineIdentity: Display: OSS: FOnlineIdentityGooglePlay::GetPlayerNickname
[2021.05.14-11.24.11:356][815]LogOnlineVoice: Oculus: Stopping networked voice for user: 0
[2021.05.14-11.24.11:356][815]LogGameMode: Display: Match State Changed from EnteringMap to WaitingToStart
[2021.05.14-11.24.11:356][815]LogGameState: Match State Changed from EnteringMap to WaitingToStart
[2021.05.14-11.24.11:356][815]LogGameMode: Display: Match State Changed from WaitingToStart to InProgress
[2021.05.14-11.24.11:362][815]LogGameState: Match State Changed from WaitingToStart to InProgress
[2021.05.14-11.24.11:362][815]LogHMD: FSplash::OnPostLoadMap Hide Auto Splash
[2021.05.14-11.24.11:363][815]LogLoad: Took 0.487080 seconds to LoadMap(/Game/VirtualRealityBP/Maps/map2)


Headset #2

[2021.05.12-02.27.18:202][432]LogOnlineSession: OSS: Join session: traveling to 3928780467239151.oculus [2021.05.12-02.27.18:203][432]LogGameMode: Display: Match State Changed from InProgress to LeavingMap [2021.05.12-02.27.18:203][432]LogGameState: Match State Changed from InProgress to LeavingMap [2021.05.12-02.27.18:203][432]LogNet: Browse: 3928780467239151.oculus/Game/VirtualRealityBP/Maps/Map1

[2021.05.12-02.27.18:204][432]PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)

[2021.05.12-02.27.21:288][709]LogSlate: Slate User Unregistered. User Index 8

[2021.05.12-02.27.21:289][709]LogSlate: Slate User Destroyed. User Index 8, Is Virtual User: 1 [2021.05.12-02.27.21:289][709]LogSlate: Slate User Unregistered. User Index 8

[2021.05.12-02.27.23:906][944]LogSlate: New Slate User Created. User Index 8, Is Virtual User: 1 [2021.05.12-02.27.23:906][944]LogSlate: Slate User Registered. User Index 8, Is Virtual User: 1 [2021.05.12-02.27.27:738][288]LogOnlineSession: Warning: Oculus: Session (GameSession) already exists, can't join twice

 

 

Why is the other headset always joining but trying to load a map that it can't load?

Server browser will show two players in the game, but the headset trying to join does nothing after a while it reloads the default map after it fails to join the wrong map.

The other headset will always see the other headsets ID, Player count set. But it wont see the correct map loaded and hosted and set to listen?

VintageGreen
Level 5

Still can't get it working I've copied all of the .uproject .ini etc.. info from the sample project and now my app is crashing on the headset

Working again after rolling back and resetting and rebuilding project
disabling steamVR caused crashing but deleting intermediate folder etc. and rebuilding fixed it

VintageGreen
Level 5

I've done 3 weeks of 24/7 testing, Join Session does not work atm, please need a solution or fixed source