Show client connection errors and handle connection result

If result is a success sent event to launch the next netplay screen. if it fails, clear up the netplay client
This commit is contained in:
Tom Pratt
2026-04-09 12:40:07 +01:00
committed by Tom Pratt
parent 3ed9174208
commit f52ca02ca2
9 changed files with 184 additions and 21 deletions

View File

@@ -32,6 +32,7 @@ static jclass s_netplay_class;
static jfieldID s_net_play_client_pointer;
static jfieldID s_netplay_boot_session_data_pointer;
static jmethodID s_netplay_on_boot_game;
static jmethodID s_netplay_on_connection_error;
static jclass s_analytics_class;
static jmethodID s_get_analytics_value;
@@ -258,6 +259,11 @@ jmethodID GetNetplayOnBootGame()
return s_netplay_on_boot_game;
}
jmethodID GetNetplayOnConnectionError()
{
return s_netplay_on_connection_error;
}
jclass GetPairClass()
{
return s_pair_class;
@@ -668,6 +674,7 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved)
s_net_play_client_pointer = env->GetStaticFieldID(netplay_class, "netPlayClientPointer", "J");
s_netplay_boot_session_data_pointer = env->GetStaticFieldID(netplay_class, "bootSessionDataPointer", "J");
s_netplay_on_boot_game = env->GetStaticMethodID(netplay_class, "onBootGame", "(Ljava/lang/String;J)V");
s_netplay_on_connection_error = env->GetStaticMethodID(netplay_class, "onConnectionError", "(Ljava/lang/String;)V");
env->DeleteLocalRef(netplay_class);
const jclass analytics_class = env->FindClass("org/dolphinemu/dolphinemu/utils/Analytics");