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;
|
|
|
|
|
|
2022-11-07 20:25:54 +00:00
|
|
|
|
public ServerSettingsMessage()
|
2022-12-02 22:27:23 +00:00
|
|
|
|
=> _showPlayerNames = QSBCore.ShowPlayerNames;
|
2022-11-07 20:25:54 +00:00
|
|
|
|
|
2022-11-07 20:14:03 +00:00
|
|
|
|
public override void Serialize(NetworkWriter writer)
|
|
|
|
|
{
|
|
|
|
|
base.Serialize(writer);
|
2022-11-07 20:25:54 +00:00
|
|
|
|
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
|
|
|
|
}
|