Changeset - r19182:8f0b5a1acb1c
[Not reviewed]
master
0 4 0
rubidium - 13 years ago 2012-03-25 19:46:59
rubidium@openttd.org
(svn r24070) -Fix [FS#5098]: the 'last joined' server was not properly selected anymore (adf88)
4 files changed with 10 insertions and 13 deletions:
0 comments (0 inline, 0 general)
src/network/network_gamelist.cpp
Show inline comments
 
@@ -62,7 +62,7 @@ static void NetworkGameListHandleDelayed
 
			}
 
			item->manually |= ins_item->manually;
 
			if (item->manually) NetworkRebuildHostList();
 
			UpdateNetworkGameWindow(false);
 
			UpdateNetworkGameWindow();
 
		}
 
		free(ins_item);
 
	}
 
@@ -105,7 +105,7 @@ NetworkGameList *NetworkGameListAddItem(
 
	}
 
	DEBUG(net, 4, "[gamelist] added server to list");
 

	
 
	UpdateNetworkGameWindow(false);
 
	UpdateNetworkGameWindow();
 

	
 
	return item;
 
}
 
@@ -132,7 +132,7 @@ void NetworkGameListRemoveItem(NetworkGa
 

	
 
			DEBUG(net, 4, "[gamelist] removed server from list");
 
			NetworkRebuildHostList();
 
			UpdateNetworkGameWindow(false);
 
			UpdateNetworkGameWindow();
 
			return;
 
		}
 
		prev_item = item;
src/network/network_gui.cpp
Show inline comments
 
@@ -72,9 +72,9 @@ void SortNetworkLanguages()
 
 * found on the network.
 
 * @param unselect unselect the currently selected item
 
 */
 
void UpdateNetworkGameWindow(bool unselect)
 
void UpdateNetworkGameWindow()
 
{
 
	InvalidateWindowData(WC_NETWORK_WINDOW, WN_NETWORK_WINDOW_GAME, unselect ? 1 : 0);
 
	InvalidateWindowData(WC_NETWORK_WINDOW, WN_NETWORK_WINDOW_GAME, 0);
 
}
 

	
 
typedef GUIList<NetworkGameList*> GUIGameServerList;
 
@@ -438,6 +438,9 @@ protected:
 
public:
 
	NetworkGameWindow(const WindowDesc *desc) : QueryStringBaseWindow(NETWORK_CLIENT_NAME_LENGTH)
 
	{
 
		this->list_pos = SLP_INVALID;
 
		this->server = NULL;
 

	
 
		this->CreateNestedTree(desc);
 
		this->vscroll = this->GetScrollbar(WID_NG_SCROLLBAR);
 
		this->FinishInitNested(desc, WN_NETWORK_WINDOW_GAME);
 
@@ -447,8 +450,6 @@ public:
 
		InitializeTextBuffer(&this->text, this->edit_str_buf, this->edit_str_size, 120);
 
		this->SetFocusedWidget(WID_NG_CLIENT);
 

	
 
		UpdateNetworkGameWindow(true);
 

	
 
		this->field = WID_NG_CLIENT;
 
		this->last_joined = NetworkGameListAddItem(NetworkAddress(_settings_client.network.last_host, _settings_client.network.last_port));
 
		this->server = this->last_joined;
 
@@ -791,10 +792,6 @@ public:
 
	 */
 
	virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
 
	{
 
		if (data == 1) {
 
			this->server = NULL;
 
			this->list_pos = SLP_INVALID;
 
		}
 
		this->servers.ForceRebuild();
 
		this->SetDirty();
 
	}
src/network/network_internal.h
Show inline comments
 
@@ -145,7 +145,7 @@ void NetworkTCPQueryServer(NetworkAddres
 
void GetBindAddresses(NetworkAddressList *addresses, uint16 port);
 
void NetworkAddServer(const char *b);
 
void NetworkRebuildHostList();
 
void UpdateNetworkGameWindow(bool unselect);
 
void UpdateNetworkGameWindow();
 

	
 
bool IsNetworkCompatibleVersion(const char *version);
 

	
src/network/network_udp.cpp
Show inline comments
 
@@ -395,7 +395,7 @@ void ClientNetworkUDPSocketHandler::Rece
 

	
 
	item->online = true;
 

	
 
	UpdateNetworkGameWindow(false);
 
	UpdateNetworkGameWindow();
 
}
 

	
 
void ClientNetworkUDPSocketHandler::Receive_MASTER_RESPONSE_LIST(Packet *p, NetworkAddress *client_addr)
0 comments (0 inline, 0 general)