mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-08-11 19:57:58 -05:00
Store netplay BootSessionData and use it to run the netplay game
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
|
||||
#include "Core/AchievementManager.h"
|
||||
#include "Core/Boot/Boot.h"
|
||||
#include "jni/NetPlay/NetPlayUICallbacks.h"
|
||||
#include "Core/BootManager.h"
|
||||
#include "Core/CommonTitles.h"
|
||||
#include "Core/ConfigLoaders/GameConfigLoader.h"
|
||||
@@ -616,6 +617,22 @@ Java_org_dolphinemu_dolphinemu_NativeLibrary_Run___3Ljava_lang_String_2ZLjava_la
|
||||
BootSessionData(GetJString(env, jSavestate), delete_state));
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_RunNetPlay(
|
||||
JNIEnv* env, jclass, jobjectArray jPaths, jboolean jRiivolution)
|
||||
{
|
||||
auto boot_session_data = std::unique_ptr<BootSessionData>(reinterpret_cast<BootSessionData*>(
|
||||
env->GetStaticLongField(IDCache::GetNetplayClass(), IDCache::GetNetplayBootSessionDataPointer())));
|
||||
if (!boot_session_data)
|
||||
{
|
||||
env->CallStaticVoidMethod(IDCache::GetNativeLibraryClass(), IDCache::GetDisplayToastMsg(),
|
||||
ToJString(env, "Netplay: no boot session data"), JNI_TRUE);
|
||||
env->CallStaticVoidMethod(IDCache::GetNativeLibraryClass(), IDCache::GetFinishEmulationActivity());
|
||||
return;
|
||||
}
|
||||
env->SetStaticLongField(IDCache::GetNetplayClass(), IDCache::GetNetplayBootSessionDataPointer(), 0);
|
||||
Run(env, JStringArrayToVector(env, jPaths), jRiivolution, std::move(*boot_session_data));
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_RunSystemMenu(JNIEnv* env,
|
||||
jclass)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user