package com.YuyeTech.TPlat.utils;

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

    private static final int LOGIN_TIMEOUT = 5 * 1000; //5s锁
    public static int getLoginTimeout() {
        return LOGIN_TIMEOUT;
    }

    private static final int ADD_ROLE_TIMEOUT = 3 * 1000; //5s锁
    public static int getRoleTimeout() {
        return ADD_ROLE_TIMEOUT;
    }
    public static String getRoleKey(String userId) {
        return "GAME_GET_ROLE_".concat(userId);
    }
    /**
     * 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;
    }
}
