Improbable Icon

Improvements to connection behaviour in 11.0.2


#1

11.0.2 was released today, and it includes a major bugfix to the connection failure behaviour. If you’re upgrading to 11.0.2, you might want to take a look and check that you’re not relying on the old broken behaviour.

Unity SDK:

  • Before: when SpatialOS.Connect() failed, it incorrectly triggered the callbacks registered to both OnConnected and OnDisconnected.
  • Now: when SpatialOS.Connect() fails, it only triggers callbacks registered to the new OnFailedConnection.

Unreal SDK:

  • Before: when USpatialOS::Connect() failed, it incorrectly triggered the callbacks registered to OnDisconnected.
  • Now: when USpatialOS::Connect() fails, it triggers callbacks registered to OnFailedConnection.

To switch over to the new behaviour, take a look at where you’re using OnConnected and OnDisconnected. In these places:

  • Move any things you want called when .Connect() fails to OnFailedConnection.
  • Check that only things you want called when .Connect() succeeds are registered to OnConnected.
  • Check that only the things you want called on .Disconnect() are registered to OnDisconnected.

Shout out to our awesome intern @paulbalaji for fixing this up :sparkles: