Serialisation: Adjust method names/types

This commit is contained in:
Jonathan G Rennison
2023-06-14 18:16:23 +01:00
parent 4b807e091a
commit 11a3dc287b
8 changed files with 38 additions and 30 deletions

View File

@@ -223,15 +223,6 @@ std::string GenerateCompanyPasswordHash(const std::string &password, const std::
return hashed_password.str();
}
struct HashBuffer : public BufferSerialisationHelper<HashBuffer> {
std::vector<byte> &buffer;
HashBuffer(std::vector<byte> &buffer) : buffer(buffer) {}
std::vector<byte> &GetSerialisationBuffer() { return this->buffer; }
size_t GetSerialisationLimit() const { return UINT32_MAX; }
};
/**
* Hash the given password using server ID and game seed.
* @param password Password to hash.
@@ -245,7 +236,7 @@ std::vector<uint8> GenerateGeneralPasswordHash(const std::string &password, cons
std::vector<byte> data;
data.reserve(password.size() + password_server_id.size() + 6);
HashBuffer buffer(data);
BufferSerialiser buffer(data);
/* key field */
buffer.Send_uint64(password_game_seed);