This commit is contained in:
昔念
2026-04-25 23:05:41 +08:00
parent 415315c288
commit 4906197c77
18 changed files with 1009 additions and 31 deletions

View File

@@ -3,14 +3,36 @@ package model
import (
"blazing/common/data"
"blazing/cool"
"encoding/json"
"github.com/gogf/gf/v2/os/gfile"
"github.com/gogf/gf/v2/os/gtime"
"github.com/tnnmigga/enum"
)
// 表名常量
const TableNamePlayerPVP = "player_pvp"
const Curpvp = 0
const DefaultPVPSeason = 0
const pvpConfigPath = "public/config/pvp.json"
type pvpConfig struct {
CurrentSeason uint32 `json:"current_season"`
}
func CurrentPVPSeason() uint32 {
content := gfile.GetBytes(pvpConfigPath)
if len(content) == 0 {
return DefaultPVPSeason
}
var config pvpConfig
if err := json.Unmarshal(content, &config); err != nil {
return DefaultPVPSeason
}
return config.CurrentSeason
}
// PVP 对应数据库表 player_pvp用于记录用户PVP赛季数据及场次统计
type PVP struct {