realXtend/naali — pull request #337 by jonnenauha (2012-02-01 15:13:59+00:00)
Title: Admino tundra 2.2.x per connection scene state manipulation

* Expose per connection SceneSyncState objects to scripting on the server. And I do mean server only, we don't want clients getting to the sync state object directly but access it via scene.
* Allow script logic to reject addition of entities to the sync state for a particular client. Once a entity has been added to peding state it will only go to the client if its explicitly added to the sync state via the SceneSyncState object for that client.
* Allows removing entities from a client sync state. This puts the entity back to the pending entity list.
* Includes example scene where about all of the new features are presented and showed how to use them.
* Adds entity.component to return QObjectList in Entity.h/Entity.cpp. Mainly because it was missing and the example scene needed this kind of feature, there was no way to ask full list of current component from an entity.

This enables worlds to "optimize" what entities get sent to each client immediately on login and what gets sent later at a time when the script logic sees it necessary. It can also remove entities from a client eg. when it is too far away and is no longer relevant for the client. If you send only the important entities it means the asset request queue wont bloat (vs the whole scene coming immediately) and you get faster login and more responsive client.

Note: Does not change any default behaviour. The whole state gets replicated on login if there is no script (or c++ module for that matter) denying the entity and component add requests. This is optional server side logic and transparent to the client.