| | |
| | | import PlayerSuccess
|
| | | import PlayerDienstgrad
|
| | | import PlayerFreeGoods
|
| | | import PlayerRecover
|
| | | import PlayerCrossRealmPK
|
| | | import PlayerCrossChampionship
|
| | | import GameFuncComm
|
| | |
| | | import PlayerHero
|
| | | import PlayerOnline
|
| | | import TurnAttack
|
| | | import ObjPool
|
| | |
|
| | | import datetime
|
| | | import time
|
| | |
| | |
|
| | | if PlayerControl.GetCrossMapID(curPlayer):
|
| | | CrossRealmPlayer.DoExitCrossRealm(curPlayer)
|
| | | |
| | | if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
|
| | | PlayerFB.DoExitCustomScene(curPlayer)
|
| | |
|
| | | PetControl.DoLogic_PetLoadMapOK(curPlayer)
|
| | |
|
| | |
| | | #PlayerDienstgrad.RefreshBillBoardDienstgrad(curPlayer)
|
| | | # 称号
|
| | | PlayerDienstgrad.Sync_AllDienstgradOnLogin(curPlayer)
|
| | | # 资源找回OnLogin
|
| | | PlayerRecover.RecoverOnLogin(curPlayer)
|
| | |
|
| | | # ʱװ
|
| | | PlayerCoat.OnLogin_Coat(curPlayer)
|
| | |
| | | PlayerGoldRush.OnPlayerLogin(curPlayer)
|
| | | PlayerActFamilyGCZ.OnPlayerLogin(curPlayer)
|
| | | PlayerTalk.OnPlayerLogin(curPlayer)
|
| | | SyncADCntInfo(curPlayer)
|
| | |
|
| | | # 上线查询一次充值订单
|
| | | curPlayer.SendDBQueryRecharge()
|
| | |
| | | PlayerControl.SetPlayerSightLevel(curPlayer, curPlayer.GetID())
|
| | | if curPlayer.GetSight() != 0:
|
| | | PlayerControl.SetSight(curPlayer, 0)
|
| | | #刷新玩家的视野
|
| | | #if not GameWorld.IsCrossServer() and (PlayerControl.GetCrossMapID(curPlayer) or PlayerControl.GetCustomMapID(curPlayer)):
|
| | | # GameWorld.DebugLog("===登录本服地图时,处于跨服或自定义场景状态,不刷新视野!", curPlayer.GetPlayerID())
|
| | | # PlayerControl.SetPlayerSightLevel(curPlayer, curPlayer.GetID())
|
| | | #elif not GameWorld.IsCrossServer():
|
| | | # realmDifficulty = PlayerControl.GetMapRealmDifficulty(curPlayer)
|
| | | # if realmDifficulty:
|
| | | # GameWorld.DebugLog("===登录本服地图时,处于境界难度地图,自动设置难度! realmDifficulty=%s" % realmDifficulty, curPlayer.GetPlayerID())
|
| | | # PlayerControl.SetRealmDifficulty(curPlayer, realmDifficulty)
|
| | | |
| | | |
| | | PlayerState.ChangePlayerSigh(curPlayer, tick)
|
| | |
|
| | | if GameWorld.IsCrossServer():
|
| | |
| | | PlayerControl.SetPlayerSightLevel(curPlayer, curPlayer.GetID())
|
| | | if curPlayer.GetSight() != 0:
|
| | | PlayerControl.SetSight(curPlayer, 0)
|
| | | #刷新自己的视野
|
| | | #if not GameWorld.IsCrossServer() and (PlayerControl.GetCrossMapID(curPlayer) or curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene)):
|
| | | # GameWorld.DebugLog("===本服LoadMapOK时玩家处于跨服或自定义场景状态,不设置可见!", curPlayer.GetPlayerID())
|
| | | # PlayerControl.SetPlayerSightLevel(curPlayer, curPlayer.GetID())
|
| | | #elif not GameWorld.IsCrossServer():
|
| | | # realmDifficulty = PlayerControl.GetMapRealmDifficulty(curPlayer)
|
| | | # if realmDifficulty:
|
| | | # GameWorld.DebugLog("===本服LoadMapOK时玩家处于境界难度地图,自动设置难度!realmDifficulty=%s" % realmDifficulty, curPlayer.GetPlayerID())
|
| | | # PlayerControl.SetRealmDifficulty(curPlayer, realmDifficulty)
|
| | | |
| | | |
| | | curPlayer.RefreshView()
|
| | | curPlayer.SetVisible(True)
|
| | |
|
| | |
| | | NetPackCommon.SendFakePack(curPlayer, awardReceiveState)
|
| | | return
|
| | |
|
| | | def PlayerOnDay(curPlayer):
|
| | | #玩法前瞻奖励
|
| | | gameNoticeAwardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GameNoticeAwardState)
|
| | | if gameNoticeAwardState:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GameNoticeAwardState, 0)
|
| | | Sync_RewardGetRecordInfo(curPlayer, ChConfig.Def_RewardType_GameNotice, 0)
|
| | | #每日分享奖励重置
|
| | | shareGameAwardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShareGameAwardState)
|
| | | if shareGameAwardState:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ShareGameAwardState, 0)
|
| | | Sync_RewardGetRecordInfo(curPlayer, ChConfig.Def_RewardType_ShareGame, 0)
|
| | | #开服每日奖励
|
| | | awardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OpenSererDailyAward)
|
| | | if awardState:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OpenSererDailyAward, 0)
|
| | | Sync_RewardGetRecordInfo(curPlayer, ChConfig.Def_RewardType_OpenServerDailyAward, 0)
|
| | | #开服每日奖励
|
| | | awardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_RechargeDayAward)
|
| | | if awardState:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RechargeDayAward, 0)
|
| | | Sync_RewardGetRecordInfo(curPlayer, ChConfig.Def_RewardType_RechargeDayAward, 0)
|
| | | ADCntOnDay(curPlayer)
|
| | | return
|
| | |
|
| | | #//A5 04 玩家领取奖励 #tagCMPlayerGetReward
|
| | | #
|
| | | #struct tagCMPlayerGetReward
|
| | |
| | | # 仙树免费减时
|
| | | elif rewardType == ChConfig.Def_RewardType_TreeFreeTime:
|
| | | PlayerTree.FreeReduceTreeLVTime(curPlayer)
|
| | | # 广告奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_ADAward:
|
| | | OnGetADAward(curPlayer, dataEx)
|
| | | # 每日免费直购礼包
|
| | | elif rewardType == ChConfig.Def_RewardType_DayFreeGoldGift:
|
| | | PlayerDailyGiftbag.OnGetDailyFreeGiftbag(curPlayer)
|
| | |
| | | elif rewardType == ChConfig.Def_RewardType_RechargeDayAward:
|
| | | OnGetRechargeDayAward(curPlayer, rewardType)
|
| | | return
|
| | |
|
| | | def OnGetADAward(curPlayer, adID):
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("ADAward", adID)
|
| | | if not ipyData:
|
| | | return
|
| | | adCntMax = ipyData.GetADCntMax()
|
| | | adCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ADCnt % adID)
|
| | | if adCnt >= adCntMax:
|
| | | GameWorld.DebugLog("今日该广告奖励已达上限! adID=%s,adCnt=%s > %s" % (adID, adCnt, adCntMax))
|
| | | return
|
| | | adCnt += 1
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ADCnt % adID, adCnt)
|
| | | awardItemList = ipyData.GetADAwardItemList()
|
| | | adMapID = ipyData.GetADMapID()
|
| | | GameWorld.DebugLog("领取广告奖励! adID=%s,adCnt=%s,adMapID=%s,awardItemList=%s" % (adID, adCnt, adMapID, awardItemList))
|
| | | SyncADCntInfo(curPlayer, [adID])
|
| | |
|
| | | if adMapID:
|
| | | FBCommon.AddFBADCnt(curPlayer, adMapID)
|
| | | |
| | | if awardItemList:
|
| | | ItemControler.GivePlayerItemOrMail(curPlayer, awardItemList, event=["ADAward", False, {}])
|
| | | |
| | | return
|
| | |
|
| | | def ADCntOnDay(curPlayer):
|
| | | syncADIDList = []
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for index in xrange(ipyDataMgr.GetADAwardCount()):
|
| | | ipyData = ipyDataMgr.GetADAwardByIndex(index)
|
| | | adID = ipyData.GetADID()
|
| | | if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ADCnt % adID):
|
| | | continue
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ADCnt % adID, 0)
|
| | | syncADIDList.append(adID)
|
| | | if syncADIDList:
|
| | | SyncADCntInfo(curPlayer, syncADIDList)
|
| | | return
|
| | |
|
| | | def SyncADCntInfo(curPlayer, syncADIDList=None):
|
| | | if not syncADIDList:
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | adIDList = [ipyDataMgr.GetADAwardByIndex(i).GetADID() for i in xrange(ipyDataMgr.GetADAwardCount())]
|
| | | else:
|
| | | adIDList = syncADIDList
|
| | | |
| | | adInfoList = []
|
| | | for adID in adIDList:
|
| | | adCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ADCnt % adID)
|
| | | if not adCnt and syncADIDList == None:
|
| | | continue
|
| | | adInfo = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCADInfo)
|
| | | adInfo.ADID = adID
|
| | | adInfo.ADCnt = adCnt
|
| | | adInfoList.append(adInfo)
|
| | | |
| | | if not adInfoList:
|
| | | return
|
| | | |
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCADInfoList)
|
| | | clientPack.ADInfoList = adInfoList[:255]
|
| | | clientPack.Count = len(clientPack.ADInfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | | def OnGetRechargeDayAward(curPlayer, rewardType):
|
| | | ## 领取累充每日奖励,取最高档
|
| | | realTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGRealTotal)
|