From 9af0249fece9b00490c758a2438a4be0744de59c Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 25 二月 2021 14:37:08 +0800
Subject: [PATCH] 8716 【主干】【后端】【BT2】H.活动-节日祈愿(节日登录修改为连续登录领奖模式);
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastLogin.py | 19 +++++++++++++------
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py | 2 +-
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 1b7c2d5..3b06f95 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3828,7 +3828,7 @@
#节日登录活动
Def_PDict_FeastLoginID = "FeastLoginID" # 玩家身上的活动ID,唯一标识,取活动开始日期time值
-Def_PDict_FeastLoginState = "FeastLoginState" # 活动登录记录,按天编号-1为索引进行二进制位运算记录当天是否已登录
+Def_PDict_FeastLoginState = "FeastLoginState" # 活动登录记录,十位-已累计登录天数,个位-上次记录的登录天
Def_PDict_FeastLoginAwardState = "FeastLoginAwardState" # 活动登录领奖记录,按天编号-1为索引进行二进制位运算记录当天是否已领奖
#节日祝福活动
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastLogin.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastLogin.py
index fbcc757..7a47dba 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastLogin.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastLogin.py
@@ -80,11 +80,15 @@
## 设置某一天已登录,可领奖
dayIndex = actInfo.get(ShareDefine.ActKey_DayIndex, 0)
loginState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastLoginState)
- if loginState & pow(2, dayIndex):
+ loginCount, lastRecordDay = loginState / 10, loginState % 10
+ curDay = dayIndex + 1
+ if lastRecordDay >= curDay:
+ GameWorld.DebugLog(" 节日登录未达记录录登天或已记录登录! dayIndex=%s,loginState=%s,lastRecordDay(%s) >= curDay(%s)" % (dayIndex, loginState, lastRecordDay, curDay))
return
- updLoginState = loginState | pow(2, dayIndex)
+ loginCount += 1
+ updLoginState = loginCount * 10 + curDay
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastLoginState, updLoginState)
- GameWorld.DebugLog(" 节日登录设置天登录: dayIndex=%s,loginState=%s,updLoginState=%s" % (dayIndex, loginState, updLoginState))
+ GameWorld.DebugLog(" 节日登录设置天登录: dayIndex=%s,loginState=%s,updLoginState=%s,loginCount=%s" % (dayIndex, loginState, updLoginState, loginCount))
return True
def GetFeastLoginAward(curPlayer, dayNum):
@@ -125,8 +129,9 @@
awardIndex = dayNum - 1
loginState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastLoginState)
- if not loginState & pow(2, awardIndex):
- GameWorld.DebugLog("节日登录活动该天未登录,无法领奖!dayNum=%s,awardIndex=%s,loginState=%s" % (dayNum, awardIndex, loginState))
+ loginCount = loginState / 10
+ if dayNum > loginCount:
+ GameWorld.DebugLog("节日登录活动登录天不足,无法领奖!dayNum=%s > loginCount=%s,loginState=%s" % (dayNum, loginCount, loginState))
return
awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastLoginAwardState)
@@ -152,8 +157,10 @@
def Sync_FeastLoginPlayerInfo(curPlayer):
## 通知活动玩家信息
+ loginState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastLoginState)
+ loginCount = loginState / 10
clientPack = ChPyNetSendPack.tagMCFeastLoginPlayerInfo()
- clientPack.LoginState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastLoginState)
+ clientPack.LoginState = pow(2, loginCount) - 1
clientPack.LoginAward = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastLoginAwardState)
NetPackCommon.SendFakePack(curPlayer, clientPack)
return
--
Gitblit v1.8.0