Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 2, 2009, 4:19:43 PM (16 years ago)
Author:
scheusso
Message:

Network Function calls possible now (already used in Pawn::fire/doFire)

include "network/NetworkFunction.h"
register network functions like this:

registerStaticNetworkFunction( functionPointer ); this is for static (member) functions
registerMemberNetworkFunction( class, function );
this is for non-static member functions

call network functions like this:

callStaticNetworkFunction( functionPointer, clientID, arg1, … ); clientID is 0 for server
callMemberNetworkFunction( class, function, objectID, clientID, arg1, … );
objectID can be obtained by this→getObjectID() for synchronisables

arguments must be supported by MultiType !!
object must inherit from Synchronisable !!

Location:
code/branches/netp2/src/network/packet
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/netp2/src/network/packet/FunctionCalls.cc

    r2945 r2949  
    171171}
    172172
    173 void FunctionCalls::addCallStatic( uint32_t networkID, MultiType* mt1, MultiType* mt2, MultiType* mt3, MultiType* mt4, MultiType* mt5){
     173void FunctionCalls::addCallStatic( uint32_t networkID, const MultiType* mt1, const MultiType* mt2, const MultiType* mt3, const MultiType* mt4, const MultiType* mt5){
    174174  assert(!isDataENetAllocated());
    175175 
     
    245245}
    246246
    247 void FunctionCalls::addCallMember( uint32_t networkID, uint32_t objectID, MultiType* mt1, MultiType* mt2, MultiType* mt3, MultiType* mt4, MultiType* mt5){
     247void FunctionCalls::addCallMember( uint32_t networkID, uint32_t objectID, const MultiType* mt1, const MultiType* mt2, const MultiType* mt3, const MultiType* mt4, const MultiType* mt5){
    248248  assert(!isDataENetAllocated());
    249249 
  • code/branches/netp2/src/network/packet/FunctionCalls.h

    r2938 r2949  
    3232  bool process();
    3333
    34   void addCallStatic( uint32_t networkID, MultiType* mt1=0, MultiType* mt2=0, MultiType* mt3=0, MultiType* mt4=0, MultiType* mt5=0);
    35   void addCallMember( uint32_t networkID, uint32_t objectID, MultiType* mt1=0, MultiType* mt2=0, MultiType* mt3=0, MultiType* mt4=0, MultiType* mt5=0);
     34  void addCallStatic( uint32_t networkID, const MultiType* mt1=0, const MultiType* mt2=0, const MultiType* mt3=0, const MultiType* mt4=0, const MultiType* mt5=0);
     35  void addCallMember( uint32_t networkID, uint32_t objectID, const MultiType* mt1=0, const MultiType* mt2=0, const MultiType* mt3=0, const MultiType* mt4=0, const MultiType* mt5=0);
    3636private:
    3737  uint32_t nrOfCalls_;
Note: See TracChangeset for help on using the changeset viewer.