|
Mineserver
A rewrite of Minecraft 1.8.9 in C++ !
|
The file containing the config logic. More...
#include <fstream>#include <sstream>#include <string>#include <filesystem>#include <rapidjson/prettywriter.h>#include <rapidjson/stringbuffer.h>#include <cmd/commands.h>#include <utils/logger.h>#include "config.h"Macros | |
| #define | UF(x) x.load(document); |
| #define | UF(x) |
| #define | UF(x) Config::inst()->x.load(doc); |
| #define | UF(x) x.registerLuaProperty(state); |
| #define | UF(x) x.save(document); |
Functions | |
| template<typename T > | |
| bool | printFieldValue (ISender &sender, const std::string §ion, const std::string &key, Field< T > &field) |
| Prints to console field value if matching key and section. | |
| void | handleConfigCommand (const ISender::SenderType senderType, ISender &sender, const std::vector< std::string > &args) |
| Handles /config command. | |
Variables | |
| constexpr const char * | CONFIG_FILE = "config.json" |
| The config file path. | |
The file containing the config logic.
| #define UF | ( | x | ) |
| void handleConfigCommand | ( | const ISender::SenderType | senderType, |
| ISender & | sender, | ||
| const std::vector< std::string > & | args ) |
Handles /config command.
| senderType | the type of sender |
| sender | the sender in and on itself |
| args | the arguments of the command |
| bool printFieldValue | ( | ISender & | sender, |
| const std::string & | section, | ||
| const std::string & | key, | ||
| Field< T > & | field ) |
Prints to console field value if matching key and section.
See Config for more information on config fields
| T | the field type |
| sender | the asking sender |
| section | the section of the value |
| key | the key of the value |
| field | the current field |