Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 30, 2015, 2:36:27 PM (9 years ago)
Author:
landauf
Message:

fixed mapping of FunctionIDs - same reason like for ClassIDs in r10564

Location:
code/branches/core7/src/libraries/network
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/libraries/network/FunctionCall.cc

    r10478 r10565  
    4747
    4848bool FunctionCall::execute(){
    49   NetworkFunctionBase* fct = static_cast<NetworkFunctionStatic*>(NetworkFunctionManager::getInstance().getFunctionByNetworkId( this->functionID_ ));
     49  NetworkFunctionBase* fct = NetworkFunctionManager::getInstance().getFunctionByNetworkId( this->functionID_ );
     50  assert( fct != NULL );
    5051  assert( this->nrOfArguments_==this->arguments_.size() );
    5152  switch(this->nrOfArguments_)
  • code/branches/core7/src/libraries/network/NetworkFunction.cc

    r10476 r10565  
    4242    void NetworkFunctionBase::setNetworkID(uint32_t id)
    4343    {
    44         NetworkFunctionManager::getInstance().unregisterFunction(this); // unregister with old id
    4544        this->networkID_ = id;
    4645        NetworkFunctionManager::getInstance().registerFunction(this);   // register with new id
  • code/branches/core7/src/libraries/network/NetworkFunctionManager.cc

    r10542 r10565  
    6868        std::map<uint32_t, NetworkFunctionBase*>::iterator it = idMap_.find(id);
    6969        assert(it != idMap_.end());
    70         return it->second;
     70        if(it != idMap_.end())
     71            return it->second;
     72        else
     73            return NULL;
     74    }
     75
     76    /**
     77        @brief Cleans the NetworkID map (needed on clients for correct initialization)
     78    */
     79    void NetworkFunctionManager::clearNetworkIDs()
     80    {
     81        this->idMap_.clear();
    7182    }
    7283}
  • code/branches/core7/src/libraries/network/NetworkFunctionManager.h

    r10542 r10565  
    5656            NetworkFunctionBase* getFunctionByNetworkId(uint32_t id);
    5757
     58            void clearNetworkIDs();
     59
    5860        private:
    5961            std::set<NetworkFunctionBase*> functions_;
  • code/branches/core7/src/libraries/network/packet/FunctionIDs.cc

    r10475 r10565  
    128128  unsigned char *functionname;
    129129
     130  //clear the map of network ids
     131  NetworkFunctionManager::getInstance().clearNetworkIDs();
     132
    130133  orxout(verbose, context::packets) << "=== processing functionids: " << endl;
    131134  std::pair<uint32_t, std::string> tempPair;
Note: See TracChangeset for help on using the changeset viewer.