Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 4 and Version 5 of code/doc/Network


Ignore:
Timestamp:
Sep 13, 2008, 1:54:29 PM (16 years ago)
Author:
scheusso
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • code/doc/Network

    v4 v5  
    3636     * registerAllVariables: register all variables (currently only basic types and strings), that need synchronisation, to the network engine by calling REGISTERDATA and/or REGISTERSTRING
    3737     * create: (as described above)
     38     * set appropriate synchronisation direction (default: server->client) by calling setObjectMode
     39
     40
     41''' Synchronisable functions:'''[[BR]]
     42''REGISTERDATA(varname)''[[BR]]
     43Use this makro to synchronise a membervariable of a class (like position, velocity, ...). This makro sets the sync-direction of the variable to server->client
     44{{{
     45int SomeClass::i; // membervariable i
     46REGISTERDATA(i);
     47}}}
     48''REGISTERDATA_WITHMODE(varname, mode)''[[BR]]
     49Use this makro if you want to sync a variable using a different direction than the default.
     50{{{
     51int SomeClass::i; //membervariable i
     52REGISTERDATA_WITHMODE(i, network::direction::toclient); //same as REGISTERDATA(i)
     53//or
     54REGISTERDATA_WITHMODE(i, network::direction::toserver); //sync i only to the server (be carefull when using this)
     55//or
     56REGISTERDATA_WITHMODE(i, network::direction::bidirectional); //sync i in both directions
     57}}}
     58
     59''REGISTERSTRING(stringname)''[[BR]]
     60same as REGISTERDATA but for strings
     61
     62''REGISTERSTRING_WITHMODE(stringname, mode)''[[BR]]
     63same as REGISTERDATA_WITHMODE but for strings
     64
     65''setObjectMode''[[BR]]
     66this sets the sync direction of the whole object (default: server->client).
     67'''Note:''' if you don't call setObjectMode with a value other than network::direction::toclient then the variables will only be synchronised to the client (if at all)
    3868=== Host ===