| | |
| | | import PlayerNewFairyCeremony
|
| | | import PlayerFeastRedPacket
|
| | | import PlayerLuckyTreasure
|
| | | import Item_ResetAttrPoint
|
| | | import CrossRealmPlayer
|
| | | import ChNetSendPack
|
| | | import FamilyRobBoss
|
| | |
| | | import PlayerQuDaoDoubleBill
|
| | | import PlayerFB
|
| | | import SkillShell
|
| | | import PlayerYinji
|
| | |
|
| | | import datetime
|
| | | import time
|
| | |
| | |
|
| | | return
|
| | |
|
| | | #// A2 31 前端开始自定义场景 #tagCMClientStartCustomScene
|
| | | #
|
| | | #struct tagCMClientStartCustomScene
|
| | | #{
|
| | | # tagHead Head;
|
| | | # DWORD MapID;
|
| | | # WORD FuncLineID;
|
| | | #};
|
| | | def OnClientStartCustomScene(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | DoEnterCustomScene(curPlayer, clientData.MapID, clientData.FuncLineID)
|
| | | return
|
| | |
|
| | | #// A2 33 前端退出自定义场景 #tagCMClientExitCustomScene
|
| | | #
|
| | | #struct tagCMClientExitCustomScene
|
| | | #{
|
| | | # tagHead Head;
|
| | | #};
|
| | | def OnClientExitCustomScene(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | DoExitCustomScene(curPlayer)
|
| | | return
|
| | |
|
| | | def DoEnterCustomScene(curPlayer, mapID, lineID):
|
| | | ## 进入自定义场景状态
|
| | | 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) # 由于前端不一定有发mapID,所以这里额外记录这个状态,不能直接用mapID判断
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomSceneMapID, mapID)
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomSceneLineID, lineID)
|
| | | GameWorld.Log("玩家开始自定义场景!", curPlayer.GetPlayerID())
|
| | | if mapID:
|
| | | FBLogic.OnEnterCustomScene(curPlayer, mapID, lineID)
|
| | | 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)
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomSceneMapID, 0)
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomSceneLineID, 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)
|
| | | PyGameData.g_customFBPrizeInfo.pop(curPlayer.GetPlayerID(), None)
|
| | |
|
| | | 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)
|
| | |
| | | PlayerGameEvent.TakeoffFishermanEquipment(curPlayer)
|
| | | #切地图要清除的buff
|
| | | __CheckClearBuffOnMapChange(curPlayer, tick)
|
| | | #上线和切地图加有限无敌Buff
|
| | | if curPlayer.GetLV() > 50:
|
| | | 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)
|
| | |
| | | GameWorld.DebugLog("进入地图强制切换PK模式: %s" % initAttackModel)
|
| | |
|
| | | PassiveBuffEffMng.OnLoadMapGFPassive(curPlayer)
|
| | | PlayerYinji.OnLoadMap(curPlayer)
|
| | | ItemControler.PlayerItemControler(curPlayer).RefreshStartEquipCount() # 刷新装备珍品星级
|
| | |
|
| | | #EndLoadMap需放在最后
|
| | |
| | | NotifyPlayerBasePoint(curPlayer, pointAttrIDList)
|
| | | playerControl = PlayerControl.PlayerControl(curPlayer)
|
| | | playerControl.RefreshPlayerAttrState()
|
| | | #更新技能专精
|
| | | SkillShell.RefreshElementSkillByAttr(curPlayer, pointAttrIDList)
|
| | | 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=[]):
|