Skip to content
This repository was archived by the owner on Aug 8, 2025. It is now read-only.

Commit f2e1fbd

Browse files
authored
Addressing Chippy's feedback (#8)
Co-authored-by: John Detter <[email protected]>
1 parent 91ace6a commit f2e1fbd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/Server Module Languages/C#/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ You could extend the validation in `ValidateMessage` in similar ways to `Validat
184184

185185
In C# modules, you can register for OnConnect and OnDisconnect events in a special initializer function that uses the attribute `ModuleInitializer`. We'll use the `OnConnect` event to create a `User` record for the client if it doesn't yet exist, and to set its online status.
186186

187-
We'll use `User.FilterByOwnerIdentity` to look up a `User` row for `dbEvent.Sender`, if one exists. If we find one, we'll use `User.UpdateByOwnerIdentity` to overwrite it with a row that has `Online: true`. If not, we'll use `User.Insert` to insert a new row for our new user. All three of these methods are generated by the `[SpacetimeDB.Table]` attribute, with rows and behavior based on the row attributes. `FilterByOwnerIdentity` returns a nullable `User`, because the unique constraint from the `[SpacetimeDB.Column(ColumnAttrs.PrimaryKey)]` attribute means there will be either zero or one matching rows. `Insert` will throw an exception if the insert violates this constraint; if we want to overwrite a `User` row, we need to do so explicitly using `UpdateByOwnerIdentity`.
187+
We'll use `User.FilterByIdentity` to look up a `User` row for `dbEvent.Sender`, if one exists. If we find one, we'll use `User.UpdateByIdentity` to overwrite it with a row that has `Online: true`. If not, we'll use `User.Insert` to insert a new row for our new user. All three of these methods are generated by the `[SpacetimeDB.Table]` attribute, with rows and behavior based on the row attributes. `FilterByIdentity` returns a nullable `User`, because the unique constraint from the `[SpacetimeDB.Column(ColumnAttrs.PrimaryKey)]` attribute means there will be either zero or one matching rows. `Insert` will throw an exception if the insert violates this constraint; if we want to overwrite a `User` row, we need to do so explicitly using `UpdateByIdentity`.
188188

189189
In `server/Lib.cs`, add the definition of the connect reducer to the `Module` class:
190190

docs/Unity Tutorial/Part 1 - Basic Multiplayer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ Now that we've written the code for our server module, we need to publish it to
355355

356356
```bash
357357
cd server
358-
spacetime publish unity-tutorial
358+
spacetime publish -c unity-tutorial
359359
```
360360

361361
If you get any errors from this command, double check that you correctly entered everything into `lib.rs`. You can also look at the Troubleshooting section at the end of this tutorial.

0 commit comments

Comments
 (0)