You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You've just set up your first database in SpacetimeDB! The next step would be to create a client module that interacts with this module. You can use any of SpacetimDB's supported client languages to do this. Take a look at the quick start guide for your client language of choice: [Rust](/docs/sdks/rust/quickstart), [C#](/docs/sdks/c-sharp/quickstart), or [TypeScript](/docs/sdks/typescript/quickstart).
314
+
You've just set up your first database in SpacetimeDB! You can find the full code for this client [in the C# server module example](https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk/tree/master/examples~/quickstart-chat/server).
315
+
316
+
The next step would be to create a client module that interacts with this module. You can use any of SpacetimDB's supported client languages to do this. Take a look at the quick start guide for your client language of choice: [Rust](/docs/sdks/rust/quickstart), [C#](/docs/sdks/c-sharp/quickstart), or [TypeScript](/docs/sdks/typescript/quickstart).
315
317
316
318
If you are planning to use SpacetimeDB with the Unity game engine, you can skip right to the [Unity Comprehensive Tutorial](/docs/unity/part-1).
Copy file name to clipboardExpand all lines: docs/sdks/c-sharp/quickstart.md
+10-5Lines changed: 10 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ using SpacetimeDB.Types;
71
71
usingSystem.Collections.Concurrent;
72
72
```
73
73
74
-
We will also need to create some global variables that will be explained when we use them later.
74
+
We will also need to create some global variables. We'll cover the `Identity` later in the `Save credentials` section. Later we'll also be setting up a second thread for handling user input. In the `Process thread` section we'll use this in the `ConcurrentQueue` to store the commands for that thread.
75
75
76
76
To `Program.cs`, add:
77
77
@@ -153,7 +153,7 @@ DbConnection ConnectToDB()
153
153
.WithToken(AuthToken.Token)
154
154
.OnConnect(OnConnected)
155
155
.OnConnectError(OnConnectError)
156
-
.OnDisconnect(OnDisconnect)
156
+
.OnDisconnect(OnDisconnected)
157
157
.Build();
158
158
returnconn;
159
159
}
@@ -198,12 +198,14 @@ To `Program.cs`, add:
198
198
199
199
```csharp
200
200
/// Our `OnDisconnect` callback: print a note, then exit the process.
201
-
voidOnDisconnect(DbConnectionconn, Exception?e)
201
+
voidOnDisconnected(DbConnectionconn, Exception?e)
202
202
{
203
203
if (e!=null)
204
204
{
205
205
Console.Write($"Disconnected abnormally: {e}");
206
-
} else {
206
+
}
207
+
else
208
+
{
207
209
Console.Write($"Disconnected normally.");
208
210
}
209
211
}
@@ -319,6 +321,9 @@ To `Program.cs`, add:
319
321
/// Our `Message.OnInsert` callback: print new messages.
// We are filtering out messages inserted during the subscription being applied,
325
+
// since we will be printing those in the OnSubscriptionApplied callback,
326
+
// where we will be able to first sort the messages before printing.
322
327
if (ctx.EventisnotEvent<Reducer>.SubscribeApplied)
323
328
{
324
329
PrintMessage(ctx.Db, insertedValue);
@@ -551,7 +556,7 @@ dotnet run --project client
551
556
552
557
Congratulations! You've built a simple chat app using SpacetimeDB.
553
558
554
-
You can find the full code for this client [in the C# client SDK's examples](https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk/tree/master/examples~/quickstart/client).
559
+
You can find the full code for this client [in the C# client SDK's examples](https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk/tree/master/examples~/quickstart-chat/client).
555
560
556
561
Check out the [C# client SDK Reference](/docs/sdks/c-sharp) for a more comprehensive view of the SpacetimeDB C# client SDK.
0 commit comments