comparison src/network/core/tcp_game.cpp @ 18629:a55c2ad0bf2c draft

(svn r23476) -Codechange: use the error queue to replace switch mode error strings, again making it possible to return multiple errors
author rubidium <rubidium@openttd.org>
date Sat, 10 Dec 2011 15:16:58 +0000
parents f65933f87e02
children c1cf2d256f83
comparison
equal deleted inserted replaced
18628:718c69c25a56 18629:a55c2ad0bf2c
16 #include "../../stdafx.h" 16 #include "../../stdafx.h"
17 17
18 #include "../network.h" 18 #include "../network.h"
19 #include "../network_internal.h" 19 #include "../network_internal.h"
20 #include "../../debug.h" 20 #include "../../debug.h"
21 #include "../../error.h"
21 22
22 #include "table/strings.h" 23 #include "table/strings.h"
23 24
24 /** 25 /**
25 * Create a new socket for the game connection. 26 * Create a new socket for the game connection.
44 { 45 {
45 /* Clients drop back to the main menu */ 46 /* Clients drop back to the main menu */
46 if (!_network_server && _networking) { 47 if (!_network_server && _networking) {
47 _switch_mode = SM_MENU; 48 _switch_mode = SM_MENU;
48 _networking = false; 49 _networking = false;
49 extern StringID _switch_mode_errorstr; 50 ShowErrorMessage(STR_NETWORK_ERROR_LOSTCONNECTION, INVALID_STRING_ID, WL_CRITICAL);
50 _switch_mode_errorstr = STR_NETWORK_ERROR_LOSTCONNECTION;
51 51
52 return NETWORK_RECV_STATUS_CONN_LOST; 52 return NETWORK_RECV_STATUS_CONN_LOST;
53 } 53 }
54 54
55 return this->CloseConnection(error ? NETWORK_RECV_STATUS_SERVER_ERROR : NETWORK_RECV_STATUS_CONN_LOST); 55 return this->CloseConnection(error ? NETWORK_RECV_STATUS_SERVER_ERROR : NETWORK_RECV_STATUS_CONN_LOST);