Commit Graph

142 Commits

Author SHA1 Message Date
John Detter e32af97e35 Fixes after the rebase 2024-10-16 23:24:33 -05:00
John Detter bdaf6ebc83 Rebased network stats 2024-10-16 14:03:20 -05:00
John Detter 035ee4beb9 Revert PR 155 (#173)
## Description of Changes
*Describe what has been changed, any new features or bug fixes*

PR 155 introduced a build issue in Unity:


![image](https://github.com/user-attachments/assets/7e88a813-93bd-4b74-ad87-a4c821a7fb98)

This PR reverts back to a known working commit. I have tested after
reverting the commit and the branch is back to working properly.

## API

 - [ ] This is an API breaking change to the SDK

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

Not breaking

## 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*

- [x] Tested circle game against this commit and it builds + works

Co-authored-by: John Detter <no-reply@boppygames.gg>
2024-10-16 00:05:17 -05:00
Mazdak Farrokhzad 01a7e3f6e9 Add gzip + none compression algos and let SDK pick compression (#155)
## Description of Changes

Companion to https://github.com/clockworklabs/SpacetimeDB/pull/1802.

## Requires SpacetimeDB PRs

https://github.com/clockworklabs/SpacetimeDB/pull/1802
2024-10-15 19:47:40 +00:00
Jeremie Pelletier 1e13ab5b50 Jeremie/one off query decoupled from table (#163)
## Description of Changes
*Describe what has been changed, any new features or bug fixes*

## API

 - [ ] This is an API breaking change to the SDK

*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*

---------

Co-authored-by: John Detter <no-reply@boppygames.gg>
2024-10-12 10:40:26 -04:00
Zeke Foppa f376c05433 0.12.0 DLLs (again) (#161)
## Description of Changes
Update with the latest DLLs from the current 0.12.0 branch.

## API

 - [ ] This is an API breaking change to the SDK

*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*

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-10-03 21:43:39 -07:00
Jeremie Pelletier c3be5b08c3 Update to tests/examples follow codegen changes (#160)
## Description of Changes
*Describe what has been changed, any new features or bug fixes*

## API

 - [ ] This is an API breaking change to the SDK

*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*
2024-10-03 21:12:43 -07:00
John Detter d2143ccc88 Use SpacetimeDBNetworkManager everywhere (#157)
## Description of Changes
*Describe what has been changed, any new features or bug fixes*

## API

 - [ ] This is an API breaking change to the SDK

*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*

Co-authored-by: John Detter <no-reply@boppygames.gg>
2024-10-03 18:15:37 -07:00
John Detter 072d9ead84 Upgrade SDK Version to 0.12 (#156)
## Description of Changes
*Describe what has been changed, any new features or bug fixes*

- Upgrade version to 0.12.

## API

 - [ ] This is an API breaking change to the SDK

*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*

Co-authored-by: John Detter <no-reply@boppygames.gg>
2024-10-04 00:39:13 +00:00
Ingvar Stepanyan 2d20acd06e Fix UnityNetworkManager (#141)
This got broken when we switched to a new DbConnection API.

Keep track of all the active connections and update/destroy them from a
singleton game object. Fixes #134.

Marked as a draft for now, because it's untested and because we're not
yet sure that singleton for all connections as requested is the right
approach.

## Description of Changes
*Describe what has been changed, any new features or bug fixes*

## API

 - [ ] This is an API breaking change to the SDK

*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*

---------

Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
Co-authored-by: John Detter <no-reply@boppygames.gg>
2024-10-03 19:35:51 -05:00
Ingvar Stepanyan 434c5ffd8a Accept multiple queries in Subscribe (#153)
## Description of Changes

Turns out, we're not ready for single Subscribe per query, so bringing
back this ability.

## API

 - [ ] This is an API breaking change to the SDK

*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*

Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
2024-10-04 00:25:05 +00:00
Zeke Foppa b320e5ec58 Update DLLs for 0.12.0 (#152)
## Description of Changes
Updated the DLLs for 0.12.0 from the PR:
```
commit 0a7512d2a8db0dcff05aaee92f260e53d71cdc80 (HEAD -> release/v0.12.0-beta, origin/release/v0.12.0-beta)
Author: Zeke Foppa <bfops@users.noreply.github.com>
Date:   Thu Oct 3 09:35:27 2024 -0700

    [release/v0.12.0-beta]: Manually apply open PR #1707: c# client generate
```

## API

 - [ ] This is an API breaking change to the SDK

*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*

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
2024-10-03 23:31:14 +00:00
Jeremie Pelletier 1b0e843a98 Jeremie/remove break (#154)
## Description of Changes
*Describe what has been changed, any new features or bug fixes*

## API

 - [ ] This is an API breaking change to the SDK

*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*
2024-10-03 19:00:10 -04:00
Ingvar Stepanyan 2c95bee7b2 Try to catch flaky bugs (#150)
## Description of Changes

We have some flaky bug where Events are getting modified while we're
already iterating over them in the snapshot.

I think this might've been fixed by #144, but add extra checks just in
case so that the exception is thrown in a concrete event that causes it,
and not inside snapshot serialization.

## API

 - [ ] This is an API breaking change to the SDK

*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*
2024-10-03 17:17:06 +00:00
Ingvar Stepanyan 76d275f1b5 Remove obsolete tools folder (#149)
## Description of Changes

Not sure when or how this was added (it's not on master), but this
folder shouldn't be here - we have `tools~` instead.

## API

 - [ ] This is an API breaking change to the SDK

*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*
2024-10-03 17:13:59 +00:00
Zeke Foppa b96f1a6cd5 Fix gen-client-api scripts for new CLI API (#151)
## Description of Changes
The CLI arg changes in
https://github.com/clockworklabs/SpacetimeDB/pull/1741 broke these
scripts. This PR incorporates the param renames.

## API
No changes to how things are used.

## Requires SpacetimeDB PRs
I guess https://github.com/clockworklabs/SpacetimeDB/pull/1741

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-10-03 09:48:54 -07:00
Zeke Foppa affa2af7db Add script to generate nuget.config (#115)
## Description of Changes
Adds a utility script to generate `nuget.config` given a path to the
`SpacetimeDB` repo.

## API
No

## Requires SpacetimeDB PRs
None

## Testing
- [x] CI
- [x] Ran locally

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-10-03 13:03:29 +01:00
Ingvar Stepanyan fa87e36308 Don't actually try to connect to network in tests (#144)
## Description of Changes
*Describe what has been changed, any new features or bug fixes*

## API

 - [ ] This is an API breaking change to the SDK

*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*
2024-10-02 23:19:12 +00:00
Ingvar Stepanyan 9d3336e6f5 Reduce public API surface further (#145)
## Description of Changes
*Describe what has been changed, any new features or bug fixes*

## API

 - [x] This is an API breaking change to the SDK

*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*
2024-10-03 00:18:06 +01:00
Ingvar Stepanyan 463a240f45 Tighten package sources in C# smoketests (#133)
## Description of Changes

Same as https://github.com/clockworklabs/SpacetimeDB/pull/1735 but for
this repo.

## API

 - [ ] This is an API breaking change to the SDK

*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*
2024-10-02 22:52:03 +01:00
Ingvar Stepanyan cec6fb815a Fix UnityDebugLogger implementation (#143)
## Description of Changes

Without explicit reference these result in

> error CS0119: 'UnityDebugLogger.Debug(string)' is a method, which is
not valid in the given context

## API

 - [ ] This is an API breaking change to the SDK

*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*
2024-10-02 20:56:57 +00:00
Mazdak Farrokhzad b62a464384 Implement websocket changes atop C# sdk changes (#136)
## Requires SpacetimeDB PRs

This is the C# side of
https://github.com/clockworklabs/SpacetimeDB/pull/1761.
2024-10-02 17:18:24 +02:00
Ingvar Stepanyan cfd654f94c Hide more APIs (#140)
## Description of Changes

Removing unstable APIs that are not used by BitCraft; marking others
with [Obsolete] and renaming few others to match the proposal.

One exception is InternalCallReducer - it would need some further
changes to codegen; marking it as Obsolete right now would cause all
generated clients to show noisy warnings.

## API

 - [x] This is an API breaking change to the SDK

*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*
2024-10-01 20:00:32 +01:00
Jeremie Pelletier 113e8dd972 Add DbConnection argument to OnConnect (#138)
## Description of Changes
*Describe what has been changed, any new features or bug fixes*

## API

 - [ ] This is an API breaking change to the SDK

*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*
2024-10-01 13:02:54 -04:00
Ingvar Stepanyan 87a13eb74f Merge table cache into table handle (#139)
## Description of Changes

Merges cache into the table handle as suggested on the original PR +
hides most table methods that shouldn't be part of the stable API.

Few remaining methods will need a codegen change to be available only to
subclasses, so for now that's out of scope.

Same for merging ClientCache into RemoteTables - we shouldn't need a
separate collection, and instead could autogenerate a switch expression
over table name.

## API

 - [ ] This is an API breaking change to the SDK

*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*
2024-10-01 17:37:42 +01:00
Ingvar Stepanyan 5c033a4e4d Subscription API (#137)
## Description of Changes

Implements the subscription builder (at least, the parts that are
possible to implement).

## API

 - [ ] This is an API breaking change to the SDK

*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*
2024-10-01 16:17:45 +00:00
Jeremie Pelletier 76d30fedee c# client SDK (DbConnection + SDK Callbacks) (#131)
Implementation of the db connection proposal for C#

---------

Co-authored-by: Ingvar Stepanyan <me@rreverser.com>
2024-09-30 21:06:33 -04:00
SteveGibson 589d40480f Logging API (#132)
## Description of Changes
*Describe what has been changed, any new features or bug fixes*

Changed logging based on [this
proposal](https://github.com/clockworklabs/SpacetimeDBPrivate/pull/981)

## API

 - [x] This is an API breaking change to the SDK

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

Logging interface is different now. `Logger` has been renamed to `Log`,
and its methods have been renamed as well (ex. `Logger.LogError` is now
`Log.Error`)


## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*

---------

Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Co-authored-by: Jeremie Pelletier <jeremiep@gmail.com>
Co-authored-by: Steve Boytsun <steve@clockwokrlabs.io>
Co-authored-by: Ingvar Stepanyan <me@rreverser.com>
2024-09-23 13:52:50 -04:00
Zeke Foppa 6312c455f3 Copy files from old repo (#127)
## Description of Changes
For some reason, this repo was not quite properly synced up with the
state of
https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk-archive
after https://github.com/clockworklabs/spacetimedb-csharp-sdk/pull/117.

It's unclear to me how this happened, since the current state seems to
be compatible with 0.11, but the [0.11 release
commit/PR](https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk-archive/commit/382cce05fecbc00caf7c7d060fbde9a2854ad981)
also bumped the `package.json` version, which didn't happen in this
repo.

I re-copied files over. Fortunately, the only real changes were to
`package.json` and `README.md`.

## API
No breaking changes.

## Requires SpacetimeDB PRs
None

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-09-09 19:27:55 -05:00
Mazdak Farrokhzad 2422b8cce1 Nix Primitives.cs - types now defined in main repo (#120)
## Description of Changes

These types have been moved to the main repo, where they are used by
bindings-csharp as well.

## Requires SpacetimeDB PRs

- https://github.com/clockworklabs/SpacetimeDB/pull/1477

---------

Co-authored-by: Ingvar Stepanyan <me@rreverser.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-08-29 09:32:11 -07:00
Jeremie Pelletier 5670db6fe6 Update DEVELOP.md to reflect new codegen (#119)
Also ran it again, committing a few generation changes too :)
2024-08-29 09:32:11 -07:00
Zeke Foppa 341be7f582 Restore dotnet pack functionality (#118)
## Description of Changes
Single-line change so that `dotnet pack` stops complaining that nothing
was generated.

Per @RReverser this brings this package more in line with our other C#
packages.

## API
Nah nothing breaking.

## Requires SpacetimeDB PRs
Nope

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-08-29 09:32:11 -07:00
Mazdak Farrokhzad e57e5896ca Don't use BuiltinType.I/U128, use AlgebraicType.I/U128 (#116)
## Description of Changes

Required to make "SDK Tests" pass in
https://github.com/clockworklabs/SpacetimeDB/pull/1559.

## API

Not breaking.

## Requires SpacetimeDB PRs

- https://github.com/clockworklabs/SpacetimeDB/pull/1559

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-08-29 09:32:11 -07:00
Zeke Foppa e28849e22c Revert master to a stable state (#123)
## Description of Changes
Revert `master` to the original state of this PR:
https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk/issues/53.

We should prevent merging into `master` from now on, since the
repositories are now merged.

## API

 - [ ] This is an API breaking change to the SDK

*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
I loaded a bitcraft world and ran around.

I used the versions listed here:
https://github.com/clockworklabs/com.clockworklabs.spacetimedbsdk-archive/pull/57

---------

Co-authored-by: Ingvar Stepanyan <me@rreverser.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-08-29 12:21:48 -04:00
Ingvar Stepanyan cb59ebac99 Merge Unity SDK into C# SDK (#117)
## Description of Changes

This creates a frankenstein monster of a repo that is compatible with
both .NET / MSBuild as well as can be consumed as a Unity package.

- `.meta` files, Unity manifests and Unity README were copied over from
the Unity repo.
- `examples` and `tests` folders were renamed to `examples~` and
`tests~` correspondingly, as the `~` suffix is the only way to get
entire folders ignored by Unity.
- MSBuild was configured to change `bin` and `obj` to `bin~` and `obj~`
for the same reasons. This doesn't matter for the Git repo, but helpful
for local development where you don't want Unity to try and load local
DLL artifacts.
- NuGet was configured to restore Unity-compatible NuGet DLLs (and
delete others) in a local folder and committed to the repo - so, from
now on, we can easily update them by modifying `.csproj` and via
standard `dotnet restore` / `dotnet build`.

After this change, this repo should be compatible with both .NET CLI
(e.g. `dotnet test`) as well as consumable from Unity, but due to amount
of metadata changes, it needs further testing before we merge repos
properly.

Fixes #114.

## API

 - [ ] This is an API breaking change to the SDK

*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*

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-08-28 11:13:33 -07:00
Mazdak Farrokhzad 996633bebc Nix Primitives.cs - types now defined in main repo (#120)
## Description of Changes

These types have been moved to the main repo, where they are used by
bindings-csharp as well.

## Requires SpacetimeDB PRs

- https://github.com/clockworklabs/SpacetimeDB/pull/1477

---------

Co-authored-by: Ingvar Stepanyan <me@rreverser.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-08-13 21:02:39 +01:00
Jeremie Pelletier 2efa162ce9 Update DEVELOP.md to reflect new codegen (#119)
Also ran it again, committing a few generation changes too :)
2024-08-07 13:39:13 -04:00
Zeke Foppa 655c2ccb1d Restore dotnet pack functionality (#118)
## Description of Changes
Single-line change so that `dotnet pack` stops complaining that nothing
was generated.

Per @RReverser this brings this package more in line with our other C#
packages.

## API
Nah nothing breaking.

## Requires SpacetimeDB PRs
Nope

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-08-06 12:28:53 -07:00
Mazdak Farrokhzad 5394c639cd Don't use BuiltinType.I/U128, use AlgebraicType.I/U128 (#116)
## Description of Changes

Required to make "SDK Tests" pass in
https://github.com/clockworklabs/SpacetimeDB/pull/1559.

## API

Not breaking.

## Requires SpacetimeDB PRs

- https://github.com/clockworklabs/SpacetimeDB/pull/1559

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-08-06 12:06:17 -07:00
Ingvar Stepanyan 9fba1562ab Minor BSATN simplifications (#111)
## Description of Changes

Minor simplifications using BSATN helpers for Protobufectomy code.

Also removed unnecessary usings and a pattern.

## API

 - [ ] This is an API breaking change to the SDK

*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*
2024-07-29 12:20:25 +01:00
Zeke Foppa cd5f44b316 CI - push events only trigger on pushes to master (#110)
## Description of Changes
Currently, a push to a PR triggers our `dotnet` workflows twice: once
for the `push` event, and once for the `pull_request` event.

This PR brings the CI behavior in line with how SpacetimeDB does it.

(Someday we should reduce the number of `pull_request` events that
trigger this, but today is not that day).

---------

Co-authored-by: Zeke Foppa <github.com/bfops>
2024-07-26 15:40:03 +00:00
Ingvar Stepanyan 554df35b31 0.11 upgrades (#101)
## Description of Changes

- Roslyn codegen won't need to be added as a separate dependency
anymore.
- ByteArrayComparer, Identity, and Address will now live in
BSATN.Runtime so that they're reused between the client and module SDKs.

## API

 - [ ] This is an API breaking change to the SDK

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


## Requires SpacetimeDB PRs

- [x] https://github.com/clockworklabs/SpacetimeDB/pull/1440
- [ ] https://github.com/clockworklabs/SpacetimeDB/pull/1455

---------

Co-authored-by: Zeke Foppa <github.com/bfops>
2024-07-25 17:18:45 +01:00
Zeke Foppa 5e065065b5 CI - Use SpacetimeDB master when applicable (#108)
## Description of Changes
Our CI now uses the packages from SpacetimeDB's `master` branch when
applicable.

## Testing
- [x] CI passes in test PR merging in the 0.11 upgrades:
https://github.com/clockworklabs/spacetimedb-csharp-sdk/pull/109

---------

Co-authored-by: Zeke Foppa <github.com/bfops>
2024-07-24 21:46:07 +01:00
Jeremie Pelletier 706b945103 Revert breaking change in message preprocessing (#106)
## Description of Changes
*Describe what has been changed, any new features or bug fixes*

## API

 - [ ] This is an API breaking change to the SDK

*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*
2024-07-13 00:36:21 +08:00
Jeremie Pelletier 06285d3c06 Protobufectomy: c# sdk (#104)
## Description of Changes

- Removed JSON support (similar to changes being made on the TypeScript
side)
- Removed all references to protobuf
- Swapped the protobuf codegen for the output of our own C# codegen in
rust
- Refactored the connection class to reflect the API changes from
protobuf to bsatn
- Updated the example to reflect these changes

## API

 - [ ] This is an API breaking change to the SDK

Changes the SDK types passed into event handlers.


## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*
2024-07-11 13:40:32 -04:00
Ingvar Stepanyan 7e8a6ed876 Update test snapshots 2024-06-17 21:05:18 +01:00
Ingvar Stepanyan 27120e8242 Move Verify converters around 2024-06-17 11:50:42 +01:00
Ingvar Stepanyan 9c01734a1e Simplify Identity scrubbing 2024-06-17 11:48:04 +01:00
Ingvar Stepanyan e345452304 Fix formatting 2024-06-15 23:43:06 +01:00
Ingvar Stepanyan 21e475b1cc Add Stats snapshot 2024-06-15 23:40:38 +01:00