Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2015, 9:12:21 PM (9 years ago)
Author:
landauf
Message:

merged branch core7 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/network/packet/FunctionIDs.cc

    r9667 r10624  
    3737#include "core/object/ObjectList.h"
    3838#include "network/NetworkFunction.h"
     39#include "network/NetworkFunctionManager.h"
    3940
    4041namespace orxonox {
     
    5556
    5657  //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)
    5961  {
    60     const std::string& functionname = it->getName();
    61     networkID = it->getNetworkID();
     62    const std::string& functionname = (*it)->getName();
     63    networkID = (*it)->getNetworkID();
    6264    // now push the network id and the classname to the stack
    6365    tempQueue.push( std::pair<unsigned int, std::string>(networkID, functionname) );
     
    126128  unsigned char *functionname;
    127129
     130  //clear the map of network ids
     131  NetworkFunctionManager::getInstance().clearNetworkIDs();
     132
    128133  orxout(verbose, context::packets) << "=== processing functionids: " << endl;
    129134  std::pair<uint32_t, std::string> tempPair;
     
    138143    functionname = temp+2*sizeof(uint32_t);
    139144    orxout(internal_info, context::packets) << "processing functionid: " << networkID << " name: " << functionname << endl;
    140     NetworkFunctionBase::setNetworkID((const char*)functionname, networkID);
     145    NetworkFunctionManager::getInstance().getFunctionByName((const char*)functionname)->setNetworkID(networkID);
    141146    temp += 2*sizeof(uint32_t) + stringsize;
    142147  }
Note: See TracChangeset for help on using the changeset viewer.