Skip to content

Commit 7a14c77

Browse files
committed
add config option
1 parent f629cb8 commit 7a14c77

File tree

7 files changed

+10
-4
lines changed

7 files changed

+10
-4
lines changed

plugin/src/main/bash/data.bin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
BUILD_NUM="1479"
1+
BUILD_NUM="1480"

plugin/src/main/java/com/craftmend/openaudiomc/generic/migrations/MigrationWorker.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public void handleMigrations() {
6363
new AddConfigKeyMigration(SETTINGS_PRELOAD_REPLENISH_POOL, "Add config value for better pool management"),
6464
new AddConfigKeyMigration(SETTINGS_AUTO_RECONNECT, "Add a migration setting for auto reconnect"),
6565
new AddConfigKeyMigration(SETTINGS_SPEAKER_MAX_RANGE, "Add max range config value"),
66+
new AddConfigKeyMigration(SETTINGS_STATIC_CHANNELS_SHOW_IN_WEB_UI, "Add a setting to show the channels web UI"),
6667
};
6768

6869
for (SimpleMigration migration : migrations) {

plugin/src/main/java/com/craftmend/openaudiomc/generic/storage/enums/StorageKey.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ public enum StorageKey {
110110
SETTINGS_HYDRATE_REGIONS_ON_BOOT(false, "options.hydrate-regions-on-boot", StorageLocation.CONFIG_FILE),
111111

112112
SETTINGS_STATIC_CHANNELS_ENABLED(false, "static-channels.enabled", StorageLocation.CONFIG_FILE),
113+
SETTINGS_STATIC_CHANNELS_SHOW_IN_WEB_UI(false, "static-channels.show-in-webclient", StorageLocation.CONFIG_FILE),
113114
SETTINGS_STATIC_CHANNELS_BASE(false, "static-channels.list", StorageLocation.CONFIG_FILE),
114115
SETTINGS_CHANNEL_COMMAND_ENABLED(false, "options.enable-channel-command", StorageLocation.CONFIG_FILE),
115116

plugin/src/main/java/com/craftmend/openaudiomc/spigot/modules/voicechat/VoiceChannelService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
import java.util.Map;
3434
import java.util.concurrent.ConcurrentHashMap;
3535

36+
import static com.craftmend.openaudiomc.generic.storage.enums.StorageKey.SETTINGS_STATIC_CHANNELS_SHOW_IN_WEB_UI;
37+
3638
public class VoiceChannelService extends Service implements Listener {
3739

3840
private Map<String, Channel> channelMap = new ConcurrentHashMap<>();
@@ -185,6 +187,7 @@ public VoiceChannel createChannel(String name, Client creator, boolean requiresP
185187
*/
186188
@Handler
187189
public void onClientConnect(VoicechatReadyEvent event) {
190+
if (!SETTINGS_STATIC_CHANNELS_SHOW_IN_WEB_UI.getBoolean()) return;
188191
User<?> user = (User<?>) event.getClient().getActor();
189192
ClientChannelsDisplayPacket packet = new ClientChannelsDisplayPacket(new ClientChannelsDisplayPayload(channelMap.values(), user, ClientChannelsDisplayPayload.ClientChannelOperation.ALL));
190193

plugin/src/main/resources/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ vc-filter:
324324
# These values are only used on spigot instances.
325325
static-channels:
326326
enabled: true
327+
show-in-webclient: true
327328
list:
328329
# Channel names must not be duplicate, empty, or contain spaces
329330
- name: survival

plugin/src/main/resources/data.bin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
BUILD_NUM="1479"
1+
BUILD_NUM="1480"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
BUILD_VERSION="1479"
2-
BUILD_COMMIT="caaa3c3e7da6aad1e21408d8ee461d0738742221"
1+
BUILD_VERSION="1480"
2+
BUILD_COMMIT="f629cb8f2ea9af10a5226f3c0d17c11216774feb"
33
BUILD_AUTHOR="Mats"

0 commit comments

Comments
 (0)