Snapshots | |
Overview | |
Definitions | |
Structure | A snapshot contains a series of items. |
Server Side | |
Creating | Items can be added when mods_snap is called using the snap_new_item function to insert an item to the snapshot. |
Client Side | |
Inspection | modc_newsnapshot is called when a new snapshot has arrived for processing. |
Rendering | DOCTODO |
In depth | |
Compression | After a snapshot have been created, compression is applyed to reduce the bandwidth. |
Interval | The interval for how often a client recives a snapshot changes during the course of the connection. |
Definitions | |
Structure | A snapshot contains a series of items. |
A snapshot contains a series of items. Each item have a type, id and data.
Creating | Items can be added when mods_snap is called using the snap_new_item function to insert an item to the snapshot. |
Items can be added when mods_snap is called using the snap_new_item function to insert an item to the snapshot. The server can not inspect the snapshot that is in progress of being created.
Inspection | modc_newsnapshot is called when a new snapshot has arrived for processing. |
Rendering | DOCTODO |
modc_newsnapshot is called when a new snapshot has arrived for processing. snap_num_items, snap_get_item and snap_find_item can be used to inspect the current and previous snapshot. This can be done anywhere while the client is running and not just in the modc_newsnapshot function. The client can also call snap_invalidate_item if an item contains improper information that could harm the operation of the client. This should however be done in modc_newsnapshot to assure that no bad data propagates into the rest of the client.
Compression | After a snapshot have been created, compression is applyed to reduce the bandwidth. |
Interval | The interval for how often a client recives a snapshot changes during the course of the connection. |
After a snapshot have been created, compression is applyed to reduce the bandwidth. There are several steps taken inorder to reduce the size of the size of the snapshot.
ESDDDDDD EDDDDDDD EDDDDDDD EDDDDDDD
E = extend S = sign D = data bit
The interval for how often a client recives a snapshot changes during the course of the connection. There are three different snapshot rates.
Called to create the snapshot for a client.
void mods_snap( int cid )
Creates a new item that should be sent.
void *snap_new_item( int type, int id, int size )
Called when the client progressed to a new snapshot.
void modc_newsnapshot()
Check the number of items in a snapshot.
int snap_num_items( int snapid )
Gets an item from a snapshot.
void *snap_get_item( int snapid, int index, SNAP_ITEM * item )
Searches a snapshot for an item.
void *snap_find_item( int snapid, int type, int id )
Marks an item as invalid byt setting type and id to 0xffffffff.
void snap_invalidate_item( int snapid, int index )