import java.util.HashMap;
import java.util.Map;

public class Game {
    private Map<String, Object> config; // 游戏配置
    private boolean isHldDetectionEnabled; // 是否启用HLD检测

    public Game() {
        this.config = new HashMap<>();
        this.isHldDetectionEnabled = true; // 默认启用HLD检测
    }

    // 设置HLD检测是否启用
    public void setHldDetectionEnabled(boolean enabled) {
        this.isHldDetectionEnabled = enabled;
        System.out.println("HLD检测功能 " + (enabled ? "已启用" : "已关闭"));
    }

    // 模拟HLD检测逻辑
    public void detectPlayerBehavior(String playerId, boolean isCheating) {
        if (!isHldDetectionEnabled) {
            System.out.println("HLD检测已关闭，跳过行为检测。");
            return;
        }

        // 模拟HLD检测逻辑
        if (isCheating) {
            System.out.println("玩家 " + playerId + " 被检测到作弊行为！");
            banPlayer(playerId);
        } else {
            System.out.println("玩家 " + playerId + " 行为正常。");
        }
    }

    // 封禁玩家
    private void banPlayer(String playerId) {
        System.out.println("玩家 " + playerId + " 被封禁！");
        // 执行封禁操作
    }

    // 主程序
    public static void main(String[] args) {
        Game game = new Game();

        // 模拟玩家行为检测
        game.detectPlayerBehavior("player1", true);  // 检测到作弊
        game.detectPlayerBehavior("player2", false); // 行为正常

        // 关闭HLD检测功能
        game.setHldDetectionEnabled(false);

        // 再次模拟玩家行为检测
        game.detectPlayerBehavior("player3", true);  // HLD检测已关闭，跳过检测
        game.detectPlayerBehavior("player4", false); // HLD检测已关闭，跳过检测
    }
}