Skip to content

Commit

Permalink
optional speaker healthchecks
Browse files Browse the repository at this point in the history
  • Loading branch information
Mindgamesnl committed Dec 27, 2024
1 parent 3fc8135 commit f81baea
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
java adoptopenjdk-8.0.332+9
java openjdk-21
6 changes: 0 additions & 6 deletions modules/vistas-server/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,6 @@
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>hamcrest-core</artifactId>
<groupId>org.hamcrest</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<properties>
Expand Down
2 changes: 1 addition & 1 deletion plugin/src/main/bash/data.bin
Original file line number Diff line number Diff line change
@@ -1 +1 @@
BUILD_NUM="1502"
BUILD_NUM="1503"
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@AllArgsConstructor
public class ClientRtcLocationUpdate {

private static final boolean PROCESS_OBSTRUCTIONS = StorageKey.SETTINGS_VC_PROCESS_OBSTRUCTIONS.getBoolean();
// private static final boolean PROCESS_OBSTRUCTIONS = StorageKey.SETTINGS_VC_PROCESS_OBSTRUCTIONS.getBoolean();
private static IRayTracer rayTracer = new DummyTracer();

private String streamKey;
Expand All @@ -24,15 +24,15 @@ public class ClientRtcLocationUpdate {

public static ClientRtcLocationUpdate fromClientWithLocation(ClientConnection clientConnection, Location source, Vector3 targetLocation) {
int obstructions = 0;

if (PROCESS_OBSTRUCTIONS) {
// check line-of-sight
obstructions = rayTracer.obstructionsBetweenLocations(
source,
targetLocation
);

}
//
// if (PROCESS_OBSTRUCTIONS) {
// // check line-of-sight
// obstructions = rayTracer.obstructionsBetweenLocations(
// source,
// targetLocation
// );
//
// }

return new ClientRtcLocationUpdate(
clientConnection.getRtcSessionManager().getStreamKey(),
Expand All @@ -48,14 +48,14 @@ public static ClientRtcLocationUpdate fromClient(ClientConnection clientConnecti

int obstructions = 0;

if (PROCESS_OBSTRUCTIONS) {
// check line-of-sight
obstructions = rayTracer.obstructionsBetweenLocations(
player.getLocation(),
originLocation
);

}
// if (PROCESS_OBSTRUCTIONS) {
// // check line-of-sight
// obstructions = rayTracer.obstructionsBetweenLocations(
// player.getLocation(),
// originLocation
// );
//
// }

return new ClientRtcLocationUpdate(
clientConnection.getRtcSessionManager().getStreamKey(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public enum StorageKey {
SETTING_VC_ENTERED_MUTED_REGION(false, "messages.voice-disabled-here", StorageLocation.CONFIG_FILE),
SETTING_VC_LEFT_MUTED_REGION(false, "messages.voice-reenabled-here", StorageLocation.CONFIG_FILE),
SETTINGS_VC_ANNOUNCEMENTS(false, "options.voicechat-announcements", StorageLocation.CONFIG_FILE),
SETTINGS_VC_PROCESS_OBSTRUCTIONS(false, "options.voicechat-obstructions", StorageLocation.CONFIG_FILE),
// SETTINGS_VC_PROCESS_OBSTRUCTIONS(false, "options.voicechat-obstructions", StorageLocation.CONFIG_FILE),
SETTINGS_VC_ALLOW_JOIN_DURING_LOAD(false, "options.voicechat-allow-joining-while-loading", StorageLocation.CONFIG_FILE),
SETTINGS_FORCE_OFFLINE_MODE(false, "options.force-offline-mode", StorageLocation.CONFIG_FILE),
SETTINGS_DEFAULT_WORLD_NAME(false, "options.fallback-world-name", StorageLocation.CONFIG_FILE),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public class Speaker extends DataStore implements BasicSpeaker {

@Column @Getter private String source;
@Column @Getter private UUID speakerId;
@Column(defaultValue = "true")
@Getter private Boolean requiresHealthCheck = true;
@Column @Setter @Getter private Integer radius;

@Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ public void run() {
possiblyFilterLimits(setSize, this.speakerService
.getSpeakerMap()
.values().stream()
.filter(speaker -> !speaker.getValidated())
.skip(fractionStart)
.filter(Speaker::getRequiresHealthCheck)
.filter(speaker -> !speaker.getValidated())
.skip(fractionStart)
).collect(Collectors.toList())
.forEach(speaker -> {
MappedLocation mappedLocation = speaker.getLocation();
Expand Down
4 changes: 0 additions & 4 deletions plugin/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,6 @@ options:
# Decides if voicechat messages should go in the hotbar or chat. Setting this to false will default to chat
voicechat-send-messages-in-hotbar: true

# Toggles voicechat obstruction detection. This can get quite resource intensive so it's off by default, but this muffles voices when
# One or more blocks are blocking the players line-of-sight
voicechat-obstructions: false

# Automatically request a free voicechat license when the server starts
voicechat-autoclaim-on-start: true

Expand Down
2 changes: 1 addition & 1 deletion plugin/src/main/resources/data.bin
Original file line number Diff line number Diff line change
@@ -1 +1 @@
BUILD_NUM="1502"
BUILD_NUM="1503"
4 changes: 2 additions & 2 deletions plugin/src/main/resources/openaudiomc-build.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
BUILD_VERSION="1502"
BUILD_COMMIT="c1b8d01b0ffb085c03a6af17a91695c43f8a1ce8"
BUILD_VERSION="1503"
BUILD_COMMIT="3fc8135d91e657f180dcb5bd23d8505083fa5365"
BUILD_AUTHOR="Mats"
2 changes: 1 addition & 1 deletion plugin/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 6.10.6
softdepend: [WorldGuard, Train_Carts, LiteBans, Essentials, PlaceholderAPI]
main: com.craftmend.openaudiomc.spigot.OpenAudioMcSpigot
api-version: 1.13
authors: [Mindgamesnl]
authors: [Mindgamesnl, ToetMats]
description: "OpenAudioMc: Proximity voice chat & audio plugin for Minecraft, no mods needed. Supports Bungeecord, Velocity, Spigot & more."
website: https://openaudiomc.net/
commands:
Expand Down

0 comments on commit f81baea

Please sign in to comment.