Skip to content

Commit

Permalink
fix: check wildcard permission before everything else on permission u…
Browse files Browse the repository at this point in the history
…pdate
  • Loading branch information
Apehum committed Nov 4, 2024
1 parent ffdb0d6 commit cebc482
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion client/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ so there’s no need to worry if the server hasn't been updated to 2.1.x.

### Changes in 2.1.2
- Fixed buffer overflow when using AudioSender with delayed first frame.
- Fixed EncoderException on server switch on servers with proxy and proxy-side addons (e.g, groups addon).
- Fixed EncoderException on server switch on servers with proxy and proxy-side addons (e.g, groups addon).
- Fixed `pv.activation.*` permission is not being updated on the client without reconnect.
3 changes: 2 additions & 1 deletion proxy/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ so there’s no need to worry if the server hasn't been updated to 2.1.x.
### Changes in 2.1.2
- Fixed buffer overflow when using AudioSender with delayed first frame.
- Fixed client EncoderException on server switch caused by UDP packets sent to a client when client's server is null.
- Fixed ArrayIndexOutOfBoundsException exception when using `/` command on Velocity.
- Fixed ArrayIndexOutOfBoundsException exception when using `/` command on Velocity.
- Fixed `pv.activation.*` permission is not being updated on the client without reconnect.
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,8 @@ class VoiceServerActivationManager(
val player = event.player
val permission = event.permission

if (activationById.values.none { it.permissions.contains(permission) }) return

if (permission == WILDCARD_ACTIVATION_PERMISSION) {
when (player.instance.getPermission(WILDCARD_ACTIVATION_PERMISSION)) {

PermissionTristate.TRUE -> activationById.values.forEach {
player.sendPacket(ActivationRegisterPacket(it as VoiceActivation))
}
Expand All @@ -214,6 +211,9 @@ class VoiceServerActivationManager(
}
return
}

if (activationById.values.none { it.permissions.contains(permission) }) return

val permissionSplit = permission.split("\\.".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()

val activation = getActivationByName(permissionSplit[permissionSplit.size - 1]).orElse(null) ?: return
Expand Down
3 changes: 2 additions & 1 deletion server/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ Versions 2.0.x and 2.1.x are protocol-compatible,
so there’s no need to worry if the server hasn't been updated to 2.1.x.

### Changes in 2.1.2
- Fixed buffer overflow when using AudioSender with delayed first frame.
- Fixed buffer overflow when using AudioSender with delayed first frame.
- Fixed `pv.activation.*` permission is not being updated on the client without reconnect.

0 comments on commit cebc482

Please sign in to comment.