Changeset 8403
- Timestamp:
- May 5, 2011, 4:02:40 PM (14 years ago)
- Location:
- code/trunk/src/libraries/network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/network/FunctionCallManager.cc
r7801 r8403 31 31 #include "core/GameMode.h" 32 32 #include "GamestateHandler.h" 33 #include "Host.h" 34 #include "util/OrxAssert.h" 33 35 34 36 namespace orxonox { … … 175 177 while( it!=FunctionCallManager::sIncomingFunctionCallBuffer_.end() ) 176 178 { 177 if( it->first.execute() ) 179 OrxAssert( Host::getActiveInstance(), "No Host class existing" ); 180 if( it->second.first <= Host::getActiveInstance()->getLastReceivedGamestateID(it->second.second) && it->first.execute() ) 178 181 FunctionCallManager::sIncomingFunctionCallBuffer_.erase(it); 179 182 else -
code/trunk/src/libraries/network/Host.cc
r8327 r8403 161 161 return false; 162 162 } 163 164 Host* Host::getActiveInstance() 165 { 166 std::vector<Host*>::iterator it = Host::instances_s.begin(); 167 while( it != Host::instances_s.end() ) 168 { 169 if( (*it)->isActive() ) 170 return *it; 171 } 172 return 0; 173 } 174 163 175 164 176 }//namespace orxonox -
code/trunk/src/libraries/network/Host.h
r7801 r8403 71 71 72 72 public: 73 // static Host* getInstance(){ return instance_; } 73 static Host* getActiveInstance(); 74 74 static bool running(){ return instances_s.size(); } 75 75 static void addPacket(ENetPacket* packet, int clientID = NETWORK_PEER_ID_SERVER, uint8_t channelID = 0);
Note: See TracChangeset
for help on using the changeset viewer.