| | |
| | | import PlayerUniversalGameRec
|
| | | import PlayerFamily
|
| | | import GameWorldOpenServerCampaign
|
| | | import GameWorldMixServerCampaign
|
| | | import ShareDefine
|
| | | import GameDataRecord
|
| | | import GameWorldShopItem
|
| | | import PlayerCompensation
|
| | | import PlayerFB
|
| | | import UpdatePlayerName
|
| | | import PlayerFamilyBoss
|
| | | import PlayerManorWar
|
| | | import GameWorldBoss
|
| | | import GameWorldFamilyWar
|
| | | #import PlayerFamilyTech
|
| | | import PlayerFamilyRedPacket
|
| | | import PlayerFBHelpBattle
|
| | | import PlayerFamilyStore
|
| | | import PlayerHorsePetBoss
|
| | | #import PlayerFamilyStore
|
| | | import PlayerFamilySWRH
|
| | | import GameWorldProcess
|
| | | import PlayerLVAward
|
| | |
| | | import CrossRealmPlayer
|
| | | import CrossRealmMsg
|
| | | import CrossRealmPK
|
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import AuctionHouse
|
| | |
|
| | | import time
|
| | | import datetime
|
| | |
| | | return
|
| | | # 查询地图NPC数量
|
| | | elif queryType == ChConfig.queryType_NPCCnt:
|
| | | __QueryMapNPCCntInfo(curPlayer, queryCallName, sendCMD)
|
| | | __QueryMapNPCCntInfo(curPlayer, queryCallName, sendCMD, tick)
|
| | | return
|
| | | else:
|
| | | GameWorld.ErrLog('unKnow queryType = %s' % (queryType))
|
| | |
| | | # @param queryCallName: 请求回调名
|
| | | # @param sendCMD: 请求的命令 根据请求类型和请求命令来决定最终操作
|
| | | # @return None
|
| | | def __QueryMapNPCCntInfo(curPlayer, queryCallName, sendCMD):
|
| | | def __QueryMapNPCCntInfo(curPlayer, queryCallName, sendCMD, tick):
|
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | try:
|
| | | mapInfo = eval(sendCMD)
|
| | |
| | | return
|
| | |
|
| | | tagMapID = mapInfo[0]
|
| | | npcIDList = mapInfo[2]
|
| | | # 本服查询跨服地图怪物数
|
| | | if tagMapID in ChConfig.Def_CrossMapIDList and not GameWorld.IsCrossServer():
|
| | | __QueryCrossServerMapNPCCntInfo(curPlayer, tagMapID, npcIDList, tick)
|
| | | return
|
| | | playerManager.MapServer_QueryPlayer(curPlayer.GetPlayerID(), ChConfig.queryType_NPCCnt, 0, tagMapID,
|
| | | queryCallName, sendCMD, len(sendCMD), curPlayer.GetRouteServerIndex())
|
| | | return
|
| | |
|
| | | def __QueryCrossServerMapNPCCntInfo(curPlayer, mapID, npcIDList, tick):
|
| | | ## 查询跨服地图NPC个数信息
|
| | | if mapID in PyGameData.g_crossMapNPCInfo:
|
| | | infoTick, mapNPCInfoDict = PyGameData.g_crossMapNPCInfo[mapID]
|
| | | if tick - infoTick < 60 * 1000:
|
| | | #GameWorld.DebugLog("直接同步本服缓存的跨服地图NPC信息")
|
| | | SyncPlayerCrossMapNPCInfo(curPlayer, mapID, npcIDList, mapNPCInfoDict)
|
| | | return
|
| | | |
| | | # 本服缓存超时,发送跨服服务器查询
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | CrossRealmMsg.SendMsgToCrossServer(ShareDefine.ClientServerMsg_QueryNPCInfo, {"PlayerID":playerID, "MapID":mapID, "NPCIDList":npcIDList})
|
| | | return
|
| | |
|
| | | def ClientServerMsg_QueryNPCInfo(serverGroupID, msgData):
|
| | | ## 收到子服请求查看跨服地图NPC个数信息
|
| | | |
| | | mapID = msgData["MapID"]
|
| | | zoneIpyData = CrossRealmPlayer.GetServerCrossZoneMapIpyData(mapID, serverGroupID)
|
| | | if not zoneIpyData:
|
| | | return
|
| | | realMapID = zoneIpyData.GetMapID()
|
| | | copyMapID = zoneIpyData.GetCopyMapID()
|
| | | |
| | | sendCMD = {"ServerGroupID":serverGroupID, "CopyMapID":copyMapID}
|
| | | sendCMD.update(msgData)
|
| | | sendCMD = str(sendCMD)
|
| | | GameWorld.GetPlayerManager().MapServer_QueryPlayer(0, 0, 0, realMapID, "NPCCntCross", sendCMD, len(sendCMD))
|
| | | return
|
| | |
|
| | | def CrossServerMsg_NPCInfoRet(msgData, tick):
|
| | | ## 收到跨服服务器同步的地图NPC信息
|
| | | |
| | | mapID = msgData["MapID"]
|
| | | playerID = msgData["PlayerID"]
|
| | | npcIDList = msgData["NPCIDList"]
|
| | | mapNPCInfoDict = msgData["Result"]
|
| | | PyGameData.g_crossMapNPCInfo[mapID] = [tick, mapNPCInfoDict]
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
|
| | | if curPlayer:
|
| | | SyncPlayerCrossMapNPCInfo(curPlayer, mapID, npcIDList, mapNPCInfoDict)
|
| | | |
| | | return
|
| | |
|
| | | def SyncPlayerCrossMapNPCInfo(curPlayer, mapID, npcIDList, mapNPCInfoDict):
|
| | | ## 同步给玩家跨服地图NPC信息
|
| | | |
| | | npcInfoPack = ChPyNetSendPack.tagMCNPCCntList()
|
| | | npcInfoPack.Clear()
|
| | | npcInfoPack.MapID = mapID
|
| | | npcInfoPack.NPCInfoList = []
|
| | | |
| | | for npcID in npcIDList:
|
| | | npcInfo = ChPyNetSendPack.tagMCNPCCntInfo()
|
| | | npcInfo.Clear()
|
| | | npcInfo.NPCID = npcID
|
| | | npcInfo.Cnt = mapNPCInfoDict.get(npcID, 0)
|
| | | npcInfoPack.NPCInfoList.append(npcInfo)
|
| | | |
| | | npcInfoPack.NPCInfoCnt = len(npcInfoPack.NPCInfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, npcInfoPack)
|
| | | return
|
| | |
|
| | |
|
| | | ## 获得家族属性(等级,人数)获得自己所在家族的属性
|
| | | # @param curPlayer 请求的玩家
|
| | |
| | | resultName = pack.GetResultName() #[queryid, 人气值, 物品ID]
|
| | |
|
| | | if callName == "SendMail":
|
| | | title, content, getDays, playerIDList, addItemList, gold, goldPaper, silver, detail = eval(resultName)
|
| | | title, content, getDays, playerIDList, addItemList, gold, goldPaper, silver, detail, moneySource = eval(resultName)
|
| | | limitTime = str(GameWorld.GetDatetimeByDiffDays(getDays))
|
| | | limitTime = limitTime.split(".")[0]
|
| | | PlayerCompensation.SendPersonalItemMail(title, content, limitTime, playerIDList, addItemList, gold, goldPaper, silver, detail=detail)
|
| | | PlayerCompensation.SendPersonalItemMail(title, content, limitTime, playerIDList, addItemList, gold, goldPaper, silver, detail=detail, moneySource=moneySource)
|
| | | return
|
| | |
|
| | | if callName == "SendMailBatch":
|
| | |
| | | CrossRealmMsg.SendMsgToClientServer(msgType, dataMsg, serverGroupIDList)
|
| | | return
|
| | |
|
| | | if callName == 'MergeWorldNotify':
|
| | | country, msgMark, msgParamList, lineID, mergeMinOSD, mergeMaxOSD, mergeMapInfo = eval(resultName)
|
| | | PlayerControl.MergeWorldNotify(country, msgMark, msgParamList, lineID, mergeMinOSD, mergeMaxOSD, mergeMapInfo, 1)
|
| | | if callName == "SetCrossPlayerAttrValue":
|
| | | CrossRealmPlayer.SetCrossPlayerAttrValue(eval(resultName), tick)
|
| | | return
|
| | | |
| | | if callName == 'CrossNotify':
|
| | | serverGroupIDList, crossNotifyList = eval(resultName)
|
| | | PlayerControl.CrossNotify(serverGroupIDList, crossNotifyList)
|
| | | return
|
| | |
|
| | | if callName == "CommMapServerInitOK":
|
| | |
| | | PlayerFamily.MapServer_PyAddFamilyInfoValue(curPlayer, eval(resultName))
|
| | | return
|
| | |
|
| | | if callName == 'UpdRechargeRankBillboard': #地图服务器更新玩家通知特惠累计充值排行榜
|
| | | PlayerBillboard.MapServer_UpdateRechargeRankBillboard(eval(resultName))
|
| | | return
|
| | | |
| | | if callName == 'UpdCostRankBillboard': #地图服务器更新玩家通知特惠累计消费排行榜
|
| | | PlayerBillboard.MapServer_UpdateCostRankBillboard(eval(resultName))
|
| | | return
|
| | | |
| | | if callName == 'UpdateTotalRechargeBillboard': #地图服务器更新玩家充值总数排行榜
|
| | | PlayerBillboard.MapServer_UpdateTotalRechargeBillboard(eval(resultName))
|
| | | return
|
| | | |
| | | if callName == 'UpdMSRechargeRankBillboard': #地图服务器更新玩家合服活动充值总数排行榜
|
| | | PlayerBillboard.MapServer_UpdMSRechargeRankBillboard(eval(resultName))
|
| | | return
|
| | | |
| | | if callName == 'UpdMSFamilyKillBossBillboard': #地图服务器更新玩家合服活动战盟击杀boss总数排行榜
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(srcPlayerID)
|
| | | if not curPlayer:
|
| | | return
|
| | | GameWorldMixServerCampaign.UpdMixCampaignFamiliyBossCnt(curPlayer, eval(resultName))
|
| | | return
|
| | |
|
| | | if callName == 'ExitExam': #地图服务器玩家退出答题
|
| | |
| | | PlayerTalk.ChatPYSpeaker(curPlayer, eval(resultName))
|
| | | return
|
| | |
|
| | | #刷新本服角色信息
|
| | | if callName == 'RefreshMainServerRole':
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(srcPlayerID)
|
| | | if not curPlayer:
|
| | | return
|
| | | ChPlayer.DoRefreshMainServerRole(curPlayer)
|
| | | return
|
| | | |
| | | # 战盟联赛
|
| | | if callName =="FamilyWarOver":
|
| | | GameWorldFamilyWar.MapServer_FamilyWarOver(eval(resultName))
|
| | |
| | | elif notifyType == 2:
|
| | | PlayerUniversalGameRec.SendUniversalGameRecInfo(None, recType)
|
| | |
|
| | | return
|
| | | |
| | | # 领地争夺战拔旗消耗
|
| | | if callName =="ManorWarGetFlagCost":
|
| | | PlayerManorWar.ManorWarGetFlagCost(eval(resultName))
|
| | | return
|
| | | |
| | | # 领地争夺战获胜战盟
|
| | | if callName =="ManorWarWinner":
|
| | | PlayerManorWar.DoMapServerManorWarWinner(eval(resultName))
|
| | | return
|
| | |
|
| | | # 战盟副本boss开始、被击杀
|
| | |
| | | GameWorldProcess.UpdGlobalKillCount(eval(resultName))
|
| | | return
|
| | |
|
| | | # 自定义商店全服限购次数清空
|
| | | if callName =="ShopItemClearBuyCnt":
|
| | | shopID = eval(resultName)[0]
|
| | | GameWorldShopItem.DoShopItemClearBuyCnt(shopID)
|
| | | return
|
| | | |
| | | # 新手指导员天数
|
| | | if callName =="FreshmanGuiderDay":
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(srcPlayerID)
|
| | |
| | | return
|
| | |
|
| | | #生成仙盟红包
|
| | | if callName == 'CreatFamilyRedPacket':
|
| | | PlayerFamilyRedPacket.CreatFamilyRedPacket(eval(resultName))
|
| | | if callName == "MapServer_CreatRedPacket":
|
| | | PlayerFamilyRedPacket.MapServer_CreatRedPacket(eval(resultName))
|
| | | return
|
| | | #发仙盟红包
|
| | | if callName == 'SendFamilyRedPacket':
|
| | |
| | | if callName =="DuJieFBOver":
|
| | | PlayerDuJie.DoDuJieFBOver(eval(resultName))
|
| | | return
|
| | | #境界提升全服buff
|
| | | if callName =="RealmUpAddBuff":
|
| | | PlayerDuJie.DoRealmUpAddBuff(resultName)
|
| | | return
|
| | |
|
| | | # 组队副本队长请求进入询问结果
|
| | | if callName == "EnterFBTeamAsk":
|
| | |
| | | if not curPlayer:
|
| | | return
|
| | | PlayerBourse.OnGivePlayerBourseGainsResult(curPlayer, eval(resultName))
|
| | | return
|
| | | |
| | | # 拍卖行
|
| | | if callName == "AuctionHouse":
|
| | | curPlayer = None
|
| | | if srcPlayerID:
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(srcPlayerID)
|
| | | if not curPlayer:
|
| | | return
|
| | | AuctionHouse.MapServer_AuctionHouseLogic(curPlayer, eval(resultName), tick)
|
| | | return
|
| | |
|
| | | if callName == "TeamMemFuncData":
|
| | |
| | | if callName =="AddBossRebornPoint":
|
| | | GameWorldBoss.AddBossRebornPoint(eval(resultName))
|
| | | return
|
| | | #通知神兽副本NPC刷新时间
|
| | | if callName =="DogzNPCTime":
|
| | | PyGameData.g_dogzNPCRefreshTimeDict = eval(resultName)
|
| | | GameWorldBoss.Sync_DogzNPCRefreshTime()
|
| | | #多仙盟BOSS结束
|
| | | if callName =="AllFamilyBossOver":
|
| | | PlayerFamilyBoss.AllFamilyBossKilled()
|
| | | return
|
| | | #骑宠BOSS结束
|
| | | if callName =="HorsePetBossOver":
|
| | | PlayerHorsePetBoss.HorsePetBossKilled(int(resultName))
|
| | | return
|
| | | |
| | | #---return分割线-----------------------------------------------------------------
|
| | |
|
| | |
|
| | |
| | | if callName == 'SendInviteCode':
|
| | | #邀请码验证回复
|
| | | resultName = PlayerRecall.PlayerRecall_InviteCode(srcPlayerID, pack.GetQueryID())
|
| | | |
| | | if callName == 'MixServerCampaignAward':
|
| | | #可否领取合服活动奖励
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(srcPlayerID)
|
| | | resultName = '%s' % GameWorldMixServerCampaign.CanGiveMixCampaignAward(curPlayer, eval(resultName))
|
| | |
|
| | | if callName == 'OpenServerCampaignAward':
|
| | | #可否领取开服活动奖励
|
| | |
| | | return
|
| | | resultName = '%s' % ret
|
| | |
|
| | | # 战盟仓库
|
| | | if callName == "FamilyStore":
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(srcPlayerID)
|
| | | if not curPlayer:
|
| | | return
|
| | | resultName = '%s' % PlayerFamilyStore.DoMapServerFamilyStore(curPlayer, eval(resultName), tick)
|
| | | |
| | | # 自定义商店物品
|
| | | if callName == "ShopItem":
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(srcPlayerID)
|
| | | resultName = '%s' % GameWorldShopItem.DoShopItemQueryResult(curPlayer, eval(resultName))
|
| | | |
| | | # 玩家天梯奖励
|
| | | if callName == "HighLadderReward":
|
| | | curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(srcPlayerID)
|
| | | import HighLadder
|
| | | needResult, resultName = HighLadder.MapServer_HighLadderReward(curPlayer, eval(resultName))
|
| | | if not needResult:
|
| | | return
|
| | | # # 战盟仓库
|
| | | # if callName == "FamilyStore":
|
| | | # curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(srcPlayerID)
|
| | | # if not curPlayer:
|
| | | # return
|
| | | # resultName = '%s' % PlayerFamilyStore.DoMapServerFamilyStore(curPlayer, eval(resultName), tick)
|
| | |
|
| | | srcPlayer = GameWorld.GetPlayerManager().FindPlayerByID(srcPlayerID)
|
| | |
|