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
=== modified file 'src/network/network_lan_promotion.cc'
--- src/network/network_lan_promotion.cc 2019-02-23 11:00:49 +0000
+++ src/network/network_lan_promotion.cc 2019-06-01 17:25:24 +0000
@@ -102,7 +102,7 @@
102 for (ifa = ifaddr, n = 0; ifa != nullptr; ifa = ifa->ifa_next, n++) {102 for (ifa = ifaddr, n = 0; ifa != nullptr; ifa = ifa->ifa_next, n++) {
103 if (ifa->ifa_addr == nullptr)103 if (ifa->ifa_addr == nullptr)
104 continue;104 continue;
105 if (!(ifa->ifa_flags & IFF_BROADCAST) && !(ifa->ifa_flags & IFF_MULTICAST))105 if (!(ifa->ifa_flags & IFF_LOOPBACK) && !(ifa->ifa_flags & IFF_BROADCAST) && !(ifa->ifa_flags & IFF_MULTICAST))
106 continue;106 continue;
107 switch (ifa->ifa_addr->sa_family) {107 switch (ifa->ifa_addr->sa_family) {
108 case AF_INET:108 case AF_INET:
@@ -291,7 +291,7 @@
291 // Remove this interface id from the set291 // Remove this interface id from the set
292 it = interface_indices_v6.erase(it);292 it = interface_indices_v6.erase(it);
293 if (interface_indices_v6.empty()) {293 if (interface_indices_v6.empty()) {
294 log("[LAN] Warning: No more multicast capable IPv6 interfaces."294 log("[LAN] Warning: No more multicast capable IPv6 interfaces. "
295 "Other LAN players won't find your game.\n");295 "Other LAN players won't find your game.\n");
296 }296 }
297 } else {297 } else {
@@ -359,7 +359,7 @@
359 throw WLWarning(_("Failed to use the local network!"),359 throw WLWarning(_("Failed to use the local network!"),
360 /** TRANSLATORS: %s is a list of alternative ports with "or" */360 /** TRANSLATORS: %s is a list of alternative ports with "or" */
361 _("Widelands was unable to use the local network. "361 _("Widelands was unable to use the local network. "
362 "Maybe some other process is already running a server on port %s"362 "Maybe some other process is already running a server on port %s "
363 "or your network setup is broken."),363 "or your network setup is broken."),
364 i18n::localize_list(ports_list, i18n::ConcatenateWith::OR).c_str());364 i18n::localize_list(ports_list, i18n::ConcatenateWith::OR).c_str());
365}365}

Subscribers

People subscribed via source and target branches

to status/vote changes: