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
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ bool UDeploymentSnapshotTemplate::WriteToSnapshotOutput(Worker_SnapshotOutputStr
// Serialize Session component data
Worker_ComponentData SessionComponentData{};
SessionComponentData.component_id = 1000;
SessionComponentData.schema_type = Schema_CreateComponentData(1000);
SessionComponentData.schema_type = Schema_CreateComponentData();
Schema_Object* SessionComponentDataObject = Schema_GetComponentDataFields(SessionComponentData.schema_type);
Schema_AddInt32(SessionComponentDataObject, 1, 1);

Worker_ComponentData DeploymentComponentData{};
DeploymentComponentData.component_id = 1001;
DeploymentComponentData.schema_type = Schema_CreateComponentData(1001);
DeploymentComponentData.schema_type = Schema_CreateComponentData();

Components.Add(SpatialGDK::Position(SpatialGDK::Origin).CreatePositionData());
Components.Add(SpatialGDK::Metadata(TEXT("Session")).CreateMetadataData());
Expand All @@ -46,7 +46,8 @@ bool UDeploymentSnapshotTemplate::WriteToSnapshotOutput(Worker_SnapshotOutputStr
SessionEntity.component_count = Components.Num();
SessionEntity.components = Components.GetData();

bool success = Worker_SnapshotOutputStream_WriteEntity(OutputStream, &SessionEntity) != 0;
Worker_SnapshotOutputStream_WriteEntity(OutputStream, &SessionEntity);
bool success = Worker_SnapshotOutputStream_GetState(OutputStream).stream_state == WORKER_STREAM_STATE_GOOD;
if (success) {
NextEntityId++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void USpatialSessionStateComponent::SendStateUpdate(EGDKSessionProgress SessionP
Worker_EntityId target_entity_id = SessionEntityId;
Worker_ComponentUpdate component_update = {};
component_update.component_id = SessionComponentId;
component_update.schema_type = Schema_CreateComponentUpdate(SessionComponentId);
component_update.schema_type = Schema_CreateComponentUpdate();
Schema_Object* fields_object = Schema_GetComponentUpdateFields(component_update.schema_type);
Schema_AddInt32(fields_object, 1, SessionState);
SpatialNetDriver->Connection->SendComponentUpdate(target_entity_id, &component_update);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "CoreMinimal.h"
#include "Utils/SnapshotGenerationTemplate.h"
#include <WorkerSDK/improbable/c_worker.h>

#include "DeploymentSnapshotTemplate.generated.h"


Expand Down
4 changes: 2 additions & 2 deletions spatial/spatialos.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "your_project_name_here",
"project_version": "0.0.1",
"sdk_version": "13.8.1",
"sdk_version": "14.1.0",
"dependencies": [
{
"name": "standard_library",
"version": "13.8.1"
"version": "14.1.0"
}
]
}