My idea is to implement support for this myself. I'd add a radio button in
the dialog created in gtkgame.c:PlayersPage under the "Human" radio button
that would be labeled "Human (Host Network Game)". When selected, an
adjacent text box labeled "Port:" would be enabled and would contain a
default port (to listen on) that the user could modify. Also, the choice of
"Human (Host Network Game)" would force the radio box shown for the other
player to "Human (Connect to Network Game)". On the actual client's end,
he'd have to enter the server's "Host:" and "Port:". (It's not obvious how
these settings should appear to each player, but hopefully this explanation
makes sense.)

In terms of actual implementation, either player will be a PLAYER_HUMAN from
his own perspective, and his opponent will see himself as a PLAYER_EXTERNAL.
However, I think it will probably be necessary to create a supplementary
player type PLAYER_HUMAN_HOST and change the code so that comparisons such
as (ap[i].pt && (PLAYER_HUMAN || PLAYER_HUMAN_HOST)) end up being done. (Not
sure about the best way to do this, as I first set eyes on the gnubg sources
several hours ago.)

It seems that all of this won't require terribly much work, since all that
has to be done is to add to the GUI here and there and hook up the human
host to the human client by treating the latter like an "external" player
from the host's perspective (and vice-versa from the client's perspective).
I can forsee the need to factor out some code -- e.g. from
external.c:CommandExternal, so that the human host can listen for the human
client. But this doesn't look like it'd be too involved.

Eager to hear what you think -- especially if this has been hashed over
before.

Regards,

Jonathan
_______________________________________________
Bug-gnubg mailing list
Bug-gnubg@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnubg

Reply via email to