Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 25, 2015, 5:37:15 PM (9 years ago)
Author:
landauf
Message:

callStaticNetworkFunction() and callMemberNetworkFunction() are now template functions instead of macros.
simplified function call interface: always pass five MultiType-references. Check if MultiType.null() evaluates to true to see if the argument was defined.
moved references to NetworkFunctionManager to NetworkFunctionIncludes.cc.
this also fixed a linker error in MSVC by including NetworkFunctionIncludes.h in a build-unit inside the network library.

Location:
code/branches/core7/src/modules
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/modules/docking/Dock.cc

    r10465 r10478  
    184184            }
    185185            else
    186                 callStaticNetworkFunction(Dock::showDockingDialog, player->getClientID());
     186                callStaticNetworkFunction(&Dock::showDockingDialog, player->getClientID());
    187187
    188188        }
     
    201201        }
    202202        else
    203             callStaticNetworkFunction(Dock::showDockingDialog, player->getClientID());
     203            callStaticNetworkFunction(&Dock::showDockingDialog, player->getClientID());
    204204
    205205    }
  • code/branches/core7/src/modules/notifications/NotificationDispatcher.cc

    r10465 r10478  
    118118        if(!GameMode::isStandalone())
    119119        {
    120             callMemberNetworkFunction(NotificationDispatcher, broadcastHelper, this->getObjectID(), NETWORK_PEER_ID_BROADCAST);
     120            callMemberNetworkFunction(&NotificationDispatcher::broadcastHelper, this->getObjectID(), NETWORK_PEER_ID_BROADCAST);
    121121        }
    122122    }
     
    148148        else if(GameMode::isServer())
    149149        {
    150             callMemberNetworkFunction(NotificationDispatcher, dispatch, this->getObjectID(), clientId, clientId);
     150            callMemberNetworkFunction(&NotificationDispatcher::dispatch, this->getObjectID(), clientId, clientId);
    151151        }
    152152    }
  • code/branches/core7/src/modules/objects/Script.cc

    r10465 r10478  
    198198                for(std::map<unsigned int, PlayerInfo*>::const_iterator it = clients.begin(); it != clients.end(); it++)
    199199                {
    200                     callStaticNetworkFunction(Script::executeHelper, it->first, this->getCode(), this->getMode(), this->getNeedsGraphics());
     200                    callStaticNetworkFunction(&Script::executeHelper, it->first, this->getCode(), this->getMode(), this->getNeedsGraphics());
    201201                    if(this->times_ != Script::INF) // Decrement the number of remaining executions.
    202202                    {
     
    210210            else
    211211            {
    212                 callStaticNetworkFunction(Script::executeHelper, clientId, this->getCode(), this->getMode(), this->getNeedsGraphics());
     212                callStaticNetworkFunction(&Script::executeHelper, clientId, this->getCode(), this->getMode(), this->getNeedsGraphics());
    213213                if(this->times_ != Script::INF) // Decrement the number of remaining executions.
    214214                    this->remainingExecutions_--;
     
    248248        if(GameMode::isServer() && this->isOnLoad())
    249249        {
    250             callStaticNetworkFunction(Script::executeHelper, clientId, this->getCode(), this->getMode(), this->getNeedsGraphics());
     250            callStaticNetworkFunction(&Script::executeHelper, clientId, this->getCode(), this->getMode(), this->getNeedsGraphics());
    251251        }
    252252    }
  • code/branches/core7/src/modules/pickup/PickupManager.cc

    r10465 r10478  
    214214        else
    215215        {
    216             callStaticNetworkFunction(PickupManager::pickupChangedUsedNetwork, clientId, index, used, pickup->isUsable(), pickup->isUnusable());
     216            callStaticNetworkFunction(&PickupManager::pickupChangedUsedNetwork, clientId, index, used, pickup->isUsable(), pickup->isUnusable());
    217217        }
    218218    }
     
    318318            if(this->representations_.find(pickup->getRepresentationName()) == this->representations_.end())
    319319            {
    320                 callStaticNetworkFunction(PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->defaultRepresentation_->getObjectID(), pickedUp);
     320                callStaticNetworkFunction(&PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->defaultRepresentation_->getObjectID(), pickedUp);
    321321            }
    322322            else
    323323            {
    324                 callStaticNetworkFunction(PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->representations_[pickup->getRepresentationName()]->getObjectID(), pickedUp);
     324                callStaticNetworkFunction(&PickupManager::pickupChangedPickedUpNetwork, clientId, index, pickup->isUsable(), this->representations_[pickup->getRepresentationName()]->getObjectID(), pickedUp);
    325325            }
    326326        }
     
    409409        else
    410410        {
    411             callStaticNetworkFunction(PickupManager::dropPickupNetworked, 0, pickup);
     411            callStaticNetworkFunction(&PickupManager::dropPickupNetworked, 0, pickup);
    412412        }
    413413    }
     
    452452        else
    453453        {
    454             callStaticNetworkFunction(PickupManager::usePickupNetworked, 0, pickup, use);
     454            callStaticNetworkFunction(&PickupManager::usePickupNetworked, 0, pickup, use);
    455455        }
    456456    }
Note: See TracChangeset for help on using the changeset viewer.