summaryrefslogtreecommitdiff
path: root/Source/Android/app/src/main
diff options
context:
space:
mode:
authorTom Pratt <tom.pratt@outlook.com>2026-04-23 15:25:07 +0200
committerTom Pratt <tompratt@squareup.com>2026-05-19 12:02:57 +0200
commitb52ffa3e8ba6a12d1321c1f1adc76cf7cdce834e (patch)
tree758940c21a27eff6291f7adb80f0f630672d021d /Source/Android/app/src/main
parentb1b133b0361d5047b01d60dd492f0d5207921e42 (diff)
Release boot session data during Netplay cleanup
Boot session data is already handled when the game is booted so this is just fallback in case the game launch fails in some weird way. Add missing @Keep annotations to functions called from C++
Diffstat (limited to 'Source/Android/app/src/main')
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/netplay/Netplay.kt17
1 files changed, 15 insertions, 2 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/netplay/Netplay.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/netplay/Netplay.kt
index 7298795d71..f4eb178cb4 100644
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/netplay/Netplay.kt
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/netplay/Netplay.kt
@@ -27,8 +27,6 @@ import org.dolphinemu.dolphinemu.features.netplay.model.ConnectionType
import org.dolphinemu.dolphinemu.features.netplay.model.NetplayMessage
import org.dolphinemu.dolphinemu.features.netplay.model.Player
-//TODO add other necessary @Keep annotations
-//TODO clear boot session data at appropriate time
object Netplay {
@Keep
private var netPlayClientPointer: Long = 0
@@ -123,6 +121,11 @@ object Netplay {
sessionScope?.cancel()
sessionScope = null
+ if (bootSessionDataPointer != 0L) {
+ ReleaseBootSessionData()
+ bootSessionDataPointer = 0
+ }
+
if (netPlayClientPointer != 0L) {
ReleaseNetplayClient()
netPlayClientPointer = 0
@@ -159,6 +162,9 @@ object Netplay {
external fun adjustPadBufferSize(buffer: Int)
@JvmStatic
+ private external fun ReleaseBootSessionData()
+
+ @JvmStatic
private external fun ReleaseNetplayClient()
private fun mergeMessages(): Flow<NetplayMessage> = merge(
@@ -170,6 +176,7 @@ object Netplay {
// NetPlayUI callbacks
+ @Keep
@JvmStatic
fun onBootGame(gameFilePath: String, bootSessionDataPointer: Long) {
this.bootSessionDataPointer = bootSessionDataPointer
@@ -189,31 +196,37 @@ object Netplay {
_connectionLost.trySend(Unit)
}
+ @Keep
@JvmStatic
fun onConnectionError(message: String) {
_connectionErrors.trySend(message)
}
+ @Keep
@JvmStatic
fun onUpdate(players: Array<Player>) {
_players.tryEmit(players.toList())
}
+ @Keep
@JvmStatic
fun onChatMessageReceived(message: String) {
_chatMessages.tryEmit(message)
}
+ @Keep
@JvmStatic
fun onHostInputAuthorityChanged(enabled: Boolean) {
_hostInputAuthorityEnabled.tryEmit(enabled)
}
+ @Keep
@JvmStatic
fun onGameChanged(game: String) {
_game.tryEmit(game)
}
+ @Keep
@JvmStatic
fun onPadBufferChanged(buffer: Int) {
// Only for remote pad buffer settings. Ignore local max buffer changes.