a new event
Code: Select all
bz_eNewNonPlayerConnection
The data for this event will have a connection ID, and the data that was sent.
If a plug-in wishes to service this connection it can then call the function
Code: Select all
BZF_API bool bz_registerNonPlayerConnectionHandler ( int connectionID, bz_NonPlayerConnectionHandler* handler );
Code: Select all
virtual void pending ( int connectionID, void *data, unsigned int size );
virtual void disconnect( int connectionID );
the plug-in can send data to the connection by calling
Code: Select all
BZF_API bool bz_sendNonPlayerData ( int connectionID, const void *data, unsigned int size );
When the plug-in is done with a connection it can remove itself as a handler by calling
Code: Select all
BZF_API bool bz_removeNonPlayerConnectionHandler ( int connectionID, bz_NonPlayerConnectionHandler* handler );
This goes along with the changes to the bzflag connection protocol to make the client start the handshake and be more like HTTP.
There will be more API changes to let a plug-in use a protocol that needs a server side handshake, as well as listen on another port, but one thing at a time.[/code]