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

Method bind

library/RemoteClient.cpp:241–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241bool RemoteClient::bind(color_ostream &out, RemoteFunctionBase *function,
242 const std::string &name, const std::string &plugin)
243{
244 if (!active || !socket->IsSocketValid())
245 return false;
246
247 bind_call.reset();
248
249 {
250 auto in = bind_call.in();
251
252 in->set_method(name);
253 if (!plugin.empty())
254 in->set_plugin(plugin);
255 in->set_input_msg(function->p_in_template->GetTypeName());
256 in->set_output_msg(function->p_out_template->GetTypeName());
257 }
258
259 if (bind_call(out) != CR_OK)
260 return false;
261
262 function->id = bind_call.out()->assigned_id();
263
264 return true;
265}
266
267command_result RemoteClient::run_command(color_ostream &out, const std::string &cmd,
268 const std::vector<std::string> &args)

Callers 1

suspend_gameMethod · 0.45

Calls 6

GetTypeNameMethod · 0.80
isValidFunction · 0.50
resetMethod · 0.45
inMethod · 0.45
emptyMethod · 0.45
outMethod · 0.45

Tested by

no test coverage detected