RedisData.java 741 B

123456789101112131415161718192021222324252627282930313233
  1. package com.td.boss.util;
  2. import org.apache.tomcat.util.codec.binary.Base64;
  3. import org.bouncycastle.jce.provider.BouncyCastleProvider;
  4. import javax.crypto.Cipher;
  5. import javax.crypto.spec.SecretKeySpec;
  6. import java.nio.charset.StandardCharsets;
  7. import java.security.SecureRandom;
  8. import java.util.Random;
  9. /**
  10. * redis 参数
  11. */
  12. public class RedisData {
  13. /**
  14. * 1s SNB锁
  15. */
  16. private static final int SNB_TIMEOUT = 5 * 1000; //5s锁
  17. public static int getSnbTimeout() {
  18. return SNB_TIMEOUT;
  19. }
  20. /**
  21. * 10s 背包锁
  22. */
  23. private static final int PLAYER_GOODS_TIMEOUT = 10 * 1000; //超时时间 10s
  24. public static int getPlayerGoodsTimeout() {
  25. return PLAYER_GOODS_TIMEOUT;
  26. }
  27. }