It is common practice to allow users to set various information via web-form and send it to another component. It is possible with Burster plugin too.
Get the user dataYou can gather data from user using web form, for example you can allow the user to specify a texture of your game object. To do this just use standard form to get the texture file:
The uploader.php file moves uploaded file to the server, to the directory available to the Burster plugin.
The code firstly gets the session id - this identifier is latter used as a filename. The possibility that the session identifier is very low, so users have low chances to overwrite their files. After the file was moved to the directory accessible by Burster, the browser is redirected to the site with blend file embeded (see: embeding blends article).
Receiving data in blendThe most important thing is receiving the data in blend file. Before the Burster player will start you need to create valid parameters list - the example test.php file is listed below:
The additional parameter - session - is filed with user session identifier. As you remember from previous section, this parameter was used to create the file name that your blend should use. The rest of code is standard embeding code.
Now, in blend file i added to the logic bricks element that runs folowing Python code:
The script firstly checks if it is executed first time (the obj["Texture"] property is set to the user texture). Then the script finds parameter named "session". The value of the session parameter is the file name of the texture. After that, the script reads the texture from url and sets it to the object in scene.
You can download the source blend file here.
Following link http://kroliszewski.pl/itech/ shows how it works in practice.