MCPcopy Create free account
hub / github.com/DFHack/dfhack / registerCommands

Method registerCommands

library/PluginManager.cpp:1073–1088  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1071}
1072
1073void PluginManager::registerCommands( Plugin * p )
1074{
1075 std::lock_guard<std::mutex> lock{*cmdlist_mutex};
1076 std::vector <PluginCommand> & cmds = p->commands;
1077 for (size_t i = 0; i < cmds.size();i++)
1078 {
1079 std::string name = cmds[i].name;
1080 if (command_map.find(name) != command_map.end())
1081 {
1082 core->printerr("Plugin {} re-implements command \"{}\" (from plugin {})\n",
1083 p->getName(), name, command_map[name]->getName());
1084 continue;
1085 }
1086 command_map[name] = p;
1087 }
1088}
1089
1090void PluginManager::unregisterCommands( Plugin * p )
1091{

Callers 1

loadMethod · 0.80

Calls 4

sizeMethod · 0.45
findMethod · 0.45
endMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected