1#ifndef NANOMMO_SERVER_ACCOUNTS_H_
2#define NANOMMO_SERVER_ACCOUNTS_H_
8#include "absl/status/status.h"
9#include "absl/status/statusor.h"
29 absl::StatusOr<uint32_t>
Create(
const std::string& username,
30 const std::string& password_hash);
33 absl::StatusOr<Account>
Find(
const std::string& username);
absl::StatusOr< Account > Find(const std::string &username)
Returns a NotFound error if there's no account by that name.
Accounts(Database &database)
absl::StatusOr< uint32_t > Create(const std::string &username, const std::string &password_hash)
Returns an AlreadyExists error if the name is taken.
absl::Status CheckUsername(std::string_view username)
An InvalidArgument error says what's wrong, in words for the player.
absl::Status CheckPassword(std::string_view password)
std::string password_hash