Velocity queueing solution
at master 4.7 kB view raw
1/* 2 * ProxyQueues, a Velocity queueing solution 3 * Copyright (c) 2021 James Lyne 4 * 5 * Some portions of this file were taken from https://github.com/darbyjack/DeluxeQueues 6 * These portions are Copyright (c) 2019 Glare 7 * 8 * Permission is hereby granted, free of charge, to any person obtaining a copy 9 * of this software and associated documentation files (the "Software"), to deal 10 * in the Software without restriction, including without limitation the rights 11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 * copies of the Software, and to permit persons to whom the Software is 13 * furnished to do so, subject to the following conditions: 14 * 15 * The above copyright notice and this permission notice shall be included in all 16 * copies or substantial portions of the Software. 17 * 18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 */ 25 26package uk.co.notnull.proxyqueues.configuration.sections; 27 28import ch.jalu.configme.Comment; 29import ch.jalu.configme.SettingsHolder; 30import ch.jalu.configme.configurationdata.CommentsConfiguration; 31import ch.jalu.configme.properties.Property; 32 33import java.util.List; 34 35import static ch.jalu.configme.properties.PropertyInitializer.newListProperty; 36import static ch.jalu.configme.properties.PropertyInitializer.newProperty; 37 38 39public class ConfigOptions implements SettingsHolder { 40 @Comment("How many players should be allowed on the server in total? -1 to disable") 41 public static final Property<Integer> PLAYER_LIMIT = 42 newProperty("settings.player-limit", -1); 43 44 @Comment("How many seconds should be in-between each queue movement?") 45 public static final Property<Integer> DELAY_LENGTH = 46 newProperty("settings.delay-length", 2); 47 48 @Comment("How many seconds after a player disconnects should they be removed from the queue?") 49 public static final Property<Integer> DISCONNECT_TIMEOUT = 50 newProperty("settings.disconnect-timeout", 180); 51 52 @Comment({"List all the servers here that you would like to have a queue for.", 53 "For each server, you need to specify:", 54 "- The number of players to enabled queueing at", 55 "- The maximum number of players to allow into the server from the normal queue", 56 "- The maximum number of players to allow into the server from the normal and priority queues", 57 "- The maximum number of players to allow into the server from all queues", 58 "Syntax: server name; start players; max normal players ; max normal + priority players ; max all queues", 59 "Example: hub;50;200;220;225"}) 60 public static final Property<List<String>> QUEUE_SERVERS = 61 newListProperty("settings.servers", ""); 62 63 @Comment({"Players joining queue servers directly will be redirect to this server, or kicked if it isn't available"}) 64 public static final Property<String> WAITING_SERVER = 65 newProperty("settings.waiting-server", ""); 66 67 @Comment({"What would you like the priority permission node to be?"}) 68 public static final Property<String> PRIORITY_PERMISSION = 69 newProperty("settings.priority-permission", "proxyqueues.priority"); 70 71 @Comment({"What would you like the staff permission node to be?"}) 72 public static final Property<String> STAFF_PERMISSION = 73 newProperty("settings.staff-permission", "proxyqueues.staff"); 74 75 @Comment({"List of kick reasons that should be considered fatal.", 76 "If a player gets kicked from a queued server with one of these reasons, they will be removed from the queue without retrying.", 77 "Accepts partial reasons"}) 78 public static final Property<List<String>> FATAL_ERRORS = 79 newListProperty("settings.fatal-errors", ""); 80 81 @Comment({"How would you like to inform the player that they are in the queue?", 82 "Currently supports: BOSSBAR, ACTIONBAR, TEXT, TITLE"}) 83 public static final Property<String> INFORM_METHOD = 84 newProperty("notify.method", "ACTIONBAR"); 85 86 @Override 87 public void registerComments(CommentsConfiguration configuration) { 88 String[] pluginHeader = { 89 "ProxyQueues" 90 }; 91 configuration.setComment("settings", pluginHeader); 92 } 93 94}