package com.td.Dawa.util;

/**
 * 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_BUYFOOD_TIMEOUT = 5 * 1000; //超时时间 5s
    public static int getPlayerCultivateBuyFoodTimeout() {
        return PLAYER_CULTIVATE_BUYFOOD_TIMEOUT;
    }


    /**
     * 10s 兑换种子模块
     */
    private static final int PLAYER_SCORE_TIMEOUT = 10 * 1000;
    public static int getPlayerScoreTimeout() {
        return PLAYER_SCORE_TIMEOUT;
    }


    /**
     * player 相关
     */
    private static final int PLAYER_TIMEOUT = 5 * 1000; //5s锁

    public static int getPlayerTimeout() {
        return PLAYER_TIMEOUT;
    }
    /**
     *  characters 相关
     */
    private static final int CHARACTERS_TIMEOUT = 5 * 1000; //5s锁

    public static int getCharactersTimeout() {
        return CHARACTERS_TIMEOUT;
    }

    public static String getCharactersKey(String userId,Integer roleId) {
        return "CHARACTERS_".concat(userId).concat("_").concat(roleId.toString());
    }
    /**
     * sys 相关
     */
    private static final int BACKPACK_TIMEOUT = 5 * 1000; //5s锁

    public static int getBackpackTimeout() {
        return BACKPACK_TIMEOUT;
    }

    private static final int CHARACTER_TIMEOUT = 5 * 1000; //5s锁

    public static int getCharacterTimeout() {
        return CHARACTER_TIMEOUT;
    }
}
