feat: 新增PVP匹配队列分组和暗黑门关卡前置检查
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-04-23 14:48:34 +08:00
parent 5500684e29
commit 57676e998f
6 changed files with 87 additions and 19 deletions

View File

@@ -2,6 +2,7 @@ package service
import (
"blazing/cool"
configservice "blazing/modules/config/service"
"blazing/modules/player/model"
"errors"
"strings"
@@ -27,6 +28,19 @@ func (s *TaskService) ShopRequirementError() error {
return errors.New("请先完成试炼任务50")
}
var darkTask *model.Task
s.dbm(s.Model).Where("task_id", 110).Scan(&darkTask)
darkTaskBits := bitset32.New(0)
if darkTask != nil {
darkTaskBits = bitset32.From(darkTask.Data)
}
for _, level := range configservice.NewTower110Service().EnabledLevels() {
if !darkTaskBits.Test(uint(level)) {
return errors.New("请先完成暗黑门全部已开放关卡")
}
}
return nil
}