mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2024-12-29 12:21:25 +00:00
28 lines
598 B
C#
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;
|
|
}
|