+Console::consoleCommand(std::string command, std::vector<std::string> arguments)
+{
+ if (command == "ccrs") {
+ if (arguments.size() != 1) {
+ msg_info << "Usage: ccrs <command>" << std::endl;
+ return true;
+ }
+ std::map<std::string, std::list<ConsoleCommandReceiver*> >::iterator i = commands.find(arguments[0]);
+ if ((i == commands.end()) || (i->second.size() == 0)) {
+ msg_info << "unknown command: \"" << arguments[0] << "\"" << std::endl;
+ return true;
+ }
+
+ std::ostringstream ccr_list;
+ std::list<ConsoleCommandReceiver*> &ccrs = i->second;
+ std::list<ConsoleCommandReceiver*>::iterator j;
+ for (j = ccrs.begin(); j != ccrs.end(); j++) {
+ if (j != ccrs.begin()) ccr_list << ", ";
+ ccr_list << "[" << *j << "]";
+ }
+
+ msg_info << "registered ccrs for \"" << arguments[0] << "\": " << ccr_list.str() << std::endl;
+ return true;
+ }
+
+ return false;
+}
+
+bool