bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnubg] Adding support for human vs. human over network


From: Jonathan DePeri
Subject: [Bug-gnubg] Adding support for human vs. human over network
Date: Sun, 20 Jun 2010 02:00:25 -0400

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]