offlist (Re: ||unity-dev|| Relationship between server-side & client-side)

unity-dev@moock.org unity-dev@moock.org
Tue Feb 21 22:54:01 2006


Hi, here's what I use on the java side:

    // shortcut for global shared attributes
    public void setSharedAttr(ClientServices client, String attribute,
Object value)
    {
    	setClientAttr(client, attribute, value, null, null, 1);    	
    }

    // call this instead of client.setAttr directly.
     public void setClientAttr(ClientServices client, String
attribute, Object value,
     												String namespace, String room, int flags)
     {
         String fullname = (namespace == null)? null : namespace + "." + room;
         client.setAttribute(attribute, value, fullname, flags);
         UPCMessage msg = new UPCMessage("upcOnClientAttributeUpdate");
         msg.addArg(room);
         msg.addArg(namespace);
         msg.addArg(client.getClientID());
         msg.addArg(attribute);
         msg.addArg(value.toString());
         client.broadcastClient(UPCBuilder.build(msg));
     }



Then to use, I just do something like this: (still in java)
   String lastName = "Smithson";
   setSharedAttr(client, "lastName", lastName);

-David R

On 2/21/06, unity-dev-admin@moock.org <unity-dev-admin@moock.org> wrote:
> Hello,
>
> I'd be interested to get some some light about this topic too.
> I assume the answer is no, but i'd like to get a confirmation. :)
>
> thanks in advance,
>
> francis
>
> > 2. When creating a new obj attribute in Java via the
> > client.setAttribute("user",user,"udefault.presence",1),
> > is this attribute accessible from the flash-client
> > via: remoteuser.getAttribute()?
> >
> > I am assuming the answer is no because on the Java
> > side you are passing an object and on the flash side
> > you are accessing a simple string arg. If that is the
> > case and I cannot directly set parameters on the Java
> > side (i.e. firstName,lastName,age,etc.) which can then
> > be accessed directly by flash, I will have to send a
> > UPC message and pass each arg to a flash method which
> > then sets the attributes.
>
> --
> you're a unity-dev subscriber. to unsubscribe, visit www.moock.org/mailman/listinfo/unity-dev/
>
> superb hosting for this list and moock.org is generously provided by Rackspace. See: http://www.rackspace.com/?supbid=moock
>