Skip to content
Merged
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 backend/brico-bot/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# ── prism's relay-module (the BitCraft read-mirror) ──────────────────────────
#BRICO_RELAY_HOST=http://127.0.0.1:3000
#BRICO_RELAY_MODULE=prism-relay
#BRICO_RELAY_MODULE=prism-release

# ── brico-app (brico's own module) ───────────────────────────────────────────
#BRICO_APP_ENABLED=1
Expand Down
1 change: 1 addition & 0 deletions common/bindings/prism/craft_meta_table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ export default __t.row({
get status() {
return CraftStatus;
},
buildingDescId: __t.i32().name("building_desc_id"),
});
170 changes: 152 additions & 18 deletions common/bindings/prism/index.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.

// This was generated using spacetimedb cli version 2.9.0 (commit 9e0d92412ff2248f401a8ad12d535f2b5ac30912).
// This was generated using spacetimedb cli version 2.14.0 (commit 7c3ee551755dc0152d9e0b0d5241fff939d3eda0).

/* eslint-disable */
/* tslint:disable */
import {
DbConnectionBuilder as __DbConnectionBuilder,
type DbConnectionConfig as __DbConnectionConfig,
DbConnectionImpl as __DbConnectionImpl,
type ErrorContextInterface as __ErrorContextInterface,
type EventContextInterface as __EventContextInterface,
makeQueryBuilder as __makeQueryBuilder,
procedures as __procedures,
type QueryBuilder as __QueryBuilder,
type ReducerEventContextInterface as __ReducerEventContextInterface,
reducers as __reducers,
type RemoteModule as __RemoteModule,
schema as __schema,
SubscriptionBuilderImpl as __SubscriptionBuilderImpl,
type SubscriptionEventContextInterface as __SubscriptionEventContextInterface,
type SubscriptionHandleImpl as __SubscriptionHandleImpl,
table as __table,
DbConnectionBuilder as __DbConnectionBuilder,
type DbConnectionConfig as __DbConnectionConfig,
DbConnectionImpl as __DbConnectionImpl,
type ErrorContextInterface as __ErrorContextInterface,
type EventContextInterface as __EventContextInterface,
makeQueryBuilder as __makeQueryBuilder,
procedures as __procedures,
type QueryBuilder as __QueryBuilder,
type ReducerEventContextInterface as __ReducerEventContextInterface,
reducers as __reducers,
type RemoteModule as __RemoteModule,
schema as __schema,
SubscriptionBuilderImpl as __SubscriptionBuilderImpl,
type SubscriptionEventContextInterface as __SubscriptionEventContextInterface,
type SubscriptionHandleImpl as __SubscriptionHandleImpl,
table as __table,
} from "spacetimedb";

// Import all reducer arg schemas
Expand All @@ -42,6 +42,11 @@ import PlayerStateRow from "./player_state_table";
import RecipeMetaRow from "./recipe_meta_table";
import RegionRow from "./region_table";
import ResourceLocationRow from "./resource_location_table";
import ShopInfoRow from "./shop_info_table";
import ShopInventoryRow from "./shop_inventory_table";
import TradeEventHistoryRow from "./trade_event_history_table";
import TradeEventRow from "./trade_event_table";
import TradeOrderRow from "./trade_order_table";

/** Type-only namespace exports for generated type groups. */

Expand Down Expand Up @@ -146,6 +151,9 @@ const tablesSchema = __schema({
{ accessor: 'by_owner', name: 'craft_meta_owner_entity_id_idx_btree', algorithm: 'btree', columns: [
'ownerEntityId',
] },
{ accessor: 'by_region', name: 'craft_meta_region_id_idx_btree', algorithm: 'btree', columns: [
'regionId',
] },
],
constraints: [
{ name: 'craft_meta_entity_id_key', constraint: 'unique', columns: ['entityId'] },
Expand Down Expand Up @@ -289,6 +297,97 @@ const tablesSchema = __schema({
{ name: 'resource_location_entity_id_key', constraint: 'unique', columns: ['entityId'] },
],
}, ResourceLocationRow),
shopInfo: __table({
name: 'shop_info',
indexes: [
{ accessor: 'by_claim', name: 'shop_info_claim_entity_id_idx_btree', algorithm: 'btree', columns: [
'claimEntityId',
] },
{ accessor: 'by_owner', name: 'shop_info_player_owner_id_idx_btree', algorithm: 'btree', columns: [
'playerOwnerId',
] },
{ accessor: 'by_region', name: 'shop_info_region_id_idx_btree', algorithm: 'btree', columns: [
'regionId',
] },
{ accessor: 'shop_entity_id', name: 'shop_info_shop_entity_id_idx_btree', algorithm: 'btree', columns: [
'shopEntityId',
] },
],
constraints: [
{ name: 'shop_info_shop_entity_id_key', constraint: 'unique', columns: ['shopEntityId'] },
],
}, ShopInfoRow),
shopInventory: __table({
name: 'shop_inventory',
indexes: [
{ accessor: 'by_region', name: 'shop_inventory_region_id_idx_btree', algorithm: 'btree', columns: [
'regionId',
] },
{ accessor: 'shop_entity_id', name: 'shop_inventory_shop_entity_id_idx_btree', algorithm: 'btree', columns: [
'shopEntityId',
] },
],
constraints: [
{ name: 'shop_inventory_shop_entity_id_key', constraint: 'unique', columns: ['shopEntityId'] },
],
}, ShopInventoryRow),
tradeEvent: __table({
name: 'trade_event',
indexes: [
{ accessor: 'by_claim', name: 'trade_event_claim_entity_id_idx_btree', algorithm: 'btree', columns: [
'claimEntityId',
] },
{ accessor: 'id', name: 'trade_event_id_idx_btree', algorithm: 'btree', columns: [
'id',
] },
{ accessor: 'by_region', name: 'trade_event_region_id_idx_btree', algorithm: 'btree', columns: [
'regionId',
] },
{ accessor: 'by_shop', name: 'trade_event_shop_entity_id_idx_btree', algorithm: 'btree', columns: [
'shopEntityId',
] },
],
constraints: [
{ name: 'trade_event_id_key', constraint: 'unique', columns: ['id'] },
],
}, TradeEventRow),
tradeEventHistory: __table({
name: 'trade_event_history',
indexes: [
{ accessor: 'by_claim', name: 'trade_event_history_claim_entity_id_idx_btree', algorithm: 'btree', columns: [
'claimEntityId',
] },
{ accessor: 'id', name: 'trade_event_history_id_idx_btree', algorithm: 'btree', columns: [
'id',
] },
{ accessor: 'by_region', name: 'trade_event_history_region_id_idx_btree', algorithm: 'btree', columns: [
'regionId',
] },
{ accessor: 'by_shop', name: 'trade_event_history_shop_entity_id_idx_btree', algorithm: 'btree', columns: [
'shopEntityId',
] },
],
constraints: [
{ name: 'trade_event_history_id_key', constraint: 'unique', columns: ['id'] },
],
}, TradeEventHistoryRow),
tradeOrder: __table({
name: 'trade_order',
indexes: [
{ accessor: 'id', name: 'trade_order_id_idx_hash', algorithm: 'btree', columns: [
'id',
] },
{ accessor: 'by_region', name: 'trade_order_region_id_idx_btree', algorithm: 'btree', columns: [
'regionId',
] },
{ accessor: 'by_shop', name: 'trade_order_shop_entity_id_idx_btree', algorithm: 'btree', columns: [
'shopEntityId',
] },
],
constraints: [
{ name: 'trade_order_id_key', constraint: 'unique', columns: ['id'] },
],
}, TradeOrderRow),
});

/** The schema information for all reducers in this module. This is defined the same way as the reducers would have been defined in the server, except the body of the reducer is omitted in code generation. */
Expand Down Expand Up @@ -329,13 +428,23 @@ type __SchemaWithTableAccessorAliases = Omit<typeof tablesSchema.schemaType, "ta
readonly "recipe_meta": Omit<typeof tablesSchema.schemaType.tables["recipeMeta"], "accessorName"> & { readonly accessorName: "recipe_meta" };
/** @deprecated Use `resourceLocation` instead. This alias will be removed in the next major version. */
readonly "resource_location": Omit<typeof tablesSchema.schemaType.tables["resourceLocation"], "accessorName"> & { readonly accessorName: "resource_location" };
/** @deprecated Use `shopInfo` instead. This alias will be removed in the next major version. */
readonly "shop_info": Omit<typeof tablesSchema.schemaType.tables["shopInfo"], "accessorName"> & { readonly accessorName: "shop_info" };
/** @deprecated Use `shopInventory` instead. This alias will be removed in the next major version. */
readonly "shop_inventory": Omit<typeof tablesSchema.schemaType.tables["shopInventory"], "accessorName"> & { readonly accessorName: "shop_inventory" };
/** @deprecated Use `tradeEvent` instead. This alias will be removed in the next major version. */
readonly "trade_event": Omit<typeof tablesSchema.schemaType.tables["tradeEvent"], "accessorName"> & { readonly accessorName: "trade_event" };
/** @deprecated Use `tradeEventHistory` instead. This alias will be removed in the next major version. */
readonly "trade_event_history": Omit<typeof tablesSchema.schemaType.tables["tradeEventHistory"], "accessorName"> & { readonly accessorName: "trade_event_history" };
/** @deprecated Use `tradeOrder` instead. This alias will be removed in the next major version. */
readonly "trade_order": Omit<typeof tablesSchema.schemaType.tables["tradeOrder"], "accessorName"> & { readonly accessorName: "trade_order" };
};
};

/** The remote SpacetimeDB module schema, both runtime and type information. */
const REMOTE_MODULE = {
versionInfo: {
cliVersion: "2.9.0" as const,
cliVersion: "2.14.0" as const,
},
tables: tablesSchema.schemaType.tables as __SchemaWithTableAccessorAliases["tables"],
reducers: reducersSchema.reducersType.reducers,
Expand All @@ -361,6 +470,11 @@ const tableAccessorAliases = {
"player_state": "playerState",
"recipe_meta": "recipeMeta",
"resource_location": "resourceLocation",
"shop_info": "shopInfo",
"shop_inventory": "shopInventory",
"trade_event": "tradeEvent",
"trade_event_history": "tradeEventHistory",
"trade_order": "tradeOrder",
} as const;

function __withTableAccessorAliases<T extends object>(target: T, freeze = false): T {
Expand Down Expand Up @@ -409,6 +523,16 @@ export type DbView = __DbViewBase & {
readonly "recipe_meta": __DbViewBase["recipeMeta"];
/** @deprecated Use `resourceLocation` instead. This alias will be removed in the next major version. */
readonly "resource_location": __DbViewBase["resourceLocation"];
/** @deprecated Use `shopInfo` instead. This alias will be removed in the next major version. */
readonly "shop_info": __DbViewBase["shopInfo"];
/** @deprecated Use `shopInventory` instead. This alias will be removed in the next major version. */
readonly "shop_inventory": __DbViewBase["shopInventory"];
/** @deprecated Use `tradeEvent` instead. This alias will be removed in the next major version. */
readonly "trade_event": __DbViewBase["tradeEvent"];
/** @deprecated Use `tradeEventHistory` instead. This alias will be removed in the next major version. */
readonly "trade_event_history": __DbViewBase["tradeEventHistory"];
/** @deprecated Use `tradeOrder` instead. This alias will be removed in the next major version. */
readonly "trade_order": __DbViewBase["tradeOrder"];
};

type __TablesBase = __QueryBuilder<typeof tablesSchema.schemaType>;
Expand Down Expand Up @@ -441,6 +565,16 @@ export type Tables = __TablesBase & {
readonly "recipe_meta": __TablesBase["recipeMeta"];
/** @deprecated Use `resourceLocation` instead. This alias will be removed in the next major version. */
readonly "resource_location": __TablesBase["resourceLocation"];
/** @deprecated Use `shopInfo` instead. This alias will be removed in the next major version. */
readonly "shop_info": __TablesBase["shopInfo"];
/** @deprecated Use `shopInventory` instead. This alias will be removed in the next major version. */
readonly "shop_inventory": __TablesBase["shopInventory"];
/** @deprecated Use `tradeEvent` instead. This alias will be removed in the next major version. */
readonly "trade_event": __TablesBase["tradeEvent"];
/** @deprecated Use `tradeEventHistory` instead. This alias will be removed in the next major version. */
readonly "trade_event_history": __TablesBase["tradeEventHistory"];
/** @deprecated Use `tradeOrder` instead. This alias will be removed in the next major version. */
readonly "trade_order": __TablesBase["tradeOrder"];
};

/** The tables available in this remote SpacetimeDB module. Each table reference doubles as a query builder. */
Expand Down
19 changes: 19 additions & 0 deletions common/bindings/prism/shop_info_table.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.

/* eslint-disable */
/* tslint:disable */
import {t as __t,} from "spacetimedb";
import {ShopType,} from "./types";


export default __t.row({
shopEntityId: __t.u64().primaryKey().name("shop_entity_id"),
regionId: __t.u8().name("region_id"),
claimEntityId: __t.u64().name("claim_entity_id"),
shopName: __t.string().name("shop_name"),
playerOwnerId: __t.u64().name("player_owner_id"),
get shopType() {
return ShopType.name("shop_type");
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
/* eslint-disable */
/* tslint:disable */
import {t as __t,} from "spacetimedb";
import {Pocket,} from "./types";


export default __t.row({
id: __t.u64().primaryKey(),
accountId: __t.u64().name("account_id"),
label: __t.string(),
createdBy: __t.identity().name("created_by"),
createdAt: __t.timestamp().name("created_at"),
shopEntityId: __t.u64().primaryKey().name("shop_entity_id"),
regionId: __t.u8().name("region_id"),
get pockets() {
return __t.array(Pocket);
},
cargoIndex: __t.u32().name("cargo_index"),
});
30 changes: 30 additions & 0 deletions common/bindings/prism/trade_event_history_table.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.

/* eslint-disable */
/* tslint:disable */
import {t as __t,} from "spacetimedb";
import {BarterStallInventoryChangeReason, ItemStack,} from "./types";


export default __t.row({
id: __t.u64().primaryKey(),
regionId: __t.u8().name("region_id"),
shopEntityId: __t.u64().name("shop_entity_id"),
claimEntityId: __t.u64().name("claim_entity_id"),
actorEntityId: __t.u64().name("actor_entity_id"),
get reason() {
return BarterStallInventoryChangeReason;
},
tradeOrderEntityId: __t.option(__t.u64()).name("trade_order_entity_id"),
tradeAmount: __t.option(__t.i32()).name("trade_amount"),
get addedItems() {
return __t.array(ItemStack).name("added_items");
},
get removedItems() {
return __t.array(ItemStack).name("removed_items");
},
treasuryCoinsAdded: __t.i32().name("treasury_coins_added"),
treasuryCoinsRemoved: __t.i32().name("treasury_coins_removed"),
timestamp: __t.timestamp(),
});
30 changes: 30 additions & 0 deletions common/bindings/prism/trade_event_table.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.

/* eslint-disable */
/* tslint:disable */
import {t as __t,} from "spacetimedb";
import {BarterStallInventoryChangeReason, ItemStack,} from "./types";


export default __t.row({
id: __t.u64().primaryKey(),
regionId: __t.u8().name("region_id"),
shopEntityId: __t.u64().name("shop_entity_id"),
claimEntityId: __t.u64().name("claim_entity_id"),
actorEntityId: __t.u64().name("actor_entity_id"),
get reason() {
return BarterStallInventoryChangeReason;
},
tradeOrderEntityId: __t.option(__t.u64()).name("trade_order_entity_id"),
tradeAmount: __t.option(__t.i32()).name("trade_amount"),
get addedItems() {
return __t.array(ItemStack).name("added_items");
},
get removedItems() {
return __t.array(ItemStack).name("removed_items");
},
treasuryCoinsAdded: __t.i32().name("treasury_coins_added"),
treasuryCoinsRemoved: __t.i32().name("treasury_coins_removed"),
timestamp: __t.timestamp(),
});
24 changes: 24 additions & 0 deletions common/bindings/prism/trade_order_table.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.

/* eslint-disable */
/* tslint:disable */
import {t as __t,} from "spacetimedb";
import {ItemStack,} from "./types";


export default __t.row({
id: __t.u64().primaryKey(),
shopEntityId: __t.u64().name("shop_entity_id"),
remainingStock: __t.i32().name("remaining_stock"),
get offerItems() {
return __t.array(ItemStack).name("offer_items");
},
get requiredItems() {
return __t.array(ItemStack).name("required_items");
},
claimEntityId: __t.u64().name("claim_entity_id"),
regionId: __t.u8().name("region_id"),
shopName: __t.string().name("shop_name"),
active: __t.bool(),
});
Loading
Loading