Skip to content

Commit

Permalink
[6.0.11][publish] Experimental > fix packet error
Browse files Browse the repository at this point in the history
  • Loading branch information
Bkm016 committed Jun 12, 2023
1 parent 1c36008 commit a70de28
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import taboolib.common.platform.Awake
import taboolib.common.platform.Platform
import taboolib.common.platform.PlatformSide
import taboolib.common.platform.event.SubscribeEvent
import taboolib.common.platform.function.info
import taboolib.common.platform.function.isListened
import taboolib.common.platform.function.pluginId
import taboolib.common.platform.function.warning
Expand Down Expand Up @@ -108,9 +109,19 @@ object ChannelExecutor {
ConnectionGetter.instance.release(e.player.address ?: return)
}

@Awake(LifeCycle.ENABLE)
@Awake(LifeCycle.ACTIVE)
private fun onEnable() {
onlinePlayers.forEach { addPlayerChannel(it, it.address?.address ?: return@forEach) }
if (TabooLibCommon.isStopped()) {
return
}
onlinePlayers.forEach {
val address = it.address?.address
if (address == null) {
warning("Cannot get player address: ${it.name} (${it.address})")
return@forEach
}
addPlayerChannel(it, address)
}
}

@Awake(LifeCycle.DISABLE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class ConnectionGetterImpl : ConnectionGetter() {
}
used
}
dev("Player connection ($address) -> ${connection.address()} (init=$init)")
dev("Player connection ($address) -> ${connection.address()} (${if (init) "init" else "get"})")
return connection
}

Expand Down

0 comments on commit a70de28

Please sign in to comment.