Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/bindings-cpp/include/spacetimedb/bsatn/DEVELOP.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Core bsatn library

These files here are being used by both the Unreal C++ Client SDK and the Module Library.
These files are the main files. The SDK do not use these files directly becouse a user might move the SDK plugin to the unreal engine plugin direcory or the unreal project directory.
These files are the main files. The SDK do not use these files directly because a user might move the SDK plugin to the unreal engine plugin directory or the unreal project directory.
All changed made in one of the files should copied over to the SDK.

SDK bsatn path: "crates\sdk-unreal\SpacetimeDBSdk\Source\SpacetimeDBSdk\Public\BSATN"
6 changes: 3 additions & 3 deletions crates/bindings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
└───────────────────────┘ └───────────────────────┘
```

Rust modules are written with the the Rust Module Library (this crate). They are built using [cargo](https://doc.rust-lang.org/cargo/) and deployed using the [`spacetime` CLI tool](https://spacetimedb.com/install). Rust modules can import any Rust [crate](https://crates.io/) that supports being compiled to WebAssembly.
Rust modules are written with the Rust Module Library (this crate). They are built using [cargo](https://doc.rust-lang.org/cargo/) and deployed using the [`spacetime` CLI tool](https://spacetimedb.com/install). Rust modules can import any Rust [crate](https://crates.io/) that supports being compiled to WebAssembly.

(Note: Rust can also be used to write **clients** of SpacetimeDB databases, but this requires using a different library, the SpacetimeDB Rust Client SDK. See the documentation on [clients] for more information.)

Expand Down Expand Up @@ -127,12 +127,12 @@ pub fn init(_ctx: &ReducerContext) {

#[spacetimedb::reducer(client_connected)]
pub fn identity_connected(_ctx: &ReducerContext) {
// Called everytime a new client connects
// Called every time a new client connects
}

#[spacetimedb::reducer(client_disconnected)]
pub fn identity_disconnected(_ctx: &ReducerContext) {
// Called everytime a client disconnects
// Called every time a client disconnects
}

#[spacetimedb::reducer]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ Modules themselves also have Identities. When you `spacetime publish` a module,

Identities are issued using the [OpenID Connect](https://openid.net/developers/how-connect-works/) specification. Database developers are responsible for issuing Identities to their end users. OpenID Connect lets users log in to these accounts through standard services like Google and Facebook.

Specifically, an identity is derived from the issuer and subject fields of a [JSON Web Token (JWT)](https://jwt.io/) hashed together. The psuedocode for this is as follows:
Specifically, an identity is derived from the issuer and subject fields of a [JSON Web Token (JWT)](https://jwt.io/) hashed together. The pseudocode for this is as follows:

```python
def identity_from_claims(issuer: str, subject: str) -> [u8; 32]:
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/00100-intro/00300-tutorials/00100-chat-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -2440,7 +2440,7 @@ fn on_connected(_ctx: &DbConnection, _identity: Identity, token: &str) {

#### Handle errors and disconnections

We need to handle connection errors and disconnections by printing appropriate messages and exiting the program. These callbacks take an `ErrorContext`, a `DbConnection` that's been augmented with information about the error that occured.
We need to handle connection errors and disconnections by printing appropriate messages and exiting the program. These callbacks take an `ErrorContext`, a `DbConnection` that's been augmented with information about the error that occurred.

To `src/main.rs`, add:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ Just update your module by publishing and you're on your way eating food! Try to

We didn't even have to update the client, because our client's `OnDelete` callbacks already handled deleting entities from the scene when they're deleted on the server. SpacetimeDB just synchronizes the state with your client automatically.

Notice that the food automatically respawns as you vaccuum them up. This is because our scheduled reducer is automatically replacing the food 2 times per second, to ensure that there is always close to 600 food on the map.
Notice that the food automatically respawns as you vacuum them up. This is because our scheduled reducer is automatically replacing the food 2 times per second, to ensure that there is always close to 600 food on the map.

## Connecting to Maincloud

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2266,7 +2266,7 @@ Add **Function** named `SpawnOrGetPlayer` as follows:

With the functions and variables in place next we'll expand the **EventGraph**:

Extened **OnConnect_Event** as follows:
Extended **OnConnect_Event** as follows:
![Update OnConnect_Event](/images/unreal/part-3-03-blueprint-gamemanager-4.png)
![Update OnConnect_Event](/images/unreal/part-3-03-blueprint-gamemanager-5.png)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ Just update your module by publishing and you're on your way eating food! Try to

We didn't even have to update the client, because our client's `OnDelete` callbacks already handled deleting entities from the scene when they're deleted on the server. SpacetimeDB just synchronizes the state with your client automatically.

Notice that the food automatically respawns as you vaccuum them up. This is because our scheduled reducer is automatically replacing the food 2 times per second, to ensure that there is always 600 food on the map.
Notice that the food automatically respawns as you vacuum them up. This is because our scheduled reducer is automatically replacing the food 2 times per second, to ensure that there is always 600 food on the map.

## Connecting to Maincloud

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Click "Create" to generate the blank project.
We will add the SpacetimeDB SDK using NuGet. Godot does not initialize a C# Project when creating a new Godot project, so we need to create a C# Script first to initialize our Godot C# Project.

1. **Right-click** in the **FileSystem** dock, then select `New Script`.
2. Select `C#` in **Lanugage** and name it `GameManager`. We will use this script later to put the high level initialization and coordination logic for our game.
2. Select `C#` in **Language** and name it `GameManager`. We will use this script later to put the high level initialization and coordination logic for our game.

![Create GameManager Script](/images/godot/part-1-game-manager-script.png)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,7 @@ public partial class CircleController : EntityController

At the top, we're just defining some possible colors for our circle. We've also created a constructor which takes a `Circle` (same type that's in our `circle` table) and a `PlayerController` which selects a color based on the circle's player Id, as well as setting up the text to show the player's username.

To show crisp text underneath each cirlce, we lazyly create a global `CanvasLayer` and a `Control` node to have a UI context where we can add labels for each circle. In the `_Process` method, we call `UpdateScreenLabelPosition` to update the Label's position relative to the circle position and radius.
To show crisp text underneath each circle, we lazily create a global `CanvasLayer` and a `Control` node to have a UI context where we can add labels for each circle. In the `_Process` method, we call `UpdateScreenLabelPosition` to update the Label's position relative to the circle position and radius.

Note that the `CircleController` inherits from the `EntityController`.

Expand Down Expand Up @@ -1338,7 +1338,7 @@ public partial class PlayerController : Node
}
```

Let's also create a new `Instantiator.cs` script that we can use as a factory to instanciate and update nodes when our database changes. Replace the contents of the file with:
Let's also create a new `Instantiator.cs` script that we can use as a factory to instantiate and update nodes when our database changes. Replace the contents of the file with:

```csharp
using System.Collections.Generic;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ Just update your module by publishing and you're on your way eating food! Try to

We didn't even have to update the client, because our client's `OnDelete` callbacks already handled deleting entities from the scene when they're deleted on the server. SpacetimeDB just synchronizes the state with your client automatically.

Notice that the food automatically respawns as you vaccuum them up. This is because our scheduled reducer is automatically replacing the food 2 times per second, to ensure that there is always close to 600 food on the map.
Notice that the food automatically respawns as you vacuum them up. This is because our scheduled reducer is automatically replacing the food 2 times per second, to ensure that there is always close to 600 food on the map.

## Connecting to Maincloud

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ SPACETIMEDB_CLIENT_CONNECTED(restrict_auth_provider_connect, ReducerContext ctx)

If you want to access additional claims that aren't available via helper functions, you can parse the full JWT payload. This is useful for handling custom or application-specific claims.

As an example, let's say that your tokens have a "roles" claim, which is a list of priviledges. If you want to make sure that only users with the `admin` role are able to call a certain reducer, you could do the following:
As an example, let's say that your tokens have a "roles" claim, which is a list of privileges. If you want to make sure that only users with the `admin` role are able to call a certain reducer, you could do the following:

<Tabs groupId="server-language" defaultValue="rust">
<TabItem value="typescript" label="TS">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ All [`DbContext`](#trait-dbcontext) implementors, including [`DbConnection`](#ty
Each reducer defined by the module has three methods on the `.reducers`:

- An invoke method, whose name is the reducer's name converted to snake case, like `set_name`. This requests that the module run the reducer.
- A callback registation method, whose name is prefixed with `on_`, like `on_set_name`. This registers a callback to run whenever we are notified that the reducer ran, including successfully committed runs and runs we requested which failed. This method returns a callback id, which can be passed to the callback remove method.
- A callback registration method, whose name is prefixed with `on_`, like `on_set_name`. This registers a callback to run whenever we are notified that the reducer ran, including successfully committed runs and runs we requested which failed. This method returns a callback id, which can be passed to the callback remove method.
- A callback remove method, whose name is prefixed with `remove_on_`, like `remove_on_set_name`. This cancels a callback previously registered via the callback registration method.

## Identify a client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ All [`DbContext`](#interface-dbcontext) implementors, including [`DbConnection`]
Each reducer defined by the module has three methods on the `.reducers`:

- An invoke method, whose name is the reducer's name converted to camel case, like `setName`. This requests that the module run the reducer. It returns a `Promise<void>` which rejects with `SenderError` if the reducer fails, so `await` it in a `try`/`catch` to handle errors.
- A callback registation method, whose name is prefixed with `on`, like `onSetName`. This registers a callback to run whenever we are notified that the reducer ran, including successfully committed runs and runs we requested which failed. This method returns a callback id, which can be passed to the callback remove method.
- A callback registration method, whose name is prefixed with `on`, like `onSetName`. This registers a callback to run whenever we are notified that the reducer ran, including successfully committed runs and runs we requested which failed. This method returns a callback id, which can be passed to the callback remove method.
- A callback remove method, whose name is prefixed with `removeOn`, like `removeOnSetName`. This cancels a callback previously registered via the callback registration method.

For example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ const PLAYER_FILTER: Filter = Filter::Sql(
RLS rules automatically apply to subscriptions so that if a client subscribes to a table with RLS filters,
the subscription will only return rows that the client is allowed to see.

While the contraints and limitations outlined in the [reference docs] do not apply to RLS rules,
While the constraints and limitations outlined in the [reference docs] do not apply to RLS rules,
they do apply to the subscriptions that use them.
For example, it is valid for an RLS rule to have more joins than are supported by subscriptions.
However a client will not be able to subscribe to the table for which that rule is defined.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const LOG_LEVEL_TRACE: u8 = 4;
/// a fatal error causes the WASM module to trap.
const LOG_LEVEL_PANIC: u8 = 101;

/// Log at `level` a `text` message occuring in `filename:line_number`
/// Log at `level` a `text` message occurring in `filename:line_number`
/// with `target` being the module path at the `log!` invocation site.
///
/// These various pointers are interpreted lossily as UTF-8 strings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ SELECT * FROM Inventory WHERE price > {X} AND amount < {Y}
SELECT projection FROM relation [ WHERE predicate ] [LIMIT NUM]
```

The query languge is a strict superset of the subscription language.
The query language is a strict superset of the subscription language.
The main differences are seen in column projections and [joins](#from-clause).

The subscription api only supports `*` projections,
Expand Down Expand Up @@ -354,7 +354,7 @@ the Spacetime Algebraic Type System.
Spacetime SQL however does not support all of SATS,
specifically in the way of product and sum types.
The language itself does not provide a way to construct them,
nore does it provide any scalar operators for them.
nor does it provide any scalar operators for them.
Nevertheless rows containing them can be returned to clients.

## Literals
Expand Down
2 changes: 1 addition & 1 deletion sdks/unreal/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ If you have started with the [Rust Module Quickstart](https://spacetimedb.com/do

## How to Use the Quickstart Chat Example

1. Follow the instructions in `Develop.md` in in "sdk-unreal" directory to integrate the `SpacetimeDbSdk` plugin into your project.
1. Follow the instructions in `DEVELOP.md` in the `sdks/unreal` directory to integrate the `SpacetimeDbSdk` plugin into your project.
2. Launch the project in Unreal Engine.
3. Create a new level. Press add in the Content Browser, then select "Level" to create a new level.
- Alternatively, you can open an existing level if you already have one.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Core bsatn library

These files here are being used by both the Unreal C++ Client SDK and the Module Library.
These files are noy the main files. The SDK do not use these files directly becouse a user might move the SDK plugin to the unreal engine plugin direcory or the unreal project directory.
These files are not the main files. The SDK do not use these files directly because a user might move the SDK plugin to the unreal engine plugin directory or the unreal project directory.
Make all changed in the core library and copy them here.

Core path: "crates\bindings-cpp\include\spacetimedb\bsatn"
2 changes: 1 addition & 1 deletion templates/chat-react-ts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This is a simple chat application that demonstrates how to use SpacetimeDB with

It is based directly on the plain React + TypeScript + Vite template. You can follow the quickstart guide for how creating this project from scratch at [SpacetimeDB TypeScript Quickstart](https://spacetimedb.com/docs/sdks/typescript/quickstart).

You can follow the instructions for creating your own SpacetimeDB module here: [SpacetimeDB Rust Module Quickstart](https://spacetimedb.com/docs/modules/rust/quickstart). Place the module in the `quickstart-chat/server` directory for compability with this project.
You can follow the instructions for creating your own SpacetimeDB module here: [SpacetimeDB Rust Module Quickstart](https://spacetimedb.com/docs/modules/rust/quickstart). Place the module in the `quickstart-chat/server` directory for compatibility with this project.

In order to run this example, you need to:

Expand Down