/** * @file PlayerInfoAPI.h * @author LiteLDev (https://github.com/LiteLDev) * @brief Player information database interfaces * * @copyright Copyright (c) 2021-present LiteLoaderBDS developers and all contributors * */ #pragma once #include "Global.h" #include namespace PlayerInfo { /** * @brief Player information structure. * */ struct Info { std::string name; ///< Real name(xbox) xuid_t xuid; ///< Xuid(online-mode is required) std::string uuid; ///< UUID }; /** * @brief Find the information of a player by realName. * * @param name The player name * @return std::optional The info */ LIAPI std::optional findByName(const std::string& name); /** * @brief Find the information of a player by xuid. * * @param xuid The player xuid * @return std::optional The info */ LIAPI std::optional findByXuid(const xuid_t& xuid); /** * @brief Find the information of a player by UUID. * * @param uuid The player UUID * @return std::optional The info */ LIAPI std::optional findByUUID(const std::string& uuid); /** * @brief Get all the player names. * * @return std::vector The names */ LIAPI std::vector getAllPlayerNames(); /** * @brief Get all the player info. * * @return std::vector The info */ LIAPI std::vector getAllPlayerInfo(); LIAPI bool insert(std::string name, std::string xuid, std::string uuid); LIAPI std::string getXuid(std::string name); LIAPI std::string getUUID(std::string name); LIAPI std::string fromXuid(std::string xuid); LIAPI std::string fromUUID(std::string uuid); LIAPI void forEachInfo(std::function callback); } // namespace PlayerInfo