Store netplay BootSessionData and use it to run the netplay game

This commit is contained in:
Tom Pratt
2026-04-08 15:20:19 +01:00
committed by Tom Pratt
parent 766374434c
commit 3ed9174208
8 changed files with 82 additions and 4 deletions

View File

@@ -30,7 +30,8 @@ static jfieldID s_game_file_cache_manager_instance;
static jclass s_netplay_class;
static jfieldID s_net_play_client_pointer;
static jmethodID s_netplay_on_msg_start_game;
static jfieldID s_netplay_boot_session_data_pointer;
static jmethodID s_netplay_on_boot_game;
static jclass s_analytics_class;
static jmethodID s_get_analytics_value;
@@ -247,6 +248,16 @@ jfieldID GetNetPlayClientPointer()
return s_net_play_client_pointer;
}
jfieldID GetNetplayBootSessionDataPointer()
{
return s_netplay_boot_session_data_pointer;
}
jmethodID GetNetplayOnBootGame()
{
return s_netplay_on_boot_game;
}
jclass GetPairClass()
{
return s_pair_class;
@@ -655,6 +666,8 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved)
env->FindClass("org/dolphinemu/dolphinemu/features/netplay/Netplay");
s_netplay_class = reinterpret_cast<jclass>(env->NewGlobalRef(netplay_class));
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");
env->DeleteLocalRef(netplay_class);
const jclass analytics_class = env->FindClass("org/dolphinemu/dolphinemu/utils/Analytics");