This commit is contained in:
by 2025-01-03 14:09:48 +08:00
commit 79abb14bd3
2 changed files with 8 additions and 151 deletions

View File

@ -117,157 +117,6 @@ func init() {
etcd.Register(etcd.KeyRedPacket, webapi.RedPacketConfig{}, platformConfigEvent)
// 累计消耗活动配置
etcd.Register(etcd.KeyActConsume, webapi.ConsumeConfig{}, platformConfigEvent)
WelfareMgrSington.UpdateRedPacket(&webapi.RedPacketConfig{
Platform: "1",
List: []*webapi.RedPacketInfo{
{
Id: 1,
On: 1,
StartHMS: 90000,
EndHMS: 100000,
StayTs: 0,
MaxCount: 100,
LessCount: 5,
ItemId: 100001,
TotalNum: 100000,
RedList: []*webapi.RedInfo{
{
Num: 1,
Rate: 50,
},
{
Num: 10,
Rate: 10,
},
{
Num: 20,
Rate: 10,
},
{
Num: 30,
Rate: 10,
},
},
},
{
Id: 2,
On: 1,
StartHMS: 100000,
EndHMS: 120000,
StayTs: 30,
MaxCount: 10000,
LessCount: 5,
ItemId: 100001,
TotalNum: 100000,
RedList: []*webapi.RedInfo{
{
Num: 1,
Rate: 50,
},
{
Num: 10,
Rate: 10,
},
{
Num: 20,
Rate: 10,
},
{
Num: 30,
Rate: 10,
},
},
},
{
Id: 3,
On: 1,
StartHMS: 120000,
EndHMS: 150000,
StayTs: 0,
MaxCount: 10000,
LessCount: 5,
ItemId: 100001,
TotalNum: 100000,
RedList: []*webapi.RedInfo{
{
Num: 1,
Rate: 50,
},
{
Num: 10,
Rate: 10,
},
{
Num: 20,
Rate: 10,
},
{
Num: 30,
Rate: 10,
},
},
},
{
Id: 4,
On: 1,
StartHMS: 150000,
EndHMS: 160000,
StayTs: 0,
MaxCount: 10000,
LessCount: 5,
ItemId: 100001,
TotalNum: 100000,
RedList: []*webapi.RedInfo{
{
Num: 1,
Rate: 50,
},
{
Num: 10,
Rate: 10,
},
{
Num: 20,
Rate: 10,
},
{
Num: 30,
Rate: 10,
},
},
},
{
Id: 5,
On: 1,
StartHMS: 160000,
EndHMS: 180000,
StayTs: 0,
MaxCount: 10000,
LessCount: 5,
ItemId: 100001,
TotalNum: 100000,
RedList: []*webapi.RedInfo{
{
Num: 1,
Rate: 50,
},
{
Num: 10,
Rate: 10,
},
{
Num: 20,
Rate: 10,
},
{
Num: 30,
Rate: 10,
},
},
},
},
}, false)
}
func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {

View File

@ -176,6 +176,14 @@ func (this *Player) init() bool {
this.GuideData = make(map[int32]int32)
}
this.InitRolesAndPets()
// 数据修复
if this.PlayerData != nil && this.PlayerData.WelfData != nil {
for k, v := range this.PlayerData.WelfData.Task {
if v == nil {
delete(this.PlayerData.WelfData.Task, k)
}
}
}
return true
}