| | |
| | | import ChItem
|
| | | import ItemCommon
|
| | | import ItemControler
|
| | | import ChEquip
|
| | | import FunctionNPCCommon
|
| | | import PlayerGMOper
|
| | | import ReadChConfig
|
| | |
| | | import ChPyNetSendPack
|
| | | import DataRecordPack
|
| | | import PlayerBillboard
|
| | | import UpdatePlayerName
|
| | | import PlayerOnlinePrize
|
| | | import PlayerLVAward
|
| | | import PlayerGoldGift
|
| | |
| | | import PlayerSuccess
|
| | | import PlayerDienstgrad
|
| | | import PlayerFreeGoods
|
| | | import PlayerRecover
|
| | | import PlayerEquipDecompose
|
| | | import PlayerCrossRealmPK
|
| | | import PlayerCrossChampionship
|
| | | import GameFuncComm
|
| | |
| | | import PlayerActCollectWords
|
| | | import PlayerActTotalRecharge
|
| | | import PlayerActRechargePrize
|
| | | import PlayerActGarbageSorting
|
| | | import PlayerActXianXiaMJ
|
| | | import PlayerActGubao
|
| | | import PlayerActHorsePetTrain
|
| | | import PlayerActLianqi
|
| | | import PlayerActGodGift
|
| | | import PlayerActFamilyCTGAssist
|
| | | import PlayerActRechargeRebateGold
|
| | | import PlayerActManyDayRecharge
|
| | | import PlayerActSingleRecharge
|
| | | import PlayerActHorsePetFeast
|
| | | import PlayerActBossTrial
|
| | | import PlayerSpringSale
|
| | | import GY_Query_BossFirstKill
|
| | | import PlayerCrossYaomoBoss
|
| | |
| | | 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)
|
| | |
|
| | |
| | | #通知玩家死亡时间
|
| | | #PlayerControl.PlayerControl(curPlayer).NotifyPlayerDeadTime(curPlayer)
|
| | |
|
| | | #角色改名次数
|
| | | #UpdatePlayerName.Sync_UpdatePlayerNameCount(curPlayer)
|
| | | |
| | | # 坐骑相关通知
|
| | | PlayerHorse.PlayerHorseLogin(curPlayer)
|
| | |
|
| | |
| | | #PlayerDienstgrad.RefreshBillBoardDienstgrad(curPlayer)
|
| | | # 称号
|
| | | PlayerDienstgrad.Sync_AllDienstgradOnLogin(curPlayer)
|
| | | # 资源找回OnLogin
|
| | | PlayerRecover.RecoverOnLogin(curPlayer)
|
| | |
|
| | | # ʱװ
|
| | | PlayerCoat.OnLogin_Coat(curPlayer)
|
| | |
| | | # 通知设置的被动功法
|
| | | #PassiveBuffEffMng.OnLoginGFPassive(curPlayer)
|
| | | PlayerOnlinePrize.OnPlayerLogin(curPlayer)
|
| | | #装备分解
|
| | | #PlayerEquipDecompose.PlayerLogin(curPlayer)
|
| | | # 极品白拿
|
| | | PlayerFreeGoods.OnLogin(curPlayer)
|
| | | # BOSS复活活动
|
| | | PlayerBossReborn.OnLogin(curPlayer)
|
| | | # boss历练
|
| | | PlayerActBossTrial.OnPlayerLogin(curPlayer)
|
| | | # 骑宠盛宴活动
|
| | | PlayerActHorsePetFeast.OnLogin(curPlayer)
|
| | | # 周狂欢活动
|
| | | PlayerWeekParty.OnLogin(curPlayer)
|
| | | # 购买次数礼包活动
|
| | |
| | | PlayerFeastTravel.OnPlayerLogin(curPlayer)
|
| | | # 登录奖励活动
|
| | | PlayerActLogin.OnLogin(curPlayer)
|
| | | # 垃圾分类活动
|
| | | PlayerActGarbageSorting.OnPlayerLogin(curPlayer)
|
| | | # 仙匣秘境活动
|
| | | PlayerActXianXiaMJ.OnPlayerLogin(curPlayer)
|
| | | # 古宝养成活动
|
| | | PlayerActGubao.OnPlayerLogin(curPlayer)
|
| | | # 骑宠养成活动
|
| | | PlayerActHorsePetTrain.OnPlayerLogin(curPlayer)
|
| | | # 炼器活动
|
| | | PlayerActLianqi.OnPlayerLogin(curPlayer)
|
| | | # 天帝礼包活动
|
| | |
| | | PlayerGoldRush.OnPlayerLogin(curPlayer)
|
| | | PlayerActFamilyGCZ.OnPlayerLogin(curPlayer)
|
| | | PlayerTalk.OnPlayerLogin(curPlayer)
|
| | | SyncADCntInfo(curPlayer)
|
| | |
|
| | | # 上线查询一次充值订单
|
| | | curPlayer.SendDBQueryRecharge()
|
| | |
| | | # 那么在DoPlayerLogin 中设置的数据将不会被保存, 如会导致第一个任务重复触发问题,记录多次发送
|
| | | EventReport.WriteEvent_Entry(curPlayer, 4)
|
| | | #EventReport.EventReport(ShareDefine.Def_UserAction_FirstLogin, "", curPlayer)
|
| | | |
| | | curPlayer.SetFightPoint(1) # 初始化为1倍消耗
|
| | |
|
| | | #---补满血满魔---
|
| | | GameObj.SetHP(curPlayer, GameObj.GetMaxHP(curPlayer))
|
| | |
| | |
|
| | | # 同步排行榜
|
| | | PlayerBillboard.UpdatePlayerBillboardOnLeaveServer(curPlayer, isAll=True)
|
| | | |
| | | # bossƾ֤
|
| | | PlayerActBossTrial.OnMixFirstLogin(curPlayer)
|
| | | # 仙匣秘境
|
| | | PlayerActXianXiaMJ.OnMixFirstLogin(curPlayer)
|
| | | # 古宝养成
|
| | | PlayerActGubao.OnMixFirstLogin(curPlayer)
|
| | | # 骑宠养成
|
| | | PlayerActHorsePetTrain.OnMixFirstLogin(curPlayer)
|
| | | # 重置玩家改名次数
|
| | | #UpdatePlayerName.ResetChangeNameCnt(curPlayer)
|
| | | return
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | |
| | | 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)
|
| | |
|
| | |
| | |
|
| | | #在线时间
|
| | | PlayerOnlinePrize.CalcOnlineTime(curPlayer)
|
| | | #首充提示时间
|
| | | PlayerGoldGift.UpdateFirstGoldTime(curPlayer)
|
| | | #玩家未回图形验证码下线将会记录错误次数
|
| | | #===========================================================================
|
| | | # if curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_Captcha_WaitSign) \
|
| | |
| | | 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_LVAward:
|
| | | PlayerLVAward.GetPlayerLVAward(curPlayer, dataEx)
|
| | | # 首充礼包奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_GoldGiftFirst:
|
| | | PlayerGoldGift.GetPlayerGoldGiftFirst(curPlayer, dataEx)
|
| | | elif rewardType == ChConfig.Def_RewardType_FirstCharge:
|
| | | PlayerGoldGift.GetPlayerFirstCharge(curPlayer, dataEx, dataExStr)
|
| | | # 领取极品白拿
|
| | | elif rewardType == ChConfig.Def_RewardType_FreeGoods:
|
| | | PlayerFreeGoods.OnGetFreeGoods(curPlayer, dataEx)
|
| | |
| | | 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)
|
| | |
| | | #PlayerControl.SetRealmDifficulty(curPlayer, clientData.RealmDifficulty)
|
| | | return
|
| | |
|
| | | #// A0 08 查看通用记录 #tagCSViewGameRec
|
| | | #
|
| | | #struct tagCSViewGameRec
|
| | | #{
|
| | | # tagHead Head;
|
| | | # WORD RecType; //记录类型
|
| | | # DWORD RecID; //自定义记录ID
|
| | | #};
|
| | | def OnViewGameRec(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | recType = clientData.RecType
|
| | | recID = clientData.RecID
|
| | | if recType not in ShareDefine.Def_GameRecTypeList:
|
| | | return
|
| | | if recType in ShareDefine.Def_ViewGameRecSelfList:
|
| | | recID = curPlayer.GetPlayerID()
|
| | | recTypeIDMgr = DBDataMgr.GetGameRecMgr().GetRecTypeIDMgr(recType, recID)
|
| | | SyncGameRecInfo(curPlayer, recType, recID, recTypeIDMgr.GetDataList())
|
| | | return
|
| | |
|
| | | def SyncGameRecInfo(curPlayer, recType, recID, recDataList):
|
| | | recList = []
|
| | | for recData in recDataList:
|
| | | if not recData:
|
| | | continue
|
| | | rec = ChPyNetSendPack.tagSCGameRec()
|
| | | rec.Time = recData.GetTime()
|
| | | rec.Value1 = recData.GetValue1()
|
| | | rec.Value2 = recData.GetValue2()
|
| | | rec.Value3 = recData.GetValue3()
|
| | | rec.Value4 = recData.GetValue4()
|
| | | rec.Value5 = recData.GetValue5()
|
| | | rec.Value6 = recData.GetValue6()
|
| | | rec.Value7 = recData.GetValue7()
|
| | | rec.Value8 = recData.GetValue8()
|
| | | rec.UserData = recData.GetUserData()
|
| | | rec.UserDataLen = len(rec.UserData)
|
| | | recList.append(rec)
|
| | | |
| | | clientPack = ChPyNetSendPack.tagSCGameRecInfo()
|
| | | clientPack.Clear()
|
| | | clientPack.RecType = recType
|
| | | clientPack.RecID = recID
|
| | | clientPack.RecList = recList
|
| | | clientPack.Count = len(clientPack.RecList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|