viernes, 22 de mayo de 2020

viernes, 31 de julio de 2009

typed data on Remote SharedObject's

I have a couple of Users who do videoChat, the User object (valueObject) has a Status, and a Role.

I have a remote Shared Object so that every user sees the Status of all the others, as well as their role.

The best fit would be doing sharedObject.setProperty(this.user.name,this.user) so the other users would see me and my status and role, and that whenever I do this.user.status="busy" all the other users see the change automatically. That would be possible if the User were "Bindable" and the "sharedObject" had bound to the user... unfortunately SharedObjects don't seem to be that advanced, and you need to do sharedObject.setDirty(this.user.name) but that's still easy enough.

I have tried to use RemoteClass meta-attribute in order to have my sharedObject.data users having the type User in all of the videoChat clients. Unfortunately that doesnt't seem to work. When you do setProperty to the sharedObject, it keeps a reference to the object with its type, but when it sends the object to the server, it is converted to a simple Object with attribute-value-pairs (think plain json), and Type is lost.
I have tried this with Red5, and maybe this is something that depends on the RTMP implementation, since RemoteClass was originally thought to synchronize the type of an object on the client with the type of an object on the server. I thought it would still allow to synchronize the Type of the object on the different clients but that doesn't seem to be the case, furthermore the sharedObject properties don't seem to be forwarded from the server to the clients if they have a RemoteClass type (I think this may be because the server doesn't have a class by that name, and thus it throws a ClassNotFound exception, and then the changes don't get propatagated to the clients..., could that be a source for DOS attacks ? :P)