Skip to content
This repository has been archived by the owner on Jun 20, 2019. It is now read-only.

Commit

Permalink
v2.1: Added Beam support
Browse files Browse the repository at this point in the history
  • Loading branch information
dries007 committed Feb 24, 2016
1 parent 16fa953 commit b091889
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
@@ -1,7 +1,7 @@
ForgeSubWhitelist
=================

Forge Whitelist mod for Twitch and GameWisp
Forge Whitelist mod for Twitch, Beam and GameWisp

For players
-----------
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Expand Up @@ -28,14 +28,14 @@ apply plugin: "maven"
apply plugin: "idea-utils"

group = "net.doubledoordev.fsw"
version = "2.0.0"
version = "2.1.0"

targetCompatibility = 1.7
sourceCompatibility = 1.7

archivesBaseName = 'ForgeSubWhitelist'
def githuborg = 'DoubleDoorDevelopment'
def description = 'Automatic sub login checker for Twitch, GameWisp, ...'
def description = 'Automatic sub login checker for Twitch, Beam & GameWisp'
minecraft {
version = "1.7.10-10.13.4.1558-1.7.10"
runDir = "jars"
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/net/doubledoordev/fsw/ForgeSubWhitelist.java
Expand Up @@ -66,6 +66,7 @@ public class ForgeSubWhitelist
private static String[] kickMsg = new String[]{"You must be subscribed to join this server.", "Make sure your accounts are linked: http://doubledoordev.net/?p=linking"};
private static String apiToken;
private static boolean twitch = true;
private static boolean beam = true;
private static int gamewisp = -1;
private static Logger logger;
private static String url;
Expand Down Expand Up @@ -112,8 +113,9 @@ public void syncConfig()

apiToken = configuration.getString("apiToken", MODID, "", "Get it from http://doubledoordev.net/?p=linking");
kickMsg = configuration.getStringList("kickMsg", MODID, kickMsg, "Please put a nice message here. Newline allowed. Its recommended to link to a document explain the auth process and/or your channel. Remember that you cannot click links, so keep it short.");
twitch = configuration.getBoolean("twitch", MODID, twitch, "If true anyone who is subbed on twitch will be able to join this server. Set to false to use GameWisp ranks.");
gamewisp = configuration.getInt("gamewisp", MODID, gamewisp, -1, Integer.MAX_VALUE, "If -1, use twitch. Put in the tier at which subs get access to this server. (Includes all above). Your first tier is 1, second is 2, ...");
twitch = configuration.getBoolean("twitch", MODID, twitch, "If true anyone who is subbed on twitch will be able to join this server.");
beam = configuration.getBoolean("beam", MODID, beam, "If true anyone who is subbed on beam will be able to join this server.");
gamewisp = configuration.getInt("gamewisp", MODID, gamewisp, -1, Integer.MAX_VALUE, "If -1, use ignore. Put in the tier at which subs get access to this server. (Includes all above). Your first tier is 1, second is 2, ...");

if (configuration.hasChanged()) configuration.save();

Expand All @@ -131,6 +133,7 @@ public void syncConfig()
}
url = URL + "&uuid=$UUID$";
if (twitch) url += "&twitch=$TWITCH$";
if (beam) url += "&beam=$BEAM$";
if (gamewisp != -1) url += "&twitch=$TWITCH$";
}

Expand Down Expand Up @@ -166,6 +169,7 @@ public void run()
String out = IOUtils.toString(new URL(url
.replace("$TOKEN$", apiToken)
.replace("$TWITCH$", String.valueOf(twitch))
.replace("$BEAM$", String.valueOf(beam))
.replace("$UUID$", uuid.toString())
.replace("$GAMEWISP$", String.valueOf(gamewisp))));
if (Boolean.parseBoolean(out))
Expand Down

0 comments on commit b091889

Please sign in to comment.