16 卡牌服务端(删除资源找回;前端自定义副本,公共扫荡;)
| | |
| | | PacketSubCMD_1=0x08
|
| | | PacketCallFunc_1=OnDoFBAction
|
| | |
|
| | | PacketCMD_2=0xA2
|
| | | PacketSubCMD_2=0x10
|
| | | PacketCallFunc_2=OnClearFBCD
|
| | | PacketCMD_2=
|
| | | PacketSubCMD_2=
|
| | | PacketCallFunc_2=
|
| | |
|
| | | PacketCMD_3=0xA5
|
| | | PacketSubCMD_3=0x05
|
| | | PacketCallFunc_3=OnPlayerFBWipeOut
|
| | |
|
| | | PacketCMD_4=0xA5
|
| | | PacketSubCMD_4=0x1B
|
| | | PacketCallFunc_4=OnPlayerBuyFBEnergy
|
| | | PacketCMD_4=
|
| | | PacketSubCMD_4=
|
| | | PacketCallFunc_4=
|
| | |
|
| | | PacketCMD_5=0xB1
|
| | | PacketSubCMD_5=0x02
|
| | | PacketCallFunc_5=OnPlayerGetMultiFBPrize
|
| | | PacketCMD_5=
|
| | | PacketSubCMD_5=
|
| | | PacketCallFunc_5=
|
| | |
|
| | | PacketCMD_6=0xA5
|
| | | PacketSubCMD_6=0x60
|
| | | PacketCallFunc_6=OnPlayerResetFBJoinCnt
|
| | | PacketCMD_6=
|
| | | PacketSubCMD_6=
|
| | | PacketCallFunc_6=
|
| | |
|
| | | PacketCMD_7=0xB1
|
| | | PacketSubCMD_7=0x01
|
| | | PacketCallFunc_7=OnClientEndFB
|
| | | PacketCMD_7=
|
| | | PacketSubCMD_7=
|
| | | PacketCallFunc_7=
|
| | |
|
| | | PacketCMD_8=0xB1
|
| | | PacketSubCMD_8=0x04
|
| | | PacketCallFunc_8=OnClientStartFB
|
| | | PacketCMD_8=
|
| | | PacketSubCMD_8=
|
| | | PacketCallFunc_8=
|
| | |
|
| | | PacketCMD_9=0xB1
|
| | | PacketSubCMD_9=0x08
|
| | |
| | | PacketSubCMD_11=
|
| | | PacketCallFunc_11=
|
| | |
|
| | | PacketCMD_12=0xA2
|
| | | PacketSubCMD_12=0x31
|
| | | PacketCallFunc_12=OnClientStartCustomScene
|
| | | PacketCMD_12=
|
| | | PacketSubCMD_12=
|
| | | PacketCallFunc_12=
|
| | |
|
| | | PacketCMD_13=0xA2
|
| | | PacketSubCMD_13=0x33
|
| | | PacketCallFunc_13=OnClientExitCustomScene
|
| | | PacketCMD_13=
|
| | | PacketSubCMD_13=
|
| | | PacketCallFunc_13=
|
| | |
|
| | | ;ç©å®¶ç¸å
³
|
| | | [ChPlayer]
|
| | |
| | | PacketSubCMD_1=0x52
|
| | | PacketCallFunc_1=OnBuyCollectionCnt
|
| | |
|
| | | PacketCMD_2=A2
|
| | | PacketSubCMD_2=34
|
| | | PacketCallFunc_2=OnGetCustomSceneCollectAward
|
| | | PacketCMD_2=
|
| | | PacketSubCMD_2=
|
| | | PacketCallFunc_2=
|
| | |
|
| | | PacketCMD_3=0xA5
|
| | | PacketSubCMD_3=0x0A
|
| | |
| | | PacketSubCMD_4=0x23
|
| | | PacketCallFunc_4=OnNPCShowEnd
|
| | |
|
| | | PacketCMD_5=0xB4
|
| | | PacketSubCMD_5=0x0C
|
| | | PacketCallFunc_5=OnSummonPriWoodPile
|
| | | PacketCMD_5=
|
| | | PacketSubCMD_5=
|
| | | PacketCallFunc_5=
|
| | |
|
| | | PacketCMD_6=0xB4
|
| | | PacketSubCMD_6=0x0F
|
| | | PacketCallFunc_6=OnRecyclePriWoodPile
|
| | |
|
| | | ;èµæºæ¾å
|
| | | [PlayerRecover]
|
| | | ScriptName = Player\PlayerRecover.py
|
| | | Writer = ljd
|
| | | Releaser = ljd
|
| | | RegType = 0
|
| | | RegisterPackCount = 1
|
| | |
|
| | | PacketCMD_1=0xA5
|
| | | PacketSubCMD_1=0x53
|
| | | PacketCallFunc_1=OnRecoverGain
|
| | | PacketCMD_6=
|
| | | PacketSubCMD_6=
|
| | | PacketCallFunc_6=
|
| | |
|
| | | ;ç¥å¨
|
| | | [PlayerGodWeapon]
|
| | |
| | | if not curTag:
|
| | | continue
|
| | |
|
| | | #éèªå®ä¹åºæ¯æéè¦å¤æ
|
| | | if not attacker.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
|
| | | if curSkillUseTag == ChConfig.Def_UseSkillTag_CanAttackNPC:
|
| | | if NPCCommon.GetNpcObjOwnerIsPlayer(curTag):
|
| | | #npc主人æ¯ç©å®¶ä¸è½æ»å»
|
| | | continue
|
| | | |
| | | if GameWorld.GetDist(curTag.GetPosX(), curTag.GetPosY(), attacker.GetPosX(), attacker.GetPosY()) > attacker.GetSight():
|
| | | # æè¿è·ç¦»é²è
|
| | | GameWorld.DebugLog("#--- æè¿è·ç¦»é²è[%s-%s]"%(attacker.GetID(), curTag.GetID()))
|
| | | if curSkillUseTag == ChConfig.Def_UseSkillTag_CanAttackNPC:
|
| | | if NPCCommon.GetNpcObjOwnerIsPlayer(curTag):
|
| | | #npc主人æ¯ç©å®¶ä¸è½æ»å»
|
| | | continue
|
| | | |
| | | if CheckFunc != None:
|
| | | #æ£æ¥æ¯å¦åå½±å
|
| | | if not CheckFunc(attacker, curTag, curSkill, tick):
|
| | | continue
|
| | | |
| | | if GameWorld.GetDist(curTag.GetPosX(), curTag.GetPosY(), attacker.GetPosX(), attacker.GetPosY()) > attacker.GetSight():
|
| | | # æè¿è·ç¦»é²è
|
| | | GameWorld.DebugLog("#--- æè¿è·ç¦»é²è[%s-%s]"%(attacker.GetID(), curTag.GetID()))
|
| | | continue
|
| | | |
| | | if CheckFunc != None:
|
| | | #æ£æ¥æ¯å¦åå½±å
|
| | | if not CheckFunc(attacker, curTag, curSkill, tick):
|
| | | continue
|
| | |
|
| | | resultList.append(curTag)
|
| | |
|
| | |
| | | #éååç£
|
| | | Def_FBMapID_MirrorBattle = 100
|
| | |
|
| | | #å端èªå®ä¹åºæ¯å°å¾
|
| | | ClientCustomSceneList = []
|
| | |
|
| | | #éåPKçå°å¾IDå表
|
| | | MirrorBattleMapIDList = []
|
| | |
|
| | |
| | |
|
| | | # ä»å¯æ¬éåºæ¶ï¼å¯ä»¥è¿åè¿å
¥åç坿¬ID
|
| | | Def_CanBackFBMap = []
|
| | |
|
| | | #çé¢è§¦åå°å¾
|
| | | Def_Subject_Map = [
|
| | | ]
|
| | | #没éå
³è¿ä¸å¯èµæºæ¾åçå°å¾
|
| | | Def_UnRecoverNoPassMap = [Def_FBMapID_KirinHome, Def_FBMapID_MunekadoTrial, Def_FBMapID_QueenRelics]
|
| | |
|
| | | #坿¬å»¶æ¶è¸¢åºç©å®¶çæ¶é´
|
| | | Def_FBKickPlayerTime = 5000 #5ç§
|
| | |
| | | Def_PlayerKey_SomersaultTime = "Somersault" # ç¿»æ»ä¸å®æ¶é´å
æ æï¼è¡¨ç°ä¸ºMISS
|
| | | Def_Player_RefreshAttrByBuff = "PlayerAttrByBuff" # ç©å®¶å±æ§å·æ°åè½å±æ§ç¼åï¼ä¾¿äºbuffå·æ°è®¡ç®, é´éå·æ°
|
| | | Def_Player_HadRefreshAttr = "HadRefreshAttr" # ç©å®¶å¨æ¬å°å¾æ¯å¦å·æ°è¿å±æ§
|
| | | Def_PlayerKey_ClientCustomScene = "ClientCustomScene" # 客æ·ç«¯èªå®ä¹åºæ¯ç¶æ
|
| | | Def_PlayerKey_ClientCustomSceneStepTick = "ClientCustomSceneStepTick" # 客æ·ç«¯èªå®ä¹åºæ¯tick
|
| | | Def_PlayerKey_ClientCustomSceneGrade = "ClientCustomSceneGrade" # 客æ·ç«¯èªå®ä¹åºæ¯è¯çº§
|
| | | Def_PlayerKey_ChangeMapID = "ChangeMapID" # 请æ±åæ¢çå°å¾ID
|
| | | Def_PlayerKey_ChangeLineID = "ChangeLineID" # 请æ±åæ¢ç线路ID
|
| | | Def_PlayerKey_ResetFBLinePosX = "ResetFBLinePosX" # 请æ±åæ¢å¯æ¬å¤åä¸å°å¾åè½çº¿è·¯ID
|
| | |
| | | Def_Player_Dict_ReqFBMissionID = "ReqFBMissionID" # 请æ±è¿å
¥å¯æ¬çä»»å¡ID
|
| | | Def_Player_Dict_ReqFBMissionType = "ReqFBMissionType" # 请æ±è¿å
¥å¯æ¬çä»»å¡ç±»å
|
| | | Def_Player_Dict_PlayerFBStar_MapId = "FBStar_%s_%s" # 坿¬æçº§æçº§ä¿¡æ¯, åæ°ä¸º[mapID, keyç¼å·], æä½å卿¯ä¸ªlineID对åºçæçº§
|
| | | Def_Player_Dict_CustomMapStep = "CustomMapStep_%s_%s" # å端èªå®ä¹åºæ¯é¶æ®µ, åæ°(mapID, lineID)ï¼å¯¹åº CustomMapStep_Fight ...
|
| | | Def_Player_Dict_FBPassLineID = "FBPassLineID_%s" # 坿¬å·²è¿å
³å°çlineID, åæ°ä¸ºå¯æ¬ID
|
| | | Def_Player_Dict_EnterFbCntTotal = "EnterFbCntTotal_%s" # è¿å
¥å¯æ¬æ»ç´¯è®¡æ¬¡æ°, åæ°ä¸ºå¯æ¬ID
|
| | | Def_Player_Dict_EnterFbCntDay = "EnterFbCntDay_%s" # 仿¥è¿å
¥å¯æ¬æ¬¡æ°, åæ°ä¸ºå¯æ¬ID
|
| | | Def_Player_Dict_BuyFbCntDay = "BuyFbCntDay_%s" # 仿¥è´ä¹°å¯æ¬è¿å
¥æ¬¡æ°, åæ°ä¸ºå¯æ¬ID
|
| | | Def_Player_Dict_RecoverFbCnt = "RecoverFbCnt_%s" # 仿¥æ¾åç坿¬æ¬¡æ°, åæ°ä¸ºå¯æ¬ID
|
| | | Def_Player_Dict_ItemAddFbCnt = "ItemAddFbCnt_%s" # 使ç¨ç©åå¢å ç坿¬æ¬¡æ°, åæ°ä¸ºå¯æ¬ID
|
| | | Def_Player_Dict_RegainFbCnt = "RegainFbCnt_%s" # æ¶é´æ¢å¤å¢å ç坿¬æ¬¡æ°, åæ°ä¸ºå¯æ¬ID
|
| | | Def_Player_Dict_EnterFbCntWeek = "EnterFbCntWeek_%s" # æ¬å¨è¿å
¥å¯æ¬æ¬¡æ°, åæ°ä¸ºå¯æ¬ID
|
| | | Def_Player_Dict_FbCntRegainStartTime = "FbCntRegainStartTime_%s" # 坿¬æ¬¡æ°æ¢å¤å¼å§æ¶é´, åæ°ä¸ºå¯æ¬ID
|
| | | Def_Player_Dict_FbCntRegainTotalTime = "FbCntRegainTotalTime_%s" # 坿¬æ¬¡æ°æ¢å¤è¿éæ¶é´, åæ°ä¸ºå¯æ¬ID
|
| | | Def_Player_Dict_FBHistoryMaxLine = "FBHistoryMaxLine_%s" # 坿¬å岿é«éå
³, åæ°ä¸ºå¯æ¬ID
|
| | | Def_Player_Dict_IceLoadLineID = "IceLoadLineID_%s" # 坿¬æçº§æçº§ä¿¡æ¯, åæ°ä¸º[keyç¼å·], æä½å卿¯ä¸ªlineIDæ¯å¦éä¸
|
| | | Def_Player_Dict_RefurbishGoodBookPlayerLv = "RefurbishGoodBookPlayerLv_97" # å·æ°å¤©ä¹¦ä»»å¡æ¶çç©å®¶ç级
|
| | |
| | | Def_PDict_NobleEndTime = "NobleEndTime_%s" # è´µæå°æç»ææ¶é´<åä½s>, åæ°ä¸ºè´µæç级, ä»1å¼å§
|
| | | Def_PDict_NobleExperState = "NobleExperState" # ä½éªè´µæç¶æï¼ 0-æ æï¼1-ææ; 2-å¯ä½éª
|
| | |
|
| | | Def_PDict_RecoverFBCommonCnt = "RecoverFBCommonCnt_%s" # èµæºæ¾å坿¬æ®éæ¬¡æ° <%s-æ¾å项索å¼>
|
| | | Def_PDict_RecoverFBRegainCnt = "RecoverFBRegainCnt_%s" # èµæºæ¾å坿¬æ¶é´æ¢å¤æ¬¡æ° <%s-æ¾å项索å¼>
|
| | | Def_PDict_RecoverFBExtraCnt = "RecoverFBExtraCnt_%s" # èµæºæ¾å坿¬VIPé¢å¤æ¬¡æ° <%s-æ¾å项索å¼>
|
| | | Def_PDict_RecoverFBBuyCnt = "RecoverFBBuyCnt_%s" # èµæºæ¾å坿¬è´ä¹°æ¬¡æ° <%s-æ¾å项索å¼>
|
| | | Def_PDict_RecoverFBItemAddCnt = "RecoverFBItemAddCnt_%s" # èµæºæ¾å坿¬ç©åå¢å æ¬¡æ° <%s-æ¾å项索å¼>
|
| | | Def_PDict_RecoverFBNoBuyCnt = "RecoverFBNoBuyCnt_%s" # èµæºæ¾å坿¬æªè´ä¹°æ¬¡æ° <%s-æ¾å项索å¼>
|
| | | Def_PDict_RecoverGainData = "RecoverGainData_%s" # èµæºæ¾åé¢å¤æ°æ®<%s-æ¾å项索å¼>
|
| | | Def_PDict_RecoverGainDataEx = "RecoverGainDataEx_%s" # èµæºæ¾åé¢å¤æ°æ®<%s-æ¾å项索å¼>
|
| | | Def_PDict_HaveRecover = "HaveRecover_%s" # èµæºæ¾å仿¥æ¯å¦å·²æ¾å<%s-æ¾å项索å¼> 1ï¼æ¾åäºæ®é 2ï¼æ¾åäºvip 3ï¼2ä¸ªé½ææ¾å
|
| | | Def_PDict_RecoverGainLastTime = "RecoverGainLastTime" # ä¸ä¸æ¬¡èµæºæ¾åæ¶çæ¶é´
|
| | |
|
| | | Def_PDict_NPCKillCount = "NPCKillCount_%s" # NPCå·²å»ææ¬¡æ°, åæ°(NPCID) CCBBAA, AAåå¨å
Œ
±è£
夿¬¡æ°ï¼BBåå¨å
Œ
±ID次æ°ï¼CCåå¨ç§ææ¬¡æ°
|
| | | Def_PDict_NPCAttackCount = "NPCAttackCount_%s" # NPCå·²æ»å»æ¬¡æ°, åæ°(NPCID)
|
| | |
|
| | |
| | | # çµå¨å¹å
»
|
| | | Def_PDict_LingQiTrainLV = "LingQiTrainLV_%s_%s" # å¹å
»çé¶ï¼åæ°ä¸º(place, å¹å
»ç±»å)
|
| | | Def_PDict_LingQiTrainItemCount = "LingQiTrainItemCount_%s_%s" # å¹å
»å½åé¶å·²åå¹å
»ä¸¹ä¸ªæ°ï¼åæ°ä¸º(place, å¹å
»ç±»å)
|
| | |
|
| | | # å
Œ
±CD坿¬æ«è¡
|
| | | Def_PDict_PubCDFBS_Time = "PCDFBS_%s_Time" # å¼å§æ«è¡æ¶é´, åæ°(å
Œ
±ç»ç¼å·)
|
| | | Def_PDict_PubCDFBS_MapID = "PCDFBS_%s_MID" # æ«è¡çå°å¾, åæ°(å
Œ
±ç»ç¼å·)
|
| | | Def_PDict_PubCDFBS_LineID = "PCDFBS_%s_LID" # æ«è¡ç线路, åæ°(å
Œ
±ç»ç¼å·)
|
| | | Def_PDict_PubCDFBS_Cnt = "PCDFBS_%s_Cnt" # æ«è¡æ¬¡æ°, åæ°(å
Œ
±ç»ç¼å·)
|
| | | Def_PDict_PubCDFBS_DataEx = "PCDFBS_%s_DEx" # æ«è¡æ¬¡æ°, åæ°(å
Œ
±ç»ç¼å·)
|
| | |
|
| | | # å® ç©
|
| | | Def_PDict_FightPetIndex = "FightPetIndex" # åºæçå® ç©ç´¢å¼
|
| | |
| | | Def_Cost_5, # 坿¬é¼è 5
|
| | | Def_Cost_GoldInvest, # çè´¢æèµ
|
| | | Def_Cost_Pray, # ç¥ç¥·
|
| | | Def_Cost_RecoverGain, # èµæºæ¾å
|
| | | Def_Cost_8, # èµæºæ¾å
|
| | | Def_Cost_BuyVIPItem, # è´ä¹°VIP礼å
|
| | | Def_Cost_GM, # GM 10
|
| | | Def_Cost_BourseBuy, # 交ææè´ä¹°
|
| | |
| | | Def_Cost_Pray:"Pray",
|
| | | Def_Cost_Treasure:"Treasure",
|
| | | Def_Cost_OpenNoble:"OpenNoble",
|
| | | Def_Cost_RecoverGain:"RecoverGain",
|
| | | Def_Cost_EnterFB:"EnterFB",
|
| | |
|
| | | # æ æ¶è´¹å¯¹è±¡åç±»ç
|
| | |
| | | Def_GiveMoney_Pickup, # ʰȡ
|
| | | Def_GiveMoney_Bourse, # äº¤ææ 10
|
| | | Def_GiveMoney_GoldInvest, # ç»é»æèµ
|
| | | Def_GiveMoney_Recover, # èµæºæ¾å
|
| | | Def_GiveMoney_12, # èµæºæ¾å
|
| | | Def_GiveMoney_RedPacket, # 红å
|
| | | Def_GiveMoney_RefineGift, # ç¼å¶å¥å±
|
| | | Def_GiveMoney_Mail, # é®ä»¶ï¼è¡¥å¿ï¼ 15
|
| | |
| | | Def_GiveMoney_Pickup:"Pickup",
|
| | | Def_GiveMoney_Bourse:"Bourse",
|
| | | Def_GiveMoney_GoldInvest:"GoldInvest",
|
| | | Def_GiveMoney_Recover:"Recover",
|
| | | Def_GiveMoney_RedPacket:"RedPacket",
|
| | | Def_GiveMoney_RefineGift:"RefineGift",
|
| | | Def_GiveMoney_Mail:"Mail",
|
| | |
| | | }
|
| | |
|
| | | ##==================================================================================================
|
| | |
|
| | | # å端èªå®ä¹åºæ¯ç¶æ
|
| | | CustomMapStep_Over = 0 # 没ææå·²ç»æ
|
| | | CustomMapStep_Fight = 1 # ææè¿è¡ä¸
|
| | |
|
| | | # 坿¬åä¸ç±»å
|
| | | FB_JoinType = (
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A2 10 æ¸
é¤å¯æ¬CD#tagCMClearFBCD
|
| | |
|
| | | class tagCMClearFBCD(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("MapID", c_int), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA2
|
| | | self.SubCmd = 0x10
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xA2
|
| | | self.SubCmd = 0x10
|
| | | self.MapID = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMClearFBCD)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A2 10 æ¸
é¤å¯æ¬CD//tagCMClearFBCD:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | MapID:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.MapID
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMClearFBCD=tagCMClearFBCD()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMClearFBCD.Cmd,m_NAtagCMClearFBCD.SubCmd))] = m_NAtagCMClearFBCD
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A2 33 å端éåºèªå®ä¹åºæ¯ #tagCMClientExitCustomScene
|
| | |
|
| | | class tagCMClientExitCustomScene(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA2
|
| | | self.SubCmd = 0x33
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xA2
|
| | | self.SubCmd = 0x33
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMClientExitCustomScene)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A2 33 å端éåºèªå®ä¹åºæ¯ //tagCMClientExitCustomScene:
|
| | | Cmd:%s,
|
| | | SubCmd:%s
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMClientExitCustomScene=tagCMClientExitCustomScene()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMClientExitCustomScene.Cmd,m_NAtagCMClientExitCustomScene.SubCmd))] = m_NAtagCMClientExitCustomScene
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A2 31 å端å¼å§èªå®ä¹åºæ¯ #tagCMClientStartCustomScene
|
| | |
|
| | | class tagCMClientStartCustomScene(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("MapID", c_int), |
| | | ("FuncLineID", c_ushort), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA2
|
| | | self.SubCmd = 0x31
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xA2
|
| | | self.SubCmd = 0x31
|
| | | self.MapID = 0
|
| | | self.FuncLineID = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMClientStartCustomScene)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A2 31 å端å¼å§èªå®ä¹åºæ¯ //tagCMClientStartCustomScene:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | MapID:%d,
|
| | | FuncLineID:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.MapID,
|
| | | self.FuncLineID
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMClientStartCustomScene=tagCMClientStartCustomScene()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMClientStartCustomScene.Cmd,m_NAtagCMClientStartCustomScene.SubCmd))] = m_NAtagCMClientStartCustomScene
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A2 24 触碰NPC #tagCMTouchNPC
|
| | |
|
| | | class tagCMTouchNPC(Structure):
|
| | |
| | |
|
| | | m_NAtagCMTouchNPC=tagCMTouchNPC()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMTouchNPC.Cmd,m_NAtagCMTouchNPC.SubCmd))] = m_NAtagCMTouchNPC
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A2 34 èªå®ä¹åºæ¯ä¸è·åééå¥å± #tagCMGetCustomSceneCollectAward
|
| | |
|
| | | class tagCMGetCustomSceneCollectAward(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("NPCID", c_int), #ééçNPCID
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA2
|
| | | self.SubCmd = 0x34
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xA2
|
| | | self.SubCmd = 0x34
|
| | | self.NPCID = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMGetCustomSceneCollectAward)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A2 34 èªå®ä¹åºæ¯ä¸è·åééå¥å± //tagCMGetCustomSceneCollectAward:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | NPCID:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.NPCID
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMGetCustomSceneCollectAward=tagCMGetCustomSceneCollectAward()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMGetCustomSceneCollectAward.Cmd,m_NAtagCMGetCustomSceneCollectAward.SubCmd))] = m_NAtagCMGetCustomSceneCollectAward
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 1B è´ä¹°ææå¯æ¬ç²¾å #tagCMBuyFBEnergy
|
| | |
|
| | | class tagCMBuyFBEnergy(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x1B
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x1B
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMBuyFBEnergy)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A5 1B è´ä¹°ææå¯æ¬ç²¾å //tagCMBuyFBEnergy:
|
| | | Cmd:%s,
|
| | | SubCmd:%s
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMBuyFBEnergy=tagCMBuyFBEnergy()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMBuyFBEnergy.Cmd,m_NAtagCMBuyFBEnergy.SubCmd))] = m_NAtagCMBuyFBEnergy
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 0A è´ä¹°å¯å»æbossæ¬¡æ° #tagCMBuyKillBossCnt
|
| | |
|
| | | class tagCMBuyKillBossCnt(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 53 èµæºæ¾å #tagCMRecoverGain
|
| | |
|
| | | class tagCMRecoverGain(Structure):
|
| | | Head = tagHead()
|
| | | Type = 0 #(BYTE Type)// æ¾åæ¹å¼ 0 ä»ç 1éé±
|
| | | Cnt = 0 #(BYTE Cnt)
|
| | | IndexList = list() #(vector<BYTE> IndexList)// æ¾åç´¢å¼å表
|
| | | RecoverCntList = list() #(vector<BYTE> RecoverCntList)// ç´¢å¼å¯¹åºæ¾å次æ°å表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA5
|
| | | self.Head.SubCmd = 0x53
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Type,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.Cnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Cnt):
|
| | | value,_pos=CommFunc.ReadBYTE(_lpData,_pos)
|
| | | self.IndexList.append(value)
|
| | | for i in range(self.Cnt):
|
| | | value,_pos=CommFunc.ReadBYTE(_lpData,_pos)
|
| | | self.RecoverCntList.append(value)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA5
|
| | | self.Head.SubCmd = 0x53
|
| | | self.Type = 0
|
| | | self.Cnt = 0
|
| | | self.IndexList = list()
|
| | | self.RecoverCntList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 1
|
| | | length += 1 * self.Cnt
|
| | | length += 1 * self.Cnt
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.Type)
|
| | | data = CommFunc.WriteBYTE(data, self.Cnt)
|
| | | for i in range(self.Cnt):
|
| | | data = CommFunc.WriteBYTE(data, self.IndexList[i])
|
| | | for i in range(self.Cnt):
|
| | | data = CommFunc.WriteBYTE(data, self.RecoverCntList[i])
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Type:%d,
|
| | | Cnt:%d,
|
| | | IndexList:%s,
|
| | | RecoverCntList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Type,
|
| | | self.Cnt,
|
| | | "...",
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMRecoverGain=tagCMRecoverGain()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMRecoverGain.Head.Cmd,m_NAtagCMRecoverGain.Head.SubCmd))] = m_NAtagCMRecoverGain
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A5 74 å·æ°æ¬èµä»»å¡ #tagCMRefreshArrestTask
|
| | |
|
| | | class tagCMRefreshArrestTask(Structure):
|
| | |
| | |
|
| | | m_NAtagCMRequestTreasure=tagCMRequestTreasure()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMRequestTreasure.Cmd,m_NAtagCMRequestTreasure.SubCmd))] = m_NAtagCMRequestTreasure
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | #A5 60 éç½®å¯æ¬æææ¬¡æ° #tagCMResetFBJoinCnt
|
| | |
|
| | | class tagCMResetFBJoinCnt(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x60
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xA5
|
| | | self.SubCmd = 0x60
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMResetFBJoinCnt)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''//A5 60 éç½®å¯æ¬æææ¬¡æ° //tagCMResetFBJoinCnt:
|
| | | Cmd:%s,
|
| | | SubCmd:%s
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMResetFBJoinCnt=tagCMResetFBJoinCnt()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMResetFBJoinCnt.Cmd,m_NAtagCMResetFBJoinCnt.SubCmd))] = m_NAtagCMResetFBJoinCnt
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 01 客æ·ç«¯å¯æ¬åéç»æ #tagCMClientEndFB
|
| | |
|
| | | class tagCMClientEndFB(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("MapID", c_int), |
| | | ("LineID", c_ushort), |
| | | ("Data1", c_int), #坿¬æ°æ®
|
| | | ("Data2", c_int), #坿¬æ°æ®
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB1
|
| | | self.SubCmd = 0x01
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xB1
|
| | | self.SubCmd = 0x01
|
| | | self.MapID = 0
|
| | | self.LineID = 0
|
| | | self.Data1 = 0
|
| | | self.Data2 = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMClientEndFB)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B1 01 客æ·ç«¯å¯æ¬åéç»æ //tagCMClientEndFB:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | MapID:%d,
|
| | | LineID:%d,
|
| | | Data1:%d,
|
| | | Data2:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.MapID,
|
| | | self.LineID,
|
| | | self.Data1,
|
| | | self.Data2
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMClientEndFB=tagCMClientEndFB()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMClientEndFB.Cmd,m_NAtagCMClientEndFB.SubCmd))] = m_NAtagCMClientEndFB
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 04 客æ·ç«¯åéå¼å§å¯æ¬ #tagCMClientStartFB
|
| | |
|
| | | class tagCMClientStartFB(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB1
|
| | | self.SubCmd = 0x04
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xB1
|
| | | self.SubCmd = 0x04
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMClientStartFB)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B1 04 客æ·ç«¯åéå¼å§å¯æ¬ //tagCMClientStartFB:
|
| | | Cmd:%s,
|
| | | SubCmd:%s
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMClientStartFB=tagCMClientStartFB()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMClientStartFB.Cmd,m_NAtagCMClientStartFB.SubCmd))] = m_NAtagCMClientStartFB
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 08 å¿«éä¸é®è¿å
³å¯æ¬ #tagCMFBQuickPass
|
| | |
|
| | | class tagCMFBQuickPass(Structure):
|
| | |
| | |
|
| | | m_NAtagCMFBQuickPass=tagCMFBQuickPass()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMFBQuickPass.Cmd,m_NAtagCMFBQuickPass.SubCmd))] = m_NAtagCMFBQuickPass
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B1 02 é¢åå¤å坿¬å¥å± #tagCMGetMultiFBPrize
|
| | |
|
| | | class tagCMGetMultiFBPrize(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("MapID", c_int), |
| | | ("LineID", c_ushort), |
| | | ("Percent", c_ushort), # é¢å¤å¥å±ç¾åæ¯, å¦50代表é¢å¤50%å¥å±
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB1
|
| | | self.SubCmd = 0x02
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xB1
|
| | | self.SubCmd = 0x02
|
| | | self.MapID = 0
|
| | | self.LineID = 0
|
| | | self.Percent = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMGetMultiFBPrize)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B1 02 é¢åå¤å坿¬å¥å± //tagCMGetMultiFBPrize:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | MapID:%d,
|
| | | LineID:%d,
|
| | | Percent:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.MapID,
|
| | | self.LineID,
|
| | | self.Percent
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMGetMultiFBPrize=tagCMGetMultiFBPrize()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMGetMultiFBPrize.Cmd,m_NAtagCMGetMultiFBPrize.SubCmd))] = m_NAtagCMGetMultiFBPrize
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B4 0F åæ¶ç§æä¸å±æ¨æ¡©æª #tagCMRecyclePriWoodPile
|
| | |
|
| | | class tagCMRecyclePriWoodPile(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("ObjID", c_int), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB4
|
| | | self.SubCmd = 0x0F
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xB4
|
| | | self.SubCmd = 0x0F
|
| | | self.ObjID = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMRecyclePriWoodPile)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B4 0F åæ¶ç§æä¸å±æ¨æ¡©æª //tagCMRecyclePriWoodPile:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | ObjID:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.ObjID
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMRecyclePriWoodPile=tagCMRecyclePriWoodPile()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMRecyclePriWoodPile.Cmd,m_NAtagCMRecyclePriWoodPile.SubCmd))] = m_NAtagCMRecyclePriWoodPile
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B4 0E ç©å®¶æè¡ #tagCMRoleLostHP
|
| | |
|
| | | class tagCMRoleLostHP(Structure):
|
| | |
| | |
|
| | | m_NAtagCMRoleLostHP=tagCMRoleLostHP()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMRoleLostHP.Cmd,m_NAtagCMRoleLostHP.SubCmd))] = m_NAtagCMRoleLostHP
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B4 0C å¬å¤ç§æä¸å±æ¨æ¡©æª #tagCMSummonPriWoodPile
|
| | |
|
| | | class tagCMSummonPriWoodPile(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("NPCID", c_int), |
| | | ("Count", c_ubyte), #é»è®¤1ä¸ªï¼æå¤5个
|
| | | ("HP", c_int), #é»è®¤0åæå¤§å¼ï¼å
¶ä¸ä¸ä¸ªè¡éæ°å¼å¤§äº0åç¨æå®è¡é
|
| | | ("HPEx", c_int), #é»è®¤0åæå¤§å¼ï¼å
¶ä¸ä¸ä¸ªè¡éæ°å¼å¤§äº0åç¨æå®è¡é
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB4
|
| | | self.SubCmd = 0x0C
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xB4
|
| | | self.SubCmd = 0x0C
|
| | | self.NPCID = 0
|
| | | self.Count = 0
|
| | | self.HP = 0
|
| | | self.HPEx = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMSummonPriWoodPile)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B4 0C å¬å¤ç§æä¸å±æ¨æ¡©æª //tagCMSummonPriWoodPile:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | NPCID:%d,
|
| | | Count:%d,
|
| | | HP:%d,
|
| | | HPEx:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.NPCID,
|
| | | self.Count,
|
| | | self.HP,
|
| | | self.HPEx
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMSummonPriWoodPile=tagCMSummonPriWoodPile()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMSummonPriWoodPile.Cmd,m_NAtagCMSummonPriWoodPile.SubCmd))] = m_NAtagCMSummonPriWoodPile
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 49 èµæºæ¾åæ¬¡æ° #tagMCRecoverNum
|
| | |
|
| | | class tagMCRecoverNumInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Index", c_ubyte), # æ¾å项索å¼
|
| | | ("RecoverCnt", c_ubyte), # 坿¾å次æ°
|
| | | ("ExtraCnt", c_ubyte), # VIPé¢å¤æ¬¡æ°
|
| | | ("ExtraData", c_ubyte), # é¢å¤åæ°1
|
| | | ("ExtraData2", c_ubyte), # é¢å¤åæ°2
|
| | | ("HaveRecover", c_ubyte), # å·²æ¾å 1-å
¨é¨å·²æ¾å 2-éVIPå·²æ¾å
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Index = 0
|
| | | self.RecoverCnt = 0
|
| | | self.ExtraCnt = 0
|
| | | self.ExtraData = 0
|
| | | self.ExtraData2 = 0
|
| | | self.HaveRecover = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCRecoverNumInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A3 49 èµæºæ¾åæ¬¡æ° //tagMCRecoverNum:
|
| | | Index:%d,
|
| | | RecoverCnt:%d,
|
| | | ExtraCnt:%d,
|
| | | ExtraData:%d,
|
| | | ExtraData2:%d,
|
| | | HaveRecover:%d
|
| | | '''\
|
| | | %(
|
| | | self.Index,
|
| | | self.RecoverCnt,
|
| | | self.ExtraCnt,
|
| | | self.ExtraData,
|
| | | self.ExtraData2,
|
| | | self.HaveRecover
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCRecoverNum(Structure):
|
| | | Head = tagHead()
|
| | | Num = 0 #(BYTE Num)// æ¾åä¿¡æ¯æ°
|
| | | NumInfo = list() #(vector<tagMCRecoverNumInfo> NumInfo)// æ¾åä¿¡æ¯å表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0x49
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Num,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Num):
|
| | | temNumInfo = tagMCRecoverNumInfo()
|
| | | _pos = temNumInfo.ReadData(_lpData, _pos)
|
| | | self.NumInfo.append(temNumInfo)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0x49
|
| | | self.Num = 0
|
| | | self.NumInfo = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.Num):
|
| | | length += self.NumInfo[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.Num)
|
| | | for i in range(self.Num):
|
| | | data = CommFunc.WriteString(data, self.NumInfo[i].GetLength(), self.NumInfo[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Num:%d,
|
| | | NumInfo:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Num,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCRecoverNum=tagMCRecoverNum()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCRecoverNum.Head.Cmd,m_NAtagMCRecoverNum.Head.SubCmd))] = m_NAtagMCRecoverNum
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 1F ç©å®¶ç¬¦å°ä¿¡æ¯ #tagMCRuneInfo
|
| | |
|
| | | class tagMCRuneInfo(Structure):
|
| | |
| | |
|
| | | m_NAtagMCEmojiPackInfo=tagMCEmojiPackInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCEmojiPackInfo.Head.Cmd,m_NAtagMCEmojiPackInfo.Head.SubCmd))] = m_NAtagMCEmojiPackInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A7 03 éç¥è¿å
¥å¯æ¬æ¶é´ #tagMCFBEnterTickList
|
| | |
|
| | | class tagMCFBEnterTick(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("MapID", c_int), # 坿¬å°å¾id
|
| | | ("LastEnterTick", c_int), # 䏿¬¡è¿å
¥å¯æ¬æ¶é´
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.MapID = 0
|
| | | self.LastEnterTick = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCFBEnterTick)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A7 03 éç¥è¿å
¥å¯æ¬æ¶é´ //tagMCFBEnterTickList:
|
| | | MapID:%d,
|
| | | LastEnterTick:%d
|
| | | '''\
|
| | | %(
|
| | | self.MapID,
|
| | | self.LastEnterTick
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCFBEnterTickList(Structure):
|
| | | Head = tagHead()
|
| | | Cnt = 0 #(BYTE Cnt)// ä¿¡æ¯ä¸ªæ°
|
| | | EnterTickList = list() #(vector<tagMCFBEnterTick> EnterTickList)// ä¿¡æ¯å表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA7
|
| | | self.Head.SubCmd = 0x03
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Cnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Cnt):
|
| | | temEnterTickList = tagMCFBEnterTick()
|
| | | _pos = temEnterTickList.ReadData(_lpData, _pos)
|
| | | self.EnterTickList.append(temEnterTickList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA7
|
| | | self.Head.SubCmd = 0x03
|
| | | self.Cnt = 0
|
| | | self.EnterTickList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.Cnt):
|
| | | length += self.EnterTickList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.Cnt)
|
| | | for i in range(self.Cnt):
|
| | | data = CommFunc.WriteString(data, self.EnterTickList[i].GetLength(), self.EnterTickList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Cnt:%d,
|
| | | EnterTickList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Cnt,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCFBEnterTickList=tagMCFBEnterTickList()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFBEnterTickList.Head.Cmd,m_NAtagMCFBEnterTickList.Head.SubCmd))] = m_NAtagMCFBEnterTickList
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 09 坿¬æ¬¡æ°æ¢å¤å©ä½æ¶é´ #tagMCFBCntRegainRemainTime
|
| | |
|
| | | class tagMCFBCntRegain(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("DataMapID", c_int), # å°å¾ID
|
| | | ("RemainTime", c_int), # å©ä½æ¶é´ç§
|
| | | ("RegainCnt", c_ubyte), # 仿¥å·²æ¢å¤æ¬¡æ°
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.DataMapID = 0
|
| | | self.RemainTime = 0
|
| | | self.RegainCnt = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCFBCntRegain)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B2 09 坿¬æ¬¡æ°æ¢å¤å©ä½æ¶é´ //tagMCFBCntRegainRemainTime:
|
| | | DataMapID:%d,
|
| | | RemainTime:%d,
|
| | | RegainCnt:%d
|
| | | '''\
|
| | | %(
|
| | | self.DataMapID,
|
| | | self.RemainTime,
|
| | | self.RegainCnt
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCFBCntRegainRemainTime(Structure):
|
| | | Head = tagHead()
|
| | | Cnt = 0 #(BYTE Cnt)// ä¿¡æ¯æ°
|
| | | InfoList = list() #(vector<tagMCFBCntRegain> InfoList)// ä¿¡æ¯å表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xB2
|
| | | self.Head.SubCmd = 0x09
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Cnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Cnt):
|
| | | temInfoList = tagMCFBCntRegain()
|
| | | _pos = temInfoList.ReadData(_lpData, _pos)
|
| | | self.InfoList.append(temInfoList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB2
|
| | | self.Head.SubCmd = 0x09
|
| | | self.Cnt = 0
|
| | | self.InfoList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.Cnt):
|
| | | length += self.InfoList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.Cnt)
|
| | | for i in range(self.Cnt):
|
| | | data = CommFunc.WriteString(data, self.InfoList[i].GetLength(), self.InfoList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Cnt:%d,
|
| | | InfoList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Cnt,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCFBCntRegainRemainTime=tagMCFBCntRegainRemainTime()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFBCntRegainRemainTime.Head.Cmd,m_NAtagMCFBCntRegainRemainTime.Head.SubCmd))] = m_NAtagMCFBCntRegainRemainTime
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 01 éç¥å°éåååå»æç¶æ #tagMCFMTDoubleState
|
| | |
|
| | | class tagMCFMTDoubleState(Structure):
|
| | |
| | |
|
| | | m_NAtagMCFMTDoubleState=tagMCFMTDoubleState()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFMTDoubleState.Cmd,m_NAtagMCFMTDoubleState.SubCmd))] = m_NAtagMCFMTDoubleState
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 03 å
Œ
±å¯æ¬æ«è¡ä¿¡æ¯ #tagMCPubFBSweepData
|
| | |
|
| | | class tagMCPubFBSweep(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("PubNum", c_ubyte), # å
Œ
±ç»ç¼å·
|
| | | ("FBMapID", c_int), # å½åæ«è¡ç坿¬å°å¾ID
|
| | | ("LineID", c_ushort), # lineID
|
| | | ("SweepTime", c_int), # å¼å§æ«è¡çæ¶é´
|
| | | ("SweepCnt", c_ubyte), # æ«è¡æ¬¡æ°
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB2
|
| | | self.SubCmd = 0x03
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xB2
|
| | | self.SubCmd = 0x03
|
| | | self.PubNum = 0
|
| | | self.FBMapID = 0
|
| | | self.LineID = 0
|
| | | self.SweepTime = 0
|
| | | self.SweepCnt = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCPubFBSweep)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B2 03 å
Œ
±å¯æ¬æ«è¡ä¿¡æ¯ //tagMCPubFBSweepData:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | PubNum:%d,
|
| | | FBMapID:%d,
|
| | | LineID:%d,
|
| | | SweepTime:%d,
|
| | | SweepCnt:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.PubNum,
|
| | | self.FBMapID,
|
| | | self.LineID,
|
| | | self.SweepTime,
|
| | | self.SweepCnt
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCPubFBSweepData(Structure):
|
| | | Head = tagHead()
|
| | | Cnt = 0 #(BYTE Cnt)// ä¿¡æ¯æ°
|
| | | SweepDatList = list() #(vector<tagMCPubFBSweep> SweepDatList)// ä¿¡æ¯å表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xB2
|
| | | self.Head.SubCmd = 0x03
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Cnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Cnt):
|
| | | temSweepDatList = tagMCPubFBSweep()
|
| | | _pos = temSweepDatList.ReadData(_lpData, _pos)
|
| | | self.SweepDatList.append(temSweepDatList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xB2
|
| | | self.Head.SubCmd = 0x03
|
| | | self.Cnt = 0
|
| | | self.SweepDatList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.Cnt):
|
| | | length += self.SweepDatList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.Cnt)
|
| | | for i in range(self.Cnt):
|
| | | data = CommFunc.WriteString(data, self.SweepDatList[i].GetLength(), self.SweepDatList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Cnt:%d,
|
| | | SweepDatList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Cnt,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCPubFBSweepData=tagMCPubFBSweepData()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCPubFBSweepData.Head.Cmd,m_NAtagMCPubFBSweepData.Head.SubCmd))] = m_NAtagMCPubFBSweepData
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # B2 16 å¼å§èªå®ä¹åºæ¯ç»æ #tagMCStartCustomSceneResult
|
| | |
|
| | | class tagMCStartCustomSceneResult(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("MapID", c_int), |
| | | ("FuncLineID", c_ushort), |
| | | ("Result", c_ubyte), #æ¯å¦å
许
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xB2
|
| | | self.SubCmd = 0x16
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xB2
|
| | | self.SubCmd = 0x16
|
| | | self.MapID = 0
|
| | | self.FuncLineID = 0
|
| | | self.Result = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCStartCustomSceneResult)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// B2 16 å¼å§èªå®ä¹åºæ¯ç»æ //tagMCStartCustomSceneResult:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | MapID:%d,
|
| | | FuncLineID:%d,
|
| | | Result:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.MapID,
|
| | | self.FuncLineID,
|
| | | self.Result
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCStartCustomSceneResult=tagMCStartCustomSceneResult()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCStartCustomSceneResult.Cmd,m_NAtagMCStartCustomSceneResult.SubCmd))] = m_NAtagMCStartCustomSceneResult
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | | SendEventPack("PlayerSubmit_%s" % eventName, dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | ## èµæºæ¾åè®°å½
|
| | | # @param curPlayer
|
| | | # @return: None
|
| | | def DR_PlayerRecover(curPlayer, recoverWay, recoverCntDict, totalExp, totalMoney, totalSP, totalItemDict):
|
| | | |
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(), |
| | | 'AccID':curPlayer.GetAccID(), 'recoverWay':recoverWay, 'recoverCntDict':recoverCntDict,
|
| | | 'totalExp':totalExp, 'totalMoney':totalMoney, 'totalSP':totalSP, 'totalItemDict':totalItemDict}
|
| | |
|
| | | #åéå°å
|
| | | SendEventPack("PlayerRecover", dataDict, curPlayer)
|
| | | return
|
| | |
|
| | | def DR_GlobalDropCD(curPlayer, npcID, itemID):
|
| | | # å
¨å±æè½CDæè½è®°å½
|
| | | dataDict = {'PlayerID':curPlayer.GetPlayerID(), 'PlayerName':curPlayer.GetPlayerName(),
|
| | |
| | | if FBCommon.GetFBPDictValue(curPlayer, ChConfig.Def_PDict_LastEnterFBTick % mapID):
|
| | | FBCommon.SetFBPDictValue(curPlayer, ChConfig.Def_PDict_LastEnterFBTick % mapID, 0)
|
| | |
|
| | | tick = GameWorld.GetGameWorld().GetTick()
|
| | | if mapID in FBCommon.GetClientCustomScene():
|
| | | PlayerFB.DoEnterCustomScene(curPlayer, mapID, lineID, tick)
|
| | | elif mapID in ChConfig.Def_CrossMapIDList:
|
| | | if mapID in ChConfig.Def_CrossMapIDList:
|
| | | PlayerControl.PlayerEnterCrossServer(curPlayer, mapID, lineID)
|
| | | else:
|
| | | PlayerControl.PlayerEnterFB(curPlayer, mapID, lineID, posX, posY)
|
| | |
| | | CrossRealmPlayer.PlayerExitCrossServer(curPlayer)
|
| | | return
|
| | |
|
| | | if PlayerControl.GetCustomMapID(curPlayer):
|
| | | PlayerFB.DoExitCustomScene(curPlayer)
|
| | | return
|
| | | |
| | | isAll = paramList[0] if paramList else 0
|
| | | if isAll:
|
| | | copyMapPlayerManager = GameWorld.GetMapCopyPlayerManager()
|
| | |
| | | # @return None
|
| | | # @remarks 彿°è¯¦ç»è¯´æ.
|
| | | def DoFB_Player_KillNPC(curPlayer , curNPC , tick):
|
| | | mapID = PlayerControl.GetCustomMapID(curPlayer)
|
| | | lineID = PlayerControl.GetCustomLineID(curPlayer)
|
| | | if mapID:
|
| | | DoCustomScene_Player_KillNPC(curPlayer, curNPC, mapID, lineID)
|
| | | return
|
| | | |
| | | do_FBLogic_ID = __GetFBLogic_MapID(GameWorld.GetMap().GetMapID())
|
| | |
|
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "DoFB_Player_KillNPC"))
|
| | |
| | | # @return None
|
| | | # @remarks 彿°è¯¦ç»è¯´æ.
|
| | | def DoFBOnKill_Player(curPlayer, defender, tick):
|
| | | mapID = PlayerControl.GetCustomMapID(curPlayer)
|
| | | if not mapID:
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(mapID)
|
| | |
|
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "DoFBOnKill_Player"))
|
| | |
| | |
|
| | | #GameWorld.Log("坿¬é»è¾ä¸å¯ä½¿ç¨ GameLogic_%d"%(mapID))
|
| | | callFunc(tick)
|
| | | return
|
| | |
|
| | | def OnCustomSceneProcess(curPlayer, tick):
|
| | | customMapID = PlayerControl.GetCustomMapID(curPlayer)
|
| | | if not customMapID:
|
| | | return
|
| | | customLineID = PlayerControl.GetCustomLineID(curPlayer)
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(customMapID)
|
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnCustomSceneProcess"))
|
| | | if callFunc:
|
| | | callFunc(curPlayer, customMapID, customLineID, tick)
|
| | | |
| | | return
|
| | |
|
| | | ## å¼å§éé
|
| | |
| | | return False
|
| | |
|
| | | return callFunc(curPlayer, addExp, expViewType)
|
| | |
|
| | | ## è·å¾å¤å坿¬å¥å±
|
| | | # @param curPlayer å½åç©å®¶
|
| | | # @param mapID |
| | | # @param lineID |
| | | # @param prizeExLV é¢å¤å¥å±ç¾åæ¯ç级
|
| | | # @return
|
| | | def OnGetMultiFBPrize(curPlayer, mapID, lineID, prizeExLV):
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(mapID)
|
| | | |
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnGetMultiFBPrize"))
|
| | | |
| | | if callFunc == None:
|
| | | return
|
| | | |
| | | return callFunc(curPlayer, mapID, lineID, prizeExLV)
|
| | |
|
| | | ## 坿¬æ«è¡è¯¢é®
|
| | | def OnPlayerFBSweepAsk(curPlayer, mapID, lineID, cnt, isFinish, dataEx):
|
| | |
| | |
|
| | | if callFunc:
|
| | | callFunc(curPlayer, curNPC, tick)
|
| | | return
|
| | |
|
| | | ## 客æ·ç«¯åéç»æå¯æ¬
|
| | | def OnClientEndFB(curPlayer, mapID, lineID, dataList):
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(mapID)
|
| | | |
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnClientEndFB"))
|
| | | |
| | | if callFunc == None:
|
| | | return False
|
| | | |
| | | return callFunc(curPlayer, mapID, lineID, dataList)
|
| | |
|
| | | ## 客æ·ç«¯åéå¼å§å¯æ¬
|
| | | def OnClientStartFB(curPlayer, tick):
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(GameWorld.GetMap().GetMapID())
|
| | | |
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnClientStartFB"))
|
| | | |
| | | if callFunc == None:
|
| | | return False
|
| | | |
| | | return callFunc(curPlayer, tick)
|
| | |
|
| | | ## 客æ·ç«¯è¿å
¥èªå®ä¹åºæ¯
|
| | | def OnEnterCustomScene(curPlayer, mapID, lineID):
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(mapID)
|
| | | |
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnEnterCustomScene"))
|
| | | |
| | | if callFunc == None:
|
| | | return
|
| | | |
| | | return callFunc(curPlayer, mapID, lineID)
|
| | |
|
| | | ## 夿å¯å¦å¬å¤æ¨æ¡©æª
|
| | | def OnCanSummonPriWoodPile(curPlayer, mapID, lineID, npcID, count):
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(mapID)
|
| | | |
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnCanSummonPriWoodPile"))
|
| | | |
| | | if callFunc == None:
|
| | | return True
|
| | | |
| | | return callFunc(curPlayer, mapID, lineID, npcID, count)
|
| | |
|
| | | ## èªå®ä¹åºæ¯å¯æ¬å»æNPC
|
| | | def DoCustomScene_Player_KillNPC(curPlayer, curNPC, mapID, lineID):
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(mapID)
|
| | | |
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "DoCustomScene_Player_KillNPC"))
|
| | | |
| | | if callFunc:
|
| | | callFunc(curPlayer, curNPC, mapID, lineID)
|
| | | |
| | | return
|
| | |
|
| | | ## èªå®ä¹åºæ¯ééOKï¼éèªå¸¦æ¯å¦å
许ééç夿
|
| | | def OnCustomSceneCollectOK(curPlayer, mapID, lineID, npcID):
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(mapID)
|
| | | |
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnCustomSceneCollectOK"))
|
| | | |
| | | if callFunc:
|
| | | return callFunc(curPlayer, mapID, lineID, npcID)
|
| | | |
| | | return
|
| | |
|
| | | ## è¿å
¥è·¨æå¯æ¬æ³¨åæ°æ®åé»è¾
|
| | |
| | | PlayerControl.NotifyCode(curPlayer, notifyMark, [mapID])
|
| | | return ShareDefine.EntFBAskRet_NoEnterCnt
|
| | |
|
| | | #è¿å
¥CD夿
|
| | | if CheckIsEnterCD(curPlayer, mapID):
|
| | | if isNotify:
|
| | | PlayerControl.NotifyCode(curPlayer, "SingleEnterCD", [mapID])
|
| | | return ShareDefine.EntFBAskRet_EnterCD
|
| | | # åè½çº¿è·¯éç¨æ£æ¥
|
| | | if fbLineIpyData:
|
| | | #ççº§å¤æ
|
| | |
| | | GameWorld.GetGameFB().SetPlayerGameFBDict(curPlayer.GetID(), ChConfig.FBPlayerDict_IsDelTicket, delSign)
|
| | | return
|
| | |
|
| | | ## èªå®ä¹åºæ¯é¶æ®µ
|
| | | def GetCustomMapStep(curPlayer, mapID, lineID):
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_CustomMapStep % (mapID, lineID))
|
| | | def SetCustomMapStep(curPlayer, mapID, lineID, step):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_CustomMapStep % (mapID, lineID), step)
|
| | | if step == ChConfig.CustomMapStep_Over:
|
| | | PlayerControl.SetCustomMap(curPlayer, 0, 0)
|
| | | return
|
| | |
|
| | | def GetCurSingleFBPlayer():
|
| | | ''' è·åå½ååäººå¯æ¬ç©å®¶ '''
|
| | | curPlayer = None
|
| | |
| | | FBLogic.DoFBHelp(curPlayer, tick)
|
| | | if updGrade != lowest:
|
| | | curPlayer.Sync_TimeTick(timeType, 0, diffSecond * 1000, True)
|
| | | return updGrade
|
| | |
|
| | | def UpdateCustomFBGrade(curPlayer, tick, gradeTimeList, timeType=IPY_GameWorld.tttFlagTake):
|
| | | '''æ´æ°å½å坿¬æçº§ãè¯çº§
|
| | | @param gradeTimeList: è¯çº§å段æ¶é´å表ï¼åä½ç§ [æé«è¯çº§å¯ç¨æ¶é´, ä¸çº§å¯ç¨æ¶é´, ..., æä½çº§å¯ç¨æ¶é´]
|
| | | @param curPlayer: 触åçç©å®¶ï¼ä¸è¬æ¯DoEnteræ¶è°ç¨ï¼ä¼åæ¥æ´æ°ä¸æ¬¡å¯æ¬è¯çº§å¹¶å°ä¿¡æ¯éç¥è¯¥ç©å®¶
|
| | | @note: æçº§ï¼1-1æï¼2-2æ ... [60, 20, 10]
|
| | | è¯çº§ï¼1-Dï¼2-Cï¼3-Bï¼4-Aï¼5-S; [60, 30, 30, 20, 10]
|
| | | '''
|
| | | lowest = 1
|
| | | curGrade = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomSceneGrade)
|
| | | #æåä¸ä¸ªè¯çº§äºï¼ä¸åå¤ç
|
| | | if curGrade == lowest:
|
| | | return curGrade
|
| | | |
| | | fbStepTick = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomSceneStepTick)
|
| | | useSecond = int((tick - fbStepTick) / 1000.0) # ææé¶æ®µå·²èæ»ç§æ°
|
| | | diffSecond = 0
|
| | | updGrade = len(gradeTimeList)
|
| | | gSecondTotal = 0
|
| | | for gSecond in gradeTimeList:
|
| | | gSecondTotal += gSecond
|
| | | diffSecond = gSecondTotal - useSecond
|
| | | # è¿å¨å½åè¯çº§æ®µ
|
| | | if diffSecond > 0:
|
| | | break
|
| | | updGrade -= 1 # ç¨æ¶è¶
è¿å½åè¯çº§æ®µï¼é级
|
| | | updGrade = max(lowest, updGrade) # ä¿åºæä½çº§
|
| | | if curGrade == updGrade:
|
| | | return curGrade
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomSceneGrade, updGrade)
|
| | | |
| | | GameWorld.DebugLog("UpdateCustomFBGrade useSecond=%s,gradeTimeList=%s,curGrade=%s,updGrade=%s,diffSecond=%s" |
| | | % (useSecond, gradeTimeList, curGrade, updGrade, diffSecond))
|
| | | |
| | | Notify_FBHelp(curPlayer, {Help_grade:updGrade})
|
| | | if updGrade != lowest:
|
| | | curPlayer.Sync_TimeTick(timeType, 0, diffSecond * 1000, True)
|
| | | return updGrade
|
| | |
|
| | | def NotifyFBOver(curPlayer, dataMapID, lineID, isPass, overDict={}):
|
| | |
| | | if not fbIpyData:
|
| | | return 0
|
| | | maxTimes = fbIpyData.GetDayTimes()
|
| | | MWPrivilegeID = fbIpyData.GetExtraTimesMWPriID()
|
| | |
|
| | | mwAddCnt = 0#wmpIpyData.GetEffectValue() if wmpIpyData else 0
|
| | | extraTimesVIPPriID = fbIpyData.GetExtraTimesVIPPriID()
|
| | | extraCnt = 0
|
| | | buyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_BuyFbCntDay % mapID)
|
| | | recoverFbCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_RecoverFbCnt % mapID)
|
| | | itemAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ItemAddFbCnt % mapID)
|
| | | regainFbCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_RegainFbCnt % mapID)
|
| | | regainFbCnt = 0
|
| | | investFBCnt = PlayerGoldInvest.GetAddFBCnt(curPlayer, mapID)
|
| | | maxCnt = maxTimes + regainFbCnt + extraCnt + buyCnt + recoverFbCnt + mwAddCnt + itemAddCnt + investFBCnt
|
| | | maxCnt = maxTimes + regainFbCnt + extraCnt + buyCnt + mwAddCnt + itemAddCnt + investFBCnt
|
| | | return maxCnt
|
| | |
|
| | | def GetFBDetailCntInfo(curPlayer, mapID):
|
| | | #è¿åFBå©ä½æ£å¸¸æ¬¡æ°ãæ¶é´æ¢å¤æ¬¡æ°ãvipé¢å¤æ¬¡æ°ã已买次æ°ãéå
·å¢å 次æ°ãæªä¹°æ¬¡æ°
|
| | | fbIpyData = GetFBIpyData(mapID)
|
| | | enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % mapID)
|
| | | maxTimes = fbIpyData.GetDayTimes()
|
| | | maxRegainFbCnt = 0
|
| | | recoverIntervalDict = IpyGameDataPY.GetFuncEvalCfg('FBCntRegainInterval', 1)
|
| | | if str(mapID) in recoverIntervalDict:
|
| | | maxRegainFbCnt = recoverIntervalDict[str(mapID)][0]
|
| | | |
| | | MWPrivilegeID = fbIpyData.GetExtraTimesMWPriID()
|
| | | |
| | | mwAddCnt = 0#wmpIpyData.GetEffectValue() if wmpIpyData else 0
|
| | | maxTimes += mwAddCnt #æ³å®å¢å çæ¬¡æ°å å°åºç¡æ¬¡æ°é
|
| | | extraTimesVIPPriID = fbIpyData.GetExtraTimesVIPPriID()
|
| | | extraCnt = 0
|
| | | buyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_BuyFbCntDay % mapID)
|
| | | recoverFbCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_RecoverFbCnt % mapID)
|
| | | itemAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ItemAddFbCnt % mapID)
|
| | | #å
ç¨æ¾åæ¥ç次æ°ï¼åç¨Vipé¢å¤æ¬¡æ°ï¼åç¨æ¯æ¥å·æ°æ¬¡æ°ãæ¶é´æ¢å¤æ¬¡æ°ãåVipä¹°åæ¥çæ¬¡æ°ï¼æåç¨å·è½´å çæ¬¡æ°
|
| | | cntList = [recoverFbCnt, extraCnt, maxTimes, maxRegainFbCnt, buyCnt, itemAddCnt]
|
| | | rCntList = copy.deepcopy(cntList)
|
| | | sumCnt = 0
|
| | | for i, cnt in enumerate(cntList):
|
| | | sumCnt += cnt
|
| | | rCntList[i] = max(0, sumCnt - enterCnt)
|
| | | if enterCnt <= sumCnt:
|
| | | break
|
| | | rRecoverFbCnt, rExtraCnt, rCommonCnt, rRegainFbCnt, rBuyCnt, rItemAddCnt = rCntList
|
| | |
|
| | | #æªä¹°æ¬¡æ°
|
| | | buyTimesVIPPriID = fbIpyData.GetBuyTimesVIPPriID()
|
| | | canBuyCnt = 0
|
| | | noBuyCnt = max(0, canBuyCnt - buyCnt)
|
| | | return [[rCommonCnt, rRegainFbCnt, rExtraCnt, rBuyCnt, rItemAddCnt, noBuyCnt], [maxTimes, maxRegainFbCnt, extraCnt, canBuyCnt, 10000, canBuyCnt]]
|
| | |
|
| | | ## ç©å®¶è¿å
¥å¯æ¬æ¬¡æ°
|
| | | # @param curPlayer ç©å®¶å®ä¾
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_ItemAddFbCnt % mapID, itemAddCnt + addCnt)
|
| | | Sync_FBPlayerFBInfoData(curPlayer, mapID)
|
| | | PlayerControl.NotifyCode(curPlayer, 'AddActivityCount_1', [itemID, mapID, addCnt])
|
| | | OnFBCountChangeEffectRecoverCount(curPlayer, mapID)
|
| | | return
|
| | |
|
| | | ## å¢å ç©å®¶è¿å
¥å¯æ¬æ¬¡æ°
|
| | |
| | | GameWorld.DebugLog(" AddEnterFBCount fbID=%s, addCount=%s, lineBit=%s, enterCnt=%s,updValue=%s,enterCntTotal=%s"
|
| | | % (fbID, addCount, lineBit, enterCnt, updValue, enterCntTotal), curPlayer.GetPlayerID())
|
| | | Sync_FBPlayerFBInfoData(curPlayer, fbID)
|
| | | OnFBCountChangeEffectRecoverCount(curPlayer, fbID)
|
| | | return True
|
| | |
|
| | | def OnFBCountChangeEffectRecoverCount(curPlayer, mapID):
|
| | | ## 坿¬ç¸å
³æ¬¡æ°åæ´ï¼å
å«å¢å ãæ£é¤çå½±å坿¬ææ¶é´æ¢å¤æ¬¡æ°ç¸å
³é»è¾å¤ç
|
| | | |
| | | recoverIntervalDict = IpyGameDataPY.GetFuncEvalCfg('FBCntRegainInterval', 1)
|
| | | if str(mapID) not in recoverIntervalDict:
|
| | | return
|
| | | maxCanRecoverCnt, recoverInterval = recoverIntervalDict[str(mapID)]
|
| | | curRegainFbCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_RegainFbCnt % mapID) # å½åå·²æ¢å¤æ¬¡æ°
|
| | | if curRegainFbCnt >= maxCanRecoverCnt:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FbCntRegainStartTime % mapID, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FbCntRegainTotalTime % mapID, 0)
|
| | | GameWorld.DebugLog("坿¬æ¶é´æ¢å¤æ¬¡æ°å·²è¾¾å½æ¥ä¸é!")
|
| | | else:
|
| | | curTime = int(time.time())
|
| | | fbIpyData = GetFBIpyData(mapID)
|
| | | maxFreeTimes = fbIpyData.GetDayTimes() # 常è§å°é¡¶æ¬¡æ°
|
| | | enterCnt = GetEnterFBCount(curPlayer, mapID) # å·²ç»è¿å
¥æ¬¡æ°
|
| | | maxCnt = GetEnterFBMaxCnt(curPlayer, mapID) # å½åå¯ç¨æå¤§æ¬¡æ°
|
| | | remainCanEnterCnt = maxCnt - enterCnt # å©ä½å¯è¿å
¥æ¬¡æ°
|
| | | regainStartTime = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbCntRegainStartTime % mapID)
|
| | | passTime = curTime - regainStartTime
|
| | | # å°è¾¾å¸¸è§æ¬¡æ°ä¸éï¼ææ¶æ¢å¤æ¶é´
|
| | | if remainCanEnterCnt >= maxFreeTimes:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FbCntRegainStartTime % mapID, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FbCntRegainTotalTime % mapID, 0)
|
| | | GameWorld.DebugLog("坿¬æ¶é´æ¢å¤æ¬¡æ°å·²è¾¾å¸¸è§æ¬¡æ°!")
|
| | | elif passTime < recoverInterval:
|
| | | pass
|
| | | #GameWorld.DebugLog("坿¬æ¶é´æ¢å¤æ¬¡æ°è¿æªå°è¾¾æ¢å¤CD!")
|
| | | else:
|
| | | if not regainStartTime:
|
| | | updRegainTotalTime = recoverInterval
|
| | | else:
|
| | | updRegainTotalTime = recoverInterval - passTime % recoverInterval
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FbCntRegainStartTime % mapID, curTime)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FbCntRegainTotalTime % mapID, updRegainTotalTime)
|
| | | GameWorld.DebugLog("坿¬è¿å¯ææ¶é´æ¢å¤æ¬¡æ°!curTime=%s,regainStartTime=%s,passTime=%s,updRegainTotalTime=%s" |
| | | % (curTime, regainStartTime, passTime, updRegainTotalTime))
|
| | | NotifyFBCntRegainInfo(curPlayer, [mapID])
|
| | | return
|
| | |
|
| | | def RegainFBCntProcess(curPlayer):
|
| | | ## ææ¶é´æ¢å¤å¯æ¬æ¬¡æ°
|
| | | |
| | | curTime = int(time.time())
|
| | | recoverIntervalDict = IpyGameDataPY.GetFuncEvalCfg('FBCntRegainInterval', 1)
|
| | | for mapIDStr, recoverInfo in recoverIntervalDict.items():
|
| | | mapID = int(mapIDStr)
|
| | | maxCanRecoverCnt, recoverInterval = recoverInfo
|
| | | curRegainFbCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_RegainFbCnt % mapID) # å½åå·²æ¢å¤æ¬¡æ°
|
| | | if maxCanRecoverCnt and curRegainFbCnt >= maxCanRecoverCnt:
|
| | | #GameWorld.DebugLog("å·²å°è¾¾å¯æ¬æ¢å¤æ¬¡æ°ä¸é!mapID=%s,curRegainFbCnt(%s) >= maxCanRecoverCnt(%s)" % (mapID, curRegainFbCnt, maxCanRecoverCnt))
|
| | | continue
|
| | | fbIpyData = GetFBIpyData(mapID)
|
| | | maxFreeTimes = fbIpyData.GetDayTimes() # 常è§å°é¡¶æ¬¡æ°
|
| | | enterCnt = GetEnterFBCount(curPlayer, mapID) # å·²ç»è¿å
¥æ¬¡æ°
|
| | | maxCnt = GetEnterFBMaxCnt(curPlayer, mapID) # å½åå¯ç¨æå¤§æ¬¡æ°
|
| | | remainCanEnterCnt = maxCnt - enterCnt # å©ä½å¯è¿å
¥æ¬¡æ°
|
| | | if remainCanEnterCnt >= maxFreeTimes:
|
| | | #GameWorld.DebugLog("å¯è¿å
¥æ¬¡æ°å·²ç»å°è¾¾å¸¸è§å°é¡¶æ¬¡æ°!mapID=%s,remainCanEnterCnt=%s" % (mapID, remainCanEnterCnt))
|
| | | continue
|
| | | regainStartTime = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbCntRegainStartTime % mapID)
|
| | | if not regainStartTime:
|
| | | #GameWorld.DebugLog("è¿æªè®¾ç½®å¯æ¬æ¢å¤æ¬¡æ°å计æ¶!mapID=%s" % mapID)
|
| | | continue
|
| | | needTime = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbCntRegainTotalTime % mapID)
|
| | | passTime = curTime - regainStartTime
|
| | | if passTime < needTime:
|
| | | continue
|
| | | remainTime = passTime - needTime # æ£é¤æ¢å¤å次åå©ä½çæ¶é´ï¼ç¦»çº¿ä¸çº¿åå¯è½ä¸æ¬¡æ§æ¢å¤å¤æ¬¡
|
| | | recoverCnt = 1 + remainTime / recoverInterval # åè®¡æ¶æ¶é´å¯æ¢å¤æ»æ¬¡æ°
|
| | | realRecoverCnt = min(maxFreeTimes - remainCanEnterCnt, recoverCnt) # å®é
æå¤§å¯æ¢å¤æ»æ¬¡æ°
|
| | | if maxCanRecoverCnt:
|
| | | realRecoverCnt = min(realRecoverCnt, maxCanRecoverCnt - curRegainFbCnt)
|
| | | if realRecoverCnt <= 0:
|
| | | continue
|
| | | |
| | | # æ´æ°æ¶é´å计æ¶å·²æ¢å¤æ¬¡æ°
|
| | | updRegainFbCnt = curRegainFbCnt + realRecoverCnt
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_RegainFbCnt % mapID, updRegainFbCnt)
|
| | | |
| | | OnFBCountChangeEffectRecoverCount(curPlayer, mapID)
|
| | | |
| | | return
|
| | |
|
| | | def NotifyFBCntRegainInfo(curPlayer, syncMapIDList=[]):
|
| | | ##éç¥å¯æ¬æ¬¡æ°æ¢å¤å©ä½æ¶é´
|
| | | recoverIntervalDict = IpyGameDataPY.GetFuncEvalCfg('FBCntRegainInterval', 1) # {mapID:[次æ°, æ¯æ¬¡é´é], ...}
|
| | | if not recoverIntervalDict:
|
| | | return
|
| | | if not syncMapIDList:
|
| | | syncMapIDList = [int(mapIDStr) for mapIDStr in recoverIntervalDict.keys()]
|
| | | |
| | | infoList = []
|
| | | curTime = int(time.time())
|
| | | for mapID in syncMapIDList:
|
| | | if str(mapID) not in recoverIntervalDict:
|
| | | continue
|
| | | mapInfo = ChPyNetSendPack.tagMCFBCntRegain()
|
| | | mapInfo.Clear()
|
| | | mapInfo.DataMapID = mapID
|
| | | lastRegainTime = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbCntRegainStartTime % mapID)
|
| | | needTime = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbCntRegainTotalTime % mapID)
|
| | | passTime = curTime - lastRegainTime
|
| | | mapInfo.RemainTime = max(0, needTime - passTime)
|
| | | mapInfo.RegainCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_RegainFbCnt % mapID)
|
| | | infoList.append(mapInfo)
|
| | | if not infoList:
|
| | | return
|
| | | regainData = ChPyNetSendPack.tagMCFBCntRegainRemainTime()
|
| | | regainData.Clear()
|
| | | regainData.InfoList = infoList
|
| | | regainData.Cnt = len(regainData.InfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, regainData)
|
| | | return
|
| | |
|
| | | def SetIsHelpFight(curPlayer):
|
| | | ##设置æ¯å¦å©æ 注æ!éè¦å¨å¢å 坿¬æ¬¡æ°ä¹å设置
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | mapID = GetRecordMapID(mapID)
|
| | | enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % mapID)
|
| | | maxCnt = GetEnterFBMaxCnt(curPlayer, mapID)
|
| | | if enterCnt >= maxCnt:
|
| | | GameWorld.GetGameFB().SetPlayerGameFBDict(curPlayer.GetID(), ChConfig.FBPlayerDict_IsHelpFight, 1)
|
| | | return True
|
| | | return False
|
| | |
|
| | | def GetIsHelpFight(curPlayer):
|
| | | ##è·åæ¯å¦å©æ
|
| | | return GameWorld.GetGameFB().GetPlayerGameFBDictByKey(curPlayer.GetID(), ChConfig.FBPlayerDict_IsHelpFight)
|
| | |
|
| | | def FBOnWeek(curPlayer, onWeekType):
|
| | |
|
| | |
| | | buyCnt = curPlayer.NomalDictGetProperty(buyCntKey)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, buyCntKey, 0)
|
| | |
|
| | | # æ¾å次æ°
|
| | | recoverCntKey = ChConfig.Def_Player_Dict_RecoverFbCnt % mapID
|
| | | recoverCnt = curPlayer.NomalDictGetProperty(recoverCntKey)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, recoverCntKey, 0)
|
| | | |
| | | # ç©åå¢å 次æ°
|
| | | itemAddCntKey = ChConfig.Def_Player_Dict_ItemAddFbCnt % mapID
|
| | | itemAddCnt = curPlayer.NomalDictGetProperty(itemAddCntKey)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, itemAddCntKey, 0)
|
| | |
|
| | | # æ¶é´æ¢å¤æ¬¡æ°
|
| | | regainFBCntKey = ChConfig.Def_Player_Dict_RegainFbCnt % mapID
|
| | | regainFBCnt = curPlayer.NomalDictGetProperty(regainFBCntKey)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, regainFBCntKey, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FbCntRegainStartTime % mapID, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FbCntRegainTotalTime % mapID, 0)
|
| | | |
| | | GameWorld.DebugLog(" éç½®:mapID=%s,dayTimes=%s,buyCnt=%s,recoverCnt=%s,itemAddCnt=%s,regainFBCnt=%s,maxCnt=%s,enterCnt=%s" |
| | | % (mapID, dayTimes, buyCnt, recoverCnt, itemAddCnt, regainFBCnt, maxCnt, enterCnt))
|
| | | GameWorld.DebugLog(" éç½®:mapID=%s,dayTimes=%s,buyCnt=%s,itemAddCnt=%s,maxCnt=%s,enterCnt=%s" |
| | | % (mapID, dayTimes, buyCnt, itemAddCnt, maxCnt, enterCnt))
|
| | |
|
| | | mapIDInfo.append(mapID)
|
| | |
|
| | | if mapIDInfo:
|
| | | Sync_FBPlayerFBInfoData(curPlayer, mapIDInfo)
|
| | | Sync_FBPlayerFBBuyCount(curPlayer, mapIDInfo)
|
| | | NotifyFBCntRegainInfo(curPlayer, mapIDInfo)
|
| | |
|
| | | return
|
| | |
|
| | |
| | | def FBOnLogin(curPlayer):
|
| | | FBLogic.OnFBPlayerOnLogin(curPlayer)
|
| | | Sync_FBPlayerFBInfoData(curPlayer)
|
| | | SyncFBEnterTick(curPlayer)
|
| | | Sync_FBPlayerFBBuyCount(curPlayer)
|
| | | #PlayerFB.Sync_PubFBSweepData(curPlayer)
|
| | | NotifyFBCntRegainInfo(curPlayer)
|
| | | #夿坿¬é离线è¶
è¿ä¸å®æ¶é´åéåºå¯æ¬
|
| | | CheckFBPlayerOffine(curPlayer)
|
| | | return
|
| | |
|
| | | def CheckFBPlayerOffine(curPlayer):
|
| | | mapid = curPlayer.GetMapID()
|
| | | |
| | | ipyData = GetFBIpyData(mapid)
|
| | | if not ipyData:
|
| | | return
|
| | | OfflineTime = ipyData.GetOfflineTime()
|
| | | if not OfflineTime:
|
| | | return
|
| | | leaveServerSecond = PlayerControl.GetPlayerLeaveServerSecond(curPlayer) #离线æ¶é´ç§
|
| | | if leaveServerSecond >= OfflineTime:
|
| | | GameWorld.DebugLog('夿坿¬é离线è¶
è¿ä¸å®æ¶é´åéåºå¯æ¬ leaveServerSecond=%s'%leaveServerSecond)
|
| | | PlayerControl.PlayerLeaveFB(curPlayer)
|
| | | return
|
| | |
|
| | | #//A5 75 è´ä¹°å¯æ¬è¿å
¥æ¬¡æ°#tagCMBuyEnterCount
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_BuyFbCntDay % mapID, hasBuyCnt + 1)
|
| | | Sync_FBPlayerFBBuyCount(curPlayer, [mapID])
|
| | | PlayerControl.NotifyCode(curPlayer, 'FBEnterTimeBuy', [mapID])
|
| | | OnFBCountChangeEffectRecoverCount(curPlayer, mapID)
|
| | | if mapID == ChConfig.Def_FBMapID_Love:
|
| | | coupleID = PlayerControl.GetCoupleID(curPlayer)
|
| | | if coupleID:
|
| | | addItemList = IpyGameDataPY.GetFuncEvalCfg("LoveFB", 3)
|
| | | paramList = [curPlayer.GetPlayerName()]
|
| | | PlayerControl.SendMailByKey("BuyLoveFBCntCoupleMail", [coupleID], addItemList, paramList)
|
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ## 坿¬å¼å¯æç¤º(å åé)
|
| | | # @param openTimeList å¼å¯æ¶é´å表[(å¼å¯æ¶éï¼å¼å¯åé), ]
|
| | | # @param notifyMsg æç¤ºmark
|
| | | # @param notifyTimeList æç¤ºæ¶é´å表
|
| | | # @param mergeMinOSD 该æç¤ºé对跨æåæææçæå°å¼æå¤©, >=0æ¶æéå¶
|
| | | # @param mergeMaxOSD 该æç¤ºé对跨æåæææçæå¤§å¼æå¤©, >=0æ¶æéå¶
|
| | | # @param mergeMapInfo 该æç¤ºæå±çè·¨ææ´»å¨å°å¾ä¿¡æ¯, 主è¦ç¨äºä¸ååæå¯¹åºæè·¨çæ´»å¨å°å¾ID
|
| | | # @return None
|
| | | def FBOpenNotify(openTimeList, notifyMsg, notifyTimeList, mapID = 0, mergeMinOSD=-1, |
| | | mergeMaxOSD=-1, mergeMapInfo=[]):
|
| | | |
| | | # åªå¨ç¬¬ä¸çº¿ä¸æç¤º
|
| | | if GameWorld.GetGameWorld().GetCurGameWorldIndex() != 0 or not notifyTimeList:
|
| | | return
|
| | | |
| | | curTime = datetime.datetime.today()
|
| | | nextTime = curTime + datetime.timedelta(hours=1)
|
| | | |
| | | curYear, curMonth, curDay, curHour = curTime.year, curTime.month, curTime.day, curTime.hour
|
| | | nextYear, nextMonth, nextDay, nextHour = nextTime.year, nextTime.month, nextTime.day, nextTime.hour
|
| | | startTimeStrFormat = "%s-%s-%s %s:%s:%s"
|
| | | |
| | | # éè¦æç¤ºçæå¤§åé
|
| | | maxNotifyMinute = max(notifyTimeList)
|
| | | |
| | | remaindMinute = -1
|
| | | for hour, minute in openTimeList:
|
| | | |
| | | # å½åå°æ¶çåä¸ä¸ä¸ªå°æ¶ææå¯è½éè¦æç¤º
|
| | | if hour not in [curHour, nextHour]:
|
| | | continue
|
| | | |
| | | # è·åæ¬æ¬¡æ¯è¾çå¼å¯æ¶é´
|
| | | if hour == curHour:
|
| | | startTimeStr = startTimeStrFormat % (curYear, curMonth, curDay, hour, minute, "00")
|
| | | else:
|
| | | startTimeStr = startTimeStrFormat % (nextYear, nextMonth, nextDay, hour, minute, "00")
|
| | | |
| | | # å符串转å为datetime
|
| | | startTime = datetime.datetime.strptime(startTimeStr, ChConfig.TYPE_Time_Format)
|
| | | |
| | | # è¿å©å¤å°æ¶é´å¼å¯
|
| | | remainTime = startTime - curTime
|
| | | |
| | | # 计ç®å©ä½ç§æ°
|
| | | seconds = remainTime.seconds
|
| | | |
| | | # 计ç®å©ä½åéï¼æåä¸ç§éç¥
|
| | | remaindMinute = (seconds - 1) / 60 + 1
|
| | | if 0 < remaindMinute <= maxNotifyMinute:
|
| | | break
|
| | |
|
| | | # å¨é
ç½®ä¸éè¦æç¤ºï¼ä¸æªæç¤ºè¿
|
| | | if remaindMinute in notifyTimeList \
|
| | | and remaindMinute != GameWorld.GetGameFB().GetGameFBDictByKey(ChConfig.Map_FBDict_NotifyOpen):
|
| | | if mapID > 0:
|
| | | msgParamList = [remaindMinute, mapID]
|
| | | else:
|
| | | msgParamList = [remaindMinute]
|
| | | PlayerControl.WorldNotify(0, notifyMsg, msgParamList, 0, mergeMinOSD, mergeMaxOSD, mergeMapInfo)
|
| | | GameWorld.GetGameFB().SetGameFBDict(ChConfig.Map_FBDict_NotifyOpen, remaindMinute)
|
| | | return
|
| | |
|
| | |
|
| | | ## 夿å½åæ¯å¦æ¶å¯æ¬è¿åºæ¶é´(å夿¶é´)
|
| | | # @param openTimeList å¼å¯æ¶é´å表[(å¼å¯æ¶éï¼å¼å¯åé), ]
|
| | | # @param prepareSeconds å夿¶é´ï¼ç§ï¼
|
| | | # @return bool
|
| | | def CheckIsFBPrepareTime(openTimeList, prepareSeconds):
|
| | | curTime = GameWorld.GetCurrentTime()
|
| | | prevTime = curTime - datetime.timedelta(hours=1)
|
| | | |
| | | curYear, curMonth, curDay, curHour = curTime.year, curTime.month, curTime.day, curTime.hour
|
| | | prevYear, prevMonth, prevDay, prevHour = prevTime.year, prevTime.month, prevTime.day, prevTime.hour
|
| | | startTimeStrFormat = "%s-%s-%s %s:%s:%s"
|
| | | |
| | | for hour, minute in openTimeList:
|
| | |
|
| | | # å½åå°æ¶çåä¸ä¸å°æ¶ææå¯è½æ¶è¿å
¥æ¶é´
|
| | | if hour not in [curHour, prevHour]:
|
| | | continue
|
| | | |
| | | # è·åæ¬æ¬¡æ¯è¾çå¼å¯æ¶é´
|
| | | if hour == curHour:
|
| | | startTimeStr = startTimeStrFormat % (curYear, curMonth, curDay, hour, minute, "00")
|
| | | else:
|
| | | startTimeStr = startTimeStrFormat % (prevYear, prevMonth, prevDay, hour, minute, "00")
|
| | | |
| | | # å符串转å为datetime
|
| | | startTime = datetime.datetime.strptime(startTimeStr, ChConfig.TYPE_Time_Format)
|
| | | |
| | | # è·å¼å§æ¶é´çæ¶é´å·®
|
| | | pastTime = curTime - startTime
|
| | | |
| | | # æ¢ç®æç§æ°
|
| | | pastSeconds = pastTime.seconds
|
| | |
|
| | | # 妿å¨è§å®åå¤ç§æ°å
ï¼åè¿åTrue
|
| | | if 0 <= pastSeconds <= prepareSeconds:
|
| | | return True
|
| | | |
| | | return False
|
| | |
|
| | | ## è·åç©å®¶æå¨å¯æ¬åºåç¦å©åå¼
|
| | | # @param curPlayer ç©å®¶
|
| | | # @return åå¼-é»è®¤ä¸º1
|
| | | def GetAreaRewardMultiple(curPlayer):
|
| | | return max(1, curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AreaRewardMultiple))
|
| | |
|
| | | ## 设置ç©å®¶æå¨å¯æ¬åºåç¦å©åå¼
|
| | | # @param curPlayer ç©å®¶
|
| | | # @param value æ´æ°åå¼
|
| | | # @return
|
| | | def SetAreaRewardMultiple(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_AreaRewardMultiple, value) |
| | | return
|
| | |
|
| | |
|
| | | ## æ£æ¥æ¯å¦è¿å
¥å¯æ¬CDä¸
|
| | | # @param curPlayer ç©å®¶
|
| | | # @param mapID |
| | | # @return True-CDä¸ï¼ä¸å¯è¿å
¥ï¼False-éCDä¸ï¼å¯è¿å
¥
|
| | | def CheckIsEnterCD(curPlayer, mapID):
|
| | | return GetFBEnterCD(curPlayer, mapID) > 0
|
| | |
|
| | | ## è·åè¿å
¥å¯æ¬CDæ¶é´
|
| | | # @param curPlayer ç©å®¶
|
| | | # @param mapID |
| | | # @return <=0 代表没æCD, >0表示è¿å©ä¸çCD tick
|
| | | def GetFBEnterCD(curPlayer, mapID):
|
| | | mapID = GetRecordMapID(mapID)
|
| | | enterCDDict = IpyGameDataPY.GetFuncEvalCfg('FBEnterCD', 1)
|
| | | |
| | | if mapID not in enterCDDict:
|
| | | return 0
|
| | | lvLimitDict = IpyGameDataPY.GetFuncEvalCfg('FBEnterCD', 3)
|
| | | if mapID in lvLimitDict:
|
| | | if curPlayer.GetLV() >= lvLimitDict[mapID]:
|
| | | return 0
|
| | | cdTick = enterCDDict[mapID]
|
| | | lastEnterTick = GetFBPDictValue(curPlayer, ChConfig.Def_PDict_LastEnterFBTick % mapID)
|
| | | if not lastEnterTick:
|
| | | return 0
|
| | | |
| | | timeNum = GameWorld.ChangeTimeStrToNum(GameWorld.GetCurrentDataTimeStr())
|
| | | passTick = max(0, timeNum - lastEnterTick)
|
| | | curCDTick = max(0, cdTick - passTick)
|
| | | if curCDTick > 0:
|
| | | GameWorld.DebugLog("坿¬è¿å
¥CDä¸ï¼mapID=%s,timeNum=%s,lastEnterTick=%s,passTick=%s,å©ä½=%s" |
| | | % (mapID, timeNum, lastEnterTick, passTick, curCDTick))
|
| | | return curCDTick
|
| | |
|
| | |
|
| | | ## æ´æ°ç©å®¶è¿å
¥å¯æ¬æ¶é´
|
| | | # @param curPlayer ç©å®¶
|
| | | # @param tick æ´æ°å¼
|
| | | # @return
|
| | | def UpdateFBEnterTick(curPlayer):
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | mapID = GetRecordMapID(mapID)
|
| | | enterCDDict = IpyGameDataPY.GetFuncEvalCfg('FBEnterCD', 1)
|
| | | if mapID not in enterCDDict:
|
| | | return
|
| | | timeNum = GameWorld.ChangeTimeStrToNum(GameWorld.GetCurrentDataTimeStr())
|
| | | SetFBPDictValue(curPlayer, ChConfig.Def_PDict_LastEnterFBTick % mapID, timeNum)
|
| | | GameWorld.DebugLog("UpdateFBEnterTick mapID=%s,timeNum=%s" % (mapID, timeNum))
|
| | | SyncFBEnterTick(curPlayer, mapID)
|
| | | return
|
| | |
|
| | | ## è·åè®°å½å¼çmapID
|
| | |
| | |
|
| | | return GeneralTrainMapIDList
|
| | |
|
| | | def GetClientCustomScene():
|
| | | ## è·åå端èªå®ä¹å¯æ¬åºæ¯
|
| | | mapIDList = GetGeneralTrainMapIDList()
|
| | | return mapIDList + ChConfig.ClientCustomSceneList
|
| | |
|
| | | ## 忥è¿å
¥å¯æ¬æ¶é´
|
| | | # @param curPlayer ç©å®¶
|
| | | # @param syncMapID 忥çå°å¾ï¼é»è®¤0为å
¨é¨
|
| | | # @return None
|
| | | def SyncFBEnterTick(curPlayer, syncMapID=0):
|
| | | enterCDDict = IpyGameDataPY.GetFuncEvalCfg('FBEnterCD', 1)
|
| | | if not enterCDDict:
|
| | | return
|
| | | |
| | | timeNum = GameWorld.ChangeTimeStrToNum(GameWorld.GetCurrentDataTimeStr())
|
| | | |
| | | enterList = ChPyNetSendPack.tagMCFBEnterTickList()
|
| | | enterList.Clear()
|
| | | enterList.EnterTickList = []
|
| | | for mapID in enterCDDict.keys():
|
| | | |
| | | if syncMapID not in [0, mapID]:
|
| | | continue
|
| | | |
| | | lastEnterTick = GetFBPDictValue(curPlayer, ChConfig.Def_PDict_LastEnterFBTick % mapID)
|
| | | |
| | | # ä¿®æ£å¯æ¬CDæ¶é´
|
| | | if timeNum < lastEnterTick:
|
| | | SetFBPDictValue(curPlayer, ChConfig.Def_PDict_LastEnterFBTick % mapID, timeNum)
|
| | | lastEnterTick = timeNum
|
| | | GameWorld.DebugLog("ä¿®æ£ç©å®¶å¯æ¬CDæ¶é´ mapID=%s,timeNum=%s" % (mapID, timeNum), curPlayer.GetPlayerID())
|
| | | |
| | | enterTickObj = ChPyNetSendPack.tagMCFBEnterTick()
|
| | | enterTickObj.Clear()
|
| | | enterTickObj.MapID = mapID
|
| | | enterTickObj.LastEnterTick = lastEnterTick#max(enterCDDict.get(mapID) - (timeNum - lastEnterTick), 0)
|
| | | enterList.EnterTickList.append(enterTickObj)
|
| | | |
| | | enterList.Cnt = len(enterList.EnterTickList)
|
| | | NetPackCommon.SendFakePack(curPlayer, enterList) |
| | | return
|
| | |
|
| | | ## éç¥ä¸ªäººéç¨å¯æ¬ä¿¡æ¯
|
| | | # @param curPlayer: ç©å®¶å®ä¾
|
| | | # @param runTime: å·²ç»è¿è¡æ¶é´
|
| | |
| | | mapInfo.FBID = mID
|
| | | mapInfo.EnterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % mID)
|
| | | mapInfo.EnterCntTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntTotal % mID)
|
| | | mapInfo.RecoverCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_RecoverFbCnt % mID)
|
| | | mapInfo.RecoverCnt = 0
|
| | | mapInfo.ItemAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ItemAddFbCnt % mID)
|
| | | mapInfo.PassLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBPassLineID % mID)
|
| | |
|
| | |
| | |
|
| | | NetPackCommon.SendFakePack(curPlayer, fbInfoData)
|
| | | return
|
| | |
|
| | |
|
| | |
|
| | | #// A3 BD éç¥ç©å®¶è´ä¹°å¯æ¬è¿å
¥æ¬¡æ° #tagMCBuyEnterInfo
|
| | | #
|
| | |
| | | group.extend(tmpList[gi])
|
| | |
|
| | | return groupList
|
| | |
|
| | | def ClearAreaRewardRecord(playerID):
|
| | | ##æ¸
餿åºåºåç¦å©è®°å½
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | gameWorld.SetGameWorldDict(ChConfig.Map_Player_AreaReward_GetCnt%playerID, 0)
|
| | | gameWorld.SetGameWorldDict(ChConfig.Map_Player_AreaReward_GetExp%playerID, 0)
|
| | | gameWorld.SetGameWorldDict(ChConfig.Map_Player_AreaReward_GetExpPoint%playerID, 0)
|
| | | gameWorld.SetGameWorldDict(ChConfig.Map_Player_AreaReward_GetZhenQiTotal%playerID, 0)
|
| | | gameWorld.SetGameWorldDict(ChConfig.Map_Player_AreaReward_GetTechPoint%playerID, 0)
|
| | | return
|
| | |
|
| | | ##æåºåºåç¦å©é»è¾
|
| | | # @param tick æ¶é´æ³
|
| | | # @return æ æä¹
|
| | | def DoLogicAreaReward(cfgKeyName, tick, needAlive=False):
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | rewardInterval = IpyGameDataPY.GetFuncCfg(cfgKeyName, 2)
|
| | | rewardFormatDict = IpyGameDataPY.GetFuncEvalCfg(cfgKeyName)
|
| | | getCntLimit = IpyGameDataPY.GetFuncCfg(cfgKeyName, 3)
|
| | | lastAwardTick = gameFB.GetGameFBDictByKey(ChConfig.Map_FBDict_LastAreaRewardTick)
|
| | | if tick - lastAwardTick < rewardInterval:
|
| | | return
|
| | | gameFB.SetGameFBDict(ChConfig.Map_FBDict_LastAreaRewardTick, tick)
|
| | | |
| | | GameWorld.DebugLog("ç»æåºç¦å© tick=%s,needAlive=%s" % (tick, needAlive))
|
| | | # æ´æ°ç©å®¶æåºæç»æ¶é´
|
| | | playerManager = GameWorld.GetMapCopyPlayerManager()
|
| | | for index in xrange(playerManager.GetPlayerCount()):
|
| | | curPlayer = playerManager.GetPlayerByIndex(index)
|
| | | if not curPlayer:
|
| | | continue
|
| | | if needAlive and GameObj.GetHP(curPlayer) <= 0:
|
| | | continue
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | if getCntLimit:
|
| | | getCnt = gameWorld.GetGameWorldDictByKey(ChConfig.Map_Player_AreaReward_GetCnt%playerID)
|
| | | if getCnt >= getCntLimit:
|
| | | continue
|
| | | gameWorld.SetGameWorldDict(ChConfig.Map_Player_AreaReward_GetCnt%playerID, getCnt + 1)
|
| | | |
| | | multiple = GetAreaRewardMultiple(curPlayer) # ç¦å©åæ°
|
| | | reLV = curPlayer.GetLV()
|
| | | reExp = PlayerControl.GetPlayerReExp(curPlayer)
|
| | | playerControl = PlayerControl.PlayerControl(curPlayer)
|
| | | |
| | | if "Exp" in rewardFormatDict:
|
| | | addExp = eval(rewardFormatDict["Exp"])
|
| | | addExp = playerControl.AddExp(addExp)
|
| | | if addExp > 0:
|
| | | totalExp = GetFBAreaRewardExp(gameWorld, playerID) + addExp
|
| | | gameWorld.SetGameWorldDict(ChConfig.Map_Player_AreaReward_GetExp%playerID, totalExp % ChConfig.Def_PerPointValue)
|
| | | gameWorld.SetGameWorldDict(ChConfig.Map_Player_AreaReward_GetExpPoint%playerID, totalExp / ChConfig.Def_PerPointValue)
|
| | | |
| | | |
| | | if "ZhenQi" in rewardFormatDict:
|
| | | addZhenQi = eval(rewardFormatDict["ZhenQi"])
|
| | | PlayerControl.PlayerAddZhenQi(curPlayer, addZhenQi, True, True, "FB")
|
| | | totalZhenQi = gameWorld.GetGameWorldDictByKey(ChConfig.Map_Player_AreaReward_GetZhenQiTotal%playerID)
|
| | | totalZhenQi += addZhenQi
|
| | | gameWorld.SetGameWorldDict(ChConfig.Map_Player_AreaReward_GetZhenQiTotal%playerID, totalZhenQi)
|
| | | |
| | | #GameWorld.DebugLog(" æåºç¦å© ååº=%s,reLV=%s,reExp=%s,addExp=%s,addZQ=%s,totalExp=%s,totalZQ=%s" |
| | | # % (multiple, reLV, reExp, addExp, addZhenQi, totalExp, totalZhenQi), playerID)
|
| | | return
|
| | |
|
| | | def GetFBAreaRewardExp(gameWorld, playerID):
|
| | | exp = gameWorld.GetGameWorldDictByKey(ChConfig.Map_Player_AreaReward_GetExp%playerID)
|
| | | expPoint = gameWorld.GetGameWorldDictByKey(ChConfig.Map_Player_AreaReward_GetExpPoint%playerID)
|
| | | return expPoint * ChConfig.Def_PerPointValue + exp
|
| | |
|
| | | def GetFBAreaRewardZhenQi(gameWorld, playerID):
|
| | | return gameWorld.GetGameWorldDictByKey(ChConfig.Map_Player_AreaReward_GetZhenQiTotal%playerID)
|
| | |
|
| | | def GetFBAreaRewardTechPoint(gameWorld, playerID):
|
| | | return gameWorld.GetGameWorldDictByKey(ChConfig.Map_Player_AreaReward_GetTechPoint%playerID)
|
| | |
|
| | | def NotifyCopyMapPlayerFBHelp(tick, fbHelpFunc, interval=10000, befLogicFunc=None):
|
| | | gameFB = GameWorld.GetGameFB()
|
| | | lastTick = gameFB.GetGameFBDictByKey(ChConfig.Def_FB_NotifyFBHelpTick)
|
| | | if tick - lastTick < interval:
|
| | | return
|
| | | gameFB.SetGameFBDict(ChConfig.Def_FB_NotifyFBHelpTick, tick)
|
| | | |
| | | if befLogicFunc:
|
| | | befLogicFunc(tick)
|
| | | |
| | | playerManager = GameWorld.GetMapCopyPlayerManager()
|
| | | for index in xrange(playerManager.GetPlayerCount()):
|
| | | curPlayer = playerManager.GetPlayerByIndex(index)
|
| | | if not curPlayer:
|
| | | continue
|
| | | fbHelpFunc(curPlayer, tick)
|
| | | return
|
| | |
|
| | | def GetCrossDynamicLineMapZoneID():
|
| | | ## è·åè·¨æå¨æçº¿è·¯å°å¾æ¬çº¿è·¯è·¨æååº
|
| | |
| | |
|
| | | import FBCommon
|
| | | import GameWorld
|
| | | import PlayerControl
|
| | | import IpyGameDataPY
|
| | | import ItemControler
|
| | | import NPCCommon
|
| | | import ChConfig
|
| | |
|
| | | ## æ¯å¦è½å¤éè¿æ´»å¨æ¥è¯¢è¿å
¥
|
| | |
| | | ## æ¯å¦éè¦åè¿å
¥å¯æ¬éç¨æ£æ¥æ¡ä»¶é»è¾ï¼é»è®¤éè¦æ£æ¥
|
| | | def OnNeedCheckCanEnterFBComm(curPlayer, mapID, lineID):
|
| | | ## è¿è¡ä¸çä¸éè¦é夿£æ¥ï¼é²æ¢æçº¿éè¿è¢«ç¦æ¢è¿å
¥
|
| | | if FBCommon.GetCustomMapStep(curPlayer, mapID, lineID) == ChConfig.CustomMapStep_Fight:
|
| | | GameWorld.DebugLog("éç¨å
»æå¯æ¬å·²ç»å¨è¿è¡ä¸ï¼æ¬æ¬¡è¿å
¥ä¸éè¦éæ°æ£æ¥! mapID=%s,lineID=%s" % (mapID, lineID))
|
| | | return False
|
| | | return True
|
| | |
|
| | | ## 客æ·ç«¯è¿å
¥èªå®ä¹åºæ¯
|
| | | def OnEnterCustomScene(curPlayer, mapID, lineID):
|
| | | return
|
| | |
|
| | | ## 夿å¯å¦å¬å¤æ¨æ¡©æª
|
| | | def OnCanSummonPriWoodPile(curPlayer, mapID, lineID, npcID, count):
|
| | | |
| | | if FBCommon.GetCustomMapStep(curPlayer, mapID, lineID) != ChConfig.CustomMapStep_Fight:
|
| | | FBCommon.SetCustomMapStep(curPlayer, mapID, lineID, ChConfig.CustomMapStep_Fight)
|
| | | |
| | | npcIDList = GetGeneralTrainNPCIDList(mapID, lineID)
|
| | | if not npcIDList or npcID not in npcIDList:
|
| | | GameWorld.DebugLog("éç¨å
»æå¯æ¬è¯¥NPCä¸è½å¬å¤! mapID=%s,lineID=%s,npcID=%s not in %s" % (mapID, lineID, npcID, npcIDList))
|
| | | return False
|
| | | |
| | | return True
|
| | |
|
| | | def OnCustomSceneProcess(curPlayer, mapID, lineID, tick):
|
| | | return
|
| | |
|
| | | def GetGeneralTrainNPCIDList(mapID, lineID):
|
| | | npcIDList = []
|
| | |
| | | if not ipyData:
|
| | | return 0
|
| | | return ipyData.GetBossNPCID()
|
| | |
|
| | | ## èªå®ä¹åºæ¯å¯æ¬å»æNPC
|
| | | def DoCustomScene_Player_KillNPC(curPlayer, curNPC, mapID, lineID):
|
| | | |
| | | npcID = curNPC.GetNPCID()
|
| | | bossID = GetGeneralTrainBossID(mapID, lineID)
|
| | | GameWorld.DebugLog("廿坿¬NPC: mapID=%s,lineID=%s,npcID=%s,bossID=%s" % (mapID, lineID, npcID, bossID), curPlayer.GetPlayerID())
|
| | | if npcID != bossID:
|
| | | return
|
| | | |
| | | if FBCommon.GetCustomMapStep(curPlayer, mapID, lineID) != ChConfig.CustomMapStep_Fight:
|
| | | return
|
| | | |
| | | ipyData = IpyGameDataPY.GetIpyGameData('FBGeneralTrain', mapID, lineID)
|
| | | if not ipyData:
|
| | | return
|
| | | |
| | | passLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBPassLineID % mapID)
|
| | | if lineID > passLineID:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBPassLineID % mapID, lineID)
|
| | | |
| | | #å¢å è¿å
¥æ¬¡æ°
|
| | | FBCommon.AddEnterFBCount(curPlayer, mapID)
|
| | | |
| | | giveItemList = ipyData.GetPassAwardItemList()
|
| | | GameWorld.DebugLog("éç¨å
»æå¯æ¬è¿å
³! mapID=%s,lineID=%s,giveItemList=%s" % (mapID, lineID, giveItemList))
|
| | | |
| | | NPCCommon.DoGiveItemByVirtualDrop(curPlayer, giveItemList, bossID)
|
| | | |
| | | FBCommon.SetCustomMapStep(curPlayer, mapID, lineID, ChConfig.CustomMapStep_Over)
|
| | | |
| | | isPass = 1
|
| | | overDict = {FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(giveItemList)}
|
| | | FBCommon.NotifyFBOver(curPlayer, mapID, lineID, isPass, overDict)
|
| | | return
|
| | |
|
| | | ## å¯å¦æ«è¡
|
| | | def OnPlayerFBSweepAsk(curPlayer, mapID, lineID, sweepCnt, isFinish, dataEx):
|
| | |
| | |
|
| | | return
|
| | |
|
| | | #// B4 0F åæ¶ç§æä¸å±æ¨æ¡©æª #tagCMRecyclePriWoodPile
|
| | | #
|
| | | #struct tagCMRecyclePriWoodPile
|
| | | #{
|
| | | # tagHead Head;
|
| | | # DWORD ObjID;
|
| | | #};
|
| | | def OnRecyclePriWoodPile(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | objID = clientData.ObjID
|
| | | curNPC = GameWorld.FindNPCByID(objID)
|
| | | if not curNPC:
|
| | | return
|
| | | if curNPC.GetType() not in [ChConfig.ntPriWoodPilePVE, ChConfig.ntPriWoodPilePVP]:
|
| | | return
|
| | | summonPlayerID = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_PriWoodPilePlayerID)
|
| | | if curPlayer.GetPlayerID() != summonPlayerID:
|
| | | #GameWorld.DebugLog("éç©å®¶ç§ææ¨æ¡©...")
|
| | | return
|
| | | SetDeadEx(curNPC)
|
| | | return
|
| | |
|
| | | #// B4 0C å¬å¤ç§æä¸å±æ¨æ¡©æª #tagCMSummonPriWoodPile
|
| | | #
|
| | | #struct tagCMSummonPriWoodPile
|
| | | #{
|
| | | # tagHead Head;
|
| | | # DWORD NPCID;
|
| | | # BYTE Count; //é»è®¤1ä¸ªï¼æå¤5个
|
| | | # DWORD HP; //é»è®¤0åæå¤§å¼ï¼å
¶ä¸ä¸ä¸ªè¡éæ°å¼å¤§äº0åç¨æå®è¡é
|
| | | # DWORD HPEx; //é»è®¤0åæå¤§å¼ï¼å
¶ä¸ä¸ä¸ªè¡éæ°å¼å¤§äº0åç¨æå®è¡é
|
| | | #};
|
| | | def OnSummonPriWoodPile(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | npcID = clientData.NPCID
|
| | | count = clientData.Count
|
| | | hp = clientData.HP
|
| | | hpEx = clientData.HPEx
|
| | | SummonPriWoodPile(curPlayer, npcID, count, hp, hpEx)
|
| | | return
|
| | |
|
| | | def SummonPriWoodPile(curPlayer, npcID, count, hp=0, hpEx=0):
|
| | | ''' å¬å¤ç§æä¸å±æ¨æ¡©æª
|
| | | '''
|
| | | |
| | | mapID = PlayerControl.GetCustomMapID(curPlayer)
|
| | | lineID = PlayerControl.GetCustomLineID(curPlayer)
|
| | | if mapID:
|
| | | if not FBLogic.OnCanSummonPriWoodPile(curPlayer, mapID, lineID, npcID, count):
|
| | | GameWorld.ErrLog("æ æ³å¬å¤æ¨æ¡©æª!mapID=%s,lineID=%s,npcID=%s,count=%s" % (mapID, lineID, npcID, count))
|
| | | return
|
| | | |
| | | if count != 1:
|
| | | hp, hpEx = 0, 0 # æå®è¡éçæä»
éç¨äºååªç
|
| | | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | if playerID not in PyGameData.g_playerPriWoodPileNPCDict:
|
| | | PyGameData.g_playerPriWoodPileNPCDict[playerID] = []
|
| | | playerPriWoodNPCList = PyGameData.g_playerPriWoodPileNPCDict[playerID]
|
| | | maxCount = 3
|
| | | nowCount = len(playerPriWoodNPCList)
|
| | | summonCount = min(count, maxCount - nowCount)
|
| | | GameWorld.DebugLog("å¬å¤æ¨æ¡©: npcID=%s,count=%s,maxCount=%s,nowCount=%s,summonCount=%s,hp=%s,hpEx=%s" |
| | | % (npcID, count, maxCount, nowCount, summonCount, hp, hpEx))
|
| | | if summonCount <= 0:
|
| | | return
|
| | | |
| | | npcManager = GameWorld.GetNPCManager()
|
| | | for _ in xrange(summonCount):
|
| | | #summonNPC = curPlayer.SummonNewNPC()
|
| | | summonNPC = npcManager.AddPlayerSummonNPC()
|
| | | |
| | | #设置å¬å¤å
½åºç¡ä¿¡æ¯
|
| | | summonNPC.SetNPCTypeID(npcID)
|
| | | summonNPC.SetSightLevel(curPlayer.GetSightLevel())
|
| | | #åå§å
|
| | | InitNPC(summonNPC)
|
| | | |
| | | #ç©å®¶å¬å¤å
½å表添å å¬å¤å
½,å¬å¤å
½æ·»å 主人
|
| | | #summonNPC.SetOwner(curPlayer)
|
| | | summonNPC.SetDict(ChConfig.Def_NPC_Dict_PriWoodPilePlayerID, playerID)
|
| | | |
| | | #å°å¬å¤å
½å¬å¤åºæ¥
|
| | | #ç©å®¶å¨å´éæºåºçç¹
|
| | | #æè½å¬å¤åæ ChConfig.Def_SummonAppearDist
|
| | | summonPos = GameMap.GetEmptyPlaceInArea(curPlayer.GetPosX(), curPlayer.GetPosY(), 3)
|
| | | summonNPC.Reborn(summonPos.GetPosX(), summonPos.GetPosY(), False)
|
| | | NPCControl(summonNPC).ResetNPC_Init(isReborn=True)
|
| | | if hp or hpEx:
|
| | | hpTotal = hpEx * ShareDefine.Def_PerPointValue + hp
|
| | | GameObj.SetHP(summonNPC, hpTotal)
|
| | | GameObj.SetMaxHP(summonNPC, hpTotal)
|
| | | summonNPC.NotifyAppear() # æç»ç»ä¸éç¥NPCåºç°
|
| | | playerPriWoodNPCList.append(summonNPC)
|
| | | |
| | | return
|
| | |
|
| | | def ClearPriWoodPile(curPlayer):
|
| | | ## æ¸
é¤ç§ææ¨æ¡©
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | if playerID not in PyGameData.g_playerPriWoodPileNPCDict:
|
| | | return
|
| | | playerPriWoodNPCList = PyGameData.g_playerPriWoodPileNPCDict.pop(playerID)
|
| | | for summonNPC in playerPriWoodNPCList:
|
| | | if not summonNPC:
|
| | | continue
|
| | | SetDeadEx(summonNPC)
|
| | | return
|
| | |
|
| | | ## 设置npcæ»äº¡åèªèº«å¤ç(请ä¸è¦å°æ¸¸æé»è¾å 卿¤å½æ°ä¸)
|
| | | # @param curNPCï¼npcå®ä¾
|
| | | # @return
|
| | |
| | | DoGiveCollectNPCAward(curPlayer, npcID, collectNPCIpyData, crossCollectOK=True)
|
| | | return
|
| | |
|
| | | #// A2 34 èªå®ä¹åºæ¯ä¸è·åééå¥å± #tagCMGetCustomSceneCollectAward
|
| | | #
|
| | | #struct tagCMGetCustomSceneCollectAward
|
| | | #{
|
| | | # tagHead Head;
|
| | | # DWORD NPCID; //ééçNPCID
|
| | | #};
|
| | | def OnGetCustomSceneCollectAward(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | npcID = clientData.NPCID
|
| | | if not curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
|
| | | GameWorld.ErrLog("éèªå®ä¹åºæ¯ä¸ï¼æ æ³è·åå®ä¹ééå¥å±!", playerID)
|
| | | return
|
| | | mapID = PlayerControl.GetCustomMapID(curPlayer)
|
| | | lineID = PlayerControl.GetCustomLineID(curPlayer)
|
| | | GameWorld.Log("åç«¯åºæ¯éé: mapID=%s,lineID=%s,npcID=%s" % (mapID, lineID, npcID), playerID)
|
| | | if not mapID:
|
| | | GameWorld.ErrLog("æ èªå®ä¹åºæ¯å°å¾IDï¼ä¸å
许éé!", playerID)
|
| | | return
|
| | | |
| | | if not FBLogic.OnCustomSceneCollectOK(curPlayer, mapID, lineID, npcID):
|
| | | GameWorld.ErrLog("èªå®ä¹åºæ¯å°å¾ä¸å
许éé! mapID=%s,lineID=%s,npcID=%s" % (mapID, lineID, npcID), playerID)
|
| | | return
|
| | | |
| | | collectNPCIpyData = IpyGameDataPY.GetIpyGameDataNotLog("CollectNPC", npcID)
|
| | | if collectNPCIpyData:
|
| | | DoGiveCollectNPCAward(curPlayer, npcID, collectNPCIpyData)
|
| | | return
|
| | |
|
| | | def DoGiveCollectNPCAward(curPlayer, npcID, collectNPCIpyData, collectCnt=1, crossCollectOK=False, isSweep=False):
|
| | | return
|
| | |
|
| | | ## ééç»æåæ¥
|
| | | # @param None
|
| | | # @param None
|
| | | def SyncCollectionItemInfo(curPlayer, addExp, addMoney, addZhenQi, syncItemInfoList, collectNPCID=0):
|
| | | return #æä¸åæ¥
|
| | |
|
| | | def SyncCollNPCTime(curPlayer, npcIDList=None):
|
| | | ## 忥ééNPCåè½å·é鿬¡æ°
|
| | |
| | | import PlayerSuccess
|
| | | import PlayerDienstgrad
|
| | | import PlayerFreeGoods
|
| | | import PlayerRecover
|
| | | import PlayerCrossRealmPK
|
| | | import PlayerCrossChampionship
|
| | | import GameFuncComm
|
| | |
| | |
|
| | | if PlayerControl.GetCrossMapID(curPlayer):
|
| | | CrossRealmPlayer.DoExitCrossRealm(curPlayer)
|
| | | |
| | | if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
|
| | | PlayerFB.DoExitCustomScene(curPlayer)
|
| | |
|
| | | PetControl.DoLogic_PetLoadMapOK(curPlayer)
|
| | |
|
| | |
| | | #PlayerDienstgrad.RefreshBillBoardDienstgrad(curPlayer)
|
| | | # ç§°å·
|
| | | PlayerDienstgrad.Sync_AllDienstgradOnLogin(curPlayer)
|
| | | # èµæºæ¾åOnLogin
|
| | | PlayerRecover.RecoverOnLogin(curPlayer)
|
| | |
|
| | | # ʱװ
|
| | | PlayerCoat.OnLogin_Coat(curPlayer)
|
| | |
| | | PlayerControl.SetPlayerSightLevel(curPlayer, curPlayer.GetID())
|
| | | if curPlayer.GetSight() != 0:
|
| | | PlayerControl.SetSight(curPlayer, 0)
|
| | | #å·æ°ç©å®¶çè§é
|
| | | #if not GameWorld.IsCrossServer() and (PlayerControl.GetCrossMapID(curPlayer) or PlayerControl.GetCustomMapID(curPlayer)):
|
| | | # GameWorld.DebugLog("===ç»å½æ¬æå°å¾æ¶ï¼å¤äºè·¨ææèªå®ä¹åºæ¯ç¶æï¼ä¸å·æ°è§é!", curPlayer.GetPlayerID())
|
| | | # PlayerControl.SetPlayerSightLevel(curPlayer, curPlayer.GetID())
|
| | | #elif not GameWorld.IsCrossServer():
|
| | | # realmDifficulty = PlayerControl.GetMapRealmDifficulty(curPlayer)
|
| | | # if realmDifficulty:
|
| | | # GameWorld.DebugLog("===ç»å½æ¬æå°å¾æ¶ï¼å¤äºå¢çé¾åº¦å°å¾ï¼èªå¨è®¾ç½®é¾åº¦! realmDifficulty=%s" % realmDifficulty, curPlayer.GetPlayerID())
|
| | | # PlayerControl.SetRealmDifficulty(curPlayer, realmDifficulty)
|
| | | |
| | | |
| | | PlayerState.ChangePlayerSigh(curPlayer, tick)
|
| | |
|
| | | if GameWorld.IsCrossServer():
|
| | |
| | | PlayerControl.SetPlayerSightLevel(curPlayer, curPlayer.GetID())
|
| | | if curPlayer.GetSight() != 0:
|
| | | PlayerControl.SetSight(curPlayer, 0)
|
| | | #å·æ°èªå·±çè§é
|
| | | #if not GameWorld.IsCrossServer() and (PlayerControl.GetCrossMapID(curPlayer) or curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene)):
|
| | | # GameWorld.DebugLog("===æ¬æLoadMapOKæ¶ç©å®¶å¤äºè·¨ææèªå®ä¹åºæ¯ç¶æï¼ä¸è®¾ç½®å¯è§ï¼", curPlayer.GetPlayerID())
|
| | | # PlayerControl.SetPlayerSightLevel(curPlayer, curPlayer.GetID())
|
| | | #elif not GameWorld.IsCrossServer():
|
| | | # realmDifficulty = PlayerControl.GetMapRealmDifficulty(curPlayer)
|
| | | # if realmDifficulty:
|
| | | # GameWorld.DebugLog("===æ¬æLoadMapOKæ¶ç©å®¶å¤äºå¢çé¾åº¦å°å¾ï¼èªå¨è®¾ç½®é¾åº¦ï¼realmDifficulty=%s" % realmDifficulty, curPlayer.GetPlayerID())
|
| | | # PlayerControl.SetRealmDifficulty(curPlayer, realmDifficulty)
|
| | | |
| | | |
| | | curPlayer.RefreshView()
|
| | | curPlayer.SetVisible(True)
|
| | |
|
| | |
| | | return
|
| | |
|
| | | def GetMapCanOutPet(curPlayer):
|
| | | ## æ£æ¥æ¬å°å¾å¯å¦åºæå® ç©ï¼æ¯æå端èªå®ä¹åºæ¯
|
| | | customMapID = PlayerControl.GetCustomMapID(curPlayer)
|
| | | if customMapID:
|
| | | ipyMapData = IpyGameDataPY.GetIpyGameData("ChinMap", customMapID)
|
| | | canOutPet = True if ipyMapData and ipyMapData.GetCanOutPet() else False
|
| | | else:
|
| | | canOutPet = GameWorld.GetMap().GetMapCanOutPet()
|
| | | ## æ£æ¥æ¬å°å¾å¯å¦åºæå® ç©
|
| | | canOutPet = GameWorld.GetMap().GetMapCanOutPet()
|
| | | return canOutPet
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | NotifyCode(curPlayer, "CrossMap10")
|
| | | return False
|
| | |
|
| | | if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
|
| | | GameWorld.Log("客æ·ç«¯èªå®ä¹åºæ¯ä¸æ æ³ä¼ é!", curPlayer.GetPlayerID())
|
| | | return False
|
| | | |
| | | return True
|
| | |
|
| | |
|
| | |
| | | CrossPlayerData.ClearCrossSyncDataCache(curPlayer)
|
| | | #æ¸
é¤å°å¾ç©å®¶ç¼å
|
| | | PyGameData.g_playerReqEnterFBEx.pop(playerID, None)
|
| | | NPCCommon.ClearPriWoodPile(curPlayer)
|
| | | #ç§»é¤å°å¾ç¼åçå¢çé¾åº¦ç©å®¶IDä¿¡æ¯
|
| | | for playerIDList in PyGameData.g_realmDiffPlayerDict.values():
|
| | | if playerID in playerIDList:
|
| | |
| | | if isNotify:
|
| | | NotifyCode(curPlayer, "Carry_lhs_697674")
|
| | | return ShareDefine.EntFBAskRet_Sit
|
| | | |
| | | if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
|
| | | if isNotify:
|
| | | NotifyCode(curPlayer, "Carry_lhs_697674")
|
| | | GameWorld.Log("客æ·ç«¯èªå®ä¹åºæ¯ä¸æ æ³è¿å
¥å¯æ¬!", curPlayer.GetPlayerID())
|
| | | return ShareDefine.EntFBAskRet_Other
|
| | |
|
| | | if playerAction in ChConfig.Def_Player_Cannot_TransState:
|
| | | #Carry_lhs_697674ï¼æ¨å½åæå¤çç¶æä¸è½è¿è¡ä¼ é!
|
| | |
| | | fightExpRate += curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TeamExpRate) # ç»é
|
| | |
|
| | | #å°å¾å¤åç»éªå æï¼é»è®¤æ¯1åä¸å æ
|
| | | mapExpAddMultiple = max(0, FBCommon.GetAreaRewardMultiple(curPlayer) - 1)
|
| | | mapExpAddMultiple = 0
|
| | | fightExpRate += mapExpAddMultiple * ChConfig.Def_MaxRateValue
|
| | |
|
| | | if totalExpRate != fightExpRate:
|
| | |
| | | curPlayer.SetExAttr5(value, False, True)
|
| | | if not value:
|
| | | CrossPlayerData.ClearCrossSyncDataCache(curPlayer)
|
| | | return
|
| | |
|
| | | ## å端èªå®ä¹åºæ¯
|
| | | def GetCustomMapID(curPlayer): return curPlayer.GetExAttr14() / 1000
|
| | | def GetCustomLineID(curPlayer): return curPlayer.GetExAttr14() % 1000
|
| | | ## èªå®ä¹åºæ¯åç«¯å¤æå·²ç»ç®åéç´æ¥é置为0ï¼é²æ¢å端没æéåºåºæ¯ç´æ¥ä¸çº¿å¯¼è´æ°æ®æ²¡æéç½®ï¼å¯è½å¼åå¯ä»¥éå¤è¿
|
| | | def SetCustomMap(curPlayer, mapID, lineID):
|
| | | value = mapID * 1000 + lineID
|
| | | if value != curPlayer.GetExAttr14():
|
| | | curPlayer.SetExAttr14(value, False, True)
|
| | | return
|
| | |
|
| | | ## éé±ç¹, æ¯æéé±è¶
20亿
|
| | |
| | | import PlayerCrossRealmPK
|
| | | import PlayerCrossChampionship
|
| | | import PlayerPet
|
| | | import PlayerRecover
|
| | | import PlayerFamilyRedPacket
|
| | | import OpenServerCampaign
|
| | | import PlayerCostRebate
|
| | |
| | | # ç¹æ®æ¶é´ç¹Xç¹è¿å¤©
|
| | | elif onEventType == ShareDefine.Def_OnEventTypeEx:
|
| | | PlayerHero.PlayerOnDay(curPlayer)
|
| | | # èµæºæ¾å
|
| | | PlayerRecover.RecoverOnDay(curPlayer)
|
| | | # ä»çè¿å¤©
|
| | | PlayerFamily.PlayerOnDay(curPlayer)
|
| | | # éç½®ç©åæ¯æ¥ä½¿ç¨æ¬¡æ°
|
| | |
| | | #------------------------------------------------------------------------------
|
| | | #"""Version = 2016-12-02 11:00"""
|
| | | #------------------------------------------------------------------------------
|
| | | import ReadChConfig
|
| | | import IPY_GameWorld
|
| | | import PlayerControl
|
| | | import GameWorld
|
| | | import FBCommon
|
| | | import ChConfig
|
| | | import FBLogic
|
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import PlayerSuccess
|
| | | import ItemCommon
|
| | | import IpyGameDataPY
|
| | | import ShareDefine
|
| | | import GameFuncComm
|
| | | import SkillShell
|
| | | import PyGameData
|
| | | import PetControl
|
| | | import NPCCommon
|
| | | import GameObj
|
| | |
|
| | | import time
|
| | | import math
|
| | | #---------------------------------------------------------------------
|
| | | def OnLogin(curPlayer):
|
| | | return
|
| | |
| | | actionType = clientData.ActionType # è¡ä¸ºç±»å
|
| | | actionInfo = clientData.ActionInfo # è¡ä¸ºä¿¡æ¯
|
| | | FBLogic.DoFBAction(curPlayer, actionType, actionInfo, tick)
|
| | | return
|
| | |
|
| | | ## A2 10 æ¸
é¤å¯æ¬CD#tagCMClearFBCD
|
| | | # @param playerIndex ç©å®¶ç´¢å¼ |
| | | # @param clientData 客æ·ç«¯å°å
|
| | | # @param tick æ¶é´
|
| | | # @return None
|
| | | def OnClearFBCD(playerIndex, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(playerIndex)
|
| | | mapID = clientData.MapID # mapID
|
| | | GameWorld.DebugLog("OnClearFBCD mapID=%s" % mapID)
|
| | | if not mapID:
|
| | | return
|
| | | |
| | | enterCDTick = FBCommon.GetFBEnterCD(curPlayer, mapID)
|
| | | if enterCDTick <= 0:
|
| | | GameWorld.DebugLog(" CDæ¶é´å·²è¿ï¼ä¸éè¦æ¸
é¤ï¼ cdTick=%s" % enterCDTick)
|
| | | return
|
| | | clearEnterCDDict = IpyGameDataPY.GetFuncEvalCfg('FBEnterCD', 2)
|
| | | if mapID not in clearEnterCDDict:
|
| | | return
|
| | | costMoney = clearEnterCDDict[mapID]
|
| | | costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, ShareDefine.TYPE_Price_Gold_Paper_Money, costMoney)
|
| | | if not costMoneyList:
|
| | | return
|
| | | second = enterCDTick # åæ°ç§
|
| | | # æ£é¤æ¶è
|
| | | infoDict = {"MapID":mapID, "CDSecond":second}
|
| | | for moneyType, moneyCnt in costMoneyList:
|
| | | if not PlayerControl.PayMoney(curPlayer, moneyType, moneyCnt, ChConfig.Def_Cost_ClearFBCD, infoDict):
|
| | | return
|
| | | |
| | |
|
| | | GameWorld.DebugLog(" mapID=%s æ¸
é¤å¯æ¬CD second=%s,costMoneyList=%s" |
| | | % (mapID, second, costMoneyList), curPlayer.GetPlayerID())
|
| | | |
| | | FBCommon.SetFBPDictValue(curPlayer, ChConfig.Def_PDict_LastEnterFBTick % mapID, 0)
|
| | | FBCommon.SyncFBEnterTick(curPlayer)
|
| | | return
|
| | |
|
| | | #---å°å
å¼å§æ«è¡-------------------------------------
|
| | |
|
| | | (
|
| | | PCDFB_MapIDList, # 坿¬å°å¾IDå表
|
| | | PCDFB_NeedTime, # æ«è¡æ¶é´, ç§
|
| | | PCDFB_FinishTimeGold, # ç«å³å®ææ¶èé»ç³å
¬å¼
|
| | | ) = range(3)
|
| | |
|
| | |
|
| | | ## 夿æ¯å¦å½åå
Œ
±CD坿¬æ«è¡ä¸
|
| | | def IsCurPubCDFBSweeping(curPlayer, mapID):
|
| | | sweepCfg = GetPubCDFBSweepCfg(curPlayer, mapID)
|
| | | if not sweepCfg:
|
| | | return False
|
| | | groupNum = sweepCfg[0]
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_PubCDFBS_MapID % groupNum) == mapID
|
| | |
|
| | | ## è·åå
Œ
±CD坿¬æ«è¡é
置信æ¯
|
| | | def GetPubCDFBSweepCfg(curPlayer, mapID):
|
| | | PubCDFBSweepDict = ReadChConfig.GetEvalChConfig("PubCDFBSweep")
|
| | | for groupNum, sweepInfo in PubCDFBSweepDict.items():
|
| | | mapIDGroup = sweepInfo[0]
|
| | | if mapID not in mapIDGroup:
|
| | | continue
|
| | | |
| | | return groupNum, sweepInfo
|
| | | |
| | | return
|
| | |
|
| | | ## å¼å§å
Œ
±CD坿¬æ«è¡
|
| | | def __DoStartPubCDFBSweep(curPlayer, mapID, lineID, cnt, isFinish, dataEx, groupNum, sweepInfo):
|
| | | curSweepMapID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_PubCDFBS_MapID % groupNum)
|
| | | if curSweepMapID > 0:
|
| | | GameWorld.DebugLog("å
Œ
±CD坿¬æ«è¡ä¸, æ æ³æ«è¡!groupNum=%s,curSweepMapID=%s" |
| | | % (groupNum, curSweepMapID), curPlayer.GetPlayerID())
|
| | | return
|
| | | |
| | | if not FBLogic.OnStartPubCDFBSweep(curPlayer, mapID, lineID, cnt, dataEx):
|
| | | return
|
| | | |
| | | curTime = int(time.time())
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_PubCDFBS_MapID % groupNum, mapID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_PubCDFBS_LineID % groupNum, lineID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_PubCDFBS_Cnt % groupNum, cnt)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_PubCDFBS_DataEx % groupNum, dataEx)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_PubCDFBS_Time % groupNum, curTime)
|
| | | GameWorld.DebugLog("å
Œ
±CD坿¬å¼å§æ«è¡ mapID=%s,lineID=%s,cnt=%s,dataEx=%s,groupNum=%s,curTime=%s" |
| | | % (mapID, lineID, cnt, dataEx, groupNum, curTime), curPlayer.GetPlayerID())
|
| | | |
| | | |
| | | Sync_PubFBSweepData(curPlayer, groupNum)
|
| | | return
|
| | |
|
| | | ## 宿å
Œ
±CD坿¬æ«è¡
|
| | | def __DoFinishPubCDFB(curPlayer, mapID, isFinish, groupNum, sweepInfo):
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | curSweepMapID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_PubCDFBS_MapID % groupNum)
|
| | | if curSweepMapID <= 0 or curSweepMapID != mapID:
|
| | | GameWorld.DebugLog("æªæ«è¡ æ 䏿¯å½åæ£å¨æ«è¡çå
Œ
±CD坿¬, æ æ³å®æ!curSweepMapID=%s,mapID=%s" |
| | | % (curSweepMapID, mapID), playerID)
|
| | | return
|
| | | |
| | | sweepTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_PubCDFBS_Time % groupNum)
|
| | | lineID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_PubCDFBS_LineID % groupNum)
|
| | | sweepCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_PubCDFBS_Cnt % groupNum)
|
| | | dataEx = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_PubCDFBS_DataEx % groupNum)
|
| | | |
| | | sweepNeedTime = sweepInfo[PCDFB_NeedTime] # 忬¡èæ¶
|
| | | finishCostGoldFormat = sweepInfo[PCDFB_FinishTimeGold]
|
| | | needTotalTime = sweepNeedTime * sweepCnt
|
| | | |
| | | curTime = int(time.time())
|
| | | passTime = max(0, curTime - sweepTime)
|
| | | second = max(0, needTotalTime - passTime)
|
| | | |
| | | # æ£å¸¸å®æ
|
| | | if isFinish == 2 and second > 0:
|
| | | GameWorld.DebugLog("æ«è¡æ¶é´æªå°ï¼æ æ³å®æï¼å©ä½%sç§, mapID=%s" % (second, mapID), playerID)
|
| | | return
|
| | | |
| | | addDataDict = {"curTime":curTime, "startSweepTime":sweepTime, "sweepCnt":sweepCnt, |
| | | "needTotalTime":needTotalTime, "passTime":passTime, "remainSecond":second, |
| | | "costGold":0, "mapID":mapID, "lineID":lineID, "dataEx":dataEx, ChConfig.Def_Cost_Reason_SonKey:mapID}
|
| | | |
| | | # é»ç³ç«å³å®æ
|
| | | if isFinish == 1:
|
| | | costGold = eval(finishCostGoldFormat)
|
| | | if costGold > 0:
|
| | | addDataDict["costGold"] = costGold
|
| | | if not PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, costGold, |
| | | ChConfig.Def_Cost_FinishFBSweep, addDataDict):
|
| | | return
|
| | | |
| | | GameWorld.DebugLog("å
Œ
±CD坿¬æ«è¡å®æ: %s" % str(addDataDict), playerID)
|
| | | # ç»å¥å±
|
| | | FBLogic.OnGivePubCDFBSweepPrize(curPlayer, mapID, lineID, sweepCnt, dataEx)
|
| | | |
| | | # éç½®æ«è¡æ°æ®
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_PubCDFBS_MapID % groupNum, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_PubCDFBS_LineID % groupNum, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_PubCDFBS_Cnt % groupNum, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_PubCDFBS_DataEx % groupNum, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_PubCDFBS_Time % groupNum, 0)
|
| | | Sync_PubFBSweepData(curPlayer, groupNum)
|
| | | return
|
| | |
|
| | | ## 忥å
Œ
±CD坿¬æ«è¡ä¿¡æ¯
|
| | | def Sync_PubFBSweepData(curPlayer, groupNum=-1):
|
| | | |
| | | PubCDFBSweepDict = ReadChConfig.GetEvalChConfig("PubCDFBSweep")
|
| | | allGroupNumList = PubCDFBSweepDict.keys()
|
| | | if groupNum == -1:
|
| | | groupNumList = allGroupNumList
|
| | | else:
|
| | | if groupNum not in allGroupNumList:
|
| | | return
|
| | | groupNumList = [groupNum]
|
| | | |
| | | pubSweepData = ChPyNetSendPack.tagMCPubFBSweepData()
|
| | | pubSweepData.Clear()
|
| | | pubSweepData.SweepDatList = []
|
| | | |
| | | for gNum in groupNumList:
|
| | | sweepInfo = ChPyNetSendPack.tagMCPubFBSweep()
|
| | | sweepInfo.Clear()
|
| | | sweepInfo.PubNum = gNum
|
| | | sweepInfo.FBMapID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_PubCDFBS_MapID % gNum)
|
| | | sweepInfo.LineID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_PubCDFBS_LineID % gNum)
|
| | | sweepInfo.SweepTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_PubCDFBS_Time % gNum)
|
| | | sweepInfo.SweepCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_PubCDFBS_Cnt % gNum)
|
| | | pubSweepData.SweepDatList.append(sweepInfo)
|
| | | |
| | | pubSweepData.Cnt = len(pubSweepData.SweepDatList)
|
| | | NetPackCommon.SendFakePack(curPlayer, pubSweepData)
|
| | | return
|
| | |
|
| | | #//A5 05 ç©å®¶å¼å§å¯æ¬æ«è¡ #tagCMBeginFBWipeOut
|
| | |
| | | GameWorld.DebugLog("æ«è¡æ¶èéå
·ä¸è¶³, mapID=%s,lineID=%s,sweepItemID=%s,sweepCostCnt=%s"
|
| | | % (mapID, lineID, sweepItemID, sweepCostCnt), curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | | |
| | | |
| | | #å
Œ
±CDæ«è¡æ¨¡å¼æå±è½ï¼æéè¦åä¿®æ¹
|
| | | #===============================================================================================
|
| | | # groupNum = -1
|
| | | # sweepInfo = None
|
| | | # PubCDFBSweepDict = ReadChConfig.GetEvalChConfig("PubCDFBSweep")
|
| | | # for gNum, sInfo in PubCDFBSweepDict.items():
|
| | | # if mapID in sInfo[PCDFB_MapIDList]:
|
| | | # groupNum = gNum
|
| | | # sweepInfo = sInfo
|
| | | # break
|
| | | # |
| | | # # å
Œ
±CD坿¬æ«è¡
|
| | | # if groupNum >= 0:
|
| | | # if not isFinish:
|
| | | # __DoStartPubCDFBSweep(curPlayer, mapID, lineID, cnt, isFinish, dataEx, groupNum, sweepInfo)
|
| | | # else:
|
| | | # __DoFinishPubCDFB(curPlayer, mapID, isFinish, groupNum, sweepInfo)
|
| | | # return
|
| | | #===============================================================================================
|
| | |
|
| | | # 坿¬æ¯å¦å¯æ«è¡, è¿éåªå¤æå¯æ¬èªèº«çç¹æ®æ¡ä»¶, å
Œ
±æ¡ä»¶ä¸é¢å·²ç»å¤æ
|
| | | if not FBLogic.OnPlayerFBSweepAsk(curPlayer, mapID, lineID, cnt, isFinish, dataEx):
|
| | |
| | |
|
| | | #æ«è¡ç»æç»å¥å±ç
|
| | | FBLogic.OnPlayerFBSweepResult(curPlayer, mapID, lineID, cnt, isFinish, dataEx)
|
| | | return
|
| | |
|
| | |
|
| | | #// A5 1B è´ä¹°ææå¯æ¬ç²¾å #tagCMBuyFBEnergy
|
| | | #
|
| | | #struct tagCMBuyFBEnergy
|
| | | #{
|
| | | # tagHead Head;
|
| | | #};
|
| | | def OnPlayerBuyFBEnergy(playerIndex, clientData, tick):
|
| | | #curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(playerIndex)
|
| | | return
|
| | |
|
| | |
|
| | | ## ç©å®¶å¯æ¬åè½æ¶é´å¤ç
|
| | | def DoPlayerFBTimeProcess(curPlayer, tick):
|
| | | |
| | | checkInterval = ChConfig.TYPE_Player_Tick_Time[ChConfig.TYPE_Player_Tick_FBTimeProcess]
|
| | | if tick - curPlayer.GetTickByType(ChConfig.TYPE_Player_Tick_FBTimeProcess) < checkInterval:
|
| | | return |
| | | |
| | | curPlayer.SetTickByType(ChConfig.TYPE_Player_Tick_FBTimeProcess, tick)
|
| | | |
| | | # é¢ä¸»é¸ä¸ç©å®¶åè½æ¶é´å¤ç
|
| | | FBCommon.RegainFBCntProcess(curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | #// B1 02 é¢åå¤å坿¬å¥å± #tagCMGetMultiFBPrize
|
| | | #
|
| | | #struct tagCMGetMultiFBPrize
|
| | | #{
|
| | | # tagHead Head;
|
| | | # DWORD MapID;
|
| | | # WORD LineID;
|
| | | # WORD Percent; // é¢å¤å¥å±ç¾åæ¯å¥å±ç级
|
| | | #};
|
| | | def OnPlayerGetMultiFBPrize(playerIndex, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(playerIndex)
|
| | | mapID = clientData.MapID
|
| | | lineID = clientData.LineID
|
| | | prizeExLV = clientData.Percent
|
| | | FBLogic.OnGetMultiFBPrize(curPlayer, mapID, lineID, prizeExLV)
|
| | | return
|
| | |
|
| | |
|
| | | #//A5 60 éç½®å¯æ¬æææ¬¡æ° #tagCMResetFBJoinCnt
|
| | | #
|
| | | #struct tagCMResetFBJoinCnt
|
| | | #{
|
| | | # tagHead Head;
|
| | | #};
|
| | | def OnPlayerResetFBJoinCnt(playerIndex, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(playerIndex)
|
| | | return
|
| | |
|
| | |
|
| | | #// B1 01 客æ·ç«¯å¯æ¬åéç»æ #tagCMClientEndFB
|
| | | #
|
| | | #struct tagCMClientEndFB
|
| | | #{
|
| | | # tagHead Head;
|
| | | # DWORD MapID;
|
| | | # WORD LineID;
|
| | | # DWORD Data; //坿¬æ°æ®
|
| | | #};
|
| | | def OnClientEndFB(playerIndex, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(playerIndex)
|
| | | mapID = clientData.MapID
|
| | | lineID = clientData.LineID
|
| | | data1 = clientData.Data1
|
| | | data2 = clientData.Data2
|
| | | dataList = [data1, data2]
|
| | | FBLogic.OnClientEndFB(curPlayer, mapID, lineID, dataList)
|
| | | GameWorld.DebugLog(' 客æ·ç«¯å¯æ¬åéç»æmapID=%s,lineID=%s,dataList=%s'%(mapID,lineID,dataList))
|
| | | return
|
| | |
|
| | |
|
| | | #// B1 04 客æ·ç«¯åéå¼å§å¯æ¬ #tagCMClientStartFB
|
| | | #
|
| | | #struct tagCMClientStartFB
|
| | | #{
|
| | | # tagHead Head;
|
| | | #};
|
| | | def OnClientStartFB(playerIndex, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(playerIndex)
|
| | | FBLogic.OnClientStartFB(curPlayer, tick)
|
| | | return
|
| | |
|
| | | #// A2 31 å端å¼å§èªå®ä¹åºæ¯ #tagCMClientStartCustomScene
|
| | | #
|
| | | #struct tagCMClientStartCustomScene
|
| | | #{
|
| | | # tagHead Head;
|
| | | # DWORD MapID;
|
| | | # WORD FuncLineID;
|
| | | #};
|
| | | def OnClientStartCustomScene(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | mapID = clientData.MapID
|
| | | funcLineID = clientData.FuncLineID
|
| | | DoEnterCustomScene(curPlayer, mapID, funcLineID, tick)
|
| | | 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, tick):
|
| | | ## è¿å
¥èªå®ä¹åºæ¯ç¶æ
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | GameWorld.Log("ç©å®¶è¯·æ±è¿å
¥èªå®ä¹åºæ¯!mapID=%s,lineID=%s" % (mapID, lineID), playerID)
|
| | | if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
|
| | | curMapID = PlayerControl.GetCustomMapID(curPlayer)
|
| | | curLineID = PlayerControl.GetCustomLineID(curPlayer)
|
| | | if mapID == curMapID and lineID == curLineID:
|
| | | GameWorld.Log(" ç©å®¶å½åå·²ç»å¨èªå®ä¹åºæ¯ä¸ï¼æ ééæ°è¯·æ±ï¼", playerID)
|
| | | result = 1
|
| | | else:
|
| | | GameWorld.Log(" ç©å®¶å½åå¨ä¸åçèªå®ä¹åºæ¯ä¸ï¼ä¸å
许è¿å
¥ï¼curMapID=%s,curLineID=%s" |
| | | % (curMapID, curLineID), playerID)
|
| | | result = 0
|
| | | StartCustomSceneResult(curPlayer, mapID, lineID, result)
|
| | | return result
|
| | | |
| | | #è¿å
¥å¯æ¬éç¨æ£æ¥
|
| | | if mapID:
|
| | | fbIpyData = FBCommon.GetFBIpyData(mapID)
|
| | | fbLineIpyData = FBCommon.GetFBLineIpyData(mapID, lineID)
|
| | | if PlayerControl.CheckMoveToFB(curPlayer, mapID, lineID, fbIpyData, fbLineIpyData, tick) != ShareDefine.EntFBAskRet_OK:
|
| | | StartCustomSceneResult(curPlayer, mapID, lineID, 0)
|
| | | return 0
|
| | | |
| | | PlayerControl.SetPlayerSightLevel(curPlayer, curPlayer.GetID())
|
| | | |
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomScene, 1) # ç±äºå端ä¸ä¸å®æåmapIDï¼æä»¥è¿éé¢å¤è®°å½è¿ä¸ªç¶æï¼ä¸è½ç´æ¥ç¨mapID夿
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomSceneStepTick, tick)
|
| | | PlayerControl.SetCustomMap(curPlayer, mapID, lineID)
|
| | | NPCCommon.ClearPriWoodPile(curPlayer)
|
| | | GameWorld.Log("ç©å®¶å¼å§èªå®ä¹åºæ¯!mapID=%s,lineID=%s" % (mapID, lineID), playerID)
|
| | | if mapID:
|
| | | PetControl.DoLogic_PetLoadMapOK(curPlayer)
|
| | | FBLogic.OnEnterCustomScene(curPlayer, mapID, lineID)
|
| | | |
| | | #é»è®¤å满è¡
|
| | | if GameObj.GetHP(curPlayer) < GameObj.GetMaxHP(curPlayer):
|
| | | GameObj.SetHPFull(curPlayer)
|
| | | |
| | | #éç¥è¿å
¥ç¶æ
|
| | | StartCustomSceneResult(curPlayer, mapID, lineID, 1)
|
| | | return 1
|
| | |
|
| | | def StartCustomSceneResult(curPlayer, mapID, lineID, result):
|
| | | if result != 1:
|
| | | DoExitCustomScene(curPlayer)
|
| | | resultPack = ChPyNetSendPack.tagMCStartCustomSceneResult()
|
| | | resultPack.MapID = mapID
|
| | | resultPack.FuncLineID = lineID
|
| | | resultPack.Result = result
|
| | | NetPackCommon.SendFakePack(curPlayer, resultPack)
|
| | | return
|
| | |
|
| | | def DoExitCustomScene(curPlayer):
|
| | | ## éåºèªå®ä¹åºæ¯ç¶æ
|
| | | PlayerControl.SetPlayerSightLevel(curPlayer, 0)
|
| | | mapID = PlayerControl.GetCustomMapID(curPlayer)
|
| | | lineID = PlayerControl.GetCustomLineID(curPlayer)
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomScene, 0)
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomSceneStepTick, 0)
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomSceneGrade, 0)
|
| | | PlayerControl.SetCustomMap(curPlayer, 0, 0)
|
| | | if mapID and FBCommon.GetCustomMapStep(curPlayer, mapID, lineID) != ChConfig.CustomMapStep_Over:
|
| | | FBCommon.SetCustomMapStep(curPlayer, mapID, lineID, ChConfig.CustomMapStep_Over)
|
| | | NPCCommon.ClearPriWoodPile(curPlayer)
|
| | | |
| | | #é»è®¤å满è¡
|
| | | if GameObj.GetHP(curPlayer) > 0 and curPlayer.GetPlayerAction() != IPY_GameWorld.paDie and GameObj.GetHP(curPlayer) < GameObj.GetMaxHP(curPlayer):
|
| | | GameObj.SetHPFull(curPlayer)
|
| | | |
| | | GameWorld.Log("ç©å®¶éåºèªå®ä¹åºæ¯!", curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | | #// B1 08 å¿«éä¸é®è¿å
³å¯æ¬ #tagCMFBQuickPass
|
| | |
| | | if not curPlayer.GetInitOK():
|
| | | return
|
| | |
|
| | | customMapID = PlayerControl.GetCustomMapID(curPlayer)
|
| | | if customMapID:
|
| | | ipyMapData = IpyGameDataPY.GetIpyGameData("ChinMap", customMapID)
|
| | | if not ipyMapData or not ipyMapData.GetCanRide():
|
| | | PlayerControl.NotifyCode(curPlayer, "RideLimit_lhs_0")
|
| | | return
|
| | | else:
|
| | | #å°å¾ä¸å
许éªé©¬ RideLimit_lhs_0
|
| | | if not GameWorld.GetMap().GetMapCanRide():
|
| | | PlayerControl.NotifyCode(curPlayer, "RideLimit_lhs_0")
|
| | | return
|
| | | #å°å¾ä¸å
许éªé©¬ RideLimit_lhs_0
|
| | | if not GameWorld.GetMap().GetMapCanRide():
|
| | | PlayerControl.NotifyCode(curPlayer, "RideLimit_lhs_0")
|
| | | return
|
| | |
|
| | | #æ£æ¥ç©å®¶ç¶æ,åªæå¨ç©ºé²ç¶ææè½ä¸é©¬
|
| | | if curPlayer.GetPlayerVehicle() != IPY_GameWorld.pvNull :
|
| | |
| | | #å夿éªè¯
|
| | | #PlayerAutoCheckOnline.HackDefense(curPlayer, tick)
|
| | |
|
| | | #坿¬ç¸å
³æ¶é´å¤ç
|
| | | #PlayerFB.DoPlayerFBTimeProcess(curPlayer, tick)
|
| | | |
| | | #æ¶ææ»å»æ¶é´å¤ç
|
| | | #AttackCommon.ProcessMaliciousAttackPlayer(curPlayer, tick)
|
| | |
|
| | | #æ´»è·æ¾ç½®
|
| | | #PlayerActivity.ProcessActivityPlace(curPlayer)
|
| | | #èªå®ä¹åºæ¯
|
| | | #FBLogic.OnCustomSceneProcess(curPlayer, tick)
|
| | | #ç¼å¨
|
| | | #PlayerActLianqi.OnProcess(curPlayer)
|
| | | #ä»çæ»åæ
|
| | |
| | | return
|
| | | curPlayer.SetDict(ChConfig.Def_PDict_BossStateTick, 0)
|
| | | PlayerControl.SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_BossState, 0)
|
| | | return
|
| | | |
| | | def ProcessAreaExp(curPlayer, tick):
|
| | | ##ç»åºæ¯ç»éª
|
| | | if GameWorld.IsCrossServer():
|
| | | return
|
| | | if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
|
| | | return
|
| | | crossMapID = PlayerControl.GetCrossMapID(curPlayer)
|
| | | mapID = crossMapID if crossMapID else GameWorld.GetMap().GetMapID()
|
| | | if not FBLogic.OnCanGetAreaExp(curPlayer, mapID):
|
| | | return
|
| | | neutralMapExpAwardDict = IpyGameDataPY.GetFuncEvalCfg('NeutralMapExpAward', 1, {})
|
| | | expAwardInfo = GameWorld.GetDictValueByKey(neutralMapExpAwardDict, mapID)
|
| | | if not expAwardInfo:
|
| | | return
|
| | | if len(expAwardInfo) != 2:
|
| | | return
|
| | | secondCD, expFormula = expAwardInfo
|
| | | lastTick = curPlayer.GetDictByKey(ChConfig.Def_PDict_MapAreaExpTick)
|
| | | if not lastTick:
|
| | | curPlayer.SetDict(ChConfig.Def_PDict_MapAreaExpTick, tick)
|
| | | return
|
| | | if tick - lastTick < secondCD:
|
| | | return
|
| | | curPlayer.SetDict(ChConfig.Def_PDict_MapAreaExpTick, tick)
|
| | | |
| | | reExp = PlayerControl.GetPlayerReExp(curPlayer)
|
| | | reLV = curPlayer.GetLV()
|
| | | worldLV = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
|
| | | addExp = eval(FormulaControl.GetCompileFormula('NeutralMapExpAward%s'%mapID, expFormula))
|
| | | PlayerControl.PlayerControl(curPlayer).AddExp(addExp, ShareDefine.Def_ViewExpType_SysEx)
|
| | | return
|
| | |
| | | if GameObj.GetHP(curPlayer) <= 0:
|
| | | return
|
| | |
|
| | | if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
|
| | | #GameWorld.DebugLog("èªå®ä¹åºæ¯ä¸ï¼ä¸æ£æ¥!")
|
| | | return True
|
| | | |
| | | #===========================================================================
|
| | | # if curPlayer.IsMoving():
|
| | | # GameWorld.DebugLog("ç§»å¨ä¸ä¸å¯ä½¿ç¨æè½")
|