赛季积分重置修复
This commit is contained in:
parent
ae3e9d8fd6
commit
1f8f7b0f22
|
@ -319,6 +319,7 @@ const (
|
|||
GainWayItemBagChangeDoll = 111 // 背包内兑换娃娃
|
||||
GainWayClawdollCatch = 112 // 娃娃机抓取到娃娃获取卡
|
||||
GainWayItemBagChangeDollRevocation = 113 //娃娃兑换后台撤销
|
||||
GainWayPermitReset = 114 //赛季通行证积分重置
|
||||
)
|
||||
|
||||
// 后台选择 金币变化类型 的充值 类型id号起始
|
||||
|
|
|
@ -89,6 +89,7 @@ type GameParam struct {
|
|||
CustomAwardMaxAddTime int // 竞技馆假奖励方法周期,单位秒
|
||||
AdminPassword string // 管理员密码
|
||||
UseAdminPassword bool // 是否使用管理员密码
|
||||
CloseCustomRoomCreate bool // 关闭自定义房间创建
|
||||
}
|
||||
|
||||
var GameParamPath = "../data/gameparam.json"
|
||||
|
|
|
@ -133,9 +133,9 @@ func (c *CustomRoomMgr) GetRoomList(plt string) []*gamehall.PrivateRoomInfo {
|
|||
}
|
||||
|
||||
func (c *CustomRoomMgr) tryCreate(plt string, configId int32) {
|
||||
logger.Logger.Tracef("尝试创建竞技馆系统房间 %v", configId)
|
||||
logger.Logger.Tracef("尝试创建竞技馆系统房间 %v CloseCustomRoomCreate:%v", configId, model.GameParamData.CloseCustomRoomCreate)
|
||||
cfg := PlatformMgrSingleton.GetConfig(plt).RoomConfigSystem[configId]
|
||||
if cfg == nil || cfg.GetOn() == common.Off {
|
||||
if model.GameParamData.CloseCustomRoomCreate || cfg == nil || cfg.GetOn() == common.Off {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -2033,7 +2033,20 @@ func (this *Player) ResetPermit() {
|
|||
// 清理数据
|
||||
bag := BagMgrSingleton.GetBagInfo(this.SnId)
|
||||
if bag != nil {
|
||||
delete(bag.BagItem, common.ItemIDPermit)
|
||||
BagMgrSingleton.AddItems(&model.AddItemParam{
|
||||
Platform: this.Platform,
|
||||
SnId: this.SnId,
|
||||
Change: []*model.Item{
|
||||
{
|
||||
ItemId: common.ItemIDPermit,
|
||||
ItemNum: -bag.BagItem[common.ItemIDPermit].ItemNum,
|
||||
},
|
||||
},
|
||||
GainWay: common.GainWayPermitReset,
|
||||
Operator: "system",
|
||||
Remark: "赛季积分清理",
|
||||
})
|
||||
|
||||
if model.GameParamData.PermitInitScore > 0 {
|
||||
bagInfo := BagMgrSingleton.GetBagInfo(this.SnId)
|
||||
if bagInfo != nil {
|
||||
|
@ -2042,6 +2055,21 @@ func (this *Player) ResetPermit() {
|
|||
ItemNum: model.GameParamData.PermitInitScore,
|
||||
ObtainTime: time.Now().Unix(),
|
||||
}
|
||||
|
||||
BagMgrSingleton.AddItems(&model.AddItemParam{
|
||||
Platform: this.Platform,
|
||||
SnId: this.SnId,
|
||||
Change: []*model.Item{
|
||||
{
|
||||
ItemId: common.ItemIDPermit,
|
||||
ItemNum: model.GameParamData.PermitInitScore,
|
||||
},
|
||||
},
|
||||
GainWay: common.GainWayPermitReset,
|
||||
Operator: "system",
|
||||
Remark: "初始赛季积分",
|
||||
})
|
||||
|
||||
this.Permit = time.Now()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue