[Twisted-Python] Unpersistable instead of pb.Avatar

Flint grindizer at gmail.com
Sun Dec 1 05:12:56 MST 2013


Hi,

How do I fix this and actually send out new perspectives to users?
>

pb.Avatar is not a Referenceable object, the object which is sent when a
client login is a wrapper againt the pb.Avatar object built like this:

// pb.py L1327
   if not IJellyable.providedBy(avatar):
           avatar = AsReferenceable(avatar, "perspective")

So I suppose you can wrap your avatars object just like this before sending
them, "OR" you can make you own implementation of "an avatar" (implementing
IPerspective interface) and make it IJellyable at first place.

It doesn't make sense to use the same perspective in
> both games


I don't see why not personally.
Your Avatar is supposed to represente a "user" after that, it is up to you
to define what a "User" is for your application.
If a "user" is a "physical person", so your avatar could play several games
at once, your avatar could then have a list of "played games" (for
examples).
If your "user" is a couple of ("physical person"  + "a game") so each
person playing a game will represent a different "user" in the point of
view of your application.
etc.

it would be nice to separate
> the responsibilities of the user from those of the "player."
>

As I said the avatar or the user has the responsabilites that you will give
to it. I don't think Twisted makes any asumption about that (IMHO).

--
Nacim.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20131201/e1e1edfb/attachment.html>


More information about the Twisted-Python mailing list