From b8bac541f5b29d6cb7d800200f3717c82728a61c Mon Sep 17 00:00:00 2001 From: Anton Franzluebbers Date: Fri, 5 Jul 2024 18:55:10 -0400 Subject: [PATCH] sync persist id to prevent bugs on ownership change of spawned objects --- unity_package/Runtime/VelNetPersist.cs | 11 ++++++++--- unity_package/package.json | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/unity_package/Runtime/VelNetPersist.cs b/unity_package/Runtime/VelNetPersist.cs index 87afea9..2b86667 100644 --- a/unity_package/Runtime/VelNetPersist.cs +++ b/unity_package/Runtime/VelNetPersist.cs @@ -8,7 +8,7 @@ using VelNet; namespace VELConnect { - public class VelNetPersist : NetworkComponent + public class VelNetPersist : SyncState { private const float interval = 5f; private double nextUpdate; @@ -172,9 +172,14 @@ namespace VELConnect method: "DELETE"); } - public override void ReceiveBytes(byte[] message) + protected override void SendState(BinaryWriter binaryWriter) { - throw new NotImplementedException(); + binaryWriter.Write(persistId); + } + + protected override void ReceiveState(BinaryReader binaryReader) + { + persistId = binaryReader.ReadString(); } } } \ No newline at end of file diff --git a/unity_package/package.json b/unity_package/package.json index 08831f1..f9cf861 100644 --- a/unity_package/package.json +++ b/unity_package/package.json @@ -1,7 +1,7 @@ { "name": "edu.uga.engr.vel.vel-connect", "displayName": "VEL-Connect", - "version": "5.0.3", + "version": "5.0.4", "unity": "2019.1", "description": "Web-based configuration for VR applications", "keywords": [],