Merge remote-tracking branch 'origin/master'

This commit is contained in:
Alex Stewart
2020-02-25 18:26:59 -05:00
6 changed files with 265 additions and 241 deletions
+1
View File
@@ -27,5 +27,6 @@
<classpathentry kind="lib" path="lib/google-http-client-1.32.0.jar"/>
<classpathentry kind="lib" path="lib/google-api-services-youtube-v3-rev212-1.25.0.jar"/>
<classpathentry kind="lib" path="lib/LavaPlayerJar-0.0.1-jar-with-dependencies.jar"/>
<classpathentry kind="lib" path="lib/nanohttpd-2.3.1.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
+2 -2
View File
@@ -50,7 +50,7 @@
"Localized Commands","stats",""
"Localized Commands","teey",""
"Localized Commands","tony, stark, dontfeelgood, dontfeelsogood","tony, stark, dontfeelgood, dontfeelsogood, snap"
"Localized Commands","tradebeans",""
"Localized Commands","tradebeans, trade",""
"Localized Commands","tweet",""
"Localized Commands","vote",""
"Localized Commands","wolfram",""
@@ -323,7 +323,7 @@
"Command Enabler","stats","1"
"Command Enabler","teey","1"
"Command Enabler","tony, stark, dontfeelgood, dontfeelsogood","1"
"Command Enabler","tradebeans","1"
"Command Enabler","tradebeans, trade","1"
"Command Enabler","tweet","1"
"Command Enabler","vote","1"
"Command Enabler","wolfram","1"
1 Type Key Value
50 Localized Commands stats
51 Localized Commands teey
52 Localized Commands tony, stark, dontfeelgood, dontfeelsogood tony, stark, dontfeelgood, dontfeelsogood, snap
53 Localized Commands tradebeans tradebeans, trade
54 Localized Commands tweet
55 Localized Commands vote
56 Localized Commands wolfram
323 Command Enabler stats 1
324 Command Enabler teey 1
325 Command Enabler tony, stark, dontfeelgood, dontfeelsogood 1
326 Command Enabler tradebeans tradebeans, trade 1
327 Command Enabler tweet 1
328 Command Enabler vote 1
329 Command Enabler wolfram 1
Binary file not shown.
+12 -3
View File
@@ -27,13 +27,22 @@ public class CommandTradeBeans extends Command
}
int beans = 0;
try {
try
{
beans = Integer.parseInt(input.args.split(" ")[0]);
}
catch (NumberFormatException e)
{
res.send(LocStrings.stub("TradeBeansIntParseError"));
return;
try
{
beans = Integer.parseInt(input.args.split(" ")[1]);
}
catch(Exception eInner)
{
res.send(LocStrings.stub("TradeBeansIntParseError"));
return;
}
}
if(user.getBeans() < beans)
+1 -1
View File
@@ -108,7 +108,7 @@ public class CommandManager
this.register(LocCommands.stub("music"), new CommandMusicMain(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("defaultdance"), new CommandDefaultDance(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("getsauce"), new CommandGetSauce(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("tradebeans"), new CommandTradeBeans(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("tradebeans, trade"), new CommandTradeBeans(KittyRole.General, KittyRating.Safe));
this.register(LocCommands.stub("e6"), new CommandE6(KittyRole.General, KittyRating.Filtered));
this.register(LocCommands.stub("derpi"), new CommandDerpi(KittyRole.General, KittyRating.Filtered));
+15 -1
View File
@@ -75,7 +75,21 @@ public class NetworkTheColorAPI
{
try
{
hex = hex.replace("#", "");
hex = hex.replace("#", "").trim();
String hexUpper = hex.toUpperCase();
// Verify the number is hex.
for(int i = 0; i < hexUpper.length(); ++i)
{
char current = hexUpper.charAt(i);
Boolean isValidNum = current >= '0' && current <= '9';
Boolean isValidChar = current >= 'A' && current <= 'F';
// If it's not a valid character or a valid number, return null/
if(!isValidNum && !isValidChar)
return null;
}
String response = HTTPUtils.sendGETRequest("https://www.thecolorapi.com/id?hex=" + hex);
ColorData data = jsonParser.fromJson(response, ColorData.class);