Changeset 10624 for code/trunk/src/libraries/network/packet/FunctionIDs.cc
- Timestamp:
- Oct 4, 2015, 9:12:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
-
code/trunk/src/libraries/network/packet/FunctionIDs.cc
r9667 r10624 37 37 #include "core/object/ObjectList.h" 38 38 #include "network/NetworkFunction.h" 39 #include "network/NetworkFunctionManager.h" 39 40 40 41 namespace orxonox { … … 55 56 56 57 //calculate total needed size (for all strings and integers) 57 ObjectList<NetworkFunctionBase>::iterator it; 58 for(it = ObjectList<NetworkFunctionBase>::begin(); it; ++it) 58 const std::set<NetworkFunctionBase*>& set = NetworkFunctionManager::getInstance().getAllFunctions(); 59 std::set<NetworkFunctionBase*>::const_iterator it; 60 for (it = set.begin(); it != set.end(); ++it) 59 61 { 60 const std::string& functionname = it->getName();61 networkID = it->getNetworkID();62 const std::string& functionname = (*it)->getName(); 63 networkID = (*it)->getNetworkID(); 62 64 // now push the network id and the classname to the stack 63 65 tempQueue.push( std::pair<unsigned int, std::string>(networkID, functionname) ); … … 126 128 unsigned char *functionname; 127 129 130 //clear the map of network ids 131 NetworkFunctionManager::getInstance().clearNetworkIDs(); 132 128 133 orxout(verbose, context::packets) << "=== processing functionids: " << endl; 129 134 std::pair<uint32_t, std::string> tempPair; … … 138 143 functionname = temp+2*sizeof(uint32_t); 139 144 orxout(internal_info, context::packets) << "processing functionid: " << networkID << " name: " << functionname << endl; 140 NetworkFunction Base::setNetworkID((const char*)functionname,networkID);145 NetworkFunctionManager::getInstance().getFunctionByName((const char*)functionname)->setNetworkID(networkID); 141 146 temp += 2*sizeof(uint32_t) + stringsize; 142 147 }
Note: See TracChangeset
for help on using the changeset viewer.