| 67 | //------------------------------------------------------------------ |
| 68 | |
| 69 | ConsoleCustomCommand::ConsoleCustomCommand() |
| 70 | { |
| 71 | _console = Director::getInstance()->getConsole(); |
| 72 | static Console::Command commands[] = { |
| 73 | {"hello", "This is just a user generated command", |
| 74 | [](int fd, std::string_view args) { |
| 75 | const char msg[] = "how are you?\nArguments passed: "; |
| 76 | send(fd, msg, sizeof(msg), 0); |
| 77 | send(fd, args.data(), args.length(), 0); |
| 78 | send(fd, "\n", 1, 0); |
| 79 | }}, |
| 80 | }; |
| 81 | _console->addCommand(commands[0]); |
| 82 | } |
| 83 | |
| 84 | ConsoleCustomCommand::~ConsoleCustomCommand() {} |
| 85 |
nothing calls this directly
no test coverage detected