diff --git a/QSB/ConversationSync/Messages/RemoteDialogueResyncMessage.cs b/QSB/ConversationSync/Messages/RemoteDialogueInitialStateMessage.cs similarity index 83% rename from QSB/ConversationSync/Messages/RemoteDialogueResyncMessage.cs rename to QSB/ConversationSync/Messages/RemoteDialogueInitialStateMessage.cs index 01c71482..54065b8e 100644 --- a/QSB/ConversationSync/Messages/RemoteDialogueResyncMessage.cs +++ b/QSB/ConversationSync/Messages/RemoteDialogueInitialStateMessage.cs @@ -5,14 +5,14 @@ using System.Linq; namespace QSB.ConversationSync.Messages { - internal class RemoteDialogueResyncMessage : QSBWorldObjectMessage + internal class RemoteDialogueInitialStateMessage : QSBWorldObjectMessage { private bool _inRemoteDialogue; private bool[] _activatedDialogues; private int _dialogueIndex; private bool _colliderEnabled; - public RemoteDialogueResyncMessage(RemoteDialogueTrigger trigger) + public RemoteDialogueInitialStateMessage(RemoteDialogueTrigger trigger) { _inRemoteDialogue = trigger._inRemoteDialogue; _activatedDialogues = trigger._activatedDialogues; @@ -25,7 +25,7 @@ namespace QSB.ConversationSync.Messages { base.Serialize(writer); writer.Write(_inRemoteDialogue); - writer.Write(_activatedDialogues); + writer.WriteArray(_activatedDialogues); writer.Write(_dialogueIndex); writer.Write(_colliderEnabled); } @@ -34,7 +34,7 @@ namespace QSB.ConversationSync.Messages { base.Deserialize(reader); _inRemoteDialogue = reader.Read(); - _activatedDialogues = reader.Read(); + _activatedDialogues = reader.ReadArray(); _dialogueIndex = reader.Read(); _colliderEnabled = reader.Read(); } diff --git a/QSB/ConversationSync/WorldObjects/QSBRemoteDialogueTrigger.cs b/QSB/ConversationSync/WorldObjects/QSBRemoteDialogueTrigger.cs index 7a5d2341..53e3db34 100644 --- a/QSB/ConversationSync/WorldObjects/QSBRemoteDialogueTrigger.cs +++ b/QSB/ConversationSync/WorldObjects/QSBRemoteDialogueTrigger.cs @@ -10,7 +10,7 @@ namespace QSB.ConversationSync.WorldObjects { if (QSBCore.IsHost) { - this.SendMessage(new RemoteDialogueResyncMessage(AttachedObject)); + this.SendMessage(new RemoteDialogueInitialStateMessage(AttachedObject)); } } diff --git a/QSB/MeteorSync/Messages/FragmentResyncMessage.cs b/QSB/MeteorSync/Messages/FragmentInitialStateMessage.cs similarity index 97% rename from QSB/MeteorSync/Messages/FragmentResyncMessage.cs rename to QSB/MeteorSync/Messages/FragmentInitialStateMessage.cs index d19937d5..dc29c48d 100644 --- a/QSB/MeteorSync/Messages/FragmentResyncMessage.cs +++ b/QSB/MeteorSync/Messages/FragmentInitialStateMessage.cs @@ -10,7 +10,7 @@ namespace QSB.MeteorSync.Messages { /// called when we request a resync on client join /// pain - public class FragmentResyncMessage : QSBWorldObjectMessage + public class FragmentInitialStateMessage : QSBWorldObjectMessage { private float Integrity; private float OrigIntegrity; @@ -23,7 +23,7 @@ namespace QSB.MeteorSync.Messages private Vector3 RelVel; private Vector3 RelAngVel; - public FragmentResyncMessage(QSBFragment qsbFragment) + public FragmentInitialStateMessage(QSBFragment qsbFragment) { Integrity = qsbFragment.AttachedObject._integrity; OrigIntegrity = qsbFragment.AttachedObject._origIntegrity; diff --git a/QSB/MeteorSync/WorldObjects/QSBFragment.cs b/QSB/MeteorSync/WorldObjects/QSBFragment.cs index eb3cfb22..073a2388 100644 --- a/QSB/MeteorSync/WorldObjects/QSBFragment.cs +++ b/QSB/MeteorSync/WorldObjects/QSBFragment.cs @@ -26,7 +26,7 @@ namespace QSB.MeteorSync.WorldObjects { if (QSBCore.IsHost) { - this.SendMessage(new FragmentResyncMessage(this) { To = to }); + this.SendMessage(new FragmentInitialStateMessage(this) { To = to }); } } diff --git a/QSB/TriggerSync/Messages/TriggerResyncMessage.cs b/QSB/TriggerSync/Messages/TriggerInitialStateMessage.cs similarity index 86% rename from QSB/TriggerSync/Messages/TriggerResyncMessage.cs rename to QSB/TriggerSync/Messages/TriggerInitialStateMessage.cs index 905c48d4..c57984ca 100644 --- a/QSB/TriggerSync/Messages/TriggerResyncMessage.cs +++ b/QSB/TriggerSync/Messages/TriggerInitialStateMessage.cs @@ -10,11 +10,11 @@ namespace QSB.TriggerSync.Messages /// /// always sent by host /// - public class TriggerResyncMessage : QSBWorldObjectMessage + public class TriggerInitialStateMessage : QSBWorldObjectMessage { private uint[] _playerIds; - public TriggerResyncMessage(IEnumerable occupants) => + public TriggerInitialStateMessage(IEnumerable occupants) => _playerIds = occupants.Select(x => x.PlayerId).ToArray(); public override void Serialize(NetworkWriter writer) diff --git a/QSB/TriggerSync/WorldObjects/QSBTrigger.cs b/QSB/TriggerSync/WorldObjects/QSBTrigger.cs index 8eb5fc58..131d4dfe 100644 --- a/QSB/TriggerSync/WorldObjects/QSBTrigger.cs +++ b/QSB/TriggerSync/WorldObjects/QSBTrigger.cs @@ -53,7 +53,7 @@ namespace QSB.TriggerSync.WorldObjects { if (QSBCore.IsHost) { - ((IQSBTrigger)this).SendMessage(new TriggerResyncMessage(Occupants) { To = to }); + ((IQSBTrigger)this).SendMessage(new TriggerInitialStateMessage(Occupants) { To = to }); } }