package com.td.boss.util;

import org.apache.tomcat.util.codec.binary.Base64;
import org.bouncycastle.jce.provider.BouncyCastleProvider;

import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.StandardCharsets;
import java.security.SecureRandom;
import java.util.Random;

/**
 * redis 参数
 */
public class RedisData {

    /**
     * 1s SNB锁
     */
    private static final int SNB_TIMEOUT = 5 * 1000; //5s锁

    public static int getSnbTimeout() {
        return SNB_TIMEOUT;
    }

    /**
     * 10s 背包锁
     */
    private static final int PLAYER_GOODS_TIMEOUT = 10 * 1000; //超时时间 10s
    public static int getPlayerGoodsTimeout() {
        return PLAYER_GOODS_TIMEOUT;
    }

    /**
     * 土地操作锁
     */
    private static final int LAND_TIMEOUT = 60 * 1000; //超时时间 60s
    public static int getLandTimeout() {
        return LAND_TIMEOUT;
    }

    /**
     * 10s 第一次触发灾难锁
     */
    private static final int PLAYER_DISASTERS_FIRST_TIMEOUT = 10 * 1000; //超时时间 10s
    public static int getPlayerDisastersFirstTimeout() {
        return PLAYER_DISASTERS_FIRST_TIMEOUT;
    }

    private static final String PLAYER_DISASTERS_FIRST_KEY = "DISASTERS_FIRST";
    public static String getPlayerDisastersFirstKey() {
        return PLAYER_DISASTERS_FIRST_KEY;
    }


    /**
     * 1h 灾难模块锁
     */
    private static final int PLAYER_DISASTERS_WEEK_TIMEOUT = 60 * 1000*60;
    public static int getDisastersWeekTimeout() {
        return PLAYER_DISASTERS_WEEK_TIMEOUT;
    }

    /**
     * 1h 灾难模块锁
     */
    private static final int PLAYER_DISASTERS_DAY_TIMEOUT = 60 * 1000*60;
    public static int getDisastersDayTimeout() {
        return PLAYER_DISASTERS_DAY_TIMEOUT;
    }

    /**
     * 5s 工具模块锁
     */
    private static final int PLAYER_LAND_TOOL_TIMEOUT = 5 * 1000; //超时时间 10s
    public static int getPlayerLandToolTimeout() {
        return PLAYER_LAND_TOOL_TIMEOUT;
    }

    /**
     * 5s 工具模块锁
     */
    private static final int PLAYER_LAND_LEVELUP_TIMEOUT = 5 * 1000; //超时时间 10s
    public static int getPlayerLandLevelupTimeout() {
        return PLAYER_LAND_LEVELUP_TIMEOUT;
    }
    /**
     * 20s 自动审核锁
     */
    private static final int AUTO_APPLY_TIMEOUT = 1000 * 20;
    public static int getAutoApplyTimeout () {
        return AUTO_APPLY_TIMEOUT;
    }

    /**
     * 20s 用户申请锁
     */
    private static final int USER_APPLY_TIMEOUT = 1000 * 20;
    public static int getUserApplyTimeout () {
        return USER_APPLY_TIMEOUT;
    }

    /**
     * 5s 养殖模块
     */
    private static final int PLAYER_CULTIVATE_ZULIN_TIMEOUT = 5 * 1000; //超时时间 5s
    public static int getPlayerCultivateZuLinTimeout() {
        return PLAYER_CULTIVATE_ZULIN_TIMEOUT;
    }
    /**
     * 5s 养殖模块
     */
    private static final int PLAYER_CULTIVATE_TOUFANG_TIMEOUT = 5 * 1000; //超时时间 5s
    public static int getPlayerCultivateTouFangTimeout() {
        return PLAYER_CULTIVATE_TOUFANG_TIMEOUT;
    }
}
