| | |
| | | import PlayerEquipDecompose
|
| | | import PlayerGreatMaster
|
| | | import PlayerGatherSoul
|
| | | import PlayerFairyDomain
|
| | | import PlayerCrossRealmPK
|
| | | import GameFuncComm
|
| | | import PlayerMagicWeapon
|
| | |
| | | import PlayerNewFairyCeremony
|
| | | import PlayerFeastRedPacket
|
| | | import PlayerLuckyTreasure
|
| | | import Item_ResetAttrPoint
|
| | | import CrossRealmPlayer
|
| | | import ChNetSendPack
|
| | | import FamilyRobBoss
|
| | |
| | | import PlayerDogz
|
| | | import PlayerCoat
|
| | | import PlayerQuDaoDoubleBill
|
| | | import PlayerFB
|
| | | import SkillShell
|
| | | import PlayerYinji
|
| | |
|
| | | import datetime
|
| | | import time
|
| | |
| | |
|
| | | return
|
| | |
|
| | | #// A2 31 前端开始自定义场景 #tagCMClientStartCustomScene
|
| | | #
|
| | | #struct tagCMClientStartCustomScene
|
| | | #{
|
| | | # tagHead Head;
|
| | | #};
|
| | | def OnClientStartCustomScene(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | DoEnterCustomScene(curPlayer)
|
| | | return
|
| | |
|
| | | def DoEnterCustomScene(curPlayer):
|
| | | ## 进入自定义场景状态
|
| | | curPlayer.SetCanAttack(False)
|
| | | curPlayer.SetVisible(False)
|
| | | curPlayer.SetSight(0)
|
| | | curPet = curPlayer.GetPetMgr().GetFightPet()
|
| | | if curPet:
|
| | | curPet.SetVisible(False)
|
| | | |
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomScene, 1)
|
| | | GameWorld.Log("玩家开始自定义场景!", curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | | def DoExitCustomScene(curPlayer):
|
| | | ## 退出自定义场景状态
|
| | | curPlayer.SetCanAttack(True)
|
| | | curPlayer.SetVisible(True)
|
| | | curPlayer.SetSight(1)
|
| | | curPlayer.RefreshView()
|
| | | curPlayer.SetSight(ChConfig.Def_PlayerSight_Default)
|
| | | curPlayer.RefreshView()
|
| | | curPet = curPlayer.GetPetMgr().GetFightPet()
|
| | | if curPet:
|
| | | curPet.SetVisible(True)
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomScene, 0)
|
| | | GameWorld.Log("玩家退出自定义场景!", curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | | #// A1 08 刷新主服角色信息 #tagCMRefreshMainServerRole
|
| | | #
|
| | | #struct tagCMRefreshMainServerRole
|
| | |
| | | CrossRealmPlayer.DoExitCrossRealm(curPlayer)
|
| | |
|
| | | if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
|
| | | DoExitCustomScene(curPlayer)
|
| | | PlayerFB.DoExitCustomScene(curPlayer)
|
| | |
|
| | | msgInfo = ""
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(curPlayer.GetPlayerID(), 0, 0, "RefreshMainServerRole", msgInfo, len(msgInfo))
|
| | |
| | | # 离线过久恢复为非跨服状态
|
| | | if PlayerControl.GetCrossMapID(curPlayer):
|
| | | PlayerControl.SetCrossMapID(curPlayer, 0)
|
| | | |
| | | |
| | | SyncGuideState(curPlayer)
|
| | |
|
| | | #上线检查一次装备属性
|
| | |
| | | #PKģʽ
|
| | | SyncPKModel(curPlayer)
|
| | |
|
| | | #通用强化星级信息
|
| | | ChEquip.NotifyEquipPartPlusLV(curPlayer)
|
| | | ChEquip.NotifyEquipPartStar(curPlayer)
|
| | | Operate_EquipWash.OnEquipWashLogin(curPlayer)
|
| | | #通知套装信息
|
| | | #ChEquip.SyncAllEquipAttrActiveInfo(curPlayer)
|
| | | #装备位宝石镶嵌通知
|
| | | Operate_EquipStone.OnLogin(curPlayer)
|
| | | #装备相关信息
|
| | | ChEquip.OnPlayerEquipLoginLogic(curPlayer)
|
| | |
|
| | | #大师
|
| | | PlayerGreatMaster.MasterOnLogin(curPlayer)
|
| | |
| | | FBHelpBattle.DoPlayerLogin(curPlayer)
|
| | | # 聚魂
|
| | | PlayerGatherSoul.PlayerLogin(curPlayer)
|
| | | #缥缈仙域
|
| | | PlayerFairyDomain.OnLogin(curPlayer)
|
| | | PlayerFB.OnLogin(curPlayer)
|
| | | #技能专精信息
|
| | | SkillShell.NotifyElementSkillInfo(curPlayer)
|
| | | |
| | | curPlayer.SetState(0) # 脱机挂恢复为正常上线
|
| | | curPlayer.SetFacePic(0) # 通知数据库是否保存还是下线,做一次恢复,1为保存 0为正常下线
|
| | | tjgTime = PlayerTJG.GetTJGTime(curPlayer)
|
| | |
| | | mixServerWorldLV = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_LastMixServerWorldLV) # 合服时的世界等级
|
| | | GameWorld.Log("玩家合服首登处理! lastMixServerDay=%s,mixServerWorldLV=%s" % (lastMixServerDay, mixServerWorldLV), playerID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MixLoginDay, lastMixServerDay)
|
| | | |
| | | if curPlayer.GetLV() <= 1:
|
| | | GameWorld.Log(" 新号不给合服奖励!", playerID)
|
| | | return
|
| | |
|
| | | # 重置首充双倍
|
| | | PlayerCoin.DoResetCTGCount(curPlayer, "MixServer")
|
| | |
| | | PlayerGameEvent.TakeoffFishermanEquipment(curPlayer)
|
| | | #切地图要清除的buff
|
| | | __CheckClearBuffOnMapChange(curPlayer, tick)
|
| | | #上线和切地图加有限无敌Buff
|
| | | SkillCommon.AddBuffBySkillType_NoRefurbish(curPlayer, ChConfig.Def_SkillID_LimitSuperBuff, tick)
|
| | |
|
| | | #刷新玩家的视野
|
| | | if not GameWorld.IsCrossServer() and PlayerControl.GetCrossMapID(curPlayer):
|
| | | GameWorld.DebugLog("===登录本服地图时,处于跨服状态,不刷新视野!", curPlayer.GetPlayerID())
|
| | | if not GameWorld.IsCrossServer() and (PlayerControl.GetCrossMapID(curPlayer) or curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene)):
|
| | | GameWorld.DebugLog("===登录本服地图时,处于跨服或自定义场景状态,不刷新视野!", curPlayer.GetPlayerID())
|
| | | curPlayer.SetSight(0)
|
| | | else:
|
| | | elif curPlayer.GetLV() > 1:
|
| | | PlayerState.ChangePlayerSigh(curPlayer, tick)
|
| | |
|
| | | if GameWorld.IsCrossServer():
|
| | |
| | | #if not __CheckGMCanLoadMapOK(curPlayer):
|
| | | # return
|
| | |
|
| | | #上线和切地图加有限无敌Buff, 移到切换地图成功,太早发包客户端不显示
|
| | | if curPlayer.GetLV() > 50:
|
| | | SkillCommon.AddBuffBySkillType_NoRefurbish(curPlayer, ChConfig.Def_SkillID_LimitSuperBuff, tick)
|
| | | |
| | | |
| | | #检测账号是否锁定
|
| | | if not __CheckForbidLogin(curPlayer):
|
| | | return
|
| | |
| | | firstMission = QuestCommon.GetCommonMission(curPlayer)
|
| | | if not (firstMission and firstMission.GetProperty(QuestCommon.Def_NewGuyNoSight) == 1):
|
| | | #刷新自己的视野
|
| | | if not GameWorld.IsCrossServer() and PlayerControl.GetCrossMapID(curPlayer):
|
| | | GameWorld.DebugLog("===本服LoadMapOK时玩家处于跨服状态,不设置可见!", curPlayer.GetPlayerID())
|
| | | if not GameWorld.IsCrossServer() and (PlayerControl.GetCrossMapID(curPlayer) or curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene)):
|
| | | GameWorld.DebugLog("===本服LoadMapOK时玩家处于跨服或自定义场景状态,不设置可见!", curPlayer.GetPlayerID())
|
| | | else:
|
| | | curPlayer.RefreshView()
|
| | | curPlayer.SetVisible(True)
|
| | |
| | |
|
| | | PlayerTeam.PlayerLoginSetTeam(curPlayer, tick)
|
| | |
|
| | | #要求数据库得到邮件状态
|
| | | #curPlayer.DataServer_GetPlayerMailState()
|
| | | |
| | | #curPlayer.EndLoadMap()
|
| | |
|
| | | #激活玩家(保证持续性Buff处理间隔)
|
| | | PlayerControl.SetIsNeedProcess(curPlayer, True)
|
| | |
|
| | |
| | | GameWorld.Log('玩家登录重置位置失败, 设置附近点 nearPosX = %s nearPosY = %s' % (nearPosX, nearPosY) , curPlayer.GetPlayerID())
|
| | |
|
| | | #申请得到奖励物品
|
| | | curPlayer.DataServer_CheckPrizeItem()
|
| | | #curPlayer.DataServer_CheckPrizeItem()
|
| | |
|
| | | #===========================================================================
|
| | | # #if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_Frist_Lock) == 1 \
|
| | |
| | | GameWorld.DebugLog("进入地图强制切换PK模式: %s" % initAttackModel)
|
| | |
|
| | | PassiveBuffEffMng.OnLoadMapGFPassive(curPlayer)
|
| | | PlayerYinji.OnLoadMap(curPlayer)
|
| | | ItemControler.PlayerItemControler(curPlayer).RefreshStartEquipCount() # 刷新装备珍品星级
|
| | |
|
| | | #EndLoadMap需放在最后
|
| | | curPlayer.EndLoadMap()
|
| | | # 渠道返利 |
| | | PlayerQuDaoDoubleBill.OnMapQDDoubleBill(curPlayer)
|
| | | return True
|
| | |
|
| | | ## 切换地图同步一次PK模式
|
| | |
| | | NotifyPlayerBasePoint(curPlayer, pointAttrIDList)
|
| | | playerControl = PlayerControl.PlayerControl(curPlayer)
|
| | | playerControl.RefreshPlayerAttrState()
|
| | | EventShell.EventRespons_AddPoint(curPlayer)
|
| | | return
|
| | |
|
| | | #// B2 07 重置加点 #tagCMResetAttrPoint
|
| | | #struct tagCMResetAttrPoint
|
| | | #{
|
| | | # tagHead Head;
|
| | | #};
|
| | | def OnResetAttrPoint(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | canResetIDList = [ipyDataMgr.GetRolePointByIndex(index).GetAttrID() for index in xrange(ipyDataMgr.GetRolePointCount())]
|
| | | canReset = False
|
| | | for attrID in canResetIDList:
|
| | | curPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AddPointValue % attrID)
|
| | | if curPoint:
|
| | | canReset = True
|
| | | break
|
| | | if not canReset:
|
| | | GameWorld.DebugLog('重置加点 没有点数需要重置')
|
| | | return
|
| | | isFree = curPlayer.GetLV() < IpyGameDataPY.GetFuncCfg('LVUPAddPoint', 4)
|
| | | if not isFree:
|
| | | needItemID = IpyGameDataPY.GetFuncCfg('LVUPAddPoint', 5)
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | hasEnough, itemList = ItemCommon.GetItem_FromPack_ByID(needItemID, itemPack, 1)
|
| | | if not hasEnough:
|
| | | GameWorld.DebugLog("重置加点 item(%s) isn't enough" % (needItemID))
|
| | | return
|
| | | ItemCommon.ReduceItem(curPlayer, itemPack, itemList, 1, False, ChConfig.ItemDel_ResetAttrPoint)
|
| | | |
| | | Item_ResetAttrPoint.DoResetAttrPoint(curPlayer, 0, 0, 0)
|
| | | |
| | | EventShell.EventRespons_LingGenReset(curPlayer)
|
| | | return
|
| | |
|
| | | def NotifyPlayerBasePoint(curPlayer, syncAttrIDList=[]):
|
| | |
| | | #@return 返回值无意义
|
| | | #@remarks 客户端封包响应//04 02 获取鼠标左键点击之后对象的详细信息#tagCClickObjGetInfo
|
| | | def __Func_PlayerClickOtherPlayerGetInfo(index, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | |
| | | sendPack = IPY_GameWorld.IPY_CClickObjGetInfo()
|
| | | sendPack_ID = sendPack.GetObjID()
|
| | | sendPack_Type = sendPack.GetObjType()
|
| | | |
| | | tagObj = GameWorld.GetObj(sendPack_ID, sendPack_Type)
|
| | | |
| | | if tagObj == None:
|
| | | #GameWorld.Log("玩家请求其他玩家的相貌信息失败, 对象不存在", curPlayer.GetPlayerID())
|
| | | return
|
| | | |
| | | dist = GameWorld.GetDist(curPlayer.GetPosX(), curPlayer.GetPosY(), tagObj.GetPosX(), tagObj.GetPosY())
|
| | | #是否可以目标详细信息
|
| | | canGetDetail = (dist <= curPlayer.GetSight())
|
| | | #目标类型
|
| | | tagObjType = tagObj.GetGameObjType()
|
| | | |
| | | #仅处理Player和NPC
|
| | | if tagObjType not in [IPY_GameWorld.gotPlayer, IPY_GameWorld.gotNPC]:
|
| | | return
|
| | | |
| | | #---玩家处理---
|
| | | if tagObjType == IPY_GameWorld.gotPlayer:
|
| | | #获取玩家详细信息成功
|
| | | if canGetDetail:
|
| | | extendDataDict = {}
|
| | | extendDataDict['maxHP'] = tagObj.GetMaxHP()
|
| | | extendDataDict['maxMP'] = tagObj.GetMaxMP()
|
| | | extendDataDict['hit'] = tagObj.GetHit()
|
| | | extendDataDict['miss'] = tagObj.GetMiss()
|
| | | extendDataDict['atkSpeed'] = PlayerControl.GetAtkSpeed(tagObj)
|
| | | extendDataDict['superHitRate'] = tagObj.GetSuperHitRate()
|
| | | extendDataDict['superHit'] = tagObj.GetSuperHit()
|
| | | extendDataDict['luckyHitRate'] = tagObj.GetLuckyHitRate()
|
| | | extendDataDict['greatHitRate'] = tagObj.GetGreatHitRate()
|
| | | extendDataDict['ignoreDefRate'] = tagObj.GetIgnoreDefRate()
|
| | | extendDataDict['damageReduceRate'] = tagObj.GetDamageReduceRate()
|
| | | extendDataDict['damageBackRate'] = tagObj.GetDamageBackRate()
|
| | | |
| | | extendData = str(extendDataDict)
|
| | | extendDataLen = len(extendData)
|
| | | curPlayer.PlayerClickOtherPlayerDetail(tagObj, extendDataLen, extendData)
|
| | | return
|
| | | |
| | | #获取玩家详细信息失败
|
| | | curPlayer.Sync_GetPlayerInfoFail(sendPack_ID)
|
| | | return
|
| | | |
| | | #---NPC处理---
|
| | | |
| | | #获取NPC详细信息成功
|
| | | if canGetDetail:
|
| | | curPlayer.PlayerClickOtherNPCDetail(tagObj)
|
| | | return
|
| | | |
| | | #===========================================================================
|
| | | # curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | # |
| | | # sendPack = IPY_GameWorld.IPY_CClickObjGetInfo()
|
| | | # sendPack_ID = sendPack.GetObjID()
|
| | | # sendPack_Type = sendPack.GetObjType()
|
| | | # |
| | | # tagObj = GameWorld.GetObj(sendPack_ID, sendPack_Type)
|
| | | # |
| | | # if tagObj == None:
|
| | | # #GameWorld.Log("玩家请求其他玩家的相貌信息失败, 对象不存在", curPlayer.GetPlayerID())
|
| | | # return
|
| | | # |
| | | # dist = GameWorld.GetDist(curPlayer.GetPosX(), curPlayer.GetPosY(), tagObj.GetPosX(), tagObj.GetPosY())
|
| | | # #是否可以目标详细信息
|
| | | # canGetDetail = (dist <= curPlayer.GetSight())
|
| | | # #目标类型
|
| | | # tagObjType = tagObj.GetGameObjType()
|
| | | # |
| | | # #仅处理Player和NPC
|
| | | # if tagObjType not in [IPY_GameWorld.gotPlayer, IPY_GameWorld.gotNPC]:
|
| | | # return
|
| | | # |
| | | # #---玩家处理---
|
| | | # if tagObjType == IPY_GameWorld.gotPlayer:
|
| | | # #获取玩家详细信息成功
|
| | | # if canGetDetail:
|
| | | # extendDataDict = {}
|
| | | # extendDataDict['maxHP'] = tagObj.GetMaxHP()
|
| | | # extendDataDict['maxMP'] = tagObj.GetMaxMP()
|
| | | # extendDataDict['hit'] = tagObj.GetHit()
|
| | | # extendDataDict['miss'] = tagObj.GetMiss()
|
| | | # extendDataDict['atkSpeed'] = PlayerControl.GetAtkSpeed(tagObj)
|
| | | # extendDataDict['superHitRate'] = tagObj.GetSuperHitRate()
|
| | | # extendDataDict['superHit'] = tagObj.GetSuperHit()
|
| | | # extendDataDict['luckyHitRate'] = tagObj.GetLuckyHitRate()
|
| | | # extendDataDict['greatHitRate'] = tagObj.GetGreatHitRate()
|
| | | # extendDataDict['ignoreDefRate'] = tagObj.GetIgnoreDefRate()
|
| | | # extendDataDict['damageReduceRate'] = tagObj.GetDamageReduceRate()
|
| | | # extendDataDict['damageBackRate'] = tagObj.GetDamageBackRate()
|
| | | # |
| | | # extendData = str(extendDataDict)
|
| | | # extendDataLen = len(extendData)
|
| | | # curPlayer.PlayerClickOtherPlayerDetail(tagObj, extendDataLen, extendData)
|
| | | # return
|
| | | # |
| | | # #获取玩家详细信息失败
|
| | | # curPlayer.Sync_GetPlayerInfoFail(sendPack_ID)
|
| | | # return
|
| | | # |
| | | # #---NPC处理---
|
| | | # |
| | | # #获取NPC详细信息成功
|
| | | # if canGetDetail:
|
| | | # curPlayer.PlayerClickOtherNPCDetail(tagObj)
|
| | | # return
|
| | | # |
| | | #===========================================================================
|
| | | #获取NPC详细信息失败
|
| | | #暂不处理
|
| | | return
|
| | |
| | | #{
|
| | | # tagHead Head;
|
| | | # DWORD DataMapID;
|
| | | # WORD LineID;
|
| | | #};
|
| | | def OnEnterCrossServer(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | PlayerControl.PlayerEnterCrossServer(curPlayer, clientData.DataMapID)
|
| | | PlayerControl.PlayerEnterCrossServer(curPlayer, clientData.DataMapID, clientData.LineID)
|
| | | return
|
| | |
|
| | | #===============================================================================
|
| | |
| | | # 领取节日巡礼积分奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_FeastWeekPartyPoint:
|
| | | PlayerFeastWeekParty.GetFeastWeekPartyPointAward(curPlayer, dataEx, dataExStr)
|
| | | #缥缈奇遇领取
|
| | | elif rewardType == ChConfig.Def_RewardType_FairyAdventuresAward:
|
| | | PlayerFairyDomain.GetFairyAdventuresAward(curPlayer, dataEx, dataExStr)
|
| | | |
| | | return
|
| | |
|
| | |
|