summaryrefslogtreecommitdiff
path: root/Source/Core/UICommon/NetPlayIndex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/UICommon/NetPlayIndex.cpp')
-rw-r--r--Source/Core/UICommon/NetPlayIndex.cpp14
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;
+}