
AVChat 2 and AVConference are compatible with both FMS 2 & 3 and Red5 .
Creating default rooms in AVChat 2.0 and dropping users directly into them
Prerequisites:
- working AVChat 2 installation
- acces to the FMS server where the avchat2 FMS application (folder) is set up
A little bit of intro
The rooms information in AVChat 2 is kept on the FMS server. When you connect the first time to the avchat2 application on the FMS server, the FMS loads it into the memory and executes both the main.ase file and the settings.asc file. The main.ase fle holds the main logic while the settings.asc file holds some configuration options.
Getting dirty
To create default rooms you need to edit the settings.asc file with a text editor (Notepad++ is a good one) and duplicate this line:
application.createRoom('The Lobby','','');
There are 3 such lines in that file by default, each one creates another room. You can delete 2 of them but keep at least one at all times.
Each of these lines is a function call, and this is the usage:
application.createRoom(name,description,password);
The FMS application assigns a unique id to each room. The first such line from top to bottom will create the default room (with id r0) in which all users will get dumped by default when they log into AVChat via the user/admin client flash interfaces.
Create all your desired rooms by duplicating the line once for each room and modifying the 3 parameters. For example to create a public room for movie enthusiasts I would add this line at the end of the settings.asc file:
application.createRoom('Movies','Discussions about movies','');
After you are done with the setings.asc file, save it and upload it back to your FMS server. Now make sure you restart the FMS server or reload the avchat2 application using the FMS management console (Influxis does this automatically). This will ensure that the new settings.asc file will be loaded properly into the memory of the FMS server.
Dumping people into these rooms.
Now that you have your rooms you want to dump people directly into them. In the section above we have explained that each room gets a unique id (r0,r1,etc..). If you do not know what id each room has log in as an administrator using the admin interface and in the rooms list window you will see the id of each room.
Now, edit avc_settings.php or avc_settings.php and look for the roomid variable. Set the value of this variable to the id of the room you want the users to be dropped in.
If you want to distribute users across several rooms randomly, randomly assign a valid room id variable to each user.
If you have integrated your copy of AVChat 2 with your website you can drop certain users in certain rooms depending on the level of the user.
Note: If you drop a user directly into a passworded room he will not be asked for the password!
About rooms created using the user/admin interfaces
When you connect the first time to the avchat2 application on the FMS server, the FMS loads it into the memory and executes both the main.ase file and the settings.asc file. But if noone is connected and noone connects for a long time, the FMS server will unload the avchat2 application from the memory. This will mean that all the rooms created using the user/admin interfaces are cleared out because they are stored in the memory.
So to prevent rooms from dissapearing use the method above!
