Repository navigation
feat(package-api): let a Package create its own Accounts and Characters #625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
gateway/src/stdb/bindings/debug_create_package_character_reducer.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE | ||
| // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. | ||
|
|
||
| #![allow(unused, clippy::all)] | ||
| use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; | ||
|
|
||
| #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] | ||
| #[sats(crate = __lib)] | ||
| pub(super) struct DebugCreatePackageCharacterArgs { | ||
| pub package_name: String, | ||
| pub name: String, | ||
| pub race: u8, | ||
| pub class: u8, | ||
| } | ||
|
|
||
| impl From<DebugCreatePackageCharacterArgs> for super::Reducer { | ||
| fn from(args: DebugCreatePackageCharacterArgs) -> Self { | ||
| Self::DebugCreatePackageCharacter { | ||
| package_name: args.package_name, | ||
| name: args.name, | ||
| race: args.race, | ||
| class: args.class, | ||
| } | ||
| } | ||
| } | ||
|
|
||
| impl __sdk::InModule for DebugCreatePackageCharacterArgs { | ||
| type Module = super::RemoteModule; | ||
| } | ||
|
|
||
| #[allow(non_camel_case_types)] | ||
| /// Extension trait for access to the reducer `debug_create_package_character`. | ||
| /// | ||
| /// Implemented for [`super::RemoteReducers`]. | ||
| pub trait debug_create_package_character { | ||
| /// Request that the remote module invoke the reducer `debug_create_package_character` to run as soon as possible. | ||
| /// | ||
| /// This method returns immediately, and errors only if we are unable to send the request. | ||
| /// The reducer will run asynchronously in the future, | ||
| /// and this method provides no way to listen for its completion status. | ||
| /// /// Use [`debug_create_package_character:debug_create_package_character_then`] to run a callback after the reducer completes. | ||
| fn debug_create_package_character( | ||
| &self, | ||
| package_name: String, | ||
| name: String, | ||
| race: u8, | ||
| class: u8, | ||
| ) -> __sdk::Result<()> { | ||
| self.debug_create_package_character_then(package_name, name, race, class, |_, _| {}) | ||
| } | ||
|
|
||
| /// Request that the remote module invoke the reducer `debug_create_package_character` to run as soon as possible, | ||
| /// registering `callback` to run when we are notified that the reducer completed. | ||
| /// | ||
| /// This method returns immediately, and errors only if we are unable to send the request. | ||
| /// The reducer will run asynchronously in the future, | ||
| /// and its status can be observed with the `callback`. | ||
| fn debug_create_package_character_then( | ||
| &self, | ||
| package_name: String, | ||
| name: String, | ||
| race: u8, | ||
| class: u8, | ||
|
|
||
| callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>) | ||
| + Send | ||
| + 'static, | ||
| ) -> __sdk::Result<()>; | ||
| } | ||
|
|
||
| impl debug_create_package_character for super::RemoteReducers { | ||
| fn debug_create_package_character_then( | ||
| &self, | ||
| package_name: String, | ||
| name: String, | ||
| race: u8, | ||
| class: u8, | ||
|
|
||
| callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>) | ||
| + Send | ||
| + 'static, | ||
| ) -> __sdk::Result<()> { | ||
| self.imp.invoke_reducer_with_callback( | ||
| DebugCreatePackageCharacterArgs { | ||
| package_name, | ||
| name, | ||
| race, | ||
| class, | ||
| }, | ||
| callback, | ||
| ) | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Make the inventory heading match the new count.
Line 64 changes the recount comment to 287 tables. The heading at Line 57 still says "285 tables" and "128 public, 157 private". Update the heading so the document gives one count.
🤖 Prompt for AI Agents