Skip to content

Commit

Permalink
fix: correct member order in ConnectionRequest class
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Feb 17, 2025
1 parent 76f8795 commit e817978
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/bedrock/network/connection_request.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ class ConnectionRequest {
public:
[[nodiscard]] Json::Value getData(const std::string &key) const
{
if (certificate_ && raw_token_) {
if (certificate_ && certificate_->isValid() && raw_token_) {
return raw_token_->getData().get(key, Json::nullValue);
}
return Json::nullValue;
}

private:
std::unique_ptr<UnverifiedCertificate> certificate_data_; // +0
std::unique_ptr<Certificate> certificate_; // +8
std::unique_ptr<WebToken> raw_token_; // +16
std::unique_ptr<WebToken> raw_token_; // +0
std::unique_ptr<UnverifiedCertificate> certificate_data_; // +8
std::unique_ptr<Certificate> certificate_; // +16
SubClientId client_sub_id_; // +24
};
4 changes: 2 additions & 2 deletions src/bedrock/network/sub_client_connection_request.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ class SubClientConnectionRequest {
public:
[[nodiscard]] Json::Value getData(const std::string &key) const
{
if (certificate_ && raw_token_) {
if (certificate_ && certificate_->isValid() && raw_token_) {
return raw_token_->getData().get(key, Json::nullValue);
}
return Json::nullValue;
}

private:
std::unique_ptr<WebToken> raw_token_; // +16
std::unique_ptr<UnverifiedCertificate> certificate_data_; // +0
std::unique_ptr<Certificate> certificate_; // +8
std::unique_ptr<WebToken> raw_token_; // +16
};

0 comments on commit e817978

Please sign in to comment.