| 38 | * set appropriate synchronisation direction (default: server->client) by calling setObjectMode |
| 39 | |
| 40 | |
| 41 | ''' Synchronisable functions:'''[[BR]] |
| 42 | ''REGISTERDATA(varname)''[[BR]] |
| 43 | Use 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 | {{{ |
| 45 | int SomeClass::i; // membervariable i |
| 46 | REGISTERDATA(i); |
| 47 | }}} |
| 48 | ''REGISTERDATA_WITHMODE(varname, mode)''[[BR]] |
| 49 | Use this makro if you want to sync a variable using a different direction than the default. |
| 50 | {{{ |
| 51 | int SomeClass::i; //membervariable i |
| 52 | REGISTERDATA_WITHMODE(i, network::direction::toclient); //same as REGISTERDATA(i) |
| 53 | //or |
| 54 | REGISTERDATA_WITHMODE(i, network::direction::toserver); //sync i only to the server (be carefull when using this) |
| 55 | //or |
| 56 | REGISTERDATA_WITHMODE(i, network::direction::bidirectional); //sync i in both directions |
| 57 | }}} |
| 58 | |
| 59 | ''REGISTERSTRING(stringname)''[[BR]] |
| 60 | same as REGISTERDATA but for strings |
| 61 | |
| 62 | ''REGISTERSTRING_WITHMODE(stringname, mode)''[[BR]] |
| 63 | same as REGISTERDATA_WITHMODE but for strings |
| 64 | |
| 65 | ''setObjectMode''[[BR]] |
| 66 | this 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) |