Merge lp:~ebke/widelands/ping-on-pause into lp:widelands

Proposed by Johannes Ebke
Status: Merged
Merged at revision: 6421
Proposed branch: lp:~ebke/widelands/ping-on-pause
Merge into: lp:widelands
Diff against target: 15 lines (+3/-2)
1 file modified
src/network/nethost.cc (+3/-2)
To merge this branch: bzr merge lp:~ebke/widelands/ping-on-pause
Reviewer Review Type Date Requested Status
Widelands Developers Pending
Review via email: mp+116114@code.launchpad.net

Description of the change

Also start the socket keep-alive ping if all players agree on pausing the game.

To post a comment you must log in.
Revision history for this message
SirVer (sirver) wrote :

Merged in r6421. Thanks Johannes!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/network/nethost.cc'
2--- src/network/nethost.cc 2012-07-13 20:46:30 +0000
3+++ src/network/nethost.cc 2012-07-21 11:45:25 +0000
4@@ -2472,8 +2472,9 @@
5 }
6 }
7
8- // If a pause was forced, send a ping regulary to keep the sockets up and running
9- if (m_forced_pause && (time(0) > (d->lastpauseping + 20))) {
10+ // If a pause was forced or if the players all pause, send a ping regularly
11+ // to keep the sockets up and running
12+ if ((m_forced_pause || realSpeed() == 0) && (time(0) > (d->lastpauseping + 20))) {
13 d->lastpauseping = time(0);
14
15 SendPacket s;

Subscribers

People subscribed via source and target branches

to status/vote changes: