Serialization works in new version
This commit is contained in:
parent
6b3ce01e94
commit
79f7135746
23 changed files with 186 additions and 56 deletions
|
|
@ -14,7 +14,7 @@ template <class T> std::weak_ptr<T> make_weak_ptr(std::shared_ptr<T> ptr) { retu
|
|||
#define RELIABLE_COMMAND_CHANNEL "reliableCommand"
|
||||
#define UNRELIABLE_COMMAND_CHANNEL "unreliableCommand"
|
||||
#define RESOURCE_COMMAND_CHANNEL "resourceCommand"
|
||||
#define MAIN_NETLIBRARY_CHANNEL "main00003" // NOTE: Change this value whenever netcode is incompatible with the previous version
|
||||
#define MAIN_NETLIBRARY_CHANNEL "main00004" // NOTE: Change this value whenever netcode is incompatible with the previous version
|
||||
|
||||
typedef uint8_t MessageCommandType;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,18 @@ std::string version_numbers_to_version_str(const VersionNumber& versionNum) {
|
|||
return std::to_string(versionNum.major) + "." + std::to_string(versionNum.minor) + "." + std::to_string(versionNum.patch);
|
||||
}
|
||||
|
||||
bool operator<=(const VersionNumber& a, const VersionNumber& b) {
|
||||
return !(a > b);
|
||||
}
|
||||
|
||||
bool operator<(const VersionNumber& a, const VersionNumber& b) {
|
||||
return !(a >= b);
|
||||
}
|
||||
|
||||
bool operator>=(const VersionNumber& a, const VersionNumber& b) {
|
||||
return (a > b) || (a == b);
|
||||
}
|
||||
|
||||
bool operator>(const VersionNumber& a, const VersionNumber& b) {
|
||||
return (a.major > b.major) || (a.major == b.major && (a.minor > b.minor || (a.minor == b.minor && a.patch > b.patch)));
|
||||
}
|
||||
|
|
@ -13,6 +25,10 @@ bool operator==(const VersionNumber& a, const VersionNumber& b) {
|
|||
return a.major == b.major && a.minor == b.minor && a.patch == b.patch;
|
||||
}
|
||||
|
||||
bool operator!=(const VersionNumber& a, const VersionNumber& b) {
|
||||
return a.major != b.major || a.minor != b.minor || a.patch != b.patch;
|
||||
}
|
||||
|
||||
std::optional<VersionNumber> version_str_to_version_numbers(const std::string& versionStr) {
|
||||
try {
|
||||
std::vector<std::string> splitStrings = split_string_by_token(versionStr, ".");
|
||||
|
|
|
|||
|
|
@ -10,5 +10,9 @@ struct VersionNumber {
|
|||
|
||||
std::optional<VersionNumber> version_str_to_version_numbers(const std::string& versionStr);
|
||||
std::string version_numbers_to_version_str(const VersionNumber& versionNum);
|
||||
bool operator<=(const VersionNumber& a, const VersionNumber& b);
|
||||
bool operator<(const VersionNumber& a, const VersionNumber& b);
|
||||
bool operator>(const VersionNumber& a, const VersionNumber& b);
|
||||
bool operator>=(const VersionNumber& a, const VersionNumber& b);
|
||||
bool operator==(const VersionNumber& a, const VersionNumber& b);
|
||||
bool operator!=(const VersionNumber& a, const VersionNumber& b);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue