|
@@ -150,10 +150,10 @@ func (p *Player) Init() {
|
|
|
func (p *Player) InitDaily() {
|
|
|
|
|
|
if !mhayaTime.CreateFromTimestamp(p.DailyRefreshTime).IsToday() {
|
|
|
- //刷新每日任务
|
|
|
- p.DailyTask.RefreshDailyTask()
|
|
|
- //刷新抽奖每日分享
|
|
|
- p.Share.RefreshShare()
|
|
|
+ ////刷新每日任务
|
|
|
+ //p.DailyTask.RefreshDailyTask()
|
|
|
+ ////刷新抽奖每日分享
|
|
|
+ //p.Share.RefreshShare()
|
|
|
//刷新是否有排行榜奖励
|
|
|
p.RankReward.InitRank(p.UserName, 1)
|
|
|
//更新时间到当天
|
|
@@ -857,17 +857,20 @@ func (p *Player) SetInvite(pid string) bool {
|
|
|
key := fmt.Sprintf("%v:1:%v", constant.InviteKey, p.UserName)
|
|
|
ret, ok := data.DiscreteRuleConfig.Get(InviteMaxExpireTime)
|
|
|
if !ok {
|
|
|
+ mhayaLogger.Warn("SetInvite return 1")
|
|
|
return false
|
|
|
}
|
|
|
t, _ := mhayaString.ToInt64(ret.Condition)
|
|
|
err := mdb.RDB.Set(context.Background(), key, pid, time.Duration(t)*24*time.Hour).Err()
|
|
|
if err != nil {
|
|
|
+ mhayaLogger.Warn("SetInvite return 1")
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
key2 := fmt.Sprintf("%v:%v:%v", constant.InviteKey, InvitePlayer, p.Pid)
|
|
|
lRange, _ := mdb.RDB.LRange(context.Background(), key2, 0, -1).Result()
|
|
|
if slices.Contains(lRange, p.UserName) {
|
|
|
+ mhayaLogger.Warn("SetInvite return 1")
|
|
|
return false
|
|
|
}
|
|
|
mdb.RDB.LPush(context.Background(), key2, p.UserName)
|
|
@@ -877,17 +880,20 @@ func (p *Player) SetInvite(pid string) bool {
|
|
|
|
|
|
mKey := fmt.Sprintf("%v:%v:%v", constant.InviteTagKey, InvitePlayer, p.UserName)
|
|
|
|
|
|
- key4 := fmt.Sprintf("%v:%v:%v", constant.InviteTagKey, InvitePlayer, pTag)
|
|
|
+ mhayaLogger.Debugf("SetInvite finish 1")
|
|
|
if pTag != "" {
|
|
|
mdb.RDB.Set(context.Background(), mKey, pTag, 0)
|
|
|
- mdb.RDB.Incr(context.Background(), key4)
|
|
|
+ tagKey := fmt.Sprintf("%v:%v:%v", constant.InviteTagKey, 2, pTag)
|
|
|
+ mdb.RDB.Incr(context.Background(), tagKey)
|
|
|
} else {
|
|
|
kol, _ := data.KolConfig.Get(p.Pid)
|
|
|
if kol != nil {
|
|
|
mdb.RDB.Set(context.Background(), mKey, kol.Mark, 0)
|
|
|
- mdb.RDB.Incr(context.Background(), key4)
|
|
|
+ tagKey := fmt.Sprintf("%v:%v:%v", constant.InviteTagKey, 2, kol.Mark)
|
|
|
+ mdb.RDB.Incr(context.Background(), tagKey)
|
|
|
}
|
|
|
}
|
|
|
+ mhayaLogger.Debugf("SetInvite finish 2")
|
|
|
return true
|
|
|
|
|
|
}
|
|
@@ -950,6 +956,9 @@ func (p *Player) ClaimDailyTaskReward(id int) param.ChangeData {
|
|
|
|
|
|
// 初始化邀请节点奖励
|
|
|
func (p *Player) InitInviteNodeReword() {
|
|
|
+ //key := fmt.Sprintf("%v:%v", constant.InviteNodeHistoryKey, p.UserName)
|
|
|
+ //mdb.RDB.Del(context.Background(), key)
|
|
|
+
|
|
|
icfg := data.InviteConfig.GetAll()
|
|
|
|
|
|
var maxCondition int
|
|
@@ -966,9 +975,6 @@ func (p *Player) InitInviteNodeReword() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- key := fmt.Sprintf("%v:%v", constant.InviteNodeHistoryKey, p.UserName)
|
|
|
- mdb.RDB.Del(context.Background(), key)
|
|
|
-
|
|
|
if (len(p.InviteNodeReward) == 0) || isUpdate {
|
|
|
// 初次邀请和更新奖励配置
|
|
|
p.RefreshInviteNodeReward(icfg)
|
|
@@ -981,6 +987,7 @@ func (p *Player) InitInviteNodeReword() {
|
|
|
for _, item := range p.InviteNodeReward {
|
|
|
beforeNum += int64(item.Condition)
|
|
|
}
|
|
|
+ mhayaLogger.Debugf("刷新邀请奖励周期")
|
|
|
key := fmt.Sprintf("%v:%v", constant.InviteNodeHistoryKey, p.UserName)
|
|
|
mdb.RDB.IncrBy(context.Background(), key, beforeNum)
|
|
|
}
|