diff options
| author | spycrab <spycrab@users.noreply.github.com> | 2019-04-12 14:21:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-12 14:21:42 +0200 |
| commit | 2a1dee4dce2e0e671d3a90f33164fc015aece7a0 (patch) | |
| tree | 006dda648cd317e944d11881cc0fc10be25deee7 /Source/Core/UICommon/NetPlayIndex.cpp | |
| parent | f2e3f69d34317c7f4fc1fe4e94d470344dafd1f7 (diff) | |
| parent | 8b6bb39e82b66c0faa7ac29512b3f68167874404 (diff) | |
Merge pull request #7976 from spycrab/netplay_index_feedback
Qt/NetPlay: Show feedback for index adding
Diffstat (limited to 'Source/Core/UICommon/NetPlayIndex.cpp')
| -rw-r--r-- | Source/Core/UICommon/NetPlayIndex.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/Core/UICommon/NetPlayIndex.cpp b/Source/Core/UICommon/NetPlayIndex.cpp index 9915bb311d..c6ab872b4e 100644 --- a/Source/Core/UICommon/NetPlayIndex.cpp +++ b/Source/Core/UICommon/NetPlayIndex.cpp @@ -142,6 +142,8 @@ void NetPlayIndex::NotificationLoop() if (!json) { m_last_error = "BAD_JSON"; + m_secret.clear(); + m_error_callback(); return; } @@ -150,6 +152,8 @@ void NetPlayIndex::NotificationLoop() if (status != "OK") { m_last_error = std::move(status); + m_secret.clear(); + m_error_callback(); return; } } @@ -323,3 +327,13 @@ const std::string& NetPlayIndex::GetLastError() const { return m_last_error; } + +bool NetPlayIndex::HasActiveSession() const +{ + return !m_secret.empty(); +} + +void NetPlayIndex::SetErrorCallback(std::function<void()> function) +{ + m_error_callback = function; +} |
