quantum-space-buddies/QSB/ServerSettings/ServerSettingsMessage.cs
2023-07-28 19:30:57 +01:00

28 lines
598 B
C#

using Mirror;
using QSB.Messaging;
namespace QSB.ServerSettings;
public class ServerSettingsMessage : QSBMessage
{
private bool _showPlayerNames;
public ServerSettingsMessage()
=> _showPlayerNames = QSBCore.ShowPlayerNames;
public override void Serialize(NetworkWriter writer)
{
base.Serialize(writer);
writer.Write(_showPlayerNames);
}
public override void Deserialize(NetworkReader reader)
{
base.Deserialize(reader);
_showPlayerNames = reader.ReadBool();
}
public override void OnReceiveRemote()
=> ServerSettingsManager.ServerShowPlayerNames = _showPlayerNames;
}