From 56ae47514b78d6b4ae0019e4fccc8837df076be4 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 24 十二月 2019 19:48:06 +0800
Subject: [PATCH] 8361 【主干】首充三天领取
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearFirstGold.py | 3
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py | 10 ++-
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py | 23 +++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py | 2
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py | 2
PySysDB/PySysDBPY.h | 9 +++
ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py | 10 ++-
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldGift.py | 69 ++++++++++++++++------
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py | 4
9 files changed, 100 insertions(+), 32 deletions(-)
diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index f3d4730..1bc8309 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -1230,6 +1230,15 @@
char NotifyMark; //广播提示
};
+//首充表
+
+struct tagFirstGold
+{
+ BYTE _Day; //首充第几天
+ dict JobItemInfo; //职业物品奖励 {"职业":[[物品ID,个数], ...], ...}
+ list CommItemList; //通用物品奖励 [[物品ID,个数], ...]
+};
+
//等级奖励表
struct tagLVAward
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index 3462eb5..b7f0604 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -25483,8 +25483,9 @@
_fields_ = [
("Cmd", c_ubyte),
("SubCmd", c_ubyte),
- ("FirstGoldRewardState", c_ubyte), #首充奖励是否已领奖
+ ("FirstGoldRewardState", c_ubyte), #首充奖励领奖记录,按位记录首充第X天是否已领取,第1天为第0索引位
("FirstGoldTry", c_ubyte), #首充试用状态0-不可试用 1-可试用 2-已试用
+ ("FirstGoldServerDay", c_ushort), #首充时是开服第几天,从1开始,0代表未记录充值
]
def __init__(self):
@@ -25503,6 +25504,7 @@
self.SubCmd = 0x02
self.FirstGoldRewardState = 0
self.FirstGoldTry = 0
+ self.FirstGoldServerDay = 0
return
def GetLength(self):
@@ -25516,13 +25518,15 @@
Cmd:%s,
SubCmd:%s,
FirstGoldRewardState:%d,
- FirstGoldTry:%d
+ FirstGoldTry:%d,
+ FirstGoldServerDay:%d
'''\
%(
self.Cmd,
self.SubCmd,
self.FirstGoldRewardState,
- self.FirstGoldTry
+ self.FirstGoldTry,
+ self.FirstGoldServerDay
)
return DumpString
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index c15c81a..331cc9e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3502,13 +3502,13 @@
Def_PDict_TodayCTGCount = "TodayCTGCount_%s" # 当日充值次数,参数(CTG对应的商品记录ID)
Def_PDict_CTGGoodsBuyCount = "CTGGoodsBuyCount_%s" # 对应充值商品已购买次数,参数(CTG对应的商品记录ID)
Def_PDict_DayFreeGoldGiftState = "DayFreeGoldGiftState" # 每日免费直购礼包领取记录
-Def_PDict_GoldGiftFirstRecord = "GoldGiftFirstRecord" # 首充领取记录,0-未领取;1-已领取
+Def_PDict_GoldGiftFirstRecord = "GoldGiftFirstRecord" # 首充领取记录,按位记录首充第x天是否已领取
+Def_PDict_FirstGoldServerDay = "FirstGoldServerDay" # 首充时的开服天
Def_PDict_FirstGoldRemainTime = "FirstGoldRemainTime" # 首充提示剩余时间
Def_PDict_FirstGoldTipStartTime = "FirstGoldTipStartTime" # 首充提示开始时间
Def_PDict_FirstGoldTry = "FirstGoldTry" # 首充试用状态 0-不可试用 1-可试用 2-已试用
Def_PDict_DailyChargeState = "DailyChargeState" # 当日是否已充值
Def_PDict_SuperGiftStartTime = "SuperGiftStartTime" # 超值礼包开始时间
-Def_PDict_DailyGoldChargeCnt = "DailyGoldChargeCnt" # 当日已充值数
Def_PDict_IsReBorn = "Def_PDict_IsReBorn" # 是否回城复活
Def_PDict_FamilyWarDailyReward = "FamilyWarDailyReward" # 王者仙盟每日俸禄领取状态
Def_PDict_Family_Contribution = "FamilyContribution" #战盟贡献度
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index 3462eb5..b7f0604 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -25483,8 +25483,9 @@
_fields_ = [
("Cmd", c_ubyte),
("SubCmd", c_ubyte),
- ("FirstGoldRewardState", c_ubyte), #首充奖励是否已领奖
+ ("FirstGoldRewardState", c_ubyte), #首充奖励领奖记录,按位记录首充第X天是否已领取,第1天为第0索引位
("FirstGoldTry", c_ubyte), #首充试用状态0-不可试用 1-可试用 2-已试用
+ ("FirstGoldServerDay", c_ushort), #首充时是开服第几天,从1开始,0代表未记录充值
]
def __init__(self):
@@ -25503,6 +25504,7 @@
self.SubCmd = 0x02
self.FirstGoldRewardState = 0
self.FirstGoldTry = 0
+ self.FirstGoldServerDay = 0
return
def GetLength(self):
@@ -25516,13 +25518,15 @@
Cmd:%s,
SubCmd:%s,
FirstGoldRewardState:%d,
- FirstGoldTry:%d
+ FirstGoldTry:%d,
+ FirstGoldServerDay:%d
'''\
%(
self.Cmd,
self.SubCmd,
self.FirstGoldRewardState,
- self.FirstGoldTry
+ self.FirstGoldTry,
+ self.FirstGoldServerDay
)
return DumpString
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearFirstGold.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearFirstGold.py
index d5bf7b5..c22f282 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearFirstGold.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearFirstGold.py
@@ -31,10 +31,9 @@
def OnExec(curPlayer, msgList):
curPlayer.SetChangeCoinPointTotal(0, 0)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GoldGiftFirstRecord, 0)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FirstGoldServerDay, 0)
PlayerGoldGift.Sync_FirstGoldInfo(curPlayer)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FirstGoldTry, 0)
- # 重置今日已充值数
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DailyGoldChargeCnt, 0)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SuperGiftStartTime, 0)
# 重置充值次数信息
syncRecordIDList = []
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index 70374e4..052356e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -989,6 +989,12 @@
("char", "NotifyMark", 0),
),
+ "FirstGold":(
+ ("BYTE", "Day", 1),
+ ("dict", "JobItemInfo", 0),
+ ("list", "CommItemList", 0),
+ ),
+
"LVAward":(
("BYTE", "AwardID", 1),
("WORD", "LV", 0),
@@ -3566,6 +3572,19 @@
def GetGainItemList(self): return self.GainItemList # 获得物品列表[[物品ID,个数,是否绑定], ...]
def GetNotifyMark(self): return self.NotifyMark # 广播提示
+# 首充表
+class IPY_FirstGold():
+
+ def __init__(self):
+ self.Day = 0
+ self.JobItemInfo = {}
+ self.CommItemList = []
+ return
+
+ def GetDay(self): return self.Day # 首充第几天
+ def GetJobItemInfo(self): return self.JobItemInfo # 职业物品奖励 {"职业":[[物品ID,个数], ...], ...}
+ def GetCommItemList(self): return self.CommItemList # 通用物品奖励 [[物品ID,个数], ...]
+
# 等级奖励表
class IPY_LVAward():
@@ -4981,6 +5000,8 @@
self.ipyOrderInfoLen = len(self.ipyOrderInfoCache)
self.ipyCTGCache = self.__LoadFileData("CTG", IPY_CTG)
self.ipyCTGLen = len(self.ipyCTGCache)
+ self.ipyFirstGoldCache = self.__LoadFileData("FirstGold", IPY_FirstGold)
+ self.ipyFirstGoldLen = len(self.ipyFirstGoldCache)
self.ipyLVAwardCache = self.__LoadFileData("LVAward", IPY_LVAward)
self.ipyLVAwardLen = len(self.ipyLVAwardCache)
self.ipyInvestCache = self.__LoadFileData("Invest", IPY_Invest)
@@ -5459,6 +5480,8 @@
def GetOrderInfoByIndex(self, index): return self.ipyOrderInfoCache[index]
def GetCTGCount(self): return self.ipyCTGLen
def GetCTGByIndex(self, index): return self.ipyCTGCache[index]
+ def GetFirstGoldCount(self): return self.ipyFirstGoldLen
+ def GetFirstGoldByIndex(self, index): return self.ipyFirstGoldCache[index]
def GetLVAwardCount(self): return self.ipyLVAwardLen
def GetLVAwardByIndex(self, index): return self.ipyLVAwardCache[index]
def GetInvestCount(self): return self.ipyInvestLen
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
index 98b18f8..3801198 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -5319,7 +5319,7 @@
PlayerMagicWeapon.OnGetXBXZAward(curPlayer, dataEx)
# 首充礼包奖励
elif rewardType == ChConfig.Def_RewardType_GoldGiftFirst:
- PlayerGoldGift.GetPlayerGoldGiftFirst(curPlayer)
+ PlayerGoldGift.GetPlayerGoldGiftFirst(curPlayer, dataEx)
# 领取极品白拿
elif rewardType == ChConfig.Def_RewardType_FreeGoods:
PlayerFreeGoods.OnGetFreeGoods(curPlayer, dataEx)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
index aa4b2a0..6a42394 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
@@ -324,7 +324,7 @@
#仙界盛典-充值大礼
PlayerFairyCeremony.OnFCRecharge(curPlayer)
PlayerNewFairyCeremony.OnFCRecharge(curPlayer)
- PlayerGoldGift.DayChargeRedPackAward(curPlayer)
+ PlayerGoldGift.OnPlayerChargeGold(curPlayer, addGold)
#累积充值X元
PlayerActTotalRecharge.AddTotalRechargeGold(curPlayer, orderCoin/100)
PlayerFairyCeremony.AddFCCTGRMB(curPlayer, orderCoin/100)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldGift.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldGift.py
index 1295897..3abf18b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldGift.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldGift.py
@@ -96,25 +96,46 @@
return
-def GetPlayerGoldGiftFirst(curPlayer):
+def GetPlayerGoldGiftFirst(curPlayer, giftDay):
'''领取玩家首充奖励
+ @param dayIndex: 首充第几天奖励
'''
- isGet = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GoldGiftFirstRecord)
- if isGet:
- GameWorld.DebugLog("已经领取过首充奖励!", curPlayer.GetPlayerID())
+ if not giftDay:
+ return
+
+ openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ firstGoldServerDay = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FirstGoldServerDay)
+ if not firstGoldServerDay:
+ GameWorld.DebugLog("还未充值过!firstGoldServerDay=%s" % firstGoldServerDay)
+ return
+ canGetMaxDay = openServerDay - firstGoldServerDay + 1
+ if giftDay > canGetMaxDay:
+ GameWorld.DebugLog("还未到可领取的首充天,无法领取!openServerDay=%s,firstGoldServerDay=%s,canGetMaxDay=%s < giftDay=%s"
+ % (openServerDay, firstGoldServerDay, canGetMaxDay, giftDay))
+ return
+ dayIndex = giftDay - 1
+ getRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GoldGiftFirstRecord)
+ if getRecord & pow(2, dayIndex):
+ GameWorld.DebugLog("已经领取过首充奖励!giftDay=%s" % giftDay, curPlayer.GetPlayerID())
return
if not curPlayer.GetChangeCoinPointTotal():
GameWorld.DebugLog("没有充值过,无法领取首充奖励!", curPlayer.GetPlayerID())
return
- firstGoldRewardDict = IpyGameDataPY.GetFuncEvalCfg("FirstGold", 1)
+ ipyData = IpyGameDataPY.GetIpyGameData("FirstGold", giftDay)
+ if not ipyData:
+ return
+ jobItemInfoDict = ipyData.GetJobItemInfo()
+ commItemList = ipyData.GetCommItemList()
+
+ rewardItemList = []
jobStr = str(curPlayer.GetJob())
- if jobStr not in firstGoldRewardDict:
- GameWorld.ErrLog("没有配置该职业对应的首充奖励!job=%s" % jobStr, curPlayer.GetPlayerID())
- return
- rewardItemList = firstGoldRewardDict[jobStr]
+ if jobStr in jobItemInfoDict:
+ rewardItemList += jobItemInfoDict[jobStr]
+ rewardItemList += commItemList
+
if not rewardItemList:
return
needSpace = len(rewardItemList)
@@ -126,17 +147,22 @@
return
# 更新已领取成功标记
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GoldGiftFirstRecord, 1)
+ updGetRecord = getRecord | pow(2, dayIndex)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GoldGiftFirstRecord, updGetRecord)
+ GameWorld.DebugLog("领取首充奖励: giftDay=%s,getRecord=%s,updGetRecord=%s, %s" % (giftDay, getRecord, updGetRecord, rewardItemList))
# 给物品
- for itemID, itemCount, isBind in rewardItemList:
- ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, 0, [IPY_GameWorld.rptItem])
+ isAuctionItem = False
+ for itemID, itemCount in rewardItemList:
+ ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isAuctionItem, [IPY_GameWorld.rptItem])
# 全服提示
if len(rewardItemList) >= 2:
- PlayerControl.WorldNotify(0, "FirstPayReward1", [curPlayer.GetPlayerName(), rewardItemList[0][0], rewardItemList[1][0]])
+ PlayerControl.WorldNotify(0, "FirstPayReward1", [curPlayer.GetPlayerName(), rewardItemList[0][0], rewardItemList[1][0], giftDay])
+
# 记录领取事件
- DataRecordPack.DR_GoldGiftGiveItem(curPlayer, "FirstGoldGift")
+ infoDict = {"GiftDay":giftDay, "ItemList":rewardItemList}
+ DataRecordPack.DR_GoldGiftGiveItem(curPlayer, "FirstGoldGift", infoDict)
# 通知客户端
Sync_FirstGoldInfo(curPlayer)
@@ -169,13 +195,15 @@
# @param addGold: 充元宝数
# @return: None
def OnPlayerChargeGold(curPlayer, addGold):
+ DayChargeRedPackAward(curPlayer)
- # 更新今日已充值数
- dailyGoldCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DailyGoldChargeCnt)
- updDailyGoldCnt = dailyGoldCnt + addGold
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DailyGoldChargeCnt, updDailyGoldCnt)
- #PlayerControl.NotifyPlayerDictValue(curPlayer, ChConfig.Def_PDict_DailyGoldChargeCnt)
-
+ firstGoldServerDay = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FirstGoldServerDay)
+ if not firstGoldServerDay:
+ recordServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FirstGoldServerDay, recordServerDay)
+ GameWorld.DebugLog("记录首充开服天: recordServerDay=%s" % recordServerDay)
+ Sync_FirstGoldInfo(curPlayer)
+
return
def Sync_FirstGoldInfo(curPlayer):
@@ -184,6 +212,7 @@
sendPack.Clear()
sendPack.FirstGoldRewardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GoldGiftFirstRecord)
sendPack.FirstGoldTry = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FirstGoldTry)
+ sendPack.FirstGoldServerDay = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FirstGoldServerDay)
NetPackCommon.SendFakePack(curPlayer, sendPack)
return
--
Gitblit v1.8.0