quantum-space-buddies/QSB/ServerSettings/ServerSettingsMessage.cs

28 lines
598 B
C#
Raw Normal View History

2022-11-07 20:14:03 +00:00
using Mirror;
using QSB.Messaging;
namespace QSB.ServerSettings;
2023-07-28 18:30:57 +00:00
public class ServerSettingsMessage : QSBMessage
2022-11-07 20:14:03 +00:00
{
private bool _showPlayerNames;
public ServerSettingsMessage()
2022-12-02 22:27:23 +00:00
=> _showPlayerNames = QSBCore.ShowPlayerNames;
2022-11-07 20:14:03 +00:00
public override void Serialize(NetworkWriter writer)
{
base.Serialize(writer);
writer.Write(_showPlayerNames);
2022-11-07 20:14:03 +00:00
}
public override void Deserialize(NetworkReader reader)
{
base.Deserialize(reader);
_showPlayerNames = reader.ReadBool();
}
public override void OnReceiveRemote()
2022-12-02 22:27:23 +00:00
=> ServerSettingsManager.ServerShowPlayerNames = _showPlayerNames;
2022-11-07 20:14:03 +00:00
}