Update PlayerInformationMessage.cs

This commit is contained in:
_nebula 2023-01-23 13:06:04 +00:00
parent 9169283ac4
commit ae6131c64a

View File

@ -18,6 +18,7 @@ public class PlayerInformationMessage : QSBMessage
private bool ProbeActive;
private ClientState ClientState;
private float FieldOfView;
private bool IsInShip;
public PlayerInformationMessage()
{
@ -32,6 +33,7 @@ public class PlayerInformationMessage : QSBMessage
ProbeActive = player.ProbeActive;
ClientState = player.State;
FieldOfView = PlayerData.GetGraphicSettings().fieldOfView;
IsInShip = player.IsInShip;
}
public override void Serialize(NetworkWriter writer)
@ -47,6 +49,7 @@ public class PlayerInformationMessage : QSBMessage
writer.Write(ProbeActive);
writer.Write(ClientState);
writer.Write(FieldOfView);
writer.Write(IsInShip);
}
public override void Deserialize(NetworkReader reader)
@ -62,6 +65,7 @@ public class PlayerInformationMessage : QSBMessage
ProbeActive = reader.Read<bool>();
ClientState = reader.Read<ClientState>();
FieldOfView = reader.ReadFloat();
IsInShip = reader.ReadBool();
}
public override void OnReceiveRemote()
@ -78,6 +82,7 @@ public class PlayerInformationMessage : QSBMessage
player.SignalscopeEquipped = SignalscopeEquipped;
player.TranslatorEquipped = TranslatorEquipped;
player.ProbeActive = ProbeActive;
player.IsInShip = IsInShip;
if (QSBPlayerManager.LocalPlayer.IsReady && player.IsReady)
{
player.UpdateObjectsFromStates();