From 1cc08c51eb4b0f95c30c0a98ad1fc5ad3459b2df Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Wed, 12 Feb 2025 18:05:18 +1100 Subject: initial commit --- src/server/database.hh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/server/database.hh (limited to 'src/server/database.hh') diff --git a/src/server/database.hh b/src/server/database.hh new file mode 100644 index 0000000..154cdf2 --- /dev/null +++ b/src/server/database.hh @@ -0,0 +1,39 @@ +#ifndef SERVER_DATABASE_HH_ +#define SERVER_DATABASE_HH_ + +#include +#include +#include +#include +#include +#include + +#include + +#include "server/shared.hh" +#include "shared/net/net.hh" +#include "shared/shared.hh" +#include "shared/world.hh" + +namespace server { +namespace database { + +void init() noexcept; +void quit() noexcept; + +// chunks +std::optional +maybe_read_chunk(const shared::math::coords& c) noexcept; +void write_chunk(const shared::math::coords& pos, + const proto::chunk& chunk) noexcept; + +// players +std::optional> // player, password +maybe_read_player(const std::string& username) noexcept; +void write_player(const std::string& username, const std::string& password, + const proto::player& player) noexcept; + +} // namespace database +} // namespace server + +#endif -- cgit v1.2.3