network play does not open a socket with bzr8557[trunk]

Bug #1744367 reported by Klaus Halfmann
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
widelands
Fix Released
High
Notabilis

Bug Description

Tried to testplay with teppo his scout change bzr8549[feature-1656664-scout-improvement]
but failed to open a network game, tried the same with bzr8557[trunk].

We both noticed that widelands does not open.
I noticed the OSX Friewall did not ask permissions.
Teppo checkeck on linux with Netstat an strace, same problem there.

this must have been introduced somewhere in early 2018?

Teppo Mäenpää (kxq)
Changed in widelands:
status: New → Confirmed
Revision history for this message
Teppo Mäenpää (kxq) wrote :

With build 19, widelands listens a socket and I see the socket open. With current trunk,
- listen never called
- There is not listen port open (or IPv6 equivalent, unsure which we are using now)
- Network play fails: clients cannot connect.

IPv4-only network available.

Revision history for this message
Teppo Mäenpää (kxq) wrote :

"Internet game" is affected, "LAN/Direct IP" not.

GunChleoc (gunchleoc)
Changed in widelands:
assignee: nobody → Notabilis (notabilis27)
Revision history for this message
Notabilis (notabilis27) wrote :

Sorry for the late response, I had no internet for some days. :-/

In the current trunk, we are using both IPv4 and IPv6 for both types of network games.

For LAN games there is a listening port involved since the game host is also a network host. For internet games we have no network host (so no listen()), since all games are routed over the relay server / metaserver. So its correct that you can't find any open ports with current trunk since we are only using outgoing connections (same as, e.g., a webbrowser).

So much for that part. Apart from that: Congratulations, you broke the relay server, thanks for reporting! It seems that Klaus has some timeouts while trying to connect to the relay server and due to a bug the game on the relay is never closed, so further attempts with the same game name fail. Also, there are some timeouts and forcible disconnects while starting/loading the game. Bugfix: Klaus, get a faster computer. ;-)
Okay, not really. I guess I have to rethink the timeouts, probably just increase them and live with possibly longer hanging games when a client looses the connection.

Revision history for this message
Teppo Mäenpää (kxq) wrote :

Thanks for the info. How comes that a game initialized by me (=different name etc.) failed, too?

The widelands fan club of Australia should give this a try.

Revision history for this message
kaputtnik (franku) wrote :

As far i understand is Portforwarding for the one who host a game isn't needed anymore?

Revision history for this message
Notabilis (notabilis27) wrote :

As far as I can tell from the logs, everything worked fine when you were hosting. No-one tried to connect to your games, though. What was the error? Have your games been listed as un-connectable?

Uh ... what is the "widelands fan club of Australia" and what does it have to do with this??

Current trunk no longer require port forwardings for internet play over the metaserver, that is correct. There is a small note concerning it in the related wiki page but no big announcement has been done yet.

Revision history for this message
Teppo Mäenpää (kxq) wrote :

I have not checked if this is still true, but at some point widelands needed packet roudtrip to advance to next game-time step. This became a problem with intercontinental network latency.

If all network games go through a central server, this could affect network playing, if opponent is close but Berlin far away. With "ping" approaching 300 ms or so, it is not so fun anymore. Keeping in mind, that 1) I noticed this long time ago, I did not cross-check if it is still true, and 2) only loosely related to this bug.

When/if the latency is not a problem, the new way is more convenient than the old way was.

Revision history for this message
Teppo Mäenpää (kxq) wrote :

Just came to my mind when you said that a timeout caused the server to fail.

Revision history for this message
Notabilis (notabilis27) wrote :

Good point with the latency. As far as I know, network traffic is not required to advance the local state. Intercontinental latency might indeed be a problem. I can't test it myself so I guess we just have to wait if anyone complains.

I fixed a few bugs your (tried) internet game showed, thanks for reporting the problems. If any more problems turn up, please open a new bug. My current "fix" for the timeout issue is simply increasing the timeout time. It should be long enough now that even loading big maps should work with the relay. Fixing this the right way will need some restructuring of the widelands code and I wanted to get out some fix quickly.

I am setting this bug to solved even though the described problem isn't really one.

Changed in widelands:
status: Confirmed → Fix Committed
Revision history for this message
Teppo Mäenpää (kxq) wrote :

I tried playing in high latency condition. Worked, but the person hosting the game had a clear advantage. The longer the delay, the less fun it was to be at the wrong end.

This should be taken into account in future tournaments somehow.

..

Out of scope. Fix committed.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build20-rc1

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.