diff --git a/proto/decentraland/kernel/apis/restricted_actions.proto b/proto/decentraland/kernel/apis/restricted_actions.proto index 2a8c839f..044b7ba8 100644 --- a/proto/decentraland/kernel/apis/restricted_actions.proto +++ b/proto/decentraland/kernel/apis/restricted_actions.proto @@ -70,7 +70,7 @@ message StopEmoteRequest { } enum OpenExplorerUiResult { UNSPECIFIED = 0; OPENED = 1; - WAS_ALREADY_OPEN = 2; // a fullscreen panel is already open + WAS_ALREADY_OPEN = 2; // the requested panel is already open; other panels may be open too REJECTED_NOT_CURRENT_SCENE = 3; // the standard restricted-actions current-scene gate rejected the call REJECTED_FEATURE_DISABLED = 4; // the requested section is hidden by feature flags or client doesn't have that feature REJECTED_NO_USER_GESTURE = 5; // rejected: the call did not originate from a user gesture @@ -78,11 +78,17 @@ enum OpenExplorerUiResult { message OpenExplorerUiRequest { decentraland.sdk.components.common.ExplorerUi ui = 1; - - // Extension point for future per-panel parameters, as a oneof so each panel gets its - // own optional param message without touching existing fields. - // message MapParams { int32 focus_x = 1; int32 focus_y = 2; } - // oneof params { MapParams map = 10; } + // Echoed back in the events this request produces, so they can be matched to their call. + // Unset means no correlation. + optional uint32 request_id = 2; + + message PurchaseParams { + string urn = 1; + } + + oneof params { + PurchaseParams purchase = 10; + } } message OpenExplorerUiResponse { diff --git a/proto/decentraland/sdk/components/common/explorer_ui.proto b/proto/decentraland/sdk/components/common/explorer_ui.proto index 6abf3598..978f0138 100644 --- a/proto/decentraland/sdk/components/common/explorer_ui.proto +++ b/proto/decentraland/sdk/components/common/explorer_ui.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package decentraland.sdk.components.common; -// Identifies which fullscreen explorer panel OpenExplorerUi targets. +// Identifies which explorer panel OpenExplorerUi targets. Panels are not all fullscreen. // EU_SETTINGS holds 0 so an unset `ui` field defaults to the least-intrusive panel. enum ExplorerUi { EU_SETTINGS = 0; @@ -11,4 +11,8 @@ enum ExplorerUi { EU_COMMUNITIES = 4; EU_PLACES = 5; EU_EVENTS = 6; + // Opens the item-purchase confirmation modal for the urn in PurchaseParams. + // UiOpened/UiClosed are emitted in PBExplorerUiEventsResult like for every other value; + // the purchase outcome is reported via the dedicated result component (1221). + EU_ITEM_PURCHASE = 7; } diff --git a/proto/decentraland/sdk/components/explorer_item_purchase_result.proto b/proto/decentraland/sdk/components/explorer_item_purchase_result.proto new file mode 100644 index 00000000..110e94dd --- /dev/null +++ b/proto/decentraland/sdk/components/explorer_item_purchase_result.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; +package decentraland.sdk.components; + +import "decentraland/sdk/components/common/id.proto"; + +option (common.ecs_component_id) = 1221; + +// Grow-only value set appended to the scene root entity. +// Reports the outcome of an EU_ITEM_PURCHASE flow triggered via OpenExplorerUi. +message PBExplorerItemPurchaseResult { + message Purchased {} + message Dismissed {} + message Failed {} + + string urn = 1; + uint32 timestamp = 2; // The scene tick when the event occurred + uint32 request_id = 3; // The OpenExplorerUiRequest.request_id that caused this event; 0 if unset + + oneof status { + Purchased purchased = 10; + Dismissed dismissed = 11; + Failed failed = 12; + } +} diff --git a/proto/decentraland/sdk/components/explorer_ui_events_result.proto b/proto/decentraland/sdk/components/explorer_ui_events_result.proto index 69f5c0c6..5d1df67e 100644 --- a/proto/decentraland/sdk/components/explorer_ui_events_result.proto +++ b/proto/decentraland/sdk/components/explorer_ui_events_result.proto @@ -6,18 +6,20 @@ import "decentraland/sdk/components/common/explorer_ui.proto"; option (common.ecs_component_id) = 1220; -// PBExplorerUiEventsResult transports the lifecycle events of fullscreen explorer panels — a panel was +// PBExplorerUiEventsResult transports the lifecycle events of explorer UI panels — a panel was // opened, a panel was closed. It is a grow only value set appended to the scene root entity, so every // event of a tick is delivered and none overwrites another. message PBExplorerUiEventsResult { - // Emitted when a fullscreen explorer panel is opened. + // Emitted when an explorer panel is opened. The OpenExplorerUi response carries the same fact, + // but it reaches only the caller; this channel is scene wide. message UiOpened {} - // Emitted when a fullscreen explorer panel is closed. + // Emitted when an explorer panel is closed. message UiClosed {} decentraland.sdk.components.common.ExplorerUi ui = 1; // The panel that the event refers to uint32 timestamp = 2; // The scene tick when the event occurred + uint32 request_id = 3; // The OpenExplorerUiRequest.request_id that caused this event; 0 if unset // Extension point, deliberately narrow: a variant belongs here only if it is meaningful for every // value of `ui`, because `ui` and `event` are independent axes and every combination of the two is diff --git a/public/sdk-components.proto b/public/sdk-components.proto index f1a19d05..be9dec18 100644 --- a/public/sdk-components.proto +++ b/public/sdk-components.proto @@ -14,6 +14,7 @@ import public "decentraland/sdk/components/billboard.proto"; import public "decentraland/sdk/components/camera_mode_area.proto"; import public "decentraland/sdk/components/camera_mode.proto"; import public "decentraland/sdk/components/engine_info.proto"; +import public "decentraland/sdk/components/explorer_item_purchase_result.proto"; import public "decentraland/sdk/components/explorer_ui_events_result.proto"; import public "decentraland/sdk/components/gltf_container.proto"; import public "decentraland/sdk/components/gltf_node_modifiers.proto";