syncsys
Public Member Functions

syncsys::SyncClient Class Reference

base class for a client More...

#include <SyncSystem.h>

Inheritance diagram for syncsys::SyncClient:
syncsys::NetIDManager syncsys::MemExClient

List of all members.

Public Member Functions

 SyncClient (void)
 constructor for a SyncClient
void UnPackData (helpers::NetworkBuffer &, bool updatedirectly)
 Unpack all serialised data from a updatepacket and stores them.
void AddElementNeedingData (NetEntity *Callback, unsigned int NeededID, NetAction NeededAction)
 Register a NetEntity.
template<class T1 >
T1 * GetReceivedElement (unsigned int id, NetAction n=NOTHING, NetEntity *Callback=NULL, bool createanyway=false)
 For creation of NetEntities at clientsite.
template<class T1 , typename T2 >
T1 * GetReceivedElement (unsigned int id, T2 arg1, NetAction n=NOTHING, NetEntity *Callback=NULL, bool createanyway=false)
 For creation of NetEntities at clientsite.
template<class T1 , typename T2 , typename T3 >
T1 * GetReceivedElement (unsigned int id, T2 arg1, T3 arg2, NetAction n=NOTHING, NetEntity *Callback=NULL, bool createanyway=false)
 For creation of NetEntities at clientsite.
void RemoveElement (NetEntity *e)
 Removes the AttachedNetEntity for a NetEntity.

Detailed Description

base class for a client

this base client is abled to receive and store data from a server for serialised NetEntity-instances. Provides methodes for creating the serialised instances at clientsite.


Member Function Documentation

void syncsys::SyncClient::AddElementNeedingData ( NetEntity Callback,
unsigned int  NeededID,
NetAction  NeededAction 
) [inline]

Register a NetEntity.

Registered NetEntities will be notified by a ManualRefresh, if either a NetEntity with NetID equals NeededID is created or serialised data for NeededID arrives.

template<class T1 , typename T2 >
T1* syncsys::SyncClient::GetReceivedElement ( unsigned int  id,
T2  arg1,
NetAction  n = NOTHING,
NetEntity Callback = NULL,
bool  createanyway = false 
) [inline]

For creation of NetEntities at clientsite.

You should only use this methode for creating/getting NetEntity-instances on clientsize. Otherwise the NetEntity may not be assigned correctly to the system. If createanyway is true, the NetEntity will be created although if the serialised data did not arrive. Registrate Callback if the element is not created. Callback will be "informed" by changing the version causing a new deserialisation.

template<class T1 , typename T2 , typename T3 >
T1* syncsys::SyncClient::GetReceivedElement ( unsigned int  id,
T2  arg1,
T3  arg2,
NetAction  n = NOTHING,
NetEntity Callback = NULL,
bool  createanyway = false 
) [inline]

For creation of NetEntities at clientsite.

You should only use this methode for creating/getting NetEntity-instances on clientsize. Otherwise the NetEntity may not be assigned correctly to the system. If createanyway is true, the NetEntity will be created although if the serialised data did not arrive. Registrate Callback if the element is not created. Callback will be "informed" by changing the version causing a new deserialisation.

template<class T1 >
T1* syncsys::SyncClient::GetReceivedElement ( unsigned int  id,
NetAction  n = NOTHING,
NetEntity Callback = NULL,
bool  createanyway = false 
) [inline]

For creation of NetEntities at clientsite.

You should only use this methode for creating/getting NetEntity-instances on clientsize. Otherwise the NetEntity may not be assigned correctly to the system. If createanyway is true, the NetEntity will be created although if the serialised data did not arrive. Registrate Callback if the element is not created. Callback will be "informed" by changing the version causing a new deserialisation.

void syncsys::SyncClient::UnPackData ( helpers::NetworkBuffer ,
bool  updatedirectly 
)

Unpack all serialised data from a updatepacket and stores them.

Updates allready created NetEntity-instances directly, if updatedirectly is true and they got new data. Otherwise you have to call NetEntity::PerformNeededUpdates frequently. If all elements are updated frequently anyway set updatedirectly to false.

Note:
Shifts the given Buffer after usage, so you can read the rest normally.
Attention:
Never call UnPackData with updatedirectly = true asynchronously (for example from MemExClient::AsyncCallBack).

The documentation for this class was generated from the following file: