diff --git a/QSB/EchoesOfTheEye/AirlockSync/VariableSync/AirlockVariableSyncer.cs b/QSB/EchoesOfTheEye/AirlockSync/VariableSync/AirlockVariableSyncer.cs index 6289813c..e04fc56b 100644 --- a/QSB/EchoesOfTheEye/AirlockSync/VariableSync/AirlockVariableSyncer.cs +++ b/QSB/EchoesOfTheEye/AirlockSync/VariableSync/AirlockVariableSyncer.cs @@ -1,4 +1,5 @@ -using QSB.EchoesOfTheEye.AirlockSync.WorldObjects; +using Mirror; +using QSB.EchoesOfTheEye.AirlockSync.WorldObjects; using UnityEngine; namespace QSB.EchoesOfTheEye.AirlockSync.VariableSync; @@ -6,4 +7,24 @@ namespace QSB.EchoesOfTheEye.AirlockSync.VariableSync; internal class AirlockVariableSyncer : RotatingElementsVariableSyncer { protected override Transform[] RotatingElements => WorldObject.AttachedObject._interface._rotatingElements; + + protected override void Serialize(NetworkWriter writer) + { + base.Serialize(writer); + + var airlockInterface = WorldObject.AttachedObject._interface; + writer.Write(airlockInterface._currentRotation); + writer.Write(airlockInterface._rotatingSpeed); + writer.Write(airlockInterface._rotatingDirection); + } + + protected override void Deserialize(NetworkReader reader) + { + base.Deserialize(reader); + + var airlockInterface = WorldObject.AttachedObject._interface; + airlockInterface._currentRotation = reader.Read(); + airlockInterface._rotatingSpeed = reader.Read(); + airlockInterface._rotatingDirection = reader.Read(); + } }