Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 2 and Version 3 of code/howto/Synchronisable


Ignore:
Timestamp:
Sep 25, 2008, 9:26:33 PM (16 years ago)
Author:
scheusso
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • code/howto/Synchronisable

    v2 v3  
    66See also [wiki:network/Synchronisable] for more information.
    77== Basic steps ==
    8  1. {{{ #include "network/Synchronisable.h" }}}
    9  2. make sure your class inherits from Synchronisable:
     8 1. Include the appropriate header file:
     9{{{
     10#include "network/Synchronisable.h"
     11}}}
     12 2. Make sure your class inherits from Synchronisable:
    1013{{{
    1114class XYZ : public network::Synchronisable { ... };
    1215}}}
    13  3. create the function void registerAllVariables() and call REGISTERDATA or REGISTERSTRING functions in order to register these variables for synchronisation:
     16 3. Create the function void registerAllVariables() and call REGISTERDATA or REGISTERSTRING functions in order to register these variables for synchronisation:
    1417{{{
    1518void XYZ::registerAllVariables(){
     
    1821}
    1922}}}
    20  4. make sure registerAllVariables() gets called in the constructor:
     23 4. Make sure registerAllVariables() gets called in the constructor:
    2124{{{
    2225XYZ::XYZ(){
     
    2528}
    2629}}}
    27  5. implement the create() function and put all the code that needs some synchronisable variables to be set inside it:
     30 5. Implement the create() function and put all the code that needs some synchronisable variables to be set inside it:
    2831{{{
    2932bool XYZ::create(){
     
    3336== Multidirectional synchronisation ==
    3437If you want to have a variable synchronised back to the server, follow these steps (additional to/instead of the above):
    35  1. register the variable with REGISTERDATA_WITHDIR:
     38 1. Register the variable with REGISTERDATA_WITHDIR:
    3639{{{
    3740void XYZ::registerAllVariables(){