-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: server decides game difficulty
- Loading branch information
1 parent
1aba439
commit df053b2
Showing
9 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "ServerSettings.h" | ||
#include <TiltedCore/Serialization.hpp> | ||
|
||
using TiltedPhoques::Serialization; | ||
|
||
bool ServerSettings::operator==(const ServerSettings& acRhs) const noexcept | ||
{ | ||
return Difficulty == acRhs.Difficulty; | ||
} | ||
|
||
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); | ||
} | ||
|
||
void ServerSettings::Deserialize(TiltedPhoques::Buffer::Reader& aReader) noexcept | ||
{ | ||
Difficulty = Serialization::ReadVarInt(aReader) & 0xFFFFFFFF; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#pragma once | ||
|
||
#include <TiltedCore/Buffer.hpp> | ||
|
||
using TiltedPhoques::Buffer; | ||
|
||
struct ServerSettings | ||
{ | ||
bool operator==(const ServerSettings& acRhs) const noexcept; | ||
bool operator!=(const ServerSettings& acRhs) const noexcept; | ||
|
||
void Serialize(TiltedPhoques::Buffer::Writer& aWriter) const noexcept; | ||
void Deserialize(TiltedPhoques::Buffer::Reader& aReader) noexcept; | ||
|
||
uint32_t Difficulty; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters