| 265 | } |
| 266 | |
| 267 | command_result RemoteClient::run_command(color_ostream &out, const std::string &cmd, |
| 268 | const std::vector<std::string> &args) |
| 269 | { |
| 270 | if (!active || !socket->IsSocketValid()) |
| 271 | { |
| 272 | out.printerr("In RunCommand: client connection not valid.\n"); |
| 273 | return CR_FAILURE; |
| 274 | } |
| 275 | |
| 276 | runcmd_call.reset(); |
| 277 | |
| 278 | runcmd_call.in()->set_command(cmd); |
| 279 | for (size_t i = 0; i < args.size(); i++) |
| 280 | runcmd_call.in()->add_arguments(args[i]); |
| 281 | |
| 282 | return runcmd_call(out); |
| 283 | } |
| 284 | |
| 285 | int RemoteClient::suspend_game() |
| 286 | { |