Skip to content

Commit a9f8bef

Browse files
Merge pull request #2 from clockworklabs/jdetter/some-api-updates2
More API updates
2 parents 583b612 + 9143a4f commit a9f8bef

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

Assets/SpacetimeDB/Scripts/NetworkManager.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private struct DbEvent
4747
/// <summary>
4848
/// Called when a connection attempt fails.
4949
/// </summary>
50-
public event Action<WebSocketError> onConnectError;
50+
public event Action<WebSocketError?> onConnectError;
5151

5252
/// <summary>
5353
/// Called when a connection that was established has disconnected.
@@ -74,13 +74,10 @@ private struct DbEvent
7474
/// </summary>
7575
public event Action<ClientApi.Event> onEvent;
7676

77-
private WebSocketDispatch.WebSocket webSocket;
77+
private SpacetimeDB.WebSocket webSocket;
7878
private bool connectionClosed;
7979
public static ClientCache clientDB;
8080

81-
private float? lastClientTick;
82-
public static float clientTickInterval;
83-
8481
private Thread messageProcessThread;
8582

8683
public static NetworkManager instance;
@@ -95,16 +92,17 @@ protected void Awake()
9592

9693
instance = this;
9794

98-
var options = new WebSocketDispatch.ConnectOptions
95+
var options = new SpacetimeDB.ConnectOptions
9996
{
10097
//v1.bin.spacetimedb
10198
//v1.text.spacetimedb
10299
Protocol = "v1.bin.spacetimedb",
103100
};
104-
webSocket = new WebSocketDispatch.WebSocket(options);
101+
webSocket = new SpacetimeDB.WebSocket(options);
105102
webSocket.OnMessage += OnMessageReceived;
106103
webSocket.OnClose += (code, error) => onDisconnect?.Invoke(code, error);
107104
webSocket.OnConnect += () => onConnect?.Invoke();
105+
webSocket.OnConnectError += a => onConnectError?.Invoke(a);
108106

109107
clientDB = new ClientCache();
110108

Assets/SpacetimeDB/Scripts/WebSocket.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using System.Threading.Tasks;
88
using UnityEngine;
99

10-
namespace WebSocketDispatch
10+
namespace SpacetimeDB
1111
{
1212
internal abstract class MainThreadDispatch
1313
{

0 commit comments

Comments
 (0)