| | |
| | | def OnLogin(curPlayer):
|
| | | if not DoResetCTGCountByTime(curPlayer):
|
| | | Sync_CoinToGoldCountInfo(curPlayer)
|
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DayFreeGoldGiftState):
|
| | | Sync_DayFreeGoldGiftState(curPlayer)
|
| | | return
|
| | |
|
| | | def DoResetCTGCountByTime(curPlayer):
|
| | |
| | |
|
| | |
|
| | | def OnDay(curPlayer):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayCTGCoinTotal, 0)
|
| | | |
| | | syncRecordIDList = []
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for i in xrange(ipyDataMgr.GetCTGCount()):
|
| | |
| | | syncRecordIDList.append(recordID)
|
| | | if syncRecordIDList:
|
| | | Sync_CoinToGoldCountInfo(curPlayer, syncRecordIDList)
|
| | | |
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DayFreeGoldGiftState):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DayFreeGoldGiftState, 0)
|
| | | Sync_DayFreeGoldGiftState(curPlayer)
|
| | | return
|
| | |
|
| | | ## 创角赠送
|
| | |
| | | curPlayer.SetChangeCoinPointTotal(changeCoinPointBefore + orderCoin, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FirstGoldTry, 0)
|
| | |
|
| | | todayCTGCoinTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayCTGCoinTotal) + orderCoin
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayCTGCoinTotal, todayCTGCoinTotal)
|
| | | |
| | | goldAfter = curPlayer.GetGold()
|
| | | changeCoinPointAfter = curPlayer.GetChangeCoinPointTotal()
|
| | | bourseMoneyAfter = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney)
|
| | | addDRDict.update({"gold":[goldBefore, goldAfter], "changeCoinPoint":[changeCoinPointBefore, changeCoinPointAfter], |
| | | addDRDict.update({"gold":[goldBefore, goldAfter], "changeCoinPoint":[changeCoinPointBefore, changeCoinPointAfter], "todayCTGCoinTotal":todayCTGCoinTotal,
|
| | | "bourseMoney":[bourseMoneyBefore, bourseMoneyAfter], "addGold":addGold, "prizeGold":prizeGold, "giveItemList":giveItemList})
|
| | |
|
| | | DataRecordPack.DR_CTGOK(curPlayer, addDRDict)
|
| | |
| | | PlayerGoldGift.DayChargeRedPackAward(curPlayer)
|
| | | #累积充值X元
|
| | | PlayerActTotalRecharge.AddTotalRechargeGold(curPlayer, orderCoin/100)
|
| | | PlayerFairyCeremony.AddFCCTGRMB(curPlayer, orderCoin/100)
|
| | | PlayerNewFairyCeremony.AddFCCostGold(curPlayer, orderCoin/100)
|
| | | #开服活动
|
| | | OpenServerCampaign.AddOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_Recharge, orderCoin)
|
| | | #OpenServerCampaign.AddOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_Recharge, orderCoin)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Recharge, addVIPExp)
|
| | | #投资
|
| | | if ipyData:
|
| | |
| | | NetPackCommon.SendFakePack(curPlayer, countInfoPack)
|
| | | return
|
| | |
|
| | | ## ---------- 每日免费直购礼包 ----------------
|
| | |
|
| | | def OnGetDayFreeGoldGift(curPlayer):
|
| | | ''' 领取每日免费直购礼包
|
| | | '''
|
| | | |
| | | isGet = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DayFreeGoldGiftState)
|
| | | if isGet:
|
| | | #GameWorld.DebugLog("已经领取过每日免费直购礼包!")
|
| | | return
|
| | | |
| | | rewardItemList = IpyGameDataPY.GetFuncEvalCfg("DayFreeGoldGift", 1)
|
| | | if not rewardItemList:
|
| | | return
|
| | | |
| | | needSpace = len(rewardItemList)
|
| | | packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
|
| | | if needSpace > packSpace:
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
|
| | | return
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DayFreeGoldGiftState, 1)
|
| | | |
| | | # 给物品
|
| | | isAuctionItem = False
|
| | | for itemID, itemCount in rewardItemList: |
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isAuctionItem, [IPY_GameWorld.rptItem])
|
| | | |
| | | # 通知客户端
|
| | | Sync_DayFreeGoldGiftState(curPlayer)
|
| | | return
|
| | |
|
| | | def Sync_DayFreeGoldGiftState(curPlayer):
|
| | | clientPack = ChPyNetSendPack.tagMCDayFreeGoldGiftState()
|
| | | clientPack.DayFreeGoldGiftState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DayFreeGoldGiftState)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | | ## ------------------------------------------
|