mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-18 11:54:59 -04:00
fix some eros server list bugs
This commit is contained in:
parent
5c4b92e30b
commit
2f8a144965
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Minosoft
|
||||
* Copyright (C) 2021 Moritz Zwerger
|
||||
* Copyright (C) 2020-2022 Moritz Zwerger
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
@ -71,6 +71,7 @@ class PlayController : EmbeddedJavaFXController<Pane>(), Refreshable {
|
||||
refreshList()
|
||||
playTypeContentFX.children.setAll(this.root)
|
||||
}
|
||||
playTypeContentFX.children.setAll(currentController.root)
|
||||
}
|
||||
|
||||
playTypeListViewFX.selectionModel.select(0)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Minosoft
|
||||
* Copyright (C) 2021 Moritz Zwerger
|
||||
* Copyright (C) 2020-2022 Moritz Zwerger
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
@ -70,7 +70,6 @@ class ServerCardController : AbstractCardController<ServerCard>(), WatcherRefere
|
||||
if (previous === item) {
|
||||
return
|
||||
}
|
||||
previous?.unregister()
|
||||
item ?: return
|
||||
|
||||
serverNameFX.text = item.server.name
|
||||
@ -97,7 +96,7 @@ class ServerCardController : AbstractCardController<ServerCard>(), WatcherRefere
|
||||
|
||||
val ping = item.ping
|
||||
ping::state.observeFX(this) { // ToDo: Don't register twice
|
||||
if (ping.error != null || ping.lastServerStatus != null) {
|
||||
if (this.item != item || ping.error != null || ping.lastServerStatus != null) {
|
||||
return@observeFX
|
||||
}
|
||||
|
||||
|
@ -152,22 +152,19 @@ class StatusConnection(
|
||||
return super.registerEvent(invoker)
|
||||
}
|
||||
|
||||
if (!invoker.eventType.isAssignableFrom(ServerStatusReceiveEvent::class.java) && !invoker.eventType.isAssignableFrom(ConnectionErrorEvent::class.java) && !invoker.eventType.isAssignableFrom(StatusPongReceiveEvent::class.java)) {
|
||||
return super.registerEvent(invoker)
|
||||
}
|
||||
super.registerEvent(invoker)
|
||||
|
||||
|
||||
when {
|
||||
invoker.eventType.isAssignableFrom(ConnectionErrorEvent::class.java) -> {
|
||||
error?.let { invoker.invoke(ConnectionErrorEvent(this, EventInitiators.UNKNOWN, it)) } ?: super.registerEvent(invoker)
|
||||
error?.let { invoker.invoke(ConnectionErrorEvent(this, EventInitiators.UNKNOWN, it)) }
|
||||
}
|
||||
invoker.eventType.isAssignableFrom(ServerStatusReceiveEvent::class.java) -> {
|
||||
lastServerStatus?.let { invoker.invoke(ServerStatusReceiveEvent(this, EventInitiators.UNKNOWN, it)) } ?: super.registerEvent(invoker)
|
||||
lastServerStatus?.let { invoker.invoke(ServerStatusReceiveEvent(this, EventInitiators.UNKNOWN, it)) }
|
||||
}
|
||||
invoker.eventType.isAssignableFrom(StatusPongReceiveEvent::class.java) -> {
|
||||
lastPongEvent?.let { invoker.invoke(it) } ?: super.registerEvent(invoker)
|
||||
lastPongEvent?.let { invoker.invoke(it) }
|
||||
}
|
||||
else -> TODO()
|
||||
}
|
||||
return invoker
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user