| 80 | } |
| 81 | |
| 82 | Command::Result cSendCmdToServer(const Command::ArgumentList_t& args, ConsoleInterface& c, AbstractModeManager&) |
| 83 | { |
| 84 | // If we should send a console command, we do it |
| 85 | if(!ODClient::getSingleton().isConnected()) |
| 86 | { |
| 87 | c.print("Trying to send a console command while not connected"); |
| 88 | return Command::Result::FAILED; |
| 89 | } |
| 90 | |
| 91 | if(args.empty()) |
| 92 | { |
| 93 | c.print("Trying to send an empty console command"); |
| 94 | return Command::Result::INVALID_ARGUMENT; |
| 95 | } |
| 96 | |
| 97 | ClientNotification *clientNotification = new ClientNotification( |
| 98 | ClientNotificationType::askExecuteConsoleCommand); |
| 99 | uint32_t nbArgs = args.size(); |
| 100 | clientNotification->mPacket << nbArgs; |
| 101 | for(const std::string& str : args) |
| 102 | clientNotification->mPacket << str; |
| 103 | |
| 104 | ODClient::getSingleton().queueClientNotification(clientNotification); |
| 105 | return Command::Result::SUCCESS; |
| 106 | } |
| 107 | |
| 108 | Command::Result cAmbientLight(const Command::ArgumentList_t& args, ConsoleInterface& c, AbstractModeManager&) |
| 109 | { |
nothing calls this directly
no test coverage detected