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

Method dump_rpc

library/Commands.cpp:560–588  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

558 }
559
560 command_result Commands::dump_rpc(color_ostream& con, Core& core, const std::string& first, const std::vector<std::string>& parts)
561 {
562 if (parts.size() == 1)
563 {
564 std::ofstream file(parts[0]);
565 CoreService coreSvc;
566 coreSvc.dumpMethods(file);
567
568 for (auto& it : *core.getPluginManager())
569 {
570 Plugin* plug = it.second;
571 if (!plug)
572 continue;
573
574 std::unique_ptr<RPCService> svc(plug->rpc_connect(con));
575 if (!svc)
576 continue;
577
578 file << "// Plugin: " << plug->getName() << std::endl;
579 svc->dumpMethods(file);
580 }
581 }
582 else
583 {
584 con << "Usage: devel/dump-rpc \"filename\"" << std::endl;
585 return CR_WRONG_USAGE;
586 }
587 return CR_OK;
588 }
589}

Callers

nothing calls this directly

Calls 4

dumpMethodsMethod · 0.80
rpc_connectMethod · 0.80
sizeMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected