← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/bug-1542821-internet-exceptions into lp:widelands

 

GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1542821-internet-exceptions into lp:widelands.

Commit message:
Server and client will now log out when they crash.

Requested reviews:
  Klaus Halfmann (klaus-halfmann)
Related bugs:
  Bug #1542821 in widelands: "Inconsistency after Version Warning"
  https://bugs.launchpad.net/widelands/+bug/1542821

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1542821-internet-exceptions/+merge/292698

This should fix crashes with assert in internet lobby.

@klaus: If you have the time, could you please test again by pulling the cable also? I have no cable to pull...
-- 
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1542821-internet-exceptions.
=== modified file 'src/network/netclient.cc'
--- src/network/netclient.cc	2016-03-02 16:28:30 +0000
+++ src/network/netclient.cc	2016-04-23 08:26:47 +0000
@@ -221,6 +221,10 @@
 		WLApplication::emergency_save(game);
 		d->game = nullptr;
 		disconnect("CLIENT_CRASHED");
+		// We will bounce back to the main menu, so we better log out
+		if (internet_) {
+			InternetGaming::ref().logout("CLIENT_CRASHED");
+		}
 		throw;
 	}
 }

=== modified file 'src/network/nethost.cc'
--- src/network/nethost.cc	2016-03-29 10:04:48 +0000
+++ src/network/nethost.cc	2016-04-23 08:26:47 +0000
@@ -789,6 +789,10 @@
 			disconnect_client(0, "SERVER_CRASHED");
 			reaper();
 		}
+		// We will bounce back to the main menu, so we better log out
+		if (internet_) {
+			InternetGaming::ref().logout("SERVER_CRASHED");
+		}
 
 		throw;
 	}


Follow ups