129 【战斗】战斗系统-服务端(去除常规功能封包对象池使用;)
| | |
| | | import PlayerControl
|
| | | import IpyGameDataPY
|
| | | import ItemCommon
|
| | | import ObjPool
|
| | |
|
| | | # 重置类型
|
| | | ResetType_Day = 1
|
| | |
| | | syncIDList.append(shopID)
|
| | | if not syncIDList:
|
| | | return
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCShopRefreshItemInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCShopRefreshItemInfo()
|
| | | clientPack.ShopType = shopType
|
| | | clientPack.RefreshCnt = min(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShopRefreshCnt % shopType), 250)
|
| | | clientPack.ShopIDList = syncIDList
|
| | |
| | | def SyncShopItemBuyCntInfo(curPlayer, syncIDList=[]):
|
| | | ##同步商品购买次数
|
| | |
|
| | | objPool = ObjPool.GetPoolMgr()
|
| | | buyCntList = []
|
| | | if syncIDList:
|
| | | for shopID in syncIDList:
|
| | | buyInfo = objPool.acquire(ChPyNetSendPack.tagSCShopItemBuyCnt)
|
| | | buyInfo = ChPyNetSendPack.tagSCShopItemBuyCnt()
|
| | | buyInfo.ShopID = shopID
|
| | | buyInfo.BuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShopBuyCnt % shopID)
|
| | | buyCntList.append(buyInfo)
|
| | |
| | | buyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShopBuyCnt % shopID)
|
| | | if buyCnt <= 0:
|
| | | continue
|
| | | buyInfo = objPool.acquire(ChPyNetSendPack.tagSCShopItemBuyCnt)
|
| | | buyInfo = ChPyNetSendPack.tagSCShopItemBuyCnt()
|
| | | buyInfo.ShopID = shopID
|
| | | buyInfo.BuyCnt = buyCnt
|
| | | buyCntList.append(buyInfo)
|
| | |
| | | if not buyCntList:
|
| | | return
|
| | |
|
| | | clientPack = objPool.acquire(ChPyNetSendPack.tagSCShopItemBuyCntInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCShopItemBuyCntInfo()
|
| | | clientPack.BuyCntList = buyCntList
|
| | | clientPack.Count = len(clientPack.BuyCntList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | |
| | | import FBLogic
|
| | | import ChConfig
|
| | | import PlayerGoldInvest
|
| | | import ObjPool
|
| | |
|
| | | import random
|
| | | import json
|
| | |
| | | return
|
| | | mapIDList = [mapIDInfo] if type(mapIDInfo) == int else mapIDInfo
|
| | |
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCFBInfoList)
|
| | | clientPack = ChPyNetSendPack.tagSCFBInfoList()
|
| | | clientPack.FBDataList = []
|
| | |
|
| | | for mapID in mapIDList:
|
| | | fbInfo = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCFBInfo)
|
| | | fbInfo = ChPyNetSendPack.tagSCFBInfo()
|
| | | fbInfo.MapID = mapID
|
| | | fbInfo.EnterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbEnterCnt % mapID)
|
| | | fbInfo.ADAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBADCnt % mapID)
|
| | |
| | | import NPCCommon
|
| | | import BattleObj
|
| | | import ChEquip
|
| | | import ObjPool
|
| | |
|
| | | import random
|
| | |
|
| | |
| | | syncItemIDList = GetBootyItemIDList()
|
| | | else:
|
| | | syncItemIDList = [itemID]
|
| | | poolMgr = ObjPool.GetPoolMgr()
|
| | | clientPack = poolMgr.acquire(ChPyNetSendPack.tagSCDropBootyInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCDropBootyInfo()
|
| | | clientPack.DropBootyList = []
|
| | | for itemID in syncItemIDList:
|
| | | dropBooty = poolMgr.acquire(ChPyNetSendPack.tagSCDropBooty)
|
| | | dropBooty = ChPyNetSendPack.tagSCDropBooty()
|
| | | dropBooty.ItemID = itemID
|
| | | dropBooty.TodayDropCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BootyDropToday % itemID)
|
| | | clientPack.DropBootyList.append(dropBooty)
|
| | |
| | | import PlayerMail
|
| | | import DBDataMgr
|
| | | import TurnSkill
|
| | | import ObjPool
|
| | |
|
| | | def OnDay():
|
| | | ## 结算昨日奖励
|
| | |
| | | def SyncTianziInfo(curPlayer, lineID=None, bossID=None):
|
| | | if lineID == None:
|
| | | lineID, bossID = GetTianziTodayInfo(curPlayer)
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCTianziKYInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCTianziKYInfo()
|
| | | clientPack.LineID = lineID
|
| | | clientPack.HistoryHurt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TianziHisHurt % bossID)
|
| | | clientPack.HistoryHurtEx = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TianziHisHurtEx % bossID)
|
| | |
| | | import PlayerGubao
|
| | | import PyGameData
|
| | | import PlayerHero
|
| | | import ObjPool
|
| | |
|
| | | import math
|
| | | import time
|
| | |
| | | itemCount = GetItemCountByID(curPlayer, itemID)
|
| | | if not itemCount and not force:
|
| | | continue
|
| | | countInfo = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagMCAutoItemCount)
|
| | | countInfo = ChPyNetSendPack.tagMCAutoItemCount()
|
| | | countInfo.Clear()
|
| | | countInfo.ItemID = itemID
|
| | | countInfo.ItemCount = itemCount
|
| | |
| | | if not itemCountList:
|
| | | return
|
| | |
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagMCAutoItemCountRefresh)
|
| | | clientPack = ChPyNetSendPack.tagMCAutoItemCountRefresh()
|
| | | clientPack.Clear()
|
| | | clientPack.ItemCountList = itemCountList
|
| | | clientPack.Count = len(clientPack.ItemCountList)
|
| | |
| | | import PlayerTravel
|
| | | import TurnAttack
|
| | | import PlayerHJG
|
| | | import ObjPool
|
| | |
|
| | | import datetime
|
| | | import time
|
| | |
| | | adCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ADCnt % adID)
|
| | | if not adCnt and syncADIDList == None:
|
| | | continue
|
| | | adInfo = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCADInfo)
|
| | | adInfo = ChPyNetSendPack.tagSCADInfo()
|
| | | adInfo.ADID = adID
|
| | | adInfo.ADCnt = adCnt
|
| | | adInfoList.append(adInfo)
|
| | |
| | | if not adInfoList:
|
| | | return
|
| | |
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCADInfoList)
|
| | | clientPack = ChPyNetSendPack.tagSCADInfoList()
|
| | | clientPack.ADInfoList = adInfoList[:255]
|
| | | clientPack.Count = len(clientPack.ADInfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | |
| | | import ItemCommon
|
| | | import GameWorld
|
| | | import ChConfig
|
| | | import ObjPool
|
| | | import math
|
| | |
|
| | | # 开服冲榜类型对应功能ID
|
| | |
| | | return
|
| | |
|
| | | def SyncOSACelebrationInfo(curPlayer):
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCOSACelebrationInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCOSACelebrationInfo()
|
| | | clientPack.PointTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OSACelebrationPoint)
|
| | | clientPack.PointAward = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OSACelebrationAward)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | |
| | | import IpyGameDataPY
|
| | | import GameWorld
|
| | | import DBDataMgr
|
| | | import ObjPool
|
| | |
|
| | | def OnDay(curPlayer):
|
| | | CheckResetWeekActivity(curPlayer)
|
| | |
| | | return
|
| | |
|
| | | def SyncDailyTaskInfo(curPlayer, taskType=0, conds=[], isAll=False):
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCDailyTaskInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCDailyTaskInfo()
|
| | | clientPack.ActivityTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityTotal)
|
| | | clientPack.ActivityAward = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityAward)
|
| | | clientPack.DailyTaskState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DailyTaskState)
|
| | |
| | |
|
| | | clientPack.TaskList = []
|
| | | for taskType, conds in syncTaskCondList:
|
| | | task = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCDailyTask)
|
| | | task = ChPyNetSendPack.tagSCDailyTask()
|
| | | task.TaskType = taskType
|
| | | task.Conds = conds
|
| | | task.CLen = len(task.Conds)
|
| | |
| | | import PyGameData
|
| | | import GameWorld
|
| | | import ChConfig
|
| | | import ObjPool
|
| | | import random
|
| | |
|
| | | # 记录攻击类型
|
| | |
| | |
|
| | | def __SyncMatchList(curPlayer, matchIDList, viewCacheDict={}):
|
| | | ## 同步匹配列表
|
| | | objPool = ObjPool.GetPoolMgr()
|
| | | clientPack = objPool.acquire(ChPyNetSendPack.tagSCArenaMatchList)
|
| | | clientPack = ChPyNetSendPack.tagSCArenaMatchList()
|
| | | clientPack.MatchList = []
|
| | | for matchID in matchIDList:
|
| | | if matchID in viewCacheDict:
|
| | |
| | | viewCache = PlayerViewCache.FindBattleViewCache(matchID)
|
| | | if not viewCache:
|
| | | continue
|
| | | matchInfo = objPool.acquire(ChPyNetSendPack.tagSCArenaMatchInfo)
|
| | | matchInfo = ChPyNetSendPack.tagSCArenaMatchInfo()
|
| | | matchInfo.PlayerID = matchID
|
| | | if viewCache:
|
| | | matchInfo.PlayerName = viewCache.GetPlayerName()
|
| | |
| | | return
|
| | |
|
| | | def Sync_ArenaInfo(curPlayer):
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCArenaPlayerInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCArenaPlayerInfo()
|
| | | clientPack.Score = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ArenaScore)
|
| | | clientPack.WinCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ArenaWinCnt)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | |
| | | import PyGameData
|
| | | import PlayerTask
|
| | | import FBCommon
|
| | | import ObjPool
|
| | |
|
| | | # 红颜解锁方式
|
| | | (
|
| | |
| | | if not state and beautyIDList == None:
|
| | | continue
|
| | | lv, exp = GetBeautyLVInfo(curPlayer, beautyID)
|
| | | beauty = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCBeauty)
|
| | | beauty = ChPyNetSendPack.tagSCBeauty()
|
| | | beauty.BeautyID = beautyID
|
| | | beauty.State = state
|
| | | beauty.LV = lv
|
| | |
| | | else:
|
| | | if not skinInfo:
|
| | | continue
|
| | | beautySkin = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCBeautySkin)
|
| | | beautySkin = ChPyNetSendPack.tagSCBeautySkin()
|
| | | beautySkin.SkinID = skinID
|
| | | beautySkin.State = 1 if IsBeautySkinCanUse(curPlayer, beautyID, skinID, ipyData) else 0
|
| | | beautySkin.Used = GetBeautySkinUsed(curPlayer, skinID)
|
| | |
| | | if not beautyList:
|
| | | return
|
| | |
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCBeautyInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCBeautyInfo()
|
| | | clientPack.BeautyList = beautyList
|
| | | clientPack.Count = len(clientPack.BeautyList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | |
| | | import NetPackCommon
|
| | | import ItemCommon
|
| | | import ChConfig
|
| | | import ObjPool
|
| | |
|
| | | import time
|
| | |
|
| | |
| | | state = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_ChatBoxState, boxID)
|
| | | if not state and boxIDList == None:
|
| | | continue
|
| | | box = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCChatBox)
|
| | | box = ChPyNetSendPack.tagSCChatBox()
|
| | | box.BoxID = boxID
|
| | | box.State = state
|
| | | box.EndTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ChatBoxEndTime % boxID)
|
| | |
| | | if not boxList:
|
| | | return
|
| | |
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCChatBoxInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCChatBoxInfo()
|
| | | clientPack.BoxList = boxList
|
| | | clientPack.Count = len(clientPack.BoxList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | |
| | | import PlayerHero
|
| | | import PlayerHJG
|
| | | import ChConfig
|
| | | import ObjPool
|
| | |
|
| | | import random
|
| | | import time
|
| | |
| | | state = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_FaceState, faceID)
|
| | | if not state and faceIDList == None:
|
| | | continue
|
| | | face = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagMCFace)
|
| | | face = ChPyNetSendPack.tagMCFace()
|
| | | face.FaceID = faceID
|
| | | face.State = state
|
| | | face.EndTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FaceEndTime % faceID)
|
| | |
| | | if not faceList:
|
| | | return
|
| | |
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagMCFaceInfo)
|
| | | clientPack = ChPyNetSendPack.tagMCFaceInfo()
|
| | | clientPack.FaceList = faceList
|
| | | clientPack.Count = len(clientPack.FaceList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | |
| | | state = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_FacePicState, facePicID)
|
| | | if not state and facePicIDList == None:
|
| | | continue
|
| | | facePic = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagMCFacePic)
|
| | | facePic = ChPyNetSendPack.tagMCFacePic()
|
| | | facePic.FacePicID = facePicID
|
| | | facePic.State = state
|
| | | facePic.EndTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FacePicEndTime % facePicID)
|
| | |
| | | if not facePicList:
|
| | | return
|
| | |
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagMCFacePicInfo)
|
| | | clientPack = ChPyNetSendPack.tagMCFacePicInfo()
|
| | | clientPack.FacePicList = facePicList
|
| | | clientPack.Count = len(clientPack.FacePicList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | |
| | | import PlayerTask
|
| | | import DBDataMgr
|
| | | import DirtyList
|
| | | import ObjPool
|
| | |
|
| | | import random
|
| | | import time
|
| | |
| | | donateCntList.append(donateCnt)
|
| | | if not donateCntList:
|
| | | return
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCDonateCntInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCDonateCntInfo()
|
| | | clientPack.DonateCntList = donateCntList
|
| | | clientPack.Count = len(clientPack.DonateCntList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | |
| | | import PlayerFamily
|
| | | import GameWorld
|
| | | import DBDataMgr
|
| | | import ObjPool
|
| | |
|
| | | import time
|
| | |
|
| | |
| | | return
|
| | |
|
| | | def SyncTaofaInfo(curPlayer):
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCFamilyTaofaInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCFamilyTaofaInfo()
|
| | | clientPack.BuZhenState = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaBuZhenState)
|
| | | clientPack.AtkCount = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaCnt)
|
| | | clientPack.ItemAddCount = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTaofaItemAddCnt)
|
| | |
| | |
|
| | | def SyncTaofaAtkRet(curPlayer, atkType, hurtList, awardItemList):
|
| | | atkHurtList = []
|
| | | objPool = ObjPool.GetPoolMgr()
|
| | | for totalHurt, isSuper in hurtList:
|
| | | atkHurt = objPool.acquire(ChPyNetSendPack.tagSCFamilyTaofaAtkHurt)
|
| | | atkHurt = ChPyNetSendPack.tagSCFamilyTaofaAtkHurt()
|
| | | atkHurt.IsSuper = isSuper
|
| | | atkHurt.HurtValue = totalHurt % ChConfig.Def_PerPointValue
|
| | | atkHurt.HurtValueEx = totalHurt / ChConfig.Def_PerPointValue
|
| | |
| | |
|
| | | itemList = []
|
| | | for itemID, itemCount in awardItemList:
|
| | | item = objPool.acquire(ChPyNetSendPack.tagSCFamilyTaofaAtkItem)
|
| | | item = ChPyNetSendPack.tagSCFamilyTaofaAtkItem()
|
| | | item.ItemID = itemID
|
| | | item.Count = itemCount
|
| | | itemList.append(item)
|
| | |
|
| | | clientPack = objPool.acquire(ChPyNetSendPack.tagSCFamilyTaofaAtkRet)
|
| | | clientPack = ChPyNetSendPack.tagSCFamilyTaofaAtkRet()
|
| | | clientPack.AtkType = atkType
|
| | | clientPack.HurtList = atkHurtList
|
| | | clientPack.HurtCount = len(clientPack.HurtList)
|
| | |
| | | import IpyGameDataPY
|
| | | import ShareDefine
|
| | | import CommFunc
|
| | | import ObjPool
|
| | |
|
| | | import time
|
| | |
|
| | |
| | |
|
| | | firstChargeList = []
|
| | | for firstID in syncIDList:
|
| | | firstCharge = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCFirstCharge)
|
| | | firstCharge = ChPyNetSendPack.tagSCFirstCharge()
|
| | | firstCharge.FirstID = firstID
|
| | | firstCharge.ChargeTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FirstChargeTime % firstID)
|
| | | firstCharge.AwardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FirstChargeRecord % firstID)
|
| | |
| | | if not firstChargeList:
|
| | | return
|
| | |
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCFirstChargeInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCFirstChargeInfo()
|
| | | clientPack.FirstChargeList = firstChargeList
|
| | | clientPack.Count = len(clientPack.FirstChargeList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | |
| | | import PlayerGubao
|
| | | import ShareDefine
|
| | | import PlayerTask
|
| | | import ObjPool
|
| | |
|
| | | import time
|
| | | import math
|
| | |
| | | return
|
| | |
|
| | | def SyncGoldRushInfo(curPlayer):
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCGoldRushInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCGoldRushInfo()
|
| | | clientPack.CampState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GoldRushCampState)
|
| | | clientPack.WorkerState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GoldRushWorkerState)
|
| | | clientPack.PanningCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GoldRushCnt)
|
| | |
| | | return
|
| | |
|
| | | def SyncGoldCampInfo(curPlayer, syncCampIDList=None):
|
| | | poolMgr = ObjPool.GetPoolMgr()
|
| | | campList = []
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for index in range(ipyDataMgr.GetGoldRushCampCount()):
|
| | |
| | | if syncCampIDList and campID not in syncCampIDList:
|
| | | continue
|
| | | refreshCnt, goldID, workerCnt = GetCampInfo(curPlayer, campID)
|
| | | camp = poolMgr.acquire(ChPyNetSendPack.tagSCGoldRushCamp)
|
| | | camp = ChPyNetSendPack.tagSCGoldRushCamp()
|
| | | camp.CampID = campID
|
| | | camp.GoldID = goldID
|
| | | camp.RefreshCnt = refreshCnt
|
| | |
| | | campList.append(camp)
|
| | | if not campList:
|
| | | return
|
| | | clientPack = poolMgr.acquire(ChPyNetSendPack.tagSCGoldRushCampInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCGoldRushCampInfo()
|
| | | clientPack.CampList = campList
|
| | | clientPack.CampCnt = len(clientPack.CampList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | |
| | | import ItemControler
|
| | | import PlayerOnline
|
| | | import ChConfig
|
| | | import ObjPool
|
| | |
|
| | | GubaoEffType_GoldRush = 1 # 参与淘金
|
| | | GubaoEffType_Arena = 2 # 参与演武场
|
| | |
| | | # 没有指定时只同步激活的
|
| | | continue
|
| | | lv, star, layer = GetGubaoInfo(curPlayer, gubaoID)
|
| | | gubao = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagMCGubao)
|
| | | gubao = ChPyNetSendPack.tagMCGubao()
|
| | | gubao.GubaoID = gubaoID
|
| | | gubao.GubaoLV = lv
|
| | | gubao.GubaoStar = star
|
| | |
| | | if not gubaoInfoList:
|
| | | return
|
| | |
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagMCGubaoInfo)
|
| | | clientPack = ChPyNetSendPack.tagMCGubaoInfo()
|
| | | clientPack.GubaoInfoList = gubaoInfoList
|
| | | clientPack.Count = len(clientPack.GubaoInfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | |
| | | import PlayerFace
|
| | | import PlayerHero
|
| | | import ChConfig
|
| | | import ObjPool
|
| | |
|
| | | import random
|
| | | import time
|
| | |
| | | state = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_TitleState, titleID)
|
| | | if not state and titleIDList == None:
|
| | | continue
|
| | | title = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCTitle)
|
| | | title = ChPyNetSendPack.tagSCTitle()
|
| | | title.TitleID = titleID
|
| | | title.State = state
|
| | | title.EndTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TitleEndTime % titleID)
|
| | |
| | | if not titleList:
|
| | | return
|
| | |
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCTitleInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCTitleInfo()
|
| | | clientPack.TitleList = titleList
|
| | | clientPack.Count = len(clientPack.TitleList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | |
| | | state = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_ModelState, modelID)
|
| | | if not state and modelIDList == None:
|
| | | continue
|
| | | model = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCModel)
|
| | | model = ChPyNetSendPack.tagSCModel()
|
| | | model.ModelID = modelID
|
| | | model.State = state
|
| | | model.EndTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ModelEndTime % modelID)
|
| | |
| | | if not modelList:
|
| | | return
|
| | |
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCModelInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCModelInfo()
|
| | | clientPack.ModelList = modelList
|
| | | clientPack.Count = len(clientPack.ModelList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | |
| | | import PlayerOnline
|
| | | import PlayerTask
|
| | | import GameWorld
|
| | | import ObjPool
|
| | |
|
| | | import time
|
| | |
|
| | |
| | | return
|
| | |
|
| | | def SyncHorseClassInfo(curPlayer):
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCHorseClassInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCHorseClassInfo()
|
| | | clientPack.ClassLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorseClassLV)
|
| | | clientPack.HorseLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorseLV)
|
| | | clientPack.Exp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorseExp)
|
| | |
| | | state = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_HorseSkinState, horseSkinID)
|
| | | if not state and horseSkinIDList == None:
|
| | | continue
|
| | | horseSkin = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCHorseSkin)
|
| | | horseSkin = ChPyNetSendPack.tagSCHorseSkin()
|
| | | horseSkin.HorseSkinID = horseSkinID
|
| | | horseSkin.State = state
|
| | | horseSkin.EndTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorseSkinEndTime % horseSkinID)
|
| | |
| | | if not horseSkinList:
|
| | | return
|
| | |
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCHorseSkinInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCHorseSkinInfo()
|
| | | clientPack.HorseSkinList = horseSkinList
|
| | | clientPack.Count = len(clientPack.HorseSkinList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | |
| | | import ChPyNetSendPack
|
| | | import PlayerControl
|
| | | import GameWorld
|
| | | import ObjPool
|
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | | if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LLMJLVInfo):
|
| | |
| | |
|
| | | def SyncLLMJInfo(curPlayer):
|
| | | mjLV, zhanchui = GetMJLVInfo(curPlayer)
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCLLMJInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCLLMJInfo()
|
| | | clientPack.MJLV = mjLV
|
| | | clientPack.Zhanchui = zhanchui
|
| | | clientPack.ExpEx = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LLMJExp)
|
| | |
| | | #"""Version = 2025-10-09 16:30"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import ObjPool
|
| | | import DBDataMgr
|
| | | import PlayerMail
|
| | | import ShareDefine
|
| | |
| | |
|
| | | def Sync_SignDayInfo(curPlayer):
|
| | | signInMax = GetSignAwardCountMax()
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCDaySignInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCDaySignInfo()
|
| | | clientPack.SignStateList = []
|
| | | for bit in range(signInMax):
|
| | | state = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_SignInState, bit, False)
|
| | |
| | | import ItemControler
|
| | | import IpyGameDataPY
|
| | | import PyGameData
|
| | | import ObjPool
|
| | |
|
| | | #成就奖励是否已领取
|
| | | def GetSuccHasGot(curPlayer, succID):
|
| | |
| | | syncTypeCondList.append(tcList)
|
| | |
|
| | | successInfoList = []
|
| | | objPoolMgr = ObjPool.GetPoolMgr()
|
| | | for succType, conds in syncTypeCondList:
|
| | | curValue = GetSuccValue(curPlayer, succType, conds)
|
| | | # 不发送为0的数据
|
| | | if not isSendZero and curValue <= 0:
|
| | | continue
|
| | | succInfo = objPoolMgr.acquire(ChPyNetSendPack.tagSCSuccessInfo)
|
| | | succInfo = ChPyNetSendPack.tagSCSuccessInfo()
|
| | | succInfo.SuccType = succType
|
| | | succInfo.Conds = conds
|
| | | succInfo.CLen = len(succInfo.Conds)
|
| | |
| | | if not successInfoList:
|
| | | return
|
| | |
|
| | | clientPack = objPoolMgr.acquire(ChPyNetSendPack.tagSCSuccessInfoList)
|
| | | clientPack = ChPyNetSendPack.tagSCSuccessInfoList()
|
| | | clientPack.SuccessInfoList = successInfoList
|
| | | clientPack.Count = len(clientPack.SuccessInfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | |
| | | maxSuccID = ipyDataMgr.GetSuccessByIndex(succCnt - 1).GetSuccID()
|
| | | recordIndexList = xrange(maxSuccID / 31 + 1)
|
| | |
|
| | | objPoolMgr = ObjPool.GetPoolMgr()
|
| | | recordList = []
|
| | | for i in recordIndexList:
|
| | | awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SuccessAward % i)
|
| | | if not isSyncZero and not awardRecord:
|
| | | continue
|
| | | recordInfo = objPoolMgr.acquire(ChPyNetSendPack.tagSCSuccessAwardRecord)
|
| | | recordInfo = ChPyNetSendPack.tagSCSuccessAwardRecord()
|
| | | recordInfo.RecordIndex = i
|
| | | recordInfo.Record = awardRecord
|
| | | recordList.append(recordInfo)
|
| | |
| | | if not recordList:
|
| | | return
|
| | |
|
| | | clientPack = objPoolMgr.acquire(ChPyNetSendPack.tagSCSuccessAwardRecordList)
|
| | | clientPack = ChPyNetSendPack.tagSCSuccessAwardRecordList()
|
| | | clientPack.RecordList = recordList
|
| | | clientPack.RecordCnt = len(clientPack.RecordList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | |
| | | import ItemControler
|
| | | import PlayerBeauty
|
| | | import GameWorld
|
| | | import ObjPool
|
| | |
|
| | | import random
|
| | | import time
|
| | |
| | |
|
| | | gridList = []
|
| | | for row, col in syncGridList:
|
| | | grid = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCTravelGrid)
|
| | | grid = ChPyNetSendPack.tagSCTravelGrid()
|
| | | grid.Row = row
|
| | | grid.Col = col
|
| | | grid.State = GetGridState(curPlayer, row, col)
|
| | |
| | | gridList.append(grid)
|
| | |
|
| | | sceneryType, sRow, sCol = __getSceneryInfo(curPlayer)
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCTravelInfo)
|
| | | clientPack = ChPyNetSendPack.tagSCTravelInfo()
|
| | | clientPack.Energy = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelEnergy)
|
| | | clientPack.EnergyTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelEnergyTime)
|
| | | clientPack.TravelCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TravelCnt)
|
| | |
| | | import PlayerGubao
|
| | | import PlayerCoin
|
| | | import ChConfig
|
| | | import ObjPool
|
| | |
|
| | | import time
|
| | |
|
| | | # 战令类型
|
| | |
| | | rewardList = []
|
| | | for ipyData in ipyDataList:
|
| | | rewardIndex = ipyData.GetRewardIndex()
|
| | | reward = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagMCZhanling)
|
| | | reward = ChPyNetSendPack.tagMCZhanling()
|
| | | reward.Clear()
|
| | | reward.NeedValue = ipyData.GetNeedValue()
|
| | | reward.FreeRewardState = 1 if GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_ZhanlingRewardFree, rewardIndex, True, [zhanlingType]) else 0
|
| | |
| | | reward.ZLRewardStateH = 1 if GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_ZhanlingRewardH, rewardIndex, True, [zhanlingType]) else 0
|
| | | rewardList.append(reward)
|
| | |
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagMCZhanlingInfo)
|
| | | clientPack = ChPyNetSendPack.tagMCZhanlingInfo()
|
| | | clientPack.Clear()
|
| | | clientPack.ZhanlingType = zhanlingType
|
| | | clientPack.IsActivite = 1 if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ZhanlingState)&pow(2, zhanlingType) else 0
|
| | |
| | | import PyMongoMain
|
| | | import PlayerTask
|
| | | import DirtyList
|
| | | import ObjPool
|
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Rename):
|
| | |
| | | return fullName
|
| | |
|
| | | def Sync_UpdatePlayerNameCount(curPlayer):
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagUpdatePlayerNameCount)
|
| | | clientPack = ChPyNetSendPack.tagUpdatePlayerNameCount()
|
| | | clientPack.Count = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Rename)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|