From ca6a2970ea83d0850040aa3334e52d83ae0657dc Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 16 Apr 2018 16:02:21 -0400 Subject: TraversalClient: Make data externally read-only members private These are only ever queried for state, not written. Therefore, prevent writing to the members and make them private. --- Source/Core/DolphinWX/NetPlay/NetWindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Source/Core/DolphinWX/NetPlay/NetWindow.cpp') diff --git a/Source/Core/DolphinWX/NetPlay/NetWindow.cpp b/Source/Core/DolphinWX/NetPlay/NetWindow.cpp index cd4bba69a6..1ece3e1bc1 100644 --- a/Source/Core/DolphinWX/NetPlay/NetWindow.cpp +++ b/Source/Core/DolphinWX/NetPlay/NetWindow.cpp @@ -777,7 +777,7 @@ void NetPlayDialog::UpdateHostLabel() if (sel == 0) { // the traversal ID - switch (g_TraversalClient->m_State) + switch (g_TraversalClient->GetState()) { case TraversalClient::Connecting: m_host_label->SetForegroundColour(*wxLIGHT_GREY); @@ -786,13 +786,15 @@ void NetPlayDialog::UpdateHostLabel() m_host_copy_btn->Disable(); break; case TraversalClient::Connected: + { + const auto host_id = g_TraversalClient->GetHostID(); m_host_label->SetForegroundColour(*wxBLACK); - m_host_label->SetLabel( - wxString(g_TraversalClient->m_HostId.data(), g_TraversalClient->m_HostId.size())); + m_host_label->SetLabel(wxString(host_id.data(), host_id.size())); m_host_copy_btn->SetLabel(_("Copy")); m_host_copy_btn->Enable(); m_host_copy_btn_is_retry = false; break; + } case TraversalClient::Failure: m_host_label->SetForegroundColour(*wxBLACK); m_host_label->SetLabel("..."); -- cgit v1.2.3