Changeset 7284 for code/trunk/src/libraries/network/Host.cc
- Timestamp:
- Aug 31, 2010, 3:37:40 AM (14 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/network/Host.cc
r7163 r7284 32 32 #include <string> 33 33 34 #include "core/ConsoleCommand.h"35 34 #include "core/ObjectList.h" 35 #include "core/command/ConsoleCommand.h" 36 36 #include "ChatListener.h" 37 37 38 38 namespace orxonox { 39 39 40 SetConsoleCommandShortcut(Host, Chat); 40 static const std::string __CC_printRTT_name = "printRTT"; 41 42 SetConsoleCommand("chat", &Host::Chat); 43 SetConsoleCommand(__CC_printRTT_name, &Host::printRTT); 41 44 42 45 // Host* Host::instance_=0; … … 52 55 // assert(instance_==0); 53 56 instances_s.push_back(this); 54 this->printRTTCC_ = createConsoleCommand( createFunctor(&Host::printRTT, this), "printRTT" ); 55 CommandExecutor::addConsoleCommandShortcut( this->printRTTCC_ ); 57 ModifyConsoleCommand(__CC_printRTT_name).setObject(this); 56 58 this->bIsActive_ = false; 57 59 } … … 65 67 assert( std::find( instances_s.begin(), instances_s.end(), this )!=instances_s.end() ); 66 68 instances_s.erase(std::find( instances_s.begin(), instances_s.end(), this )); 67 if( this->printRTTCC_ ) 68 delete this->printRTTCC_; 69 ModifyConsoleCommand(__CC_printRTT_name).setObject(0); 69 70 } 70 71 … … 89 90 } 90 91 91 boolHost::Chat(const std::string& message)92 void Host::Chat(const std::string& message) 92 93 { 93 94 if(instances_s.size()==0) … … 95 96 for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it) 96 97 it->incomingChat(message, 0); 97 return true;98 // return true; 98 99 } 99 100 else … … 108 109 } 109 110 } 110 return result;111 // return result; 111 112 } 112 113 } … … 139 140 for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it) 140 141 it->incomingChat(message, playerID); 141 142 142 143 bool result = true; 143 144 for( std::vector<Host*>::iterator it = instances_s.begin(); it!=instances_s.end(); ++it )
Note: See TracChangeset
for help on using the changeset viewer.