]> jfr.im git - irc/rizon/acid.git/commitdiff
Users with permanent vhost are now told they have it in the VIP command
authorOrillion <redacted>
Wed, 19 Apr 2017 16:46:35 +0000 (18:46 +0200)
committerOrillion <redacted>
Wed, 19 Apr 2017 16:46:35 +0000 (18:46 +0200)
vizon/src/main/java/net/rizon/acid/plugins/vizon/commands/VipCommand.java

index 0551edb261e4a267dab9d7cd21bc4f9d61e8de78..1cbe612c37ab2cad5a2dd6b4e8d9e4fc2c22bbbf 100644 (file)
@@ -43,6 +43,7 @@ import net.rizon.acid.util.Util;
 public class VipCommand extends Command
 {
        private static final String VIP_FORMAT = "Multiplication factor: %d; Total accumulated days of current VIP: %d; Last drawing claimed of current VIP: %s (No.%d); Remaining time of current VIP: %s";
+       private static final String PERMANENT_VIP_FORMAT = "Congratulations, your colored vhost is permanent! Last drawing claimed of current VIP: %s (No.%d)";
 
        public VipCommand()
        {
@@ -75,15 +76,25 @@ public class VipCommand extends Command
                        return;
                }
 
-               Duration remaining = Duration.between(LocalDateTime.now(), user.getObtained().plusDays(user.getDays()));
-               String remainingTime = Util.fTime((int) remaining.getSeconds());
+               if (user.isPermanent())
+               {
+                       Acidictive.reply(source, to, c, String.format(
+                                       PERMANENT_VIP_FORMAT,
+                                       user.getObtained(),
+                                       user.getObtainedId()));
+               }
+               else
+               {
+                       Duration remaining = Duration.between(LocalDateTime.now(), user.getObtained().plusDays(user.getDays()));
+                       String remainingTime = Util.fTime((int) remaining.getSeconds());
 
-               Acidictive.reply(source, to, c, String.format(
-                               VIP_FORMAT,
-                               user.getMultiplier(),
-                               user.getDays(),
-                               user.getObtained(),
-                               user.getObtainedId(),
-                               remainingTime));
+                       Acidictive.reply(source, to, c, String.format(
+                                       VIP_FORMAT,
+                                       user.getMultiplier(),
+                                       user.getDays(),
+                                       user.getObtained(),
+                                       user.getObtainedId(),
+                                       remainingTime));
+               }
        }
 }