UnrealGDK
UnrealGDK copied to clipboard
Error when GameModeBase::PreLogin returns ErrorMessage
We are accepting issues and we want your feedback.
Description
When you return an ErrorMessage from GameMode::PreLogin (it's non-empty), SpatialOS doesn't account for it in SpatialReceiver::ReceiveActor where it called NetDriver->AcceptNewPlayer. AcceptNewPlayer returns null if the Error is present, as SpatialOS has an assertion at the next line that it's not null!
Expected behavior
SpatialOS should allow for errors in PreLogin (see SpatialNetDriver::AcceptNewPlayer). There appears to be a note there already referencing UNR-584?
Current behavior
Assertion failure.
Possible solution
For now just gracefully close the connection, with a note in future that the calling client should be sent the error itself.
Steps to reproduce
- Set the
ErrorMessageinPreLoginto anything (non empty) in the shooter example. - Start PIE.
Environment
4.21.1 custom spatial release branch, using release branch of GDK.