Packet 0x5 corresponds to this client function call:
/**
* This function is called when the server provides us with the details
* necessary to create an entity here. The minimum data it could send
* is the type of the entity, but for the moment it sends everything.
*
* @param id entity id.
* @param type entity type id.
* @param spaceID id of space where to create the entity in.
* @param vehicleID id of an entity to use as vehicle.
* @param position position of entity.
* @param yaw yaw of entity.
* @param pitch pitch of entity.
* @param roll roll of entity.
* @param data entity's data.
*/
void EntityManager::onEntityCreate( EntityID id, EntityTypeID type,
SpaceID spaceID, EntityID vehicleID, const Position3D & position,
float yaw, float pitch, float roll,
BinaryIStream & data )
And here how it looks like:
struct Entity {
int32 entityID;
int16 type;
int32 spaceId;
int32 vehicleId;
Vector3 position;
Vector3 direction;
int32 _sizeState;
void* state; // sizeof(_sizeState)
}
Looks like all params are clear beside these two:
- type - in fact, it is index of python class stored in entities.xml
- data - really strange thing... I've tried to understood how data is stored, but have no luck. I guess it is a strange form of PyDict.