mirror of
https://github.com/Jous99/F4MP.git
synced 2026-01-13 00:20:54 +01:00
36 lines
1.5 KiB
C++
36 lines
1.5 KiB
C++
#include "ServerSettings.h"
|
|
#include <TiltedCore/Serialization.hpp>
|
|
|
|
using TiltedPhoques::Serialization;
|
|
|
|
bool ServerSettings::operator==(const ServerSettings& acRhs) const noexcept
|
|
{
|
|
return Difficulty == acRhs.Difficulty && GreetingsEnabled == acRhs.GreetingsEnabled && PvpEnabled == acRhs.PvpEnabled && SyncPlayerHomes == acRhs.SyncPlayerHomes && DeathSystemEnabled == acRhs.DeathSystemEnabled && AutoPartyJoin == acRhs.AutoPartyJoin;
|
|
}
|
|
|
|
bool ServerSettings::operator!=(const ServerSettings& acRhs) const noexcept
|
|
{
|
|
return !this->operator==(acRhs);
|
|
}
|
|
|
|
void ServerSettings::Serialize(TiltedPhoques::Buffer::Writer& aWriter) const noexcept
|
|
{
|
|
Serialization::WriteVarInt(aWriter, Difficulty);
|
|
Serialization::WriteBool(aWriter, GreetingsEnabled);
|
|
Serialization::WriteBool(aWriter, PvpEnabled);
|
|
Serialization::WriteBool(aWriter, SyncPlayerHomes);
|
|
Serialization::WriteBool(aWriter, DeathSystemEnabled);
|
|
Serialization::WriteBool(aWriter, SyncPlayerCalendar);
|
|
Serialization::WriteBool(aWriter, AutoPartyJoin);
|
|
}
|
|
|
|
void ServerSettings::Deserialize(TiltedPhoques::Buffer::Reader& aReader) noexcept
|
|
{
|
|
Difficulty = Serialization::ReadVarInt(aReader) & 0xFFFFFFFF;
|
|
GreetingsEnabled = Serialization::ReadBool(aReader);
|
|
PvpEnabled = Serialization::ReadBool(aReader);
|
|
SyncPlayerHomes = Serialization::ReadBool(aReader);
|
|
DeathSystemEnabled = Serialization::ReadBool(aReader);
|
|
SyncPlayerCalendar = Serialization::ReadBool(aReader);
|
|
AutoPartyJoin = Serialization::ReadBool(aReader);
|
|
}
|