44 logger->
log1(
"Initializing commands database...");
55 if (text ==
"allow target")
57 else if (text ==
"need target")
67 XmlNodeConstPtrConst rootNode = doc.
rootNode();
69 if ((rootNode ==
nullptr) || !xmlNameEqual(rootNode,
"commands"))
71 logger->
log(
"Commands Database: Error while loading %s!",
78 if (xmlNameEqual(commandNode,
"include"))
86 if (!xmlNameEqual(commandNode,
"command"))
96 logger->
log(
"Commands database: duplicate id: %d",
id);
102 commandNode,
"name",
"?");
104 commandNode,
"command",
"");
106 commandNode,
"comment",
"");
108 commandNode,
"target",
""));
110 commandNode,
"icon",
"");
113 commandNode,
"skill1", 0, 0, 1000000);
115 commandNode,
"level1", 0, 0, 1000);
117 commandNode,
"skill2", 0, 0, 1000000);
119 commandNode,
"level2", 0, 0, 1000);
121 commandNode,
"mana", 0, 0, 100000);
155 logger->
log1(
"Unloading commands database...");
static void loadXmlFile(const std::string &file, const std::string &name, BadgesInfos &arr, const SkipError skipError)
#define loadXmlDir(name, function)
std::string getStringValue(const std::string &key) const
void log(const char *const log_text,...)
void log1(const char *const log_text)
static CommandTargetT parseTarget(const std::string &text)
CommandsMap::iterator CommandsMapIter
std::map< int, TextCommand * > CommandsMap
CommandTarget ::T CommandTargetT
#define for_each_xml_child_node(var, parent)
MagicSchool ::T MagicSchoolT
void loadXmlFile(const std::string &fileName, const SkipError skipError)
std::string langProperty(const xmlNodePtr node, const char *const name, const std::string &def)
int getProperty(const xmlNodePtr node, const char *const name, int def)
int getIntProperty(const xmlNodePtr node, const char *const name, int def, const int min, const int max)
const bool SkipError_false
const bool SkipError_true
const bool UseVirtFs_true