From 476fb6e578f29c09d558187deeb215afe2e5bf59 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期四, 14 三月 2019 11:42:28 +0800
Subject: [PATCH] 6307 【后端】【2.0】多套装备开发单(优化代码)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py | 77 ++++++++++++++++++++++++++++----------
1 files changed, 56 insertions(+), 21 deletions(-)
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 52a5a24..082fe20 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
@@ -44,9 +44,14 @@
import ShareDefine
import PlayerFlashGiftbag
import PlayerFairyCeremony
+import PlayerNewFairyCeremony
import PlayerGoldGift
import PlayerActTotalRecharge
+import OpenServerCampaign
+import PlayerWeekParty
import ItemCommon
+
+import time
#---------------------------------------------------------------------
#注意: GetChangeCoinPointTotal 充值点和赠送点总和
@@ -56,29 +61,55 @@
def GetCoinRate(): return IpyGameDataPY.GetFuncCfg("PayRMB")
def OnLogin(curPlayer):
-
+ if not DoResetCTGCountByTime(curPlayer):
+ Sync_CoinToGoldCountInfo(curPlayer)
+ return
+
+def DoResetCTGCountByTime(curPlayer):
# 重置充值次数
- if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_CTGDoublePrize):
- GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_CTGDoublePrize, 1)
- ipyDataMgr = IpyGameDataPY.IPY_Data()
- for i in xrange(ipyDataMgr.GetCTGCount()):
- ipyData = ipyDataMgr.GetCTGByIndex(i)
- recordID = ipyData.GetRecordID()
- totalBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGGoodsBuyCount % recordID)
- todayBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayCTGCount % recordID)
- if not totalBuyCount and not todayBuyCount:
- continue
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CTGGoodsBuyCount % recordID, 0)
- PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayCTGCount % recordID, 0)
- drDict = {"PlayerID":curPlayer.GetPlayerID(),"AccID":curPlayer.GetAccID(), "totalBuyCount":totalBuyCount, "todayBuyCount":todayBuyCount, "recordID":recordID}
- DataRecordPack.SendEventPack("ResetCTGCount", drDict, curPlayer)
- GameWorld.Log("重置充值次数: recordID=%s,totalBuyCount=%s,todayBuyCount=%s"
- % (recordID, totalBuyCount, todayBuyCount), curPlayer.GetPlayerID())
- else:
- GameWorld.DebugLog("已经重置过充值次数!")
-
+ ctgResetTimeYMD = IpyGameDataPY.GetFuncCfg("CTG", 1)
+ if not ctgResetTimeYMD:
+ return
+ if not isinstance(ctgResetTimeYMD, int):
+ GameWorld.ErrLog("充值重置时间配置必须是数值格式,不能包含符号!")
+ return
+ curTime = int(time.time())
+ #playerID = curPlayer.GetPlayerID()
+ resetTime = GameWorld.ChangeTimeStrToNum(str(ctgResetTimeYMD), "%Y%m%d")
+ if curTime < resetTime:
+ #GameWorld.DebugLog("还未到达充值充值次数时间!curTime=%s < resetTime=%s" % (curTime, resetTime), playerID)
+ return
+ playerResetTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGCountResetTime)
+ if playerResetTime == resetTime:
+ #GameWorld.DebugLog("已经重置过充值次数!resetTime=%s" % resetTime, playerID)
+ return
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CTGCountResetTime, resetTime)
+
+ DoResetCTGCount(curPlayer, ctgResetTimeYMD)
+ return True
+
+def DoResetCTGCount(curPlayer, resetEvent):
+ # 重置充值次数
+
+ playerID = curPlayer.GetPlayerID()
+ ipyDataMgr = IpyGameDataPY.IPY_Data()
+ for i in xrange(ipyDataMgr.GetCTGCount()):
+ ipyData = ipyDataMgr.GetCTGByIndex(i)
+ recordID = ipyData.GetRecordID()
+ totalBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGGoodsBuyCount % recordID)
+ todayBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayCTGCount % recordID)
+ if not totalBuyCount and not todayBuyCount:
+ continue
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CTGGoodsBuyCount % recordID, 0)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayCTGCount % recordID, 0)
+ drDict = {"PlayerID":curPlayer.GetPlayerID(),"AccID":curPlayer.GetAccID(), "ResetEvent":resetEvent,
+ "totalBuyCount":totalBuyCount, "todayBuyCount":todayBuyCount, "recordID":recordID}
+ DataRecordPack.SendEventPack("ResetCTGCount", drDict, curPlayer)
+ GameWorld.Log("重置充值次数: resetEvent=%s,recordID=%s,totalBuyCount=%s,todayBuyCount=%s"
+ % (resetEvent, recordID, totalBuyCount, todayBuyCount), playerID)
Sync_CoinToGoldCountInfo(curPlayer)
return
+
def OnDay(curPlayer):
syncRecordIDList = []
@@ -240,7 +271,7 @@
PlayerControl.SendMailByKey("", [curPlayer.GetPlayerID()], giveItemList)
else:
for itemID, itemCount, isBind in giveItemList:
- ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isBind, [IPY_GameWorld.rptItem],
+ ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, 0, [IPY_GameWorld.rptItem],
event=[ChConfig.ItemGive_CTG, True, addDRDict])
if notifyMark:
mainItemID = giveItemList[0][0]
@@ -264,9 +295,13 @@
#---充值成功后逻辑---
#仙界盛典-充值大礼
PlayerFairyCeremony.OnFCRecharge(curPlayer)
+ PlayerNewFairyCeremony.OnFCRecharge(curPlayer)
PlayerGoldGift.DayChargeRedPackAward(curPlayer)
#累积充值X元
PlayerActTotalRecharge.AddTotalRechargeGold(curPlayer, orderCoin/100)
+ #开服活动
+ OpenServerCampaign.AddOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_Recharge, orderCoin)
+ PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Recharge, addVIPExp)
GameWorld.Log("Billing: eventName=%s, %s" % (eventName, addDRDict), curPlayer.GetPlayerID())
return
--
Gitblit v1.8.0