widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #10934
Re: [Merge] lp:~widelands-dev/widelands/net-relay into lp:widelands
Sorry for the long silence, I should have written much earlier. My primary problem is lack of time, but when I can work on it its going well enough. I fear I won't be able to work on it in the next two weeks but hopefully I have more time afterwards.
Thanks for the comments regarding the protocol, it should be all fixed now. I also changed some more things while working on the implementation.
First (alpha-) versions of the relay server and the game connections have been implemented. The current state is pushed here and on GitHub. I haven't tested it yet but it compiles and the general design should be recognizable. If you want to comment on it, go ahead. My next step will probably be to try to run a game over the relay (and fix all the bugs that come up...).
As a high-level overview:
- The relay server is one process which creates a Game object for each running game. New connections are all to the same port. Based on their first message (containing the game name) they are distributed between the running games.
- I extracted a NetHostInterface/NetClientInterface from the NetHost/NetClient classes. These interfaces are also implemented by NetHostProxy/NetHostClient. For LAN games the old NetHost/NetClient classes are instantiated, for internet games the *Proxy classes are used. These pack all packets and actions (e.g. (dis-)connects) as described in relay_protocol.h and sent them over a single connection to the relay server. There they are forwarded to the other participants of the respective game. This way, the GameHost/GameClient classes do not have to care whether it is an internet or a local game.
What is currently missing is the integration with the metaserver. When a player wants to start a new game the metaserver has to order the relay to create the respective game and tell the host about ip/port/host-password of it. After the host connected, the metaserver can announce the game in the lobby for other clients to join.
--
https://code.launchpad.net/~widelands-dev/widelands/net-relay/+merge/327491
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/net-relay into lp:widelands.
References