diff --git a/Game/Source/GDKShooter/Private/Deployments/DeploymentSnapshotTemplate.cpp b/Game/Source/GDKShooter/Private/Deployments/DeploymentSnapshotTemplate.cpp index a204aae5..2bbcd247 100644 --- a/Game/Source/GDKShooter/Private/Deployments/DeploymentSnapshotTemplate.cpp +++ b/Game/Source/GDKShooter/Private/Deployments/DeploymentSnapshotTemplate.cpp @@ -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()); @@ -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++; } diff --git a/Game/Source/GDKShooter/Private/Game/Components/SpatialSessionStateComponent.cpp b/Game/Source/GDKShooter/Private/Game/Components/SpatialSessionStateComponent.cpp index 73e7a631..aa1771d6 100644 --- a/Game/Source/GDKShooter/Private/Game/Components/SpatialSessionStateComponent.cpp +++ b/Game/Source/GDKShooter/Private/Game/Components/SpatialSessionStateComponent.cpp @@ -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); diff --git a/Game/Source/GDKShooter/Public/Deployments/DeploymentSnapshotTemplate.h b/Game/Source/GDKShooter/Public/Deployments/DeploymentSnapshotTemplate.h index 435bb49d..fc7218cb 100644 --- a/Game/Source/GDKShooter/Public/Deployments/DeploymentSnapshotTemplate.h +++ b/Game/Source/GDKShooter/Public/Deployments/DeploymentSnapshotTemplate.h @@ -4,6 +4,8 @@ #include "CoreMinimal.h" #include "Utils/SnapshotGenerationTemplate.h" +#include + #include "DeploymentSnapshotTemplate.generated.h" diff --git a/spatial/spatialos.json b/spatial/spatialos.json index 5ebacfa2..e5e5f760 100644 --- a/spatial/spatialos.json +++ b/spatial/spatialos.json @@ -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" } ] }