mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-08-12 04:09:36 -05:00
Show joining info for local and external IP addresses
Doesn't support traversal yet
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <jni.h>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Core/NetPlayCommon.h"
|
||||
#include "Core/Boot/Boot.h"
|
||||
#include "Core/Config/NetplaySettings.h"
|
||||
#include "Core/NetPlayClient.h"
|
||||
@@ -174,6 +175,25 @@ Java_org_dolphinemu_dolphinemu_features_netplay_NetplaySession_nativeStartGame(J
|
||||
server->RequestStartGame();
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_org_dolphinemu_dolphinemu_features_netplay_NetplaySession_nativeGetPort(JNIEnv* env,
|
||||
jobject obj)
|
||||
{
|
||||
if (auto* server = GetServerPointer(env, obj))
|
||||
return static_cast<jint>(server->GetPort());
|
||||
return 0;
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_org_dolphinemu_dolphinemu_features_netplay_NetplaySession_nativeGetExternalIpAddress(
|
||||
JNIEnv* env, jobject)
|
||||
{
|
||||
std::string ip = NetPlay::GetExternalIPAddress();
|
||||
if (ip.empty())
|
||||
return nullptr;
|
||||
return ToJString(env, ip);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_org_dolphinemu_dolphinemu_features_netplay_NetplaySession_nativeReleaseUICallbacks(JNIEnv*,
|
||||
jobject,
|
||||
|
||||
Reference in New Issue
Block a user