Merge lp:~widelands-dev/widelands/bug-1830376-lanless-lan-game into lp:widelands

Proposed by Notabilis
Status: Merged
Merged at revision: 9136
Proposed branch: lp:~widelands-dev/widelands/bug-1830376-lanless-lan-game
Merge into: lp:widelands
Diff against target: 30 lines (+3/-3)
1 file modified
src/network/network_lan_promotion.cc (+3/-3)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug-1830376-lanless-lan-game
Reviewer Review Type Date Requested Status
GunChleoc Approve
Review via email: mp+368231@code.launchpad.net

Commit message

Use the loopback network interface for LAN announcements.

Description of the change

Allow the loopback network interface for LAN announcements, making it possible to use the LAN mode locally even when the network is disconnected.

Bonus fix: LAN games running on the same host now appear in the LAN lobby.
Also fixing missing whitespace in two error messages.

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

Tested and working :)

@bunnybot merge

review: Approve
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 5122. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/540162792.
Appveyor build 4904. State: failed. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1830376_lanless_lan_game-4904.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/network/network_lan_promotion.cc'
2--- src/network/network_lan_promotion.cc 2019-02-23 11:00:49 +0000
3+++ src/network/network_lan_promotion.cc 2019-06-01 17:25:24 +0000
4@@ -102,7 +102,7 @@
5 for (ifa = ifaddr, n = 0; ifa != nullptr; ifa = ifa->ifa_next, n++) {
6 if (ifa->ifa_addr == nullptr)
7 continue;
8- if (!(ifa->ifa_flags & IFF_BROADCAST) && !(ifa->ifa_flags & IFF_MULTICAST))
9+ if (!(ifa->ifa_flags & IFF_LOOPBACK) && !(ifa->ifa_flags & IFF_BROADCAST) && !(ifa->ifa_flags & IFF_MULTICAST))
10 continue;
11 switch (ifa->ifa_addr->sa_family) {
12 case AF_INET:
13@@ -291,7 +291,7 @@
14 // Remove this interface id from the set
15 it = interface_indices_v6.erase(it);
16 if (interface_indices_v6.empty()) {
17- log("[LAN] Warning: No more multicast capable IPv6 interfaces."
18+ log("[LAN] Warning: No more multicast capable IPv6 interfaces. "
19 "Other LAN players won't find your game.\n");
20 }
21 } else {
22@@ -359,7 +359,7 @@
23 throw WLWarning(_("Failed to use the local network!"),
24 /** TRANSLATORS: %s is a list of alternative ports with "or" */
25 _("Widelands was unable to use the local network. "
26- "Maybe some other process is already running a server on port %s"
27+ "Maybe some other process is already running a server on port %s "
28 "or your network setup is broken."),
29 i18n::localize_list(ports_list, i18n::ConcatenateWith::OR).c_str());
30 }

Subscribers

People subscribed via source and target branches

to status/vote changes: