Hi,

Le 31/01/2010 22:45, Guillaume Desmottes a écrit :
> Hi guys,
>
> As announced in a previous mail, I'm working on integrating Telepathy in
> Wormux.
>
> My idea is to add an *optional* dependency on telepathy-glib. If tp-glib
> is detected during ./configure Telepathy features are enabled.
>
> All the TP related files would live in a src/telepathy/ directory which
> would be build only if TP is enabled.
>
> The main component is a singleton Telepathy object. This object would be
> instantiated at startup and provide the following service:
>
> - Start a thread to run a GMainloop. telepathy-glib needs a Glib main
> loop to work properly. As it's not easy to hook one in Wormux's internal
> loops, the best solution is to run it in a thread..
>    

Ok for that point. It's probably the best and easier solution.

> - Handle incoming wormux tubes. Once a tube has been approved by the
> user, it has to be handled. Basically that means connecting the Wormux
> client to the tube's socket and display the network menu. This lead me
> to my first question. What's the best way to do that? This can be called
> at any point (while being in menus or in a game) so I'm not sure about
> the best way to hook that in the code. Suggestions are welcome.
>    

It can also happen in the loading screen, but it will be easier to 
handle it once the loading is finished. Menu are waiting for SDL_Event 
(there's no polling), we can generate a SDL_UserEvent to interrupt (this 
is already done when a network Action arrives).

In game, SDL_Events are tested at every refresh. So it should be 
possible to handle Menu or in game with the same code finally.

> - Track contacts supporting wormux. These contacts will be used to
> create the contact chooser widget.
>
> - Offer API to create the contact chooser. This function would be used
> by the network menu to display the list of potential contacts to invite.
>
> - Offer API to offer a tube to a contact. Once chosen, this function
> would be called to actually offer the Telepathy tube to the contact.
>
> - We should have some way to display feedback to the user: "Invitation
> sent to Alice" / "Alice accepted/rejected the invitation", etc.
> I'm not sure what's the best way to do that. Maybe passing the chat
> widget to the Telepathy module when offering a tube so it can used it
> directly to display feedback?
>    

Well, we can imagine a dedicated tab that will have its own message box 
and that will contain the contact chooser.

> Does this design make sense to you? The advantage of having a singleton
> as a single TP entry point is to reduce the number of #ifdef TELEPATHY.
> We'll have one only when initialising wormux and another on in the
> network menu (server side).
>    

 From what I read, you plan to protect all calls to Telepathy singleton 
methods. Another solution would have to protect inside methods. As far 
as I see, there will be at least one more entry point with the 
SDL_UserEvent to detect.

> I'm not used of Wormux's code so comments and suggestions are more than
> welcome.
>
> Thanks!
>    


Hope it helps,

Matt (gentildemon)

>
>       G.
>
>
>    


_______________________________________________
Wormux-dev mailing list
Wormux-dev@gna.org
https://mail.gna.org/listinfo/wormux-dev

Répondre à