Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Bunch of questions

Avatar

Level 3
Hello Cocomo's team, i have few questions and concept i would
like to validate.



1
Room management

I don't know if spawning a room on each request is the most
effective since i would have to login as a developer every time and
that takes a little bit of time. On the other hand if i create a
pool of 50 rooms and keep track of their names on my server i would
still have to login for each of them the time to redirect users to
the app has come, we would call call
accountmanager.getSession("roomname"). When i tried to pickle
(store) accountmanager object, its life time is not infinite after
a while i will need to relogin to make the "am" work.

How would you manage a pool of rooms while minimising the
login request ?



2
Room lifetime

On our free version of the tool we would like not to cut too
much on the features side but limitate the room lifetime by forcing
a closure of the room after 10 minutes for example. How would you
achieve such a thing ? by puting the code in the client directly ?
by keeping track of the time of when the room was created, and use
the webserver to remove the room after the time is up ? Other
solutions ?



3
Room limitation

In the same fashion how could i limit the number of users in
a room to Two ? (excluding the creator), that makes two publishers
for example.



Thanks,



Greg



17 Replies

Avatar

Employee
Hi Greg!



1) I would suggest you do "pickle" the accountmanager object
and reuse it to create rooms when you need to, and just catch the
authentication error (could be a permission error - you'll have to
try :) to recreate the accountmanager object when the old one
"expires".



2) Right now you will have to do it in your client, but this
makes for an excellent feature request and we'll try to provide a
better solution in one of the next revisions of the SDK (currently
the removeRoom webservice doesn't stop a running room, not because
it shouldn't, just because we didn't get to it :)



3) The correct implementation is that you configure the room
to NOT allow guests (and disable autopromote) and then make the
first two users of the room "viewer" (and after the first two you
start refusing client logins on your server). This seems to be
another good candidate for a new feature of Cocomo (you configure
you room with your own limits and we keep track of who's in) .



Hey, thanks for being the "guinea pig" for the service APIs
and keep the comments coming! :)



Avatar

Level 3
I am ok with being the guinea pig :), i wish cocomo could
bring more people on the forum tho.



For number 3,

I can stop clients to access a room by not giving them
session keys when i know there are already two people in the room
but how do i stop the same user to join twice in two separate
browser windows for example.



Greg

Avatar

Former Community Member
Hi,



Both are Room Lifetime and Room Limitation features has been
seriously given a thought and will be updated in a future drop of
SDK. So, watch out for future SDK drop!!

Avatar

Employee
In the mean time you could implement #3 by monitoring the
roster changes. If a client gets a notification for a new user with
the same userid it could shut down itself and let the new one
continue.



Avatar

Level 3
I will try to implement the roaster way.



For question #2 you stated

"currently the removeRoom webservice doesn't stop a running
room" If the room is inactive the remove call still works ?



Also i have a security question about #2

To tell my swf client the difference between a limited room
in time and an unlimited (paying account) room I will pass it a
flag or a key, as well as authtoken and the roomurl at creation
time.



But a user can see the "limited" flag and "full" flag (if he
had a previously paid accound) which he could use to forge an
unlimited room.



To solve this i was thinking of using a specific permission
value of "5" for the permission component of the authtoken
generated key. I could then check for the permission value, set up
the user as viewer and limit the time on the client if needed.

What call do i have to make to get permission value out of
the authtoken ?



Or maybe i should make my client do an http call on my server
with the roomname as parameter to return the boolean: session for
this room is limited or not depending on the creator rights.



How would you approach this ?

Thanks a lot





Avatar

Level 3
Is it possible to set up files with the FilePublisher using
the API to preset some files for a room ?

Avatar

Former Community Member
Hi ,



You can look at at the code of FilePublisher to see how
FilePublisher calls publishFileDescriptor API of FileManager. You
need to create a fileReference from name, size etc and pass it to
FileManager in that API.

You can also use either the uploadFileReference API for
FileShare or FilePublisher to publish if you already have the
reference.

Hope this helps.



Thanks

Hironmay Basu

Avatar

Former Community Member
Hi Coulix,



You should be able to set up a group in the fileManager
where "sessionDependentItems" is false (right now they're all true,
I believe). From there, your files should stay up on the server,
and (I admit I haven't tried) you should be able to template a room
with them there. Let us know if this works for you.



nigel

Avatar

Level 2
Hi,

I have a quick Question . What is The Difference between
sharedID and Groupname . As shared id is associated with
sharedModel And GroupName is associated With PODS. I dont see the
logical location of groupName on cocomo service as i can see
sharedID as Seperate Collection Node.Need Some help on this thing
thanks.

Avatar

Former Community Member
Hi ATIF,



Every collection node has a name and it is stored by that
name on server. The sharedID specifies the name of the
collectionNode. Normally, every shared model that creates a
collectionNode will give a default value to the name unless you set
it yourself. If you set the sharedID, the collectionNode will be
stored with that name(sharedID). The sharedID property is
implemented in ISessionSubscriber interface that is used by all the
shared Model components of cocomo.



GroupName is used for creating multiple groups of components
like AudioSubscriber or WebcamPublisher within the same room. So,
if you set both the sharedID and the groupName, the sharedID(name)
of the collection node will be like "sharedID" + "groupName" .
GroupName by default is null i.e. if there is only one group of
components in a room. To see details of how to use groups, see the
MultipleGroups example.



Hope this helps.



Thanks

Hironmay Basu

Avatar

Former Community Member
Hi ATIF,



groupName really shines when it comes to audio/video
components, as well as the filePublisher/subscriber - those don't
really take sharedID (they're not shared models). For components
which do use sharedID, groupName essentially offers, as Basu says,
an additional namespace in which to separate various groups of
shared models.

Avatar

Level 2
Thanks Nigel and Hironmay for giving comprehensive
explanation :)

Avatar

Level 2
i was going through "MultipleGroups.mxml"



here you explicity created group Model For each group. But i
think

when you add a user to particular group . Then group model is
automatically initialized if its not initalized allready.



protected function
initializeGroupModels(p_groupName:String):void

{

// the values at the runtime should be coming from the
layout



_simpleChatModel = new SimpleChatModel();

_simpleChatModel.sharedID = simpleChat.id + p_groupName ;

_simpleChatModel.connectSession = sess ;

_simpleChatModel.subscribe();





_noteModel = new NoteModel() ;

_noteModel.sharedID = simpleNote.id + p_groupName ;

_noteModel.connectSession = sess ;

_noteModel.subscribe();



_streamManager.createGroup(p_groupName);





}

Avatar

Former Community Member
Hi Atif,



Where you saw the users being added creates the new group? As
you will find in the UI of example MultipleGroups, you need to
first create a group, and then select that group to add an user to
it. When I create a group, it creates the required sharedModels for
that group,depending on the pods/components required, in the
InitializeGroupModels function. And I call this function only while
creating a new group.



Adding/remove user to the group updates the list of users in
a particular group in MultipleGroupModel .

Thanks

Hironmay Basu

Avatar

Level 2
protected function userAdded(p_evt:CollectionNodeEvent):void

{



if ( p_evt.item.itemID == sess.userManager.myUserID ) {

trace(p_evt.nodeName)

simpleChat.groupName = p_evt.nodeName ;

simpleNote.groupName = p_evt.nodeName ;

camera1.groupName = p_evt.nodeName ;

}



userList.dataProvider =
_model.getUsersInGroup(_model.getMyGroup());

}



following three lines will not make underlying shared models
for these three components ? or may be i am not getting it .



simpleChat.groupName = p_evt.nodeName ;

simpleNote.groupName = p_evt.nodeName ;

camera1.groupName = p_evt.nodeName ;

Avatar

Former Community Member
Hi,



Yes you are correct, It does initialize the model if they are
not already there. In the example, since I needed a groupName first
to select and assign the pods, i demonstrated a way to create the
model yourself which is internally done inside 'set groupName' for
SimpleChat and note and inside StreamManager when the group is not
there.

This was done purely for the users to have an alternate way
of initialize the a model with groupName from outside.

Thanks

Hironmay Basu



Thanks for the