clockworklabs / com.clockworklabs.spacetimedbsdk

The SpacetimeDB SDK for C# clients
https://spacetimedb.com
Apache License 2.0
6 stars 0 forks source link

Fix Reconnection Logic #167

Closed jdetter closed 1 month ago

jdetter commented 1 month ago

Description of Changes

Describe what has been changed, any new features or bug fixes

API

This is not an API break.

If the API is breaking, please state below what will break

Requires SpacetimeDB PRs

List any PRs here that are required for this SDK change to work

Testing

Write instructions for a test that you performed for this PR

public IEnumerator Reconnect() { yield return new WaitForSeconds(3.0f); // Reload the scene to cause a reconnection UnityEngine.SceneManagement.SceneManager.LoadScene("Scenes/SampleScene"); }


Previously, before this PR you would end up with:

Unhandled log message: '[Exception] InvalidOperationException: SpacetimeDBNetworkManager is a singleton and should only be attached once.'. Use UnityEngine.TestTools.LogAssert.Expect



After this PR it just works with no error.