| | |
| | | #@return 返回值无意义
|
| | | #@remarks 玩家登陆游戏初始化
|
| | | def InitLoginPlayer(curPlayer, tick):
|
| | | #初始化职业阶数,默认1
|
| | | if PlayerControl.GetJobRank(curPlayer) == 0:
|
| | | PlayerControl.SetJobRank(curPlayer, 1)
|
| | | |
| | | ##初始化交易列表
|
| | | if curPlayer.GetTradeList().GetTradeItemCount() == 0:
|
| | | curPlayer.GetTradeList().SetTradeListCount(ChConfig.Def_PlayerTradeMaxItemCount)
|
| | |
| | | SyncGuideState(curPlayer)
|
| | |
|
| | | #上线检查一次装备属性
|
| | | ItemControler.PlayerItemControler(curPlayer).CheckRolePackEquipAttr()
|
| | | #上线检查加点属性点
|
| | | PlayerControl.FixOldAddPoint(curPlayer)
|
| | | |
| | | ItemControler.PlayerItemControler(curPlayer).CheckRolePackEquipAttr() |
| | | #更新服务器组ID
|
| | | PlayerControl.UpdPlayerServerGroupID(curPlayer)
|
| | |
|
| | |
| | |
|
| | | #通知玩家技能信息
|
| | | __Sync_ClientSkill(curPlayer)
|
| | | #替换旧物品
|
| | | ItemControler.LoginCheckChangeOldItem(curPlayer)
|
| | | #清除生产采集Buff
|
| | | #PlayerControl.DelProduceBuff(curPlayer, tick)
|
| | | #清除国家答题Buff
|
| | |
| | | ChEquip.NotifyEquipPartStar(curPlayer)
|
| | | Operate_EquipWash.OnEquipWashLogin(curPlayer)
|
| | | #通知套装信息
|
| | | ChEquip.NotifyEquipPartSuiteLV(curPlayer)
|
| | | ChEquip.SyncAllEquipAttrActiveInfo(curPlayer)
|
| | | #ChEquip.SyncAllEquipAttrActiveInfo(curPlayer)
|
| | | #装备位宝石镶嵌通知
|
| | | Operate_EquipStone.OnLogin(curPlayer)
|
| | |
|
| | |
| | | GameLogic_GodArea.GodAreaOnLogin(curPlayer)
|
| | | # # 采集NPC次数通知
|
| | | NPCCommon.SyncCollNPCTime(curPlayer)
|
| | | # |
| | | # # 特惠活动
|
| | | # PlayerTeHui.PlayerLogin_TeHui(curPlayer)
|
| | | # |
| | | # # 自定义商店
|
| | | # ShopItemManage.DoOnLogin(curPlayer)
|
| | | #
|
| | | # # 每日活跃度
|
| | | PlayerActivity.OnLogin(curPlayer)
|
| | | #
|
| | | # # 副本进入时间
|
| | | FBCommon.FBOnLogin(curPlayer)
|
| | | # |
| | | # #天梯竞技场
|
| | | # HighLadderTube.OnLogin(curPlayer)
|
| | | #
|
| | | # #世界等级
|
| | | PlayerWorldAverageLv.OnLogin(curPlayer)
|
| | |
| | | mailItemList = IpyGameDataPY.GetFuncEvalCfg("MixServerMail", 1)
|
| | | worldLVMailItemList = IpyGameDataPY.GetFuncEvalCfg("MixServerMail", 2)
|
| | | mailMoneyList = IpyGameDataPY.GetFuncEvalCfg("MixServerMail", 3)
|
| | | worldLVDown = IpyGameDataPY.GetFuncCfg("MixServerMail", 5) # 等级丹相对合服世界等级差值
|
| | | itemWorldLV = max(150, mixServerWorldLV - worldLVDown)
|
| | | goldPaper, silver = mailMoneyList
|
| | | worldLVItemList = []
|
| | | for itemID, itemCount, isBind in worldLVMailItemList:
|
| | |
| | | lvLimit = curEff.GetEffectValue(1)
|
| | | if not lvLimit:
|
| | | continue
|
| | | if lvLimit <= mixServerWorldLV:
|
| | | if lvLimit <= itemWorldLV:
|
| | | worldLVItemList = [[itemID, itemCount, isBind]]
|
| | | else:
|
| | | break
|
| | | detailDict = {"MixServerWorldLV":mixServerWorldLV, "LastMixServerDay":lastMixServerDay}
|
| | | detailDict = {"MixServerWorldLV":mixServerWorldLV, "LastMixServerDay":lastMixServerDay, "ItemWorldLV":itemWorldLV}
|
| | | addItemList = mailItemList + worldLVItemList
|
| | | PlayerControl.SendMailByKey("MixServer1", [playerID], addItemList, goldPaper=goldPaper, silver=silver, detail=detailDict)
|
| | | GameWorld.Log(" 发送合服补偿邮件: addItemList=%s" % (addItemList), playerID)
|
| | | GameWorld.Log(" 发送合服补偿邮件: itemWorldLV=%s,addItemList=%s" % (itemWorldLV, addItemList), playerID)
|
| | |
|
| | | # 同步排行榜
|
| | | PlayerBillboard.UpdatePlayerBillboardOnLeaveServer(curPlayer, isAll=True)
|
| | |
| | |
|
| | | #设置装备实际个数
|
| | | curPack = itemManager.GetPack(IPY_GameWorld.rptEquip)
|
| | | curPack.SetCount(ShareDefine.retMax)
|
| | | curPack.SetCount(ChConfig.Def_PackCnt_Equip)
|
| | |
|
| | | #初始化垃圾桶
|
| | | #curPack = itemManager.GetPack(IPY_GameWorld.rptRecycle)
|
| | |
| | | #防止玩家读取地图时未触发OnDay,读取地图后再次验证(2009.9.11)
|
| | | PlayerEventCounter.UpdatePlayerLoginTime(curPlayer)
|
| | |
|
| | | #特惠活动事件
|
| | | #PlayerTeHui.PlayerLoadMapOK(curPlayer)
|
| | | |
| | | #设置阵营
|
| | | if curPlayer.GetFaction() != ChConfig.CampType_Neutral \
|
| | | and FBCommon.GetRecordMapID(GameWorld.GetMap().GetMapID()) not in ChConfig.Def_MapID_NeedCamp:
|
| | |
| | | #@return 返回值无意义
|
| | | #@remarks //03 01 加属性点#tagCAddPoint
|
| | | def AddPoint(index, tick):
|
| | | GameWorld.GetPsycoFunc(__Func_AddPoint)(index, tick)
|
| | | return
|
| | |
|
| | | ##//03 01 加属性点#tagCAddPoint
|
| | | #@param index 玩家索引
|
| | | #@param tick 时间戳
|
| | | #@return 返回值无意义
|
| | | #@remarks //03 01 加属性点#tagCAddPoint
|
| | | def __Func_AddPoint(index, tick):
|
| | | #// B2 06 玩家加点 #tagCMAddPoint
|
| | | #
|
| | | #struct tagCMAddPoint
|
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE PointAttrIDCount; // 加点属性ID个数
|
| | | # BYTE PointAttrIDList[PointAttrIDCount]; // 加点属性ID列表
|
| | | # WORD PointValueList[PointAttrIDCount]; // 加点属性ID对应的点数列表
|
| | | #};
|
| | | def OnAddPoint(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | playerControl = PlayerControl.PlayerControl(curPlayer)
|
| | | #JobQuotiety = PlayerControl.JobQuotiety
|
| | | pointAttrIDList = clientData.PointAttrIDList
|
| | | pointValueList = clientData.PointValueList
|
| | | if not pointAttrIDList or not pointValueList or len(pointAttrIDList) != len(pointValueList):
|
| | | return
|
| | | |
| | | needTotalPoint = 0
|
| | | for i, attrID in enumerate(pointAttrIDList):
|
| | | if not IpyGameDataPY.GetIpyGameData("RolePoint", attrID):
|
| | | return
|
| | | needTotalPoint += pointValueList[i]
|
| | | |
| | | curFreePoint = curPlayer.GetFreePoint()
|
| | | #job = curPlayer.GetJob()
|
| | | recvAddPoint = IPY_GameWorld.IPY_CAddPoint()
|
| | | addValue = recvAddPoint.GetPoint()
|
| | | |
| | | #检验是否能够加点
|
| | | if addValue < 1 or addValue > curFreePoint:
|
| | | #检验不通过, 返回
|
| | | #GameWorld.ErrLog("(%s,%s)检验是否能够加点,检验不通过, 返回"%(addValue,curFreePoint) , curPlayer.GetPlayerID())
|
| | | if needTotalPoint > curFreePoint:
|
| | | GameWorld.DebugLog("剩余点数不足! curFreePoint(%s) < needTotalPoint(%s)" % (curFreePoint, needTotalPoint))
|
| | | return
|
| | |
|
| | | #封包加点类型
|
| | | addPointType = recvAddPoint.GetType()
|
| | | |
| | | #加点 |
| | | if addPointType == ShareDefine.Def_Effect_STR:
|
| | | curPlayer.SetBaseSTR(addValue + curPlayer.GetBaseSTR())
|
| | | curPlayer.SetFreePoint(curFreePoint - needTotalPoint)
|
| | | for i, attrID in enumerate(pointAttrIDList):
|
| | | addPoint = pointValueList[i]
|
| | | curPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AddPointValue % attrID)
|
| | | updPoint = curPoint + addPoint
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_AddPointValue % attrID, updPoint)
|
| | | GameWorld.DebugLog("玩家加点: attrID=%s,curPoint=%s,addPoint=%s,updPoint=%s" % (attrID, curPoint, addPoint, updPoint))
|
| | |
|
| | | elif addPointType == ShareDefine.Def_Effect_PNE:
|
| | | curPlayer.SetBasePNE(addValue + curPlayer.GetBasePNE())
|
| | | |
| | | elif addPointType == ShareDefine.Def_Effect_PHY:
|
| | | curPlayer.SetBasePHY(addValue + curPlayer.GetBasePHY())
|
| | | |
| | | elif addPointType == ShareDefine.Def_Effect_CON:
|
| | | curPlayer.SetBaseCON(addValue + curPlayer.GetBaseCON())
|
| | | |
| | | else:
|
| | | #异常超出边界
|
| | | GameWorld.ErrLog("AddPoint GetTypeErr = %s" % (addPointType) , curPlayer.GetID())
|
| | | return
|
| | | |
| | | curPlayer.SetFreePoint(curFreePoint - addValue)
|
| | | |
| | | DataRecordPack.DR_Freepoint(curPlayer, "AddPoint", curFreePoint, {"AddPointType":addPointType})
|
| | | playerControl.RefreshPlayerAttrState() |
| | | |
| | | NotifyPlayerBasePoint(curPlayer, pointAttrIDList)
|
| | | playerControl = PlayerControl.PlayerControl(curPlayer)
|
| | | playerControl.RefreshPlayerAttrState()
|
| | | return
|
| | |
|
| | | def NotifyPlayerBasePoint(curPlayer):
|
| | | #上线通知基础属性点
|
| | | notifyList = []
|
| | | notifyBasePointDict = {
|
| | | IPY_GameWorld.CDBPlayerRefresh_BaseSTR:'BaseSTR',
|
| | | IPY_GameWorld.CDBPlayerRefresh_BasePHY:'BasePHY',
|
| | | IPY_GameWorld.CDBPlayerRefresh_BaseCON:'BaseCON',
|
| | | IPY_GameWorld.CDBPlayerRefresh_BasePNE:'BasePNE',
|
| | | }
|
| | | for refreshType, keyStr in notifyBasePointDict.items():
|
| | | notifyStruct = ChPyNetSendPack.tagRefreshType()
|
| | | notifyStruct.RefreshType = refreshType
|
| | | notifyStruct.Value = getattr(curPlayer, 'Get%s'%keyStr)()
|
| | | notifyList.append(notifyStruct)
|
| | | def NotifyPlayerBasePoint(curPlayer, syncAttrIDList=[]):
|
| | | # 通知基础属性点,已分配的自由点数
|
| | | |
| | | if not syncAttrIDList:
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | syncAttrIDList = [ipyDataMgr.GetRolePointByIndex(index).GetAttrID() for index in xrange(ipyDataMgr.GetRolePointCount())]
|
| | |
|
| | | #属性组合包 通知自己
|
| | | sendPack = ChPyNetSendPack.tagObjInfoListRefresh()
|
| | | sendPack.Clear()
|
| | | sendPack.ObjID = curPlayer.GetID()
|
| | | sendPack.ObjType = curPlayer.GetGameObjType()
|
| | | sendPack.Count = len(notifyList)
|
| | | sendPack.RefreshType = notifyList
|
| | | NetPackCommon.SendFakePack(curPlayer, sendPack)
|
| | | pointAttrIDList = []
|
| | | pointValueList = []
|
| | | for attrID in syncAttrIDList:
|
| | | curPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AddPointValue % attrID)
|
| | | pointAttrIDList.append(attrID)
|
| | | pointValueList.append(curPoint)
|
| | | |
| | | pointInfo = ChPyNetSendPack.tagMCRolePointInfo()
|
| | | pointInfo.PointAttrIDList = pointAttrIDList
|
| | | pointInfo.PointValueList = pointValueList
|
| | | pointInfo.PointAttrIDCount = len(pointAttrIDList)
|
| | | NetPackCommon.SendFakePack(curPlayer, pointInfo)
|
| | | return
|
| | |
|
| | | #===============================================================================
|
| | |
| | | #===========================================================================
|
| | |
|
| | | #超出视野
|
| | | if GameWorld.GetDist(curPlayer.GetPosX(), curPlayer.GetPosY(), clientData.PosX, clientData.PosY) > curPlayer.GetSight():
|
| | | if curPlayer.GetSight() and GameWorld.GetDist(curPlayer.GetPosX(), curPlayer.GetPosY(), clientData.PosX, clientData.PosY) > curPlayer.GetSight():
|
| | | return
|
| | |
|
| | | #玩家移动通用检查
|
| | |
| | | # 首充礼包奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_GoldGiftFirst:
|
| | | PlayerGoldGift.GetPlayerGoldGiftFirst(curPlayer)
|
| | | # 领取法宝之魂奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_MWSoulAward:
|
| | | PlayerMagicWeapon.GetMWSoulAward(curPlayer, dataEx)
|
| | | # 领取极品白拿
|
| | | elif rewardType == ChConfig.Def_RewardType_FreeGoods:
|
| | | PlayerFreeGoods.OnGetFreeGoods(curPlayer, dataEx)
|
| | |
| | | PlayerControl.SendMailByKey('SubpackageDownload', [curPlayer.GetID()], awardItemList)
|
| | | else:
|
| | | for itemID, itemCnt, isBind in awardItemList:
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, isBind, [IPY_GameWorld.rptItem])
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 0, [IPY_GameWorld.rptItem])
|
| | | SyncPackDownloadAward(curPlayer)
|
| | | return
|
| | |
|