Changeset 10821 for code/branches/cpp11_v2/src/libraries/network/Host.cc
- Timestamp:
- Nov 21, 2015, 7:05:53 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/network/Host.cc
r10768 r10821 80 80 void Host::addPacket(ENetPacket *packet, int clientID, uint8_t channelID) 81 81 { 82 for( std::vector<Host*>::iterator it = instances_s.begin(); it!=instances_s.end(); ++it)82 for(auto & instances_ : instances_s) 83 83 { 84 if( ( *it)->isActive() )84 if( (instances_)->isActive() ) 85 85 { 86 ( *it)->queuePacket(packet, clientID, channelID);86 (instances_)->queuePacket(packet, clientID, channelID); 87 87 } 88 88 } … … 97 97 void Host::sendChat(const std::string& message, unsigned int sourceID, unsigned int targetID) 98 98 { 99 for( std::vector<Host*>::iterator it = instances_s.begin(); it!=instances_s.end(); ++it)100 if( ( *it)->isActive() )101 ( *it)->doSendChat(message, sourceID, targetID);99 for(auto & instances_ : instances_s) 100 if( (instances_)->isActive() ) 101 (instances_)->doSendChat(message, sourceID, targetID); 102 102 } 103 103 … … 114 114 bool Host::isServer() 115 115 { 116 for ( std::vector<Host*>::iterator it=instances_s.begin(); it!=instances_s.end(); ++it)116 for (auto & instances_ : instances_s) 117 117 { 118 if( ( *it)->isActive() )118 if( (instances_)->isActive() ) 119 119 { 120 if( ( *it)->isServer_() )120 if( (instances_)->isServer_() ) 121 121 return true; 122 122 }
Note: See TracChangeset
for help on using the changeset viewer.