diff --git a/common/constant.go b/common/constant.go index fdc1687..9798add 100644 --- a/common/constant.go +++ b/common/constant.go @@ -319,6 +319,7 @@ const ( GainWayItemBagChangeDoll = 111 // 背包内兑换娃娃 GainWayClawdollCatch = 112 // 娃娃机抓取到娃娃获取卡 GainWayItemBagChangeDollRevocation = 113 //娃娃兑换后台撤销 + GainWayPermitReset = 114 //赛季通行证积分重置 ) // 后台选择 金币变化类型 的充值 类型id号起始 diff --git a/model/gameparam.go b/model/gameparam.go index bfaf9a1..b45983a 100644 --- a/model/gameparam.go +++ b/model/gameparam.go @@ -89,6 +89,7 @@ type GameParam struct { CustomAwardMaxAddTime int // 竞技馆假奖励方法周期,单位秒 AdminPassword string // 管理员密码 UseAdminPassword bool // 是否使用管理员密码 + CloseCustomRoomCreate bool // 关闭自定义房间创建 } var GameParamPath = "../data/gameparam.json" diff --git a/worldsrv/customroommgr.go b/worldsrv/customroommgr.go index 75add0a..84e4c44 100644 --- a/worldsrv/customroommgr.go +++ b/worldsrv/customroommgr.go @@ -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 } diff --git a/worldsrv/player.go b/worldsrv/player.go index 531bbf7..067e9bc 100644 --- a/worldsrv/player.go +++ b/worldsrv/player.go @@ -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() } }