| | |
| | | import PlayerTJG
|
| | | import GameLogic_XMZZ
|
| | | import GameLogic_SealDemon
|
| | | import GameLogic_Dogz
|
| | | import PlayerFlashGiftbag
|
| | | import PlayerCostRebate
|
| | | import PlayerSpringSale
|
| | |
| | | import PyGameData
|
| | | import PlayerCoin
|
| | | import PlayerGeTui
|
| | | import PlayerDogz
|
| | |
|
| | | import datetime
|
| | | import time
|
| | |
| | | # 古神禁地
|
| | | GameLogic_GodArea.GodAreaOnLogin(curPlayer)
|
| | | # # 采集NPC次数通知
|
| | | # NPCCommon.SyncCollNPCTime(curPlayer)
|
| | | NPCCommon.SyncCollNPCTime(curPlayer)
|
| | | #
|
| | | # # 特惠活动
|
| | | # PlayerTeHui.PlayerLogin_TeHui(curPlayer)
|
| | |
| | | SyncPackDownloadAward(curPlayer)
|
| | | # 登录触发功能开启(老号处理)
|
| | | GameFuncComm.DoFuncOpenLogic(curPlayer)
|
| | | # 神兽
|
| | | PlayerDogz.OnPlayerLogin(curPlayer)
|
| | | # 神兽副本
|
| | | GameLogic_Dogz.SyncNPCRefreshTime(curPlayer.GetID())
|
| | |
|
| | | # 上线查询一次充值订单
|
| | | curPlayer.SendDBQueryRecharge()
|
| | |
|
| | |
| | |
|
| | | #初始化寻宝背包
|
| | | PlayerControl.Init_TreasurePack(curPlayer)
|
| | | |
| | | #初始化神兽物品背包
|
| | | curPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptDogzItem)
|
| | | curPack.SetCount(ChConfig.Def_PackCnt_DogzItem)
|
| | | curPack.Sync_PackCanUseCount()
|
| | | #初始化神兽装备背包
|
| | | curPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptDogzEquip)
|
| | | curPack.SetCount(ChConfig.Def_PackCnt_DogzEquip)
|
| | | curPack.Sync_PackCanUseCount()
|
| | |
|
| | | #初始化临时交换背包
|
| | | curPack = itemManager.GetPack(ShareDefine.rptTempSwap)
|
| | |
| | | curMap = GameWorld.GetMap()
|
| | | #校验客户端时间
|
| | | if not PlayerControl.PlayerMoveCheckClientWorldTick(curPlayer, clientWorldTick, client_StartX, client_StartY):
|
| | | curPlayer.Sync_ClientTick()
|
| | | return
|
| | |
|
| | | #移动点检查
|
| | |
| | | return
|
| | |
|
| | | mapID = curPlayer.GetMapID()
|
| | | |
| | | activityLineID = 0 # 活动线, 默认1线
|
| | | activityMapLineDict = IpyGameDataPY.GetFuncEvalCfg("MapLine", 2, {})
|
| | | if mapID in activityMapLineDict:
|
| | | activityLineID = max(0, activityMapLineDict[mapID] - 1)
|
| | | |
| | | mapLineDict = IpyGameDataPY.GetFuncEvalCfg("MapLine", 1)
|
| | | if mapID in mapLineDict and changLineID >= mapLineDict[mapID]:
|
| | | if changLineID != activityLineID and mapID in mapLineDict and changLineID >= mapLineDict[mapID]:
|
| | | GameWorld.ErrLog("该地图没有开放此线路,无法手动切换!mapID=%s,changLineID=%s,maxLine=%s"
|
| | | % (mapID, changLineID, mapLineDict[mapID]), curPlayer.GetID())
|
| | | return
|
| | |
| | | rebornTime = GetRebronTime(curPlayer, playerRebornType)
|
| | | #冷却时间到了
|
| | | if not CanRebornByTimeOver(curPlayer, rebornTime):
|
| | | PlayerControl.NotifyCode(curPlayer, 'RebornCD')
|
| | | return False
|
| | |
|
| | | isFBReborn = False
|
| | |
| | | return
|
| | |
|
| | |
|
| | |
|
| | | ## 地图NPC数量查询封包 A2 27 查询地图NPC数量信息 #tagCMQueryNPCCntInfo
|
| | | # @param curPlayer
|
| | | # @return None
|
| | | def OnQueryMapNPCCntInfo(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | if not curPlayer:
|
| | | return
|
| | | |
| | | # 查询间隔控制
|
| | | if not clientData.IsNoTimeLimit:
|
| | | if not GameWorld.CheckPlayerTick(curPlayer, ChConfig.TYPE_Player_Tick_QueryMapNPCInfo, tick):
|
| | | GameWorld.DebugLog("OnQueryMapNPCCntInfo 查询过于频繁!")
|
| | | return
|
| | | |
| | | tagMapID = clientData.MapID
|
| | | tagLineID = clientData.LineID
|
| | | queryNPCStr = clientData.NPCIDList
|
| | | npcIDList = []
|
| | | if queryNPCStr:
|
| | | try: |
| | | npcIDList = eval(clientData.NPCIDList)
|
| | | except BaseException:
|
| | | GameWorld.ErrLog("OnQueryMapNPCCntInfo, npcIDList=%s" % clientData.NPCIDList)
|
| | | return
|
| | | |
| | | if not isinstance(npcIDList, list):
|
| | | GameWorld.ErrLog("OnQueryMapNPCCntInfo, npcIDList=%s is not list!" % str(npcIDList))
|
| | | return
|
| | | |
| | | GameWorld.DebugLog("OnQueryMapNPCCntInfo tagMapID=%s,tagLineID=%s,npcIDList=%s" |
| | | % (tagMapID, tagLineID, str(npcIDList)))
|
| | | |
| | | curMapID = GameWorld.GetMap().GetMapID()
|
| | | |
| | | # 如果是同张地图,直接查询通知
|
| | | if curMapID == tagMapID:
|
| | | npcInfoDict = NPCCommon.GetNPCCntInfo(npcIDList, tick)
|
| | |
|
| | | GameWorld.DebugLog(" 同地图查询curMapID=%s,tagLineID=%s,npcInfoDict=%s" |
| | | % (curMapID, tagLineID, str(npcInfoDict)))
|
| | | NPCCommon.SyncNPCCntInfo(curPlayer, tagMapID, npcInfoDict)
|
| | | else:
|
| | | # 请求GameServer目标地图NPC信息
|
| | | sendMsg = "%s" % str([tagMapID, tagLineID, npcIDList])
|
| | | curPlayer.GameServer_QueryPlayerByID(ChConfig.queryType_NPCCnt, 0,
|
| | | 'NPCCnt', sendMsg, len(sendMsg))
|
| | | return
|
| | |
|
| | |
|
| | | ## 跨服赛报名状态
|
| | | # @param index 玩家索引
|
| | | # @param tick 当前时间
|
| | |
| | |
|
| | | #校验客户端时间
|
| | | if not PlayerControl.PlayerMoveCheckClientWorldTick(curPlayer, sendPack_WorldTick, sendPack_SeverPosX, sendPack_SeverPosY):
|
| | | curPlayer.Sync_ClientTick()
|
| | | return False
|
| | |
|
| | | dist = GameWorld.GetDist(curPlayer.GetPosX(), curPlayer.GetPosY(), sendPack_SeverPosX, sendPack_SeverPosY)
|