diff --git a/proto/decentraland/sdk/components/network_entity.proto b/proto/decentraland/sdk/components/network_entity.proto new file mode 100644 index 00000000..b7aae9d1 --- /dev/null +++ b/proto/decentraland/sdk/components/network_entity.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +package decentraland.sdk.components; + +import "decentraland/sdk/components/common/id.proto"; +option (common.ecs_component_id) = 1098; + +/** + * NetworkEntity marks an entity for network synchronization. + + * When receiving network messages, to find which local entity they refer to, + * we look for an entity that has both the same networkId and entityId as the message. + */ +message PBNetworkEntity { + // The enumId or local entity ID + uint32 entity_id = 1; + + // - 0 for fixed entities (created with enumId at initialization) + // - User's address hash for dynamic entities (created at runtime) + uint64 network_id = 2; +} diff --git a/proto/decentraland/sdk/components/synced_clock.proto b/proto/decentraland/sdk/components/synced_clock.proto new file mode 100644 index 00000000..db4cd003 --- /dev/null +++ b/proto/decentraland/sdk/components/synced_clock.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package decentraland.sdk.components; + +import "decentraland/sdk/components/common/id.proto"; +option (common.ecs_component_id) = 1099; + +// PBTimeComponent provides synchronized time information based on NTP server data +// This component can be used to maintain consistent time across all clients +message PBSyncedClock { + // The current synchronized time (in milliseconds since epoch) + uint64 synced_timestamp = 1; + + // The synchronization status + SyncStatus status = 7; +} + +// Status of time synchronization +enum SyncStatus { + // The component is not yet synchronized with the NTP server + SS_UNINITIALIZED = 0; + + // The component is currently attempting to synchronize with the NTP server + SS_SYNCHRONIZING = 1; + + // The component is successfully synchronized with the NTP server + SS_SYNCHRONIZED = 2; + + // The component failed to synchronize with the NTP server + SS_ERROR = 3; +} diff --git a/proto/decentraland/sdk/components/tween.proto b/proto/decentraland/sdk/components/tween.proto index 2ed6d784..8fe151c0 100644 --- a/proto/decentraland/sdk/components/tween.proto +++ b/proto/decentraland/sdk/components/tween.proto @@ -20,6 +20,7 @@ message PBTween { optional bool playing = 6; // default true (pause or running) optional float current_time = 7; // between 0 and 1 + optional uint64 start_synced_timestamp = 9; // timestamp (in milliseconds) when the tween started, allows synchronization across clients } message Move {