SHARE
TWEET

Untitled

a guest Mar 23rd, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.vexsoftware.votifier.sponge.config;
  2.  
  3. import com.vexsoftware.votifier.util.TokenUtil;
  4. import ninja.leaping.configurate.objectmapping.Setting;
  5. import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
  6. import org.spongepowered.api.Sponge;
  7.  
  8. import java.util.Collections;
  9. import java.util.Map;
  10.  
  11. @ConfigSerializable
  12. public class SpongeConfig {
  13.  
  14.     @Setting(comment = "The IP to listen to. Use 0.0.0.0 if you wish to listen to all interfaces on your server. (All IP addresses)\n" +
  15.             "This defaults to the IP you have configured your server to listen on, or 0.0.0.0 if you have not configured this.")
  16.     public String host = Sponge.getServer().getBoundAddress().isPresent() ? Sponge.getServer().getBoundAddress().get().getAddress().getHostAddress() : "0.0.0.0";
  17.  
  18.     @Setting(comment = "Port to listen for new votes on")
  19.     public int port = 8192;
  20.  
  21.     @Setting(comment = "Whether or not to print debug messages. In a production system, this should be set to false.\n" +
  22.             "This is useful when initially setting up NuVotifier to ensure votes are being delivered.")
  23.     public boolean debug = true;
  24.  
  25.     @Setting( value = "disable-v1-protocol", comment = "Setting this option to true will disable handling of Protocol v1 packets. While the old protocol is not secure, this\n" +
  26.             "option is currently not recommended as most voting sites only support the old protocol at present. However, if you are\n" +
  27.             "using NuVotifier's proxy forwarding mechanism, enabling this option will increase your server's security.")
  28.     public boolean disableV1Protocol = false;
  29.  
  30.     @Setting(comment = "All tokens, labeled by the serviceName of each server list.\n" +
  31.             "Default token for all server lists, if another isn't supplied.")
  32.     public Map<String, String> tokens = Collections.singletonMap("default", TokenUtil.newToken());
  33.  
  34.     @Setting(comment = "Configuration section for all vote forwarding to NuVotifier")
  35.     public Forwarding forwarding = new Forwarding();
  36.  
  37.     @ConfigSerializable
  38.     public static class Forwarding {
  39.  
  40.         @Setting(comment = "Sets whether to set up a remote method for fowarding. Supported methods:\n" +
  41.                 "- none - Does not set up a forwarding method.\n" +
  42.                 "- pluginMessaging - Sets up plugin messaging")
  43.         public String method = "none";
  44.  
  45.         @Setting
  46.         public PluginMessaging pluginMessaging = new PluginMessaging();
  47.  
  48.         @ConfigSerializable
  49.         public static class PluginMessaging {
  50.  
  51.             @Setting
  52.             public String channel = "nuvotifier:votes";
  53.         }
  54.     }
  55. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top