| | |
| | | import PlayerGameWallow
|
| | | import NetPackCommon
|
| | | import ChPyNetSendPack
|
| | | import Operate_PlayerBuyZhenQi
|
| | | import DataRecordPack
|
| | | import PlayerBillboard
|
| | | import UpdatePlayerName
|
| | |
| | | import PlayerFamily
|
| | | import PlayerLoginDayAward
|
| | | import PlayerGodWeapon
|
| | | import PlayerWorldAverageLv
|
| | | import PlayerGoldInvest
|
| | | import PlayerActivity
|
| | | import FBCommon
|
| | |
| | | import PlayerDienstgrad
|
| | | import PlayerFreeGoods
|
| | | import PlayerRecover
|
| | | import GameLogic_IceLode
|
| | | import GameLogic_SkyTower
|
| | | import PlayerEquipDecompose
|
| | | import PlayerGreatMaster
|
| | |
| | | #@return 返回值无意义
|
| | | #@remarks 玩家登陆游戏初始化
|
| | | def InitLoginPlayer(curPlayer, tick):
|
| | | PlayerOnline.OnPlayerLogin(curPlayer)
|
| | | #初始化玩家的时钟个数
|
| | | if curPlayer.GetTickTypeCount() == 0:
|
| | | curPlayer.SetTickTypeCount(ChConfig.TYPE_Player_Tick_Count)
|
| | |
| | | if PlayerControl.GetCrossMapID(curPlayer):
|
| | | PlayerControl.SetCrossMapID(curPlayer, 0)
|
| | |
|
| | | PlayerOnline.OnPlayerLogin(curPlayer)
|
| | | TurnAttack.OnPlayerLogin(curPlayer)
|
| | | SyncGuideState(curPlayer)
|
| | |
|
| | |
| | |
|
| | | #通知玩家的buff
|
| | | __Sync_ClientBuff(curPlayer)
|
| | | |
| | | #初始化现实时间物品
|
| | | InitRealityTimeItem(curPlayer, tick)
|
| | |
|
| | | #---刷新了玩家属性, 登陆只刷新一次,其他地方不用刷
|
| | | DoPlayerLoginInMap(curPlayer, tick)
|
| | |
| | | #PKģʽ
|
| | | SyncPKModel(curPlayer)
|
| | |
|
| | | #装备相关信息
|
| | | ChEquip.OnPlayerEquipLoginLogic(curPlayer)
|
| | | |
| | | #大师
|
| | | PlayerGreatMaster.MasterOnLogin(curPlayer)
|
| | |
|
| | |
| | | PetControl.DoLogic_PetInfo_OnLogin(curPlayer, tick)
|
| | | PlayerPet.OnPlayerPetLogin(curPlayer)
|
| | |
|
| | | #清空玩家万能背包中的任务物品
|
| | | ItemControler.ClearPackEventItem(curPlayer, IPY_GameWorld.rptAnyWhere)
|
| | | |
| | | #PlayerLoginNotify(curPlayer, tick)
|
| | |
|
| | | #防沉迷计算下线累积时间
|
| | |
| | | # 首充/天天首充/充值豪礼
|
| | | PlayerGoldGift.OnLogin(curPlayer)
|
| | |
|
| | | #通知购买功能中各购买类型的已购买和可购买次数
|
| | | Operate_PlayerBuyZhenQi.DoPlayerLogin(curPlayer)
|
| | | # |
| | | # #通知功能首次触发情况
|
| | | GameFuncComm.Sync_FuncOpenState(curPlayer)
|
| | | #
|
| | |
| | |
|
| | | # 副本进入时间
|
| | | FBCommon.FBOnLogin(curPlayer)
|
| | | |
| | | #世界等级
|
| | | PlayerWorldAverageLv.OnLogin(curPlayer)
|
| | |
|
| | | # 投资理财
|
| | | PlayerGoldInvest.OnLogin(curPlayer)
|
| | |
| | |
|
| | | #---补满血满魔---
|
| | | GameObj.SetHP(curPlayer, GameObj.GetMaxHP(curPlayer))
|
| | | curPlayer.SetMP(curPlayer.GetMaxMP())
|
| | | #curPlayer.SetMP(curPlayer.GetMaxMP())
|
| | |
|
| | | #默认触发一次功能开启
|
| | | if curPlayer.GetLV() == 1:
|
| | | GameFuncComm.DoFuncOpenLogic(curPlayer)
|
| | |
|
| | | #初始化组队状态
|
| | | autoJoinReqCheck = IpyGameDataPY.GetFuncCfg("TeamCheckSet", 1)
|
| | | autoInviteCheck = IpyGameDataPY.GetFuncCfg("TeamCheckSet", 2)
|
| | | PlayerControl.SetTeamCheckStateEx(curPlayer, int(not autoJoinReqCheck), int(not autoInviteCheck))
|
| | | #autoJoinReqCheck = IpyGameDataPY.GetFuncCfg("TeamCheckSet", 1)
|
| | | #autoInviteCheck = IpyGameDataPY.GetFuncCfg("TeamCheckSet", 2)
|
| | | #PlayerControl.SetTeamCheckStateEx(curPlayer, int(not autoJoinReqCheck), int(not autoInviteCheck))
|
| | |
|
| | | #玩家默认恶名值
|
| | | curPlayer.SetInfamyValue(ChConfig.Def_FirstLogin_InfamyValue)
|
| | | #curPlayer.SetInfamyValue(ChConfig.Def_FirstLogin_InfamyValue)
|
| | |
|
| | | #curPlayer.SetDict("ThunderLogin", 1)
|
| | | #记录第一次登陆
|
| | |
| | | mailList = IpyGameDataPY.GetFuncEvalCfg("MailLVAward", 2)
|
| | | for mailTypeKey, mailItemList in mailList:
|
| | | PlayerControl.SendMailByKey(mailTypeKey, [curPlayer.GetPlayerID()], mailItemList)
|
| | | |
| | | PlayerHero.OnPlayerFirstLogin(curPlayer)
|
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FirstLogin, 1)
|
| | | return
|
| | |
| | | rolePack = itemManager.GetPack(packIndex)
|
| | | rolePack.Sync_Refresh()
|
| | |
|
| | | # 刷下装备评分,仓库可以暂不处理,取出装备后登录触发刷新
|
| | | for i in xrange(rolePack.GetCount()):
|
| | | curItem = rolePack.GetAt(i)
|
| | | if curItem.IsEmpty():
|
| | | continue
|
| | | newScore = ItemCommon.CalcEquipGS(curItem)
|
| | | hisScore = ItemCommon.GetEquipGearScore(curItem)
|
| | | if hisScore != newScore:
|
| | | ItemCommon.SetEquipGearScore(curItem, newScore)
|
| | | GameWorld.Log("登录更新装备评分: packType=%s,i=%s,hisScore=%s,newScore=%s,itemID=%s,guid=%s" |
| | | % (packIndex, i, hisScore, newScore, curItem.GetItemTypeID(), curItem.GetGUID()), curPlayer.GetPlayerID())
|
| | | |
| | | for packIndex in ChConfig.Def_VPackCnt_Dict.keys():
|
| | | ItemControler.Sync_VPackItem_Refresh(curPlayer, packIndex)
|
| | |
|
| | |
| | | # #itemManager.GetPack(IPY_GameWorld.rptBreakPrepare).Sync_Refresh()
|
| | | # #itemManager.GetPack(IPY_GameWorld.rptBreakItem).Sync_Refresh()
|
| | | #===============================================================================
|
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ##初始化现实时间物品
|
| | | #@param curPlayer 玩家实例
|
| | | #@param tick 时间戳
|
| | | #@return 返回值无意义
|
| | | #@remarks 初始化现实时间物品
|
| | | def InitRealityTimeItem(curPlayer, tick):
|
| | | PlayerState.ProcessTimeEquip(curPlayer, tick)
|
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | if GameWorld.IsCrossServer():
|
| | | curPlayer.SetForbiddenSyncClientState(False)
|
| | |
|
| | | playerControl = PlayerControl.PlayerControl(curPlayer)
|
| | | #刷新所有状态
|
| | | playerControl.ReCalcAllState()
|
| | | olPlayer = PlayerOnline.GetOnlinePlayer(curPlayer)
|
| | | olPlayer.ReCalcAllAttr()
|
| | |
|
| | | if GameWorld.IsCrossServer():
|
| | | curPlayer.SetForbiddenSyncClientState(True)
|
| | |
| | |
|
| | | PassiveBuffEffMng.OnLoadMapGFPassive(curPlayer)
|
| | | PlayerYinji.OnLoadMap(curPlayer)
|
| | | ItemControler.PlayerItemControler(curPlayer).RefreshStartEquipCount() # 刷新装备珍品星级
|
| | |
|
| | | #EndLoadMap需放在最后, 0403 tagPlayerLoginLoadOK
|
| | | curPlayer.EndLoadMap()
|
| | |
| | | NotifyPlayerBasePoint(curPlayer, pointAttrIDList)
|
| | | playerControl = PlayerControl.PlayerControl(curPlayer)
|
| | | playerControl.RefreshPlayerAttrState()
|
| | | PlayerControl.SetLingGenMaxIndex(curPlayer)
|
| | | #PlayerControl.SetLingGenMaxIndex(curPlayer)
|
| | | return
|
| | |
|
| | | #// B2 07 重置加点 #tagCMResetAttrPoint
|
| | |
| | | #下线了,将存储在字典中的真实XP值,设置给玩家,完成通知和存储
|
| | | #curPlayer.SetXP(curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_RecordXPValue))
|
| | | #######################################################################
|
| | | PlayerOnline.OnPlayerLogoff(curPlayer)
|
| | | #下线逻辑
|
| | | PlayerControl.PlayerLeaveServer(curPlayer, tick)
|
| | |
|
| | |
| | |
|
| | | #离线session
|
| | | EventReport.WriteEvent_session(curPlayer)
|
| | | |
| | | #需放最后
|
| | | PlayerOnline.OnPlayerLogoff(curPlayer)
|
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | #参考经验
|
| | | rExp = PlayerControl.GetPlayerReExp(curPlayer)
|
| | | reLV = curPlayer.GetLV() #参考等级
|
| | | worldLvExpRate = PlayerWorldAverageLv.GetWorldAverageLvExpRate(curPlayer) #世界等级经验加成
|
| | | worldLvExpRate = 0
|
| | |
|
| | | #经验公式
|
| | | redeemExp = int(eval(recList[1]))
|
| | |
| | | # @param tick: 时间戳
|
| | | # @return: None
|
| | | def ReceiveFamilyArrestAward(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | arrestID = clientData.ArrestID
|
| | | |
| | | bit = ShareDefine.Def_ArrestOverState_BitDic.get(arrestID)
|
| | | if bit == None:
|
| | | #没有这个家族悬赏任务
|
| | | GameWorld.DebugLog("没有这个家族悬赏任务 arrestID=%s" % arrestID)
|
| | | return
|
| | | |
| | | receiveState = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyArrestAwardState)
|
| | | |
| | | if receiveState & pow(2, bit):
|
| | | #该任务奖励已经领取
|
| | | GameWorld.DebugLog("该任务奖励已经领取 arrestID=%s" % arrestID)
|
| | | return
|
| | | |
| | | if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_FamilyArrestQueryState) == 1:
|
| | | #已经在查询中, 不重复查询
|
| | | GameWorld.DebugLog("已经在查询中, 不重复查询 arrestID=%s" % arrestID)
|
| | | return
|
| | | |
| | | sendMsg = '%s' % arrestID
|
| | | |
| | | #向GameServer请求该悬赏任务是否已经完成
|
| | | curPlayer.GameServer_QueryPlayerByID(ChConfig.queryType_FamilyArrest, 0, 'FamilyArrestAward', sendMsg, len(sendMsg))
|
| | | |
| | | #设置状态查询中
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_FamilyArrestQueryState, 1)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | # 功能开启奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_OpenFunc:
|
| | | GameFuncComm.GetFuncOpenAward(curPlayer, dataEx)
|
| | | # 冰晶矿脉星级奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_IceLodeStar:
|
| | | GameLogic_IceLode.GetIceLodeStarAward(curPlayer, dataEx)
|
| | | # 领取周狂欢活动奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_WeekPartyAct:
|
| | | PlayerWeekParty.GetWeekPartyActionAward(curPlayer, dataEx, dataExStr)
|