feat: 新增PVP匹配队列分组和暗黑门关卡前置检查
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user