| #!/usr/bin/python  | 
| # -*- coding: GBK -*-  | 
| #-------------------------------------------------------------------------------  | 
| #  | 
| ##@package   | 
| #  | 
| # @todo:¶ÁÈ¡PY±í  | 
| # @author hxp  | 
| # @date 2018-05-10  | 
| # @version 1.0  | 
| #  | 
| # ÏêϸÃèÊö: ¶ÁÈ¡PY±í  | 
| #  | 
| #-------------------------------------------------------------------------------  | 
| #"""Version = 2018-05-10 12:00"""  | 
| #-------------------------------------------------------------------------------  | 
|   | 
| import FormulaControl  | 
| import ChConfig  | 
| import LogUI  | 
|   | 
| import hashlib  | 
| import os  | 
|   | 
| '''±í½á¹¹¶¨Òå×Öµä  | 
| {  | 
|     ±íÃû:(  | 
|         (×Ö¶ÎÀàÐÍ, ×Ö¶ÎÃû, ÊÇ·ñ²éѯË÷Òý),   | 
|         ...  | 
|         ),  | 
|     ...  | 
| }  | 
| '''  | 
| Def_IpyTable = {  | 
|                 "FuncConfig":(  | 
|                         ("char", "Key", 1),  | 
|                         ("char", "Numerical1", 0),  | 
|                         ("char", "Numerical2", 0),  | 
|                         ("char", "Numerical3", 0),  | 
|                         ("char", "Numerical4", 0),  | 
|                         ("char", "Numerical5", 0),  | 
|                         ),  | 
|   | 
|                 "WorldLV":(  | 
|                         ("WORD", "WorldLV", 1),  | 
|                         ("DWORD", "OpenServerSecond", 0),  | 
|                         ),  | 
|   | 
|                 "Family":(  | 
|                         ("BYTE", "FamilyLV", 1),  | 
|                         ("WORD", "MemberCnt", 0),  | 
|                         ("BYTE", "DeputyLeaderCnt", 0),  | 
|                         ("BYTE", "EliteCnt", 0),  | 
|                         ("DWORD", "NeedMoney", 0),  | 
|                         ("DWORD", "WeekMissionMoneyMax", 0),  | 
|                         ("BYTE", "BossFBCnt", 0),  | 
|                         ),  | 
|   | 
|                 "MarketQuery":(  | 
|                         ("WORD", "QueryType", 1),  | 
|                         ("dict", "LimitInfo", 0),  | 
|                         ),  | 
|   | 
|                 "ActionControl":(  | 
|                         ("WORD", "ID", 1),  | 
|                         ("char", "Mark", 0),  | 
|                         ("char", "Data", 0),  | 
|                         ("WORD", "LVLimit", 0),  | 
|                         ("char", "OpenDate", 0),  | 
|                         ("char", "CloseDate", 0),  | 
|                         ("char", "ValidOpenServerDay", 0),  | 
|                         ("char", "ValidMixServerDay", 0),  | 
|                         ("char", "VaildWeek", 0),  | 
|                         ("char", "OpenTime", 0),  | 
|                         ("char", "CloseTime", 0),  | 
|                         ("BYTE", "TimeValidType", 0),  | 
|                         ("char", "SpecTimeState", 0),  | 
|                         ("char", "NotifyInfo", 0),  | 
|                         ),  | 
|   | 
|                 "DailyAction":(  | 
|                         ("DWORD", "DailyID", 1),  | 
|                         ("dict", "OpenTimeDict", 0),  | 
|                         ("DWORD", "Duration", 0),  | 
|                         ("dict", "NotifyInfo", 0),  | 
|                         ),  | 
|   | 
|                 "DailyActionCustom":(  | 
|                         ("DWORD", "ID", 0),  | 
|                         ("BYTE", "OpenServerWeek", 1),  | 
|                         ("DWORD", "OpenServerDay", 0),  | 
|                         ("BYTE", "DailyID", 0),  | 
|                         ("list", "OpenTimeList", 0),  | 
|                         ("DWORD", "Duration", 0),  | 
|                         ("dict", "NotifyInfo", 0),  | 
|                         ),  | 
|   | 
|                 "FBStateTime":(  | 
|                         ("DWORD", "ID", 1),  | 
|                         ("DWORD", "DataMapID", 0),  | 
|                         ("BYTE", "StartWeekday", 0),  | 
|                         ("BYTE", "StartHour", 0),  | 
|                         ("BYTE", "StartMinute", 0),  | 
|                         ("BYTE", "EndHour", 0),  | 
|                         ("BYTE", "EndMinute", 0),  | 
|                         ("BYTE", "CanEnter", 0),  | 
|                         ("BYTE", "StateValue", 0),  | 
|                         ("dict", "NotifyInfoDict", 0),  | 
|                         ),  | 
|   | 
|                 "FBStateTimeCustom":(  | 
|                         ("DWORD", "ID", 0),  | 
|                         ("BYTE", "OpenServerWeek", 1),  | 
|                         ("DWORD", "OpenServerDay", 0),  | 
|                         ("DWORD", "DataMapID", 0),  | 
|                         ("BYTE", "StartHour", 0),  | 
|                         ("BYTE", "StartMinute", 0),  | 
|                         ("BYTE", "EndHour", 0),  | 
|                         ("BYTE", "EndMinute", 0),  | 
|                         ("BYTE", "CanEnter", 0),  | 
|                         ("BYTE", "StateValue", 0),  | 
|                         ("dict", "NotifyInfoDict", 0),  | 
|                         ),  | 
|   | 
|                 "FBLine":(  | 
|                         ("DWORD", "DataMapID", 1),  | 
|                         ("BYTE", "LineID", 1),  | 
|                         ("DWORD", "MapID", 0),  | 
|                         ),  | 
|   | 
|                 "ChinMap":(  | 
|                         ("DWORD", "MapID", 1),  | 
|                         ("char", "MapName", 0),  | 
|                         ("BYTE", "MapFBType", 0),  | 
|                         ("BYTE", "TeamLimit", 0),  | 
|                         ),  | 
|   | 
|                 "BOSSInfo":(  | 
|                         ("DWORD", "NPCID", 1),  | 
|                         ("DWORD", "MapID", 0),  | 
|                         ("char", "RefreshTime", 0),  | 
|                         ("list", "LVLimit", 0),  | 
|                         ("BYTE", "DiffPer", 0),  | 
|                         ("BYTE", "NoUpdataCnt", 0),  | 
|                         ("DWORD", "StoneNPCID", 0),  | 
|                         ("WORD", "RebornPreNotifyTime", 0),  | 
|                         ("char", "SourceName", 0),  | 
|                         ),  | 
|   | 
|                 "QuestionBank":(  | 
|                         ("DWORD", "ID", 1),  | 
|                         ("char", "Answer", 0),  | 
|                         ),  | 
|   | 
|                 "FamilyRedPack":(  | 
|                         ("WORD", "ID", 1),  | 
|                         ("WORD", "GetType", 0),  | 
|                         ("WORD", "MoneyNum", 0),  | 
|                         ("BYTE", "MoneyType", 0),  | 
|                         ("BYTE", "PacketCnt", 0),  | 
|                         ("BYTE", "LeaderOwn", 0),  | 
|                         ),  | 
|   | 
|                 "FuncOpenLV":(  | 
|                         ("DWORD", "FuncId", 1),  | 
|                         ("DWORD", "LimitLV", 0),  | 
|                         ("DWORD", "LimitMagicWeapon", 0),  | 
|                         ("WORD", "LimiRealmLV", 0),  | 
|                         ),  | 
|   | 
|                 "ChinNPC":(  | 
|                         ("DWORD", "NPCID", 1),  | 
|                         ("char", "NPCName", 0),  | 
|                         ("WORD", "LV", 0),  | 
|                         ),  | 
|   | 
|                 "PlayerLV":(  | 
|                         ("WORD", "LV", 1),  | 
|                         ("DWORD", "ReFightPower", 0),  | 
|                         ),  | 
|   | 
|                 "ActSpringSale":(  | 
|                         ("DWORD", "CfgID", 1),  | 
|                         ("char", "ActMark", 0),  | 
|                         ("list", "ServerIDList", 0),  | 
|                         ("char", "StartDate", 0),  | 
|                         ("char", "EndDate", 0),  | 
|                         ("list", "StartTimeList", 0),  | 
|                         ("list", "EndTimeList", 0),  | 
|                         ("WORD", "AdvanceMinutes", 0),  | 
|                         ("dict", "NotifyInfoStart", 0),  | 
|                         ("dict", "NotifyInfoEnd", 0),  | 
|                         ("list", "NotifyInfoLoop", 0),  | 
|                         ("WORD", "LVLimit", 0),  | 
|                         ("BYTE", "IsDayReset", 0),  | 
|                         ),  | 
|   | 
|                 "ActFlashGiftbag":(  | 
|                         ("DWORD", "CfgID", 1),  | 
|                         ("char", "ActMark", 0),  | 
|                         ("list", "ServerIDList", 0),  | 
|                         ("char", "StartDate", 0),  | 
|                         ("char", "EndDate", 0),  | 
|                         ("list", "StartTimeList", 0),  | 
|                         ("list", "EndTimeList", 0),  | 
|                         ("WORD", "AdvanceMinutes", 0),  | 
|                         ("dict", "NotifyInfoStart", 0),  | 
|                         ("dict", "NotifyInfoEnd", 0),  | 
|                         ("list", "NotifyInfoLoop", 0),  | 
|                         ("WORD", "LVLimit", 0),  | 
|                         ("BYTE", "IsDayReset", 0),  | 
|                         ),  | 
|   | 
|                 "ActExpRate":(  | 
|                         ("DWORD", "CfgID", 1),  | 
|                         ("char", "ActMark", 0),  | 
|                         ("list", "ServerIDList", 0),  | 
|                         ("char", "StartDate", 0),  | 
|                         ("char", "EndDate", 0),  | 
|                         ("list", "StartTimeList", 0),  | 
|                         ("list", "EndTimeList", 0),  | 
|                         ("dict", "NotifyInfoStart", 0),  | 
|                         ("dict", "NotifyInfoEnd", 0),  | 
|                         ("list", "NotifyInfoLoop", 0),  | 
|                         ("WORD", "LVLimit", 0),  | 
|                         ("DWORD", "AddExpRate", 0),  | 
|                         ),  | 
|   | 
|                 "ActCostRebate":(  | 
|                         ("DWORD", "CfgID", 1),  | 
|                         ("char", "ActMark", 0),  | 
|                         ("list", "ServerIDList", 0),  | 
|                         ("char", "StartDate", 0),  | 
|                         ("char", "EndDate", 0),  | 
|                         ("dict", "NotifyInfoStart", 0),  | 
|                         ("dict", "NotifyInfoEnd", 0),  | 
|                         ("list", "NotifyInfoLoop", 0),  | 
|                         ("BYTE", "IsDayReset", 0),  | 
|                         ),  | 
|   | 
|                 "ActBossReborn":(  | 
|                         ("DWORD", "CfgID", 1),  | 
|                         ("char", "ActMark", 0),  | 
|                         ("list", "ServerIDList", 0),  | 
|                         ("char", "StartDate", 0),  | 
|                         ("char", "EndDate", 0),  | 
|                         ("BYTE", "ResetType", 0),  | 
|                         ("dict", "NotifyInfoStart", 0),  | 
|                         ("dict", "NotifyInfoEnd", 0),  | 
|                         ("WORD", "LVLimit", 0),  | 
|                         ("BYTE", "TemplateID", 0),  | 
|                         ),  | 
|   | 
|                 "ActFairyCeremony":(  | 
|                         ("DWORD", "CfgID", 1),  | 
|                         ("char", "ActMark", 0),  | 
|                         ("list", "ServerIDList", 0),  | 
|                         ("char", "StartDate", 0),  | 
|                         ("char", "EndDate", 0),  | 
|                         ("BYTE", "ResetType", 0),  | 
|                         ("dict", "NotifyInfoStart", 0),  | 
|                         ("dict", "NotifyInfoEnd", 0),  | 
|                         ("WORD", "LVLimit", 0),  | 
|                         ),  | 
|   | 
|                 "UniquenessArrive":(  | 
|                         ("BYTE", "WorldLvNum", 1),  | 
|                         ("DWORD", "Rank", 1),  | 
|                         ("dict", "Award", 0),  | 
|                         ),  | 
|   | 
|                 "ActRealmPoint":(  | 
|                         ("DWORD", "CfgID", 1),  | 
|                         ("char", "ActMark", 0),  | 
|                         ("list", "ServerIDList", 0),  | 
|                         ("char", "StartDate", 0),  | 
|                         ("char", "EndDate", 0),  | 
|                         ("BYTE", "ResetType", 0),  | 
|                         ("dict", "NotifyInfoStart", 0),  | 
|                         ("dict", "NotifyInfoEnd", 0),  | 
|                         ("WORD", "Multiple", 0),  | 
|                         ("WORD", "LVLimit", 0),  | 
|                         ),  | 
|   | 
|                 "ActFlashSale":(  | 
|                         ("DWORD", "CfgID", 1),  | 
|                         ("char", "ActMark", 0),  | 
|                         ("list", "ServerIDList", 0),  | 
|                         ("char", "StartDate", 0),  | 
|                         ("char", "EndDate", 0),  | 
|                         ("list", "StartTimeList", 0),  | 
|                         ("list", "EndTimeList", 0),  | 
|                         ("WORD", "AdvanceMinutes", 0),  | 
|                         ("dict", "NotifyInfoStart", 0),  | 
|                         ("dict", "NotifyInfoEnd", 0),  | 
|                         ("list", "NotifyInfoLoop", 0),  | 
|                         ("WORD", "LVLimit", 0),  | 
|                         ("BYTE", "IsDayReset", 0),  | 
|                         ("list", "ShopTypeList", 0),  | 
|                         ),  | 
|   | 
|                 "Store":(  | 
|                         ("DWORD", "ID", 1),  | 
|                         ("DWORD", "ShopType", 0),  | 
|                         ("BYTE", "RefreshType", 0),  | 
|                         ("DWORD", "ServerLimitCnt", 0),  | 
|                         ),  | 
|   | 
|                 "ActWishingWell":(  | 
|                         ("DWORD", "CfgID", 1),  | 
|                         ("char", "ActMark", 0),  | 
|                         ("list", "ServerIDList", 0),  | 
|                         ("char", "StartDate", 0),  | 
|                         ("char", "EndDate", 0),  | 
|                         ("BYTE", "IsDayReset", 0),  | 
|                         ("BYTE", "ResetType", 0),  | 
|                         ("dict", "NotifyInfoStart", 0),  | 
|                         ("dict", "NotifyInfoEnd", 0),  | 
|                         ("list", "NotifyInfoLoop", 0),  | 
|                         ("WORD", "LVLimit", 0),  | 
|                         ),  | 
|                 }  | 
|   | 
|   | 
| # ¹¦ÄÜÅäÖñí¸ñ | 
| class IPY_FuncConfig(): | 
|      | 
|     def __init__(self): | 
|         self.Key = ""  | 
|         self.Numerical1 = ""  | 
|         self.Numerical2 = ""  | 
|         self.Numerical3 = ""  | 
|         self.Numerical4 = ""  | 
|         self.Numerical5 = "" | 
|         return | 
|          | 
|     def GetKey(self): return self.Key # ±êʶ  | 
|     def GetNumerical1(self): return self.Numerical1 # Êý¾Ý1  | 
|     def GetNumerical2(self): return self.Numerical2 # Êý¾Ý2  | 
|     def GetNumerical3(self): return self.Numerical3 # Êý¾Ý3  | 
|     def GetNumerical4(self): return self.Numerical4 # Êý¾Ý4  | 
|     def GetNumerical5(self): return self.Numerical5 # Êý¾Ý5 | 
|   | 
| # ÊÀ½çµÈ¼¶±í¸ñ | 
| class IPY_WorldLV(): | 
|      | 
|     def __init__(self): | 
|         self.WorldLV = 0  | 
|         self.OpenServerSecond = 0 | 
|         return | 
|          | 
|     def GetWorldLV(self): return self.WorldLV # ÊÀ½çµÈ¼¶  | 
|     def GetOpenServerSecond(self): return self.OpenServerSecond # ¿ª·þʱ¼äÃë | 
|   | 
| # ÏÉÃ˱í¸ñ | 
| class IPY_Family(): | 
|      | 
|     def __init__(self): | 
|         self.FamilyLV = 0  | 
|         self.MemberCnt = 0  | 
|         self.DeputyLeaderCnt = 0  | 
|         self.EliteCnt = 0  | 
|         self.NeedMoney = 0  | 
|         self.WeekMissionMoneyMax = 0  | 
|         self.BossFBCnt = 0 | 
|         return | 
|          | 
|     def GetFamilyLV(self): return self.FamilyLV # ÏÉÃ˵ȼ¶  | 
|     def GetMemberCnt(self): return self.MemberCnt # ³ÉÔ±ÊýÁ¿  | 
|     def GetDeputyLeaderCnt(self): return self.DeputyLeaderCnt # ¸±ÃËÖ÷ÊýÁ¿  | 
|     def GetEliteCnt(self): return self.EliteCnt # ¾«Ó¢ÊýÁ¿  | 
|     def GetNeedMoney(self): return self.NeedMoney # Éý¼¶ÐèÒª×ʽð  | 
|     def GetWeekMissionMoneyMax(self): return self.WeekMissionMoneyMax # Ã¿ÖÜÈÎÎñ×î´ó¿É»ñµÃÏÉÃË×ʽð  | 
|     def GetBossFBCnt(self): return self.BossFBCnt # BOSS¸±±¾´ÎÊý | 
|   | 
| # ¼¯Êвéѯ±í | 
| class IPY_MarketQuery(): | 
|      | 
|     def __init__(self): | 
|         self.QueryType = 0  | 
|         self.LimitInfo = {} | 
|         return | 
|          | 
|     def GetQueryType(self): return self.QueryType # ²éѯÀàÐÍ  | 
|     def GetLimitInfo(self): return self.LimitInfo # ÏÞÖÆÌõ¼þ | 
|   | 
| # ÔËÓª»î¶¯±í | 
| class IPY_ActionControl(): | 
|      | 
|     def __init__(self): | 
|         self.ID = 0  | 
|         self.Mark = ""  | 
|         self.Data = ""  | 
|         self.LVLimit = 0  | 
|         self.OpenDate = ""  | 
|         self.CloseDate = ""  | 
|         self.ValidOpenServerDay = ""  | 
|         self.ValidMixServerDay = ""  | 
|         self.VaildWeek = ""  | 
|         self.OpenTime = ""  | 
|         self.CloseTime = ""  | 
|         self.TimeValidType = 0  | 
|         self.SpecTimeState = ""  | 
|         self.NotifyInfo = "" | 
|         return | 
|          | 
|     def GetID(self): return self.ID # »î¶¯ID  | 
|     def GetMark(self): return self.Mark # »î¶¯ÀàÐͱê¼Ç  | 
|     def GetData(self): return self.Data # »î¶¯Êý¾Ý  | 
|     def GetLVLimit(self): return self.LVLimit # ÏÞÖÆµÈ¼¶  | 
|     def GetOpenDate(self): return self.OpenDate # ¿ªÆôÈÕÆÚ  | 
|     def GetCloseDate(self): return self.CloseDate # ½áÊøÈÕÆÚ  | 
|     def GetValidOpenServerDay(self): return self.ValidOpenServerDay # ÓÐЧ¿ª·þÌì, ÓëºÏ·þÌì¡¢ÐÇÆÚ»¥³â  | 
|     def GetValidMixServerDay(self): return self.ValidMixServerDay # ÓÐЧºÏ·þÌì, Ó뿪·þÌì¡¢ÐÇÆÚ»¥³â  | 
|     def GetVaildWeek(self): return self.VaildWeek # ÓÐЧÐÇÆÚ, Ó뿪·þÌì¡¢ºÏ·þÌ컥³â  | 
|     def GetOpenTime(self): return self.OpenTime # ¿ªÆôʱ¼ä  | 
|     def GetCloseTime(self): return self.CloseTime # ½áÊøÊ±¼ä  | 
|     def GetTimeValidType(self): return self.TimeValidType # Ê±¼äÓÐЧÐÔ  | 
|     def GetSpecTimeState(self): return self.SpecTimeState # ÌØÊâ»î¶¯×´Ì¬Ê±¼ä¿ØÖÆÐÅÏ¢  | 
|     def GetNotifyInfo(self): return self.NotifyInfo # È«·þ¹ã²¥ÐÅÏ¢ÅäÖà | 
|   | 
| # ÈÕ³£»î¶¯±í | 
| class IPY_DailyAction(): | 
|      | 
|     def __init__(self): | 
|         self.DailyID = 0  | 
|         self.OpenTimeDict = {}  | 
|         self.Duration = 0  | 
|         self.NotifyInfo = {} | 
|         return | 
|          | 
|     def GetDailyID(self): return self.DailyID # »î¶¯ID  | 
|     def GetOpenTimeDict(self): return self.OpenTimeDict # ¿ªÆôʱ¼ä  | 
|     def GetDuration(self): return self.Duration # ³ÖÐøÊ±¼ä, 0Ϊ²»ÏÞÖÆ  | 
|     def GetNotifyInfo(self): return self.NotifyInfo # ¹ã²¥ÌáʾÐÅÏ¢ | 
|   | 
| # ÈÕ³£»î¶¯±í¶¨ÖƱí | 
| class IPY_DailyActionCustom(): | 
|      | 
|     def __init__(self): | 
|         self.ID = 0  | 
|         self.OpenServerWeek = 0  | 
|         self.OpenServerDay = 0  | 
|         self.DailyID = 0  | 
|         self.OpenTimeList = []  | 
|         self.Duration = 0  | 
|         self.NotifyInfo = {} | 
|         return | 
|          | 
|     def GetID(self): return self.ID # ID  | 
|     def GetOpenServerWeek(self): return self.OpenServerWeek # ¿ª·þÊÇÖܼ¸  | 
|     def GetOpenServerDay(self): return self.OpenServerDay # ¿ª·þµÚ¼¸Ìì  | 
|     def GetDailyID(self): return self.DailyID # ÈÕ³£»î¶¯ID  | 
|     def GetOpenTimeList(self): return self.OpenTimeList # ¿ªÆôʱ¼äÁÐ±í  | 
|     def GetDuration(self): return self.Duration # ³ÖÐøÊ±¼ä, 0Ϊ²»ÏÞÖÆ  | 
|     def GetNotifyInfo(self): return self.NotifyInfo # ¹ã²¥ÌáʾÐÅÏ¢ | 
|   | 
| # ¸±±¾×´Ì¬Ê±¼ä±í | 
| class IPY_FBStateTime(): | 
|      | 
|     def __init__(self): | 
|         self.ID = 0  | 
|         self.DataMapID = 0  | 
|         self.StartWeekday = 0  | 
|         self.StartHour = 0  | 
|         self.StartMinute = 0  | 
|         self.EndHour = 0  | 
|         self.EndMinute = 0  | 
|         self.CanEnter = 0  | 
|         self.StateValue = 0  | 
|         self.NotifyInfoDict = {} | 
|         return | 
|          | 
|     def GetID(self): return self.ID # ID  | 
|     def GetDataMapID(self): return self.DataMapID # ËùÊôµÄÍæ·¨Êý¾ÝµØÍ¼ID  | 
|     def GetStartWeekday(self): return self.StartWeekday # ¿ªÊ¼ÐÇÆÚ  | 
|     def GetStartHour(self): return self.StartHour # ¿ªÊ¼Ê±  | 
|     def GetStartMinute(self): return self.StartMinute # ¿ªÊ¼·Ö  | 
|     def GetEndHour(self): return self.EndHour # ½áÊøÊ±  | 
|     def GetEndMinute(self): return self.EndMinute # ½áÊø·Ö  | 
|     def GetCanEnter(self): return self.CanEnter # ÊÇ·ñ¿É½øÈ븱±¾  | 
|     def GetStateValue(self): return self.StateValue # ×´Ì¬Öµ  | 
|     def GetNotifyInfoDict(self): return self.NotifyInfoDict # ¹ã²¥ÌáʾÐÅÏ¢ | 
|   | 
| # ¸±±¾×´Ì¬Ê±¼ä¶¨ÖƱí | 
| class IPY_FBStateTimeCustom(): | 
|      | 
|     def __init__(self): | 
|         self.ID = 0  | 
|         self.OpenServerWeek = 0  | 
|         self.OpenServerDay = 0  | 
|         self.DataMapID = 0  | 
|         self.StartHour = 0  | 
|         self.StartMinute = 0  | 
|         self.EndHour = 0  | 
|         self.EndMinute = 0  | 
|         self.CanEnter = 0  | 
|         self.StateValue = 0  | 
|         self.NotifyInfoDict = {} | 
|         return | 
|          | 
|     def GetID(self): return self.ID # ID  | 
|     def GetOpenServerWeek(self): return self.OpenServerWeek # ¿ª·þÊÇÖܼ¸  | 
|     def GetOpenServerDay(self): return self.OpenServerDay # ¿ª·þµÚ¼¸Ìì  | 
|     def GetDataMapID(self): return self.DataMapID # ËùÊôµÄÍæ·¨Êý¾ÝµØÍ¼ID  | 
|     def GetStartHour(self): return self.StartHour # ¿ªÊ¼Ê±  | 
|     def GetStartMinute(self): return self.StartMinute # ¿ªÊ¼·Ö  | 
|     def GetEndHour(self): return self.EndHour # ½áÊøÊ±  | 
|     def GetEndMinute(self): return self.EndMinute # ½áÊø·Ö  | 
|     def GetCanEnter(self): return self.CanEnter # ÊÇ·ñ¿É½øÈ븱±¾  | 
|     def GetStateValue(self): return self.StateValue # ×´Ì¬Öµ  | 
|     def GetNotifyInfoDict(self): return self.NotifyInfoDict # ¹ã²¥ÌáʾÐÅÏ¢ | 
|   | 
| # ¸±±¾¹¦ÄÜÏß·±í | 
| class IPY_FBLine(): | 
|      | 
|     def __init__(self): | 
|         self.DataMapID = 0  | 
|         self.LineID = 0  | 
|         self.MapID = 0 | 
|         return | 
|          | 
|     def GetDataMapID(self): return self.DataMapID # Êý¾ÝµØÍ¼ID  | 
|     def GetLineID(self): return self.LineID # ¹¦ÄÜÏß·ID  | 
|     def GetMapID(self): return self.MapID # ³¡¾°µØÍ¼ID | 
|   | 
| # µØÍ¼±í | 
| class IPY_ChinMap(): | 
|      | 
|     def __init__(self): | 
|         self.MapID = 0  | 
|         self.MapName = ""  | 
|         self.MapFBType = 0  | 
|         self.TeamLimit = 0 | 
|         return | 
|          | 
|     def GetMapID(self): return self.MapID # µØÍ¼ID  | 
|     def GetMapName(self): return self.MapName # µØÍ¼Ãû  | 
|     def GetMapFBType(self): return self.MapFBType #  µØÍ¼ÀàÐÍ  | 
|     def GetTeamLimit(self): return self.TeamLimit #  ¶ÓÎéÏÞÖÆÀàÐÍ£»0²»ÏÞ£¬1-²»¿É±ä¸ü£¬2-²»¿É´æÔÚ¶ÓÎé | 
|   | 
| # BOSSÐÅÏ¢±í | 
| class IPY_BOSSInfo(): | 
|      | 
|     def __init__(self): | 
|         self.NPCID = 0  | 
|         self.MapID = 0  | 
|         self.RefreshTime = ""  | 
|         self.LVLimit = []  | 
|         self.DiffPer = 0  | 
|         self.NoUpdataCnt = 0  | 
|         self.StoneNPCID = 0  | 
|         self.RebornPreNotifyTime = 0  | 
|         self.SourceName = "" | 
|         return | 
|          | 
|     def GetNPCID(self): return self.NPCID # ID  | 
|     def GetMapID(self): return self.MapID # µØÍ¼ID  | 
|     def GetRefreshTime(self): return self.RefreshTime # Ë¢ÐÂʱ¼ä ²ÎÊý onlineCnt  | 
|     def GetLVLimit(self): return self.LVLimit # ÔÚÏßÈËÎïµÈ¼¶·¶Î§  | 
|     def GetDiffPer(self): return self.DiffPer # °Ù·Ö±ÈÓë֮ǰµÄÎó²îСÓÚX%,Ôò¸üÐÂʵʱÔÚÏßÊýÁ¿  | 
|     def GetNoUpdataCnt(self): return self.NoUpdataCnt # ¶àÉÙ´Îδ¸üÐÂʵʱÔÚÏßÊýÁ¿×Ö¶ÎÊ±Ç¿ÖÆ¸üР | 
|     def GetStoneNPCID(self): return self.StoneNPCID # Ä¹±®NPCID  | 
|     def GetRebornPreNotifyTime(self): return self.RebornPreNotifyTime # ¸´»îǰXÃë֪ͨ  | 
|     def GetSourceName(self): return self.SourceName # BOSSÀ´Ô´ | 
|   | 
| # Ñç»áÌâ¿â±í | 
| class IPY_QuestionBank(): | 
|      | 
|     def __init__(self): | 
|         self.ID = 0  | 
|         self.Answer = "" | 
|         return | 
|          | 
|     def GetID(self): return self.ID # ID  | 
|     def GetAnswer(self): return self.Answer # ´ð°¸ | 
|   | 
| # ÏÉÃ˺ì°ü±í | 
| class IPY_FamilyRedPack(): | 
|      | 
|     def __init__(self): | 
|         self.ID = 0  | 
|         self.GetType = 0  | 
|         self.MoneyNum = 0  | 
|         self.MoneyType = 0  | 
|         self.PacketCnt = 0  | 
|         self.LeaderOwn = 0 | 
|         return | 
|          | 
|     def GetID(self): return self.ID # ID  | 
|     def GetGetType(self): return self.GetType # »ñµÃ;¾¶  | 
|     def GetMoneyNum(self): return self.MoneyNum # ºì°ü¶î¶È  | 
|     def GetMoneyType(self): return self.MoneyType # ½ðÇ®ÀàÐÍ  | 
|     def GetPacketCnt(self): return self.PacketCnt # ºì°ü¸öÊý  | 
|     def GetLeaderOwn(self): return self.LeaderOwn # ÊÇ·ñ¹éÊôÃËÖ÷ | 
|   | 
| # µÈ¼¶¿ªÆô¹¦ÄÜ | 
| class IPY_FuncOpenLV(): | 
|      | 
|     def __init__(self): | 
|         self.FuncId = 0  | 
|         self.LimitLV = 0  | 
|         self.LimitMagicWeapon = 0  | 
|         self.LimiRealmLV = 0 | 
|         return | 
|          | 
|     def GetFuncId(self): return self.FuncId # ¹¦Äܱêʶ  | 
|     def GetLimitLV(self): return self.LimitLV # ¿ªÆôµÈ¼¶  | 
|     def GetLimitMagicWeapon(self): return self.LimitMagicWeapon # ÐèÒª½âËø·¨±¦ID  | 
|     def GetLimiRealmLV(self): return self.LimiRealmLV # ÐèÒª¾³½çµÈ¼¶ | 
|   | 
| # NPC±í | 
| class IPY_ChinNPC(): | 
|      | 
|     def __init__(self): | 
|         self.NPCID = 0  | 
|         self.NPCName = ""  | 
|         self.LV = 0 | 
|         return | 
|          | 
|     def GetNPCID(self): return self.NPCID  | 
|     def GetNPCName(self): return self.NPCName  | 
|     def GetLV(self): return self.LV | 
|   | 
| # Íæ¼ÒµÈ¼¶±í | 
| class IPY_PlayerLV(): | 
|      | 
|     def __init__(self): | 
|         self.LV = 0  | 
|         self.ReFightPower = 0 | 
|         return | 
|          | 
|     def GetLV(self): return self.LV # Íæ¼ÒµÈ¼¶  | 
|     def GetReFightPower(self): return self.ReFightPower # Õ½¶·Á¦ | 
|   | 
| # ÏÞÊ±ÌØ»Ý±í | 
| class IPY_ActSpringSale(): | 
|      | 
|     def __init__(self): | 
|         self.CfgID = 0  | 
|         self.ActMark = ""  | 
|         self.ServerIDList = []  | 
|         self.StartDate = ""  | 
|         self.EndDate = ""  | 
|         self.StartTimeList = []  | 
|         self.EndTimeList = []  | 
|         self.AdvanceMinutes = 0  | 
|         self.NotifyInfoStart = {}  | 
|         self.NotifyInfoEnd = {}  | 
|         self.NotifyInfoLoop = []  | 
|         self.LVLimit = 0  | 
|         self.IsDayReset = 0 | 
|         return | 
|          | 
|     def GetCfgID(self): return self.CfgID # ÅäÖÃID  | 
|     def GetActMark(self): return self.ActMark # »î¶¯×é±ê¼Ç  | 
|     def GetServerIDList(self): return self.ServerIDList # ·þÎñÆ÷IDÁÐ±í  | 
|     def GetStartDate(self): return self.StartDate # ¿ªÆôÈÕÆÚ  | 
|     def GetEndDate(self): return self.EndDate # ½áÊøÈÕÆÚ  | 
|     def GetStartTimeList(self): return self.StartTimeList # ¿ªÆôʱ¼äÁбí, Ö§³Ö¶à¸öʱ¶Î  | 
|     def GetEndTimeList(self): return self.EndTimeList # ½áÊøÊ±¼äÁбí, Ö§³Ö¶à¸öʱ¶Î  | 
|     def GetAdvanceMinutes(self): return self.AdvanceMinutes # Ç°¶ËÌáǰX·ÖÖÓչʾ»î¶¯  | 
|     def GetNotifyInfoStart(self): return self.NotifyInfoStart # È«·þÌáʾÐÅÏ¢ - Ïà¶Ô¿ªÊ¼Ê±¼ä  | 
|     def GetNotifyInfoEnd(self): return self.NotifyInfoEnd # È«·þÌáʾÐÅÏ¢ - Ïà¶Ô½áÊøÊ±¼ä  | 
|     def GetNotifyInfoLoop(self): return self.NotifyInfoLoop # È«·þÌáʾÐÅÏ¢ - Ñ»·¹ã²¥[¼ä¸ô·ÖÖÓ, ¹ã²¥key]  | 
|     def GetLVLimit(self): return self.LVLimit # ÏÞÖÆµÈ¼¶  | 
|     def GetIsDayReset(self): return self.IsDayReset # ÊÇ·ñÿÌìÖØÖà | 
|   | 
| # ÏÞʱÀñ°ü±í | 
| class IPY_ActFlashGiftbag(): | 
|      | 
|     def __init__(self): | 
|         self.CfgID = 0  | 
|         self.ActMark = ""  | 
|         self.ServerIDList = []  | 
|         self.StartDate = ""  | 
|         self.EndDate = ""  | 
|         self.StartTimeList = []  | 
|         self.EndTimeList = []  | 
|         self.AdvanceMinutes = 0  | 
|         self.NotifyInfoStart = {}  | 
|         self.NotifyInfoEnd = {}  | 
|         self.NotifyInfoLoop = []  | 
|         self.LVLimit = 0  | 
|         self.IsDayReset = 0 | 
|         return | 
|          | 
|     def GetCfgID(self): return self.CfgID # ÅäÖÃID  | 
|     def GetActMark(self): return self.ActMark # »î¶¯×é±ê¼Ç  | 
|     def GetServerIDList(self): return self.ServerIDList # ·þÎñÆ÷IDÁÐ±í  | 
|     def GetStartDate(self): return self.StartDate # ¿ªÆôÈÕÆÚ  | 
|     def GetEndDate(self): return self.EndDate # ½áÊøÈÕÆÚ  | 
|     def GetStartTimeList(self): return self.StartTimeList # ¿ªÆôʱ¼äÁбí, Ö§³Ö¶à¸öʱ¶Î  | 
|     def GetEndTimeList(self): return self.EndTimeList # ½áÊøÊ±¼äÁбí, Ö§³Ö¶à¸öʱ¶Î  | 
|     def GetAdvanceMinutes(self): return self.AdvanceMinutes # Ç°¶ËÌáǰX·ÖÖÓչʾ»î¶¯  | 
|     def GetNotifyInfoStart(self): return self.NotifyInfoStart # È«·þÌáʾÐÅÏ¢ - Ïà¶Ô¿ªÊ¼Ê±¼ä  | 
|     def GetNotifyInfoEnd(self): return self.NotifyInfoEnd # È«·þÌáʾÐÅÏ¢ - Ïà¶Ô½áÊøÊ±¼ä  | 
|     def GetNotifyInfoLoop(self): return self.NotifyInfoLoop # È«·þÌáʾÐÅÏ¢ - Ñ»·¹ã²¥[¼ä¸ô·ÖÖÓ, ¹ã²¥key]  | 
|     def GetLVLimit(self): return self.LVLimit # ÏÞÖÆµÈ¼¶  | 
|     def GetIsDayReset(self): return self.IsDayReset # ÊÇ·ñÿÌìÖØÖà | 
|   | 
| # Ë«±¶¾Ñé»î¶¯±í | 
| class IPY_ActExpRate(): | 
|      | 
|     def __init__(self): | 
|         self.CfgID = 0  | 
|         self.ActMark = ""  | 
|         self.ServerIDList = []  | 
|         self.StartDate = ""  | 
|         self.EndDate = ""  | 
|         self.StartTimeList = []  | 
|         self.EndTimeList = []  | 
|         self.NotifyInfoStart = {}  | 
|         self.NotifyInfoEnd = {}  | 
|         self.NotifyInfoLoop = []  | 
|         self.LVLimit = 0  | 
|         self.AddExpRate = 0 | 
|         return | 
|          | 
|     def GetCfgID(self): return self.CfgID # ÅäÖÃID  | 
|     def GetActMark(self): return self.ActMark # »î¶¯×é±ê¼Ç  | 
|     def GetServerIDList(self): return self.ServerIDList # ·þÎñÆ÷IDÁÐ±í  | 
|     def GetStartDate(self): return self.StartDate # ¿ªÆôÈÕÆÚ  | 
|     def GetEndDate(self): return self.EndDate # ½áÊøÈÕÆÚ  | 
|     def GetStartTimeList(self): return self.StartTimeList # ¿ªÆôʱ¼äÁбí, Ö§³Ö¶à¸öʱ¶Î  | 
|     def GetEndTimeList(self): return self.EndTimeList # ½áÊøÊ±¼äÁбí, Ö§³Ö¶à¸öʱ¶Î  | 
|     def GetNotifyInfoStart(self): return self.NotifyInfoStart # È«·þÌáʾÐÅÏ¢ - Ïà¶Ô¿ªÊ¼Ê±¼ä  | 
|     def GetNotifyInfoEnd(self): return self.NotifyInfoEnd # È«·þÌáʾÐÅÏ¢ - Ïà¶Ô½áÊøÊ±¼ä  | 
|     def GetNotifyInfoLoop(self): return self.NotifyInfoLoop # È«·þÌáʾÐÅÏ¢ - Ñ»·¹ã²¥[¼ä¸ô·ÖÖÓ, ¹ã²¥key, [¿ÉÑ¡²ÎÊý1, ...]]  | 
|     def GetLVLimit(self): return self.LVLimit # ÏÞÖÆµÈ¼¶  | 
|     def GetAddExpRate(self): return self.AddExpRate # ¾Ñé±¶Âʼӳɣ¬Íò·ÖÂÊ | 
|   | 
| # Ïû·Ñ·µÀû»î¶¯±í | 
| class IPY_ActCostRebate(): | 
|      | 
|     def __init__(self): | 
|         self.CfgID = 0  | 
|         self.ActMark = ""  | 
|         self.ServerIDList = []  | 
|         self.StartDate = ""  | 
|         self.EndDate = ""  | 
|         self.NotifyInfoStart = {}  | 
|         self.NotifyInfoEnd = {}  | 
|         self.NotifyInfoLoop = []  | 
|         self.IsDayReset = 0 | 
|         return | 
|          | 
|     def GetCfgID(self): return self.CfgID # ÅäÖÃID  | 
|     def GetActMark(self): return self.ActMark # »î¶¯×é±ê¼Ç  | 
|     def GetServerIDList(self): return self.ServerIDList # ·þÎñÆ÷IDÁÐ±í  | 
|     def GetStartDate(self): return self.StartDate # ¿ªÆôÈÕÆÚ  | 
|     def GetEndDate(self): return self.EndDate # ½áÊøÈÕÆÚ  | 
|     def GetNotifyInfoStart(self): return self.NotifyInfoStart # È«·þÌáʾÐÅÏ¢ - Ïà¶Ô¿ªÊ¼Ê±¼ä  | 
|     def GetNotifyInfoEnd(self): return self.NotifyInfoEnd # È«·þÌáʾÐÅÏ¢ - Ïà¶Ô½áÊøÊ±¼ä  | 
|     def GetNotifyInfoLoop(self): return self.NotifyInfoLoop # È«·þÌáʾÐÅÏ¢ - Ñ»·¹ã²¥[¼ä¸ô·ÖÖÓ, ¹ã²¥key]  | 
|     def GetIsDayReset(self): return self.IsDayReset # ÊÇ·ñÿÌìÖØÖà | 
|   | 
| # BOSS¸´»î»î¶¯Ê±¼ä±í | 
| class IPY_ActBossReborn(): | 
|      | 
|     def __init__(self): | 
|         self.CfgID = 0  | 
|         self.ActMark = ""  | 
|         self.ServerIDList = []  | 
|         self.StartDate = ""  | 
|         self.EndDate = ""  | 
|         self.ResetType = 0  | 
|         self.NotifyInfoStart = {}  | 
|         self.NotifyInfoEnd = {}  | 
|         self.LVLimit = 0  | 
|         self.TemplateID = 0 | 
|         return | 
|          | 
|     def GetCfgID(self): return self.CfgID # ÅäÖÃID  | 
|     def GetActMark(self): return self.ActMark # »î¶¯×é±ê¼Ç  | 
|     def GetServerIDList(self): return self.ServerIDList # ·þÎñÆ÷IDÁÐ±í  | 
|     def GetStartDate(self): return self.StartDate # ¿ªÆôÈÕÆÚ  | 
|     def GetEndDate(self): return self.EndDate # ½áÊøÈÕÆÚ  | 
|     def GetResetType(self): return self.ResetType # ÖØÖÃÀàÐÍ£¬0-0µãÖØÖã»1-5µãÖØÖà  | 
|     def GetNotifyInfoStart(self): return self.NotifyInfoStart # È«·þÌáʾÐÅÏ¢ - Ïà¶Ô¿ªÊ¼Ê±¼ä  | 
|     def GetNotifyInfoEnd(self): return self.NotifyInfoEnd # È«·þÌáʾÐÅÏ¢ - Ïà¶Ô½áÊøÊ±¼ä  | 
|     def GetLVLimit(self): return self.LVLimit # ÏÞÖÆµÈ¼¶  | 
|     def GetTemplateID(self): return self.TemplateID # Ä£°å±àºÅ | 
|   | 
| # ÏɽçÊ¢µä»î¶¯Ê±¼ä±í | 
| class IPY_ActFairyCeremony(): | 
|      | 
|     def __init__(self): | 
|         self.CfgID = 0  | 
|         self.ActMark = ""  | 
|         self.ServerIDList = []  | 
|         self.StartDate = ""  | 
|         self.EndDate = ""  | 
|         self.ResetType = 0  | 
|         self.NotifyInfoStart = {}  | 
|         self.NotifyInfoEnd = {}  | 
|         self.LVLimit = 0 | 
|         return | 
|          | 
|     def GetCfgID(self): return self.CfgID # ÅäÖÃID  | 
|     def GetActMark(self): return self.ActMark # »î¶¯×é±ê¼Ç  | 
|     def GetServerIDList(self): return self.ServerIDList # ·þÎñÆ÷IDÁÐ±í  | 
|     def GetStartDate(self): return self.StartDate # ¿ªÆôÈÕÆÚ  | 
|     def GetEndDate(self): return self.EndDate # ½áÊøÈÕÆÚ  | 
|     def GetResetType(self): return self.ResetType # ÖØÖÃÀàÐÍ£¬0-0µãÖØÖã»1-5µãÖØÖà  | 
|     def GetNotifyInfoStart(self): return self.NotifyInfoStart # È«·þÌáʾÐÅÏ¢ - Ïà¶Ô¿ªÊ¼Ê±¼ä  | 
|     def GetNotifyInfoEnd(self): return self.NotifyInfoEnd # È«·þÌáʾÐÅÏ¢ - Ïà¶Ô½áÊøÊ±¼ä  | 
|     def GetLVLimit(self): return self.LVLimit # ÏÞÖÆµÈ¼¶ | 
|   | 
| # ÏɽçÊ¢µä-¾ø°æ½µÁÙ±í | 
| class IPY_UniquenessArrive(): | 
|      | 
|     def __init__(self): | 
|         self.WorldLvNum = 0  | 
|         self.Rank = 0  | 
|         self.Award = {} | 
|         return | 
|          | 
|     def GetWorldLvNum(self): return self.WorldLvNum # ÊÀ½çµÈ¼¶µµ  | 
|     def GetRank(self): return self.Rank # ÅÅÃû  | 
|     def GetAward(self): return self.Award # ½±Àø {"Ö°Òµ":[[ÎïÆ·ID,¸öÊý,ÊÇ·ñ°ó¶¨],...], ...} | 
|   | 
| # ¶à±¶ÐÞÐеã»î¶¯Ê±¼ä±í | 
| class IPY_ActRealmPoint(): | 
|      | 
|     def __init__(self): | 
|         self.CfgID = 0  | 
|         self.ActMark = ""  | 
|         self.ServerIDList = []  | 
|         self.StartDate = ""  | 
|         self.EndDate = ""  | 
|         self.ResetType = 0  | 
|         self.NotifyInfoStart = {}  | 
|         self.NotifyInfoEnd = {}  | 
|         self.Multiple = 0  | 
|         self.LVLimit = 0 | 
|         return | 
|          | 
|     def GetCfgID(self): return self.CfgID # ÅäÖÃID  | 
|     def GetActMark(self): return self.ActMark # »î¶¯×é±ê¼Ç  | 
|     def GetServerIDList(self): return self.ServerIDList # ·þÎñÆ÷IDÁÐ±í  | 
|     def GetStartDate(self): return self.StartDate # ¿ªÆôÈÕÆÚ  | 
|     def GetEndDate(self): return self.EndDate # ½áÊøÈÕÆÚ  | 
|     def GetResetType(self): return self.ResetType # ÖØÖÃÀàÐÍ£¬0-0µãÖØÖã»1-5µãÖØÖà  | 
|     def GetNotifyInfoStart(self): return self.NotifyInfoStart # È«·þÌáʾÐÅÏ¢ - Ïà¶Ô¿ªÊ¼Ê±¼ä  | 
|     def GetNotifyInfoEnd(self): return self.NotifyInfoEnd # È«·þÌáʾÐÅÏ¢ - Ïà¶Ô½áÊøÊ±¼ä  | 
|     def GetMultiple(self): return self.Multiple # ±¶Êý  | 
|     def GetLVLimit(self): return self.LVLimit # ÏÞÖÆµÈ¼¶ | 
|   | 
| # ÏÞʱÇÀ¹º±í | 
| class IPY_ActFlashSale(): | 
|      | 
|     def __init__(self): | 
|         self.CfgID = 0  | 
|         self.ActMark = ""  | 
|         self.ServerIDList = []  | 
|         self.StartDate = ""  | 
|         self.EndDate = ""  | 
|         self.StartTimeList = []  | 
|         self.EndTimeList = []  | 
|         self.AdvanceMinutes = 0  | 
|         self.NotifyInfoStart = {}  | 
|         self.NotifyInfoEnd = {}  | 
|         self.NotifyInfoLoop = []  | 
|         self.LVLimit = 0  | 
|         self.IsDayReset = 0  | 
|         self.ShopTypeList = [] | 
|         return | 
|          | 
|     def GetCfgID(self): return self.CfgID # ÅäÖÃID  | 
|     def GetActMark(self): return self.ActMark # »î¶¯×é±ê¼Ç  | 
|     def GetServerIDList(self): return self.ServerIDList # ·þÎñÆ÷IDÁÐ±í  | 
|     def GetStartDate(self): return self.StartDate # ¿ªÆôÈÕÆÚ  | 
|     def GetEndDate(self): return self.EndDate # ½áÊøÈÕÆÚ  | 
|     def GetStartTimeList(self): return self.StartTimeList # ¿ªÆôʱ¼äÁбí, Ö§³Ö¶à¸öʱ¶Î  | 
|     def GetEndTimeList(self): return self.EndTimeList # ½áÊøÊ±¼äÁбí, Ö§³Ö¶à¸öʱ¶Î  | 
|     def GetAdvanceMinutes(self): return self.AdvanceMinutes # Ç°¶ËÌáǰX·ÖÖÓչʾ»î¶¯  | 
|     def GetNotifyInfoStart(self): return self.NotifyInfoStart # È«·þÌáʾÐÅÏ¢ - Ïà¶Ô¿ªÊ¼Ê±¼ä  | 
|     def GetNotifyInfoEnd(self): return self.NotifyInfoEnd # È«·þÌáʾÐÅÏ¢ - Ïà¶Ô½áÊøÊ±¼ä  | 
|     def GetNotifyInfoLoop(self): return self.NotifyInfoLoop # È«·þÌáʾÐÅÏ¢ - Ñ»·¹ã²¥[¼ä¸ô·ÖÖÓ, ¹ã²¥key]  | 
|     def GetLVLimit(self): return self.LVLimit # ÏÞÖÆµÈ¼¶  | 
|     def GetIsDayReset(self): return self.IsDayReset # ÊÇ·ñÿÌìÖØÖà  | 
|     def GetShopTypeList(self): return self.ShopTypeList # É̵êÀàÐÍÁбí | 
|   | 
| # É̳DZí | 
| class IPY_Store(): | 
|      | 
|     def __init__(self): | 
|         self.ID = 0  | 
|         self.ShopType = 0  | 
|         self.RefreshType = 0  | 
|         self.ServerLimitCnt = 0 | 
|         return | 
|          | 
|     def GetID(self): return self.ID # ID  | 
|     def GetShopType(self): return self.ShopType # É̵êÀàÐÍ  | 
|     def GetRefreshType(self): return self.RefreshType # Ë¢ÐÂÀàÐÍ 0-²»ÖØÖÃ,1-onWeek0µã,2-onWeek5µã,3-OnDay0µã,4-OnDay5µã  | 
|     def GetServerLimitCnt(self): return self.ServerLimitCnt # È«·þÏÞÖÆÊýÁ¿ | 
|   | 
| # ÐíÔ¸³Ø»î¶¯Ê±¼ä±í | 
| class IPY_ActWishingWell(): | 
|      | 
|     def __init__(self): | 
|         self.CfgID = 0  | 
|         self.ActMark = ""  | 
|         self.ServerIDList = []  | 
|         self.StartDate = ""  | 
|         self.EndDate = ""  | 
|         self.IsDayReset = 0  | 
|         self.ResetType = 0  | 
|         self.NotifyInfoStart = {}  | 
|         self.NotifyInfoEnd = {}  | 
|         self.NotifyInfoLoop = []  | 
|         self.LVLimit = 0 | 
|         return | 
|          | 
|     def GetCfgID(self): return self.CfgID # ÅäÖÃID  | 
|     def GetActMark(self): return self.ActMark # »î¶¯×é±ê¼Ç  | 
|     def GetServerIDList(self): return self.ServerIDList # ·þÎñÆ÷IDÁÐ±í  | 
|     def GetStartDate(self): return self.StartDate # ¿ªÆôÈÕÆÚ  | 
|     def GetEndDate(self): return self.EndDate # ½áÊøÈÕÆÚ  | 
|     def GetIsDayReset(self): return self.IsDayReset # ÊÇ·ñÿÌìÖØÖà  | 
|     def GetResetType(self): return self.ResetType # ÖØÖÃÀàÐÍ£¬0-0µãÖØÖã»1-5µãÖØÖà  | 
|     def GetNotifyInfoStart(self): return self.NotifyInfoStart # È«·þÌáʾÐÅÏ¢ - Ïà¶Ô¿ªÊ¼Ê±¼ä  | 
|     def GetNotifyInfoEnd(self): return self.NotifyInfoEnd # È«·þÌáʾÐÅÏ¢ - Ïà¶Ô½áÊøÊ±¼ä  | 
|     def GetNotifyInfoLoop(self): return self.NotifyInfoLoop # È«·þÌáʾÐÅÏ¢ - Ñ»·¹ã²¥[¼ä¸ô·ÖÖÓ, ¹ã²¥key]  | 
|     def GetLVLimit(self): return self.LVLimit # ÏÞÖÆµÈ¼¶ | 
|   | 
|   | 
| def Log(msg, playerID=0, par=0):  | 
|     LogUI.Msg("%s\t%s\t%s" % (par, playerID, msg))  | 
|     return  | 
|       | 
| def ErrLog(msg, playerID=0, par=0):  | 
|     LogUI.Msg("%s\t%s\t###Error:%s" % (par, playerID, msg))  | 
|     return  | 
|       | 
| ## PY±íÊý¾Ý¹ÜÀíÀà  | 
| class IPY_DataMgr():  | 
|       | 
|     def __init__(self):  | 
|         self.fileMD5Dict = {} # Êý¾Ý±íÎļþmd5×Öµä, ÓÃÓÚ¶Ô±ÈÎļþ²îÒìÅжÏÊÇ·ñÖØ¶Á {dtName:md5, ...}  | 
|         self.ipyConfigEx = {} # ×Ô¶¨ÒåÊý¾Ý»º´æ {key:configData, ...}  | 
|         self.ipyDataIndexMap = {} # Êý¾Ý±íË÷Òý²éѯ»º´æ {dtName:{args:[index, ...], ...}, ...}  | 
|         self.ipyDataIndexMapEx = {} # Êý¾Ý±í×Ô¶¨Òå²éѯÌõ¼þ²éѯ»º´æ {dtName_(findKey,...):{(findKeyValue, ...):[index, ...], ...}, ...}  | 
|         self.ipyFuncConfigDict = {} # ¹¦ÄÜÅäÖÃ±í»º´æ {key:IPY_FuncConfig, ...}  | 
|         self.IpyDataClear()  | 
|         return  | 
|       | 
|     def IpyDataClear(self):  | 
|         Log("IPY_DataMgr Init...")  | 
|         self.ipyConfigEx = {}  | 
|         self.ipyFuncConfigCache = self.__LoadFileData("FuncConfig", IPY_FuncConfig)  | 
|         self.ipyFuncConfigLen = len(self.ipyFuncConfigCache)  | 
|         self.ipyWorldLVCache = self.__LoadFileData("WorldLV", IPY_WorldLV)  | 
|         self.ipyWorldLVLen = len(self.ipyWorldLVCache)  | 
|         self.ipyFamilyCache = self.__LoadFileData("Family", IPY_Family)  | 
|         self.ipyFamilyLen = len(self.ipyFamilyCache)  | 
|         self.ipyMarketQueryCache = self.__LoadFileData("MarketQuery", IPY_MarketQuery)  | 
|         self.ipyMarketQueryLen = len(self.ipyMarketQueryCache)  | 
|         self.ipyActionControlCache = self.__LoadFileData("ActionControl", IPY_ActionControl)  | 
|         self.ipyActionControlLen = len(self.ipyActionControlCache)  | 
|         self.ipyDailyActionCache = self.__LoadFileData("DailyAction", IPY_DailyAction)  | 
|         self.ipyDailyActionLen = len(self.ipyDailyActionCache)  | 
|         self.ipyDailyActionCustomCache = self.__LoadFileData("DailyActionCustom", IPY_DailyActionCustom)  | 
|         self.ipyDailyActionCustomLen = len(self.ipyDailyActionCustomCache)  | 
|         self.ipyFBStateTimeCache = self.__LoadFileData("FBStateTime", IPY_FBStateTime)  | 
|         self.ipyFBStateTimeLen = len(self.ipyFBStateTimeCache)  | 
|         self.ipyFBStateTimeCustomCache = self.__LoadFileData("FBStateTimeCustom", IPY_FBStateTimeCustom)  | 
|         self.ipyFBStateTimeCustomLen = len(self.ipyFBStateTimeCustomCache)  | 
|         self.ipyFBLineCache = self.__LoadFileData("FBLine", IPY_FBLine)  | 
|         self.ipyFBLineLen = len(self.ipyFBLineCache)  | 
|         self.ipyChinMapCache = self.__LoadFileData("ChinMap", IPY_ChinMap)  | 
|         self.ipyChinMapLen = len(self.ipyChinMapCache)  | 
|         self.ipyBOSSInfoCache = self.__LoadFileData("BOSSInfo", IPY_BOSSInfo)  | 
|         self.ipyBOSSInfoLen = len(self.ipyBOSSInfoCache)  | 
|         self.ipyQuestionBankCache = self.__LoadFileData("QuestionBank", IPY_QuestionBank)  | 
|         self.ipyQuestionBankLen = len(self.ipyQuestionBankCache)  | 
|         self.ipyFamilyRedPackCache = self.__LoadFileData("FamilyRedPack", IPY_FamilyRedPack)  | 
|         self.ipyFamilyRedPackLen = len(self.ipyFamilyRedPackCache)  | 
|         self.ipyFuncOpenLVCache = self.__LoadFileData("FuncOpenLV", IPY_FuncOpenLV)  | 
|         self.ipyFuncOpenLVLen = len(self.ipyFuncOpenLVCache)  | 
|         self.ipyChinNPCCache = self.__LoadFileData("ChinNPC", IPY_ChinNPC)  | 
|         self.ipyChinNPCLen = len(self.ipyChinNPCCache)  | 
|         self.ipyPlayerLVCache = self.__LoadFileData("PlayerLV", IPY_PlayerLV)  | 
|         self.ipyPlayerLVLen = len(self.ipyPlayerLVCache)  | 
|         self.ipyActSpringSaleCache = self.__LoadFileData("ActSpringSale", IPY_ActSpringSale)  | 
|         self.ipyActSpringSaleLen = len(self.ipyActSpringSaleCache)  | 
|         self.ipyActFlashGiftbagCache = self.__LoadFileData("ActFlashGiftbag", IPY_ActFlashGiftbag)  | 
|         self.ipyActFlashGiftbagLen = len(self.ipyActFlashGiftbagCache)  | 
|         self.ipyActExpRateCache = self.__LoadFileData("ActExpRate", IPY_ActExpRate)  | 
|         self.ipyActExpRateLen = len(self.ipyActExpRateCache)  | 
|         self.ipyActCostRebateCache = self.__LoadFileData("ActCostRebate", IPY_ActCostRebate)  | 
|         self.ipyActCostRebateLen = len(self.ipyActCostRebateCache)  | 
|         self.ipyActBossRebornCache = self.__LoadFileData("ActBossReborn", IPY_ActBossReborn)  | 
|         self.ipyActBossRebornLen = len(self.ipyActBossRebornCache)  | 
|         self.ipyActFairyCeremonyCache = self.__LoadFileData("ActFairyCeremony", IPY_ActFairyCeremony)  | 
|         self.ipyActFairyCeremonyLen = len(self.ipyActFairyCeremonyCache)  | 
|         self.ipyUniquenessArriveCache = self.__LoadFileData("UniquenessArrive", IPY_UniquenessArrive)  | 
|         self.ipyUniquenessArriveLen = len(self.ipyUniquenessArriveCache)  | 
|         self.ipyActRealmPointCache = self.__LoadFileData("ActRealmPoint", IPY_ActRealmPoint)  | 
|         self.ipyActRealmPointLen = len(self.ipyActRealmPointCache)  | 
|         self.ipyActFlashSaleCache = self.__LoadFileData("ActFlashSale", IPY_ActFlashSale)  | 
|         self.ipyActFlashSaleLen = len(self.ipyActFlashSaleCache)  | 
|         self.ipyStoreCache = self.__LoadFileData("Store", IPY_Store)  | 
|         self.ipyStoreLen = len(self.ipyStoreCache)  | 
|         self.ipyActWishingWellCache = self.__LoadFileData("ActWishingWell", IPY_ActWishingWell)  | 
|         self.ipyActWishingWellLen = len(self.ipyActWishingWellCache)  | 
|         Log("IPY_FuncConfig count=%s" % len(self.ipyFuncConfigDict))  | 
|         Log("IPY_DataMgr InitOK!")  | 
|         return  | 
|       | 
|     def __LoadFileData(self, tableName, Class):  | 
|         curPath = ChConfig.GetAppPath() + "\\PySysDB\\tag" + tableName + ".txt"  | 
|         if not os.path.isfile(curPath):  | 
|             ErrLog("can not find file = %s,%s" % (tableName, curPath))  | 
|             raise Exception("can not find file = %s,%s" % (tableName, curPath))  | 
|           | 
|         fileObj = open(curPath, 'rb')  | 
|         content = fileObj.read()  | 
|         fileObj.close()  | 
|           | 
|         md5_obj = hashlib.md5()  | 
|         md5_obj.update(content)  | 
|         newMD5Code = md5_obj.hexdigest()  | 
|         if tableName in self.fileMD5Dict:  | 
|             oldMD5Code = self.fileMD5Dict[tableName]  | 
|             if newMD5Code == oldMD5Code:  | 
|                 return getattr(self, "ipy%sCache" % tableName)  | 
|               | 
|             if tableName in self.ipyDataIndexMap:  | 
|                 self.ipyDataIndexMap.pop(tableName)  | 
|             for dtName_Findkey in self.ipyDataIndexMapEx.keys():  | 
|                 findStr = "%s_" % tableName  | 
|                 if findStr in dtName_Findkey:  | 
|                     self.ipyDataIndexMapEx.pop(dtName_Findkey)  | 
|             if tableName == "FuncConfig":  | 
|                 self.ipyFuncConfigDict = {}  | 
|         self.fileMD5Dict[tableName] = newMD5Code  | 
|           | 
|         dataIndex = 0  | 
|         indexDict = {}  | 
|         cacheList = []  | 
|         fieldList = Def_IpyTable[tableName]  | 
|         infoList = content.split('\r\n')  | 
|         for line in xrange(len(infoList)):  | 
|             if line == 0:  | 
|                 continue  | 
|             if not infoList[line]:  | 
|                 #ErrLog("line not content! %s, line=%s" % (tableName, line))  | 
|                 continue  | 
|             rowList = infoList[line].split('\t')  | 
|             if len(fieldList) != len(rowList):  | 
|                 ErrLog("field count error!, %s, line=%s, len=%s,rowCount=%s" % (tableName, line, len(fieldList), len(rowList)))  | 
|                 raise Exception("field count error!, %s, line=%s, len=%s,rowCount=%s" % (tableName, line,len(fieldList), len(rowList)))  | 
|               | 
|             try:  | 
|                 indexKey = []  | 
|                 classObj = Class()  | 
|                 for j, value in enumerate(rowList):  | 
|                     fieldType, fieldName, isIndex = fieldList[j]  | 
|                     if fieldType == "char":  | 
|                         attrValue = value  | 
|                     elif fieldType == "dict":  | 
|                         attrValue = self.__StrToDict(value)  | 
|                     elif fieldType == "list":  | 
|                         attrValue = self.__StrToList(value)  | 
|                     elif fieldType == "eval":  | 
|                         attrValue = self.__StrToEval(value)  | 
|                     elif fieldType == "float":  | 
|                         attrValue = float(value)  | 
|                     else:  | 
|                         attrValue = 0 if not value.isdigit() else int(value)  | 
|                     setattr(classObj, "%s" % fieldName, attrValue)  | 
|                     if isIndex:  | 
|                         indexKey.append(attrValue)  | 
|                 cacheList.append(classObj)  | 
|                 indexKey = tuple(indexKey)  | 
|                 indexList = indexDict.get(indexKey, [])  | 
|                 indexList.append(dataIndex)  | 
|                 indexDict[indexKey] = indexList  | 
|                 dataIndex += 1  | 
|             except BaseException:  | 
|                 ErrLog("SetIpyDataError: tableName=%s,line=%s,fieldName=%s,fieldType=%s,value=%s" % (tableName, line, fieldName, fieldType, value))  | 
|                 raise  | 
|             if tableName == "FuncConfig":  | 
|                 self.__LoadFuncConfigData(fieldList, rowList)  | 
|         if tableName != "FuncConfig":  | 
|             self.ipyDataIndexMap[tableName] = indexDict  | 
|         Log("LoadIpydata: %s, content count=%s" % (tableName, len(cacheList)))  | 
|         return cacheList  | 
|       | 
|     def __LoadFuncConfigData(self, fieldList, rowList):  | 
|         funcConfigObj = IPY_FuncConfig()  | 
|         key = rowList[0]  | 
|         funcConfigObj.Key = key  | 
|         for i, strValue in enumerate(rowList):  | 
|             if i == 0:  | 
|                 continue  | 
|             try:  | 
|                 fieldName = fieldList[i][1]  | 
|                 strValue = strValue.lstrip().rstrip()  | 
|                 if strValue.isdigit():  | 
|                     configValue = int(strValue)  | 
|                 elif (strValue.startswith("{") and strValue.endswith("}")) \  | 
|                     or (strValue.startswith("[") and strValue.endswith("]")) \  | 
|                     or (strValue.startswith("(") and strValue.endswith(")")):  | 
|                     configValue = eval(strValue)  | 
|                 elif "_" in strValue and type(self.__StrToDict(strValue)) == dict:  | 
|                     configValue = self.__StrToDict(strValue)  | 
|                 elif ChConfig.Def_Str_Montant in strValue:  | 
|                     configValue = eval("(%s,)" % strValue.replace(ChConfig.Def_Str_Montant, ","))  | 
|                 elif strValue in ["-", ""]:  | 
|                     configValue = ""  | 
|                 else:  | 
|                     configValue = self.__ToFloat(strValue)  | 
|             except BaseException:  | 
|                 ErrLog("SetIpyDataError: tableName=%s,key=%s,i=%s,value=%s" % ("FuncConfig", key, i, strValue))  | 
|                 raise  | 
|             setattr(funcConfigObj, fieldName, configValue)  | 
|         self.ipyFuncConfigDict[key] = funcConfigObj  | 
|         return  | 
|       | 
|     def __ToFloat(self, strValue):  | 
|         try:  | 
|             value = float(strValue)  | 
|         except:  | 
|             return strValue  | 
|         return value  | 
|       | 
|     def __StrToEval(self, strValue):  | 
|         if not strValue or strValue in ["0", "-", ""]:  | 
|             return  | 
|         return eval(strValue)  | 
|       | 
|     def __StrToDict(self, strValue):  | 
|         setDict = {}  | 
|         if "{" in strValue and "}" in strValue:  | 
|             setDict = eval(strValue)  | 
|         elif strValue in ["0", "-", ""]:  | 
|             pass  | 
|         else:  | 
|             keyValueList = strValue.split(ChConfig.Def_Str_Montant)  | 
|             for keyValue in keyValueList:  | 
|                 if "_" not in keyValue:  | 
|                     continue  | 
|                 kv = keyValue.split("_")  | 
|                 if len(kv) != 2:  | 
|                     return  | 
|                 key, value = kv  | 
|                 if key.isdigit():  | 
|                     key = int(key)  | 
|                 if value.isdigit():  | 
|                     value = int(value)  | 
|                 setDict[key] = value  | 
|         return setDict  | 
|       | 
|     def __StrToList(self, strValue):  | 
|         setList = []  | 
|         if ("[" in strValue and "]" in strValue) or ("(" in strValue and ")" in strValue):  | 
|             setList = eval(strValue)  | 
|         elif strValue in ["0", "-", ""]:  | 
|             pass  | 
|         elif strValue.isdigit():  | 
|             setList = (int(strValue),)  | 
|         else:  | 
|             for value in strValue.split(ChConfig.Def_Str_Montant):  | 
|                 if value.isdigit():  | 
|                     value = int(value)  | 
|                 setList.append(value)  | 
|             if setList:  | 
|                 setList = tuple(setList)  | 
|         return setList  | 
|       | 
|     def GetFuncConfigCount(self): return self.ipyFuncConfigLen  | 
|     def GetFuncConfigByIndex(self, index): return self.ipyFuncConfigCache[index]  | 
|     def GetWorldLVCount(self): return self.ipyWorldLVLen  | 
|     def GetWorldLVByIndex(self, index): return self.ipyWorldLVCache[index]  | 
|     def GetFamilyCount(self): return self.ipyFamilyLen  | 
|     def GetFamilyByIndex(self, index): return self.ipyFamilyCache[index]  | 
|     def GetMarketQueryCount(self): return self.ipyMarketQueryLen  | 
|     def GetMarketQueryByIndex(self, index): return self.ipyMarketQueryCache[index]  | 
|     def GetActionControlCount(self): return self.ipyActionControlLen  | 
|     def GetActionControlByIndex(self, index): return self.ipyActionControlCache[index]  | 
|     def GetDailyActionCount(self): return self.ipyDailyActionLen  | 
|     def GetDailyActionByIndex(self, index): return self.ipyDailyActionCache[index]  | 
|     def GetDailyActionCustomCount(self): return self.ipyDailyActionCustomLen  | 
|     def GetDailyActionCustomByIndex(self, index): return self.ipyDailyActionCustomCache[index]  | 
|     def GetFBStateTimeCount(self): return self.ipyFBStateTimeLen  | 
|     def GetFBStateTimeByIndex(self, index): return self.ipyFBStateTimeCache[index]  | 
|     def GetFBStateTimeCustomCount(self): return self.ipyFBStateTimeCustomLen  | 
|     def GetFBStateTimeCustomByIndex(self, index): return self.ipyFBStateTimeCustomCache[index]  | 
|     def GetFBLineCount(self): return self.ipyFBLineLen  | 
|     def GetFBLineByIndex(self, index): return self.ipyFBLineCache[index]  | 
|     def GetChinMapCount(self): return self.ipyChinMapLen  | 
|     def GetChinMapByIndex(self, index): return self.ipyChinMapCache[index]  | 
|     def GetBOSSInfoCount(self): return self.ipyBOSSInfoLen  | 
|     def GetBOSSInfoByIndex(self, index): return self.ipyBOSSInfoCache[index]  | 
|     def GetQuestionBankCount(self): return self.ipyQuestionBankLen  | 
|     def GetQuestionBankByIndex(self, index): return self.ipyQuestionBankCache[index]  | 
|     def GetFamilyRedPackCount(self): return self.ipyFamilyRedPackLen  | 
|     def GetFamilyRedPackByIndex(self, index): return self.ipyFamilyRedPackCache[index]  | 
|     def GetFuncOpenLVCount(self): return self.ipyFuncOpenLVLen  | 
|     def GetFuncOpenLVByIndex(self, index): return self.ipyFuncOpenLVCache[index]  | 
|     def GetChinNPCCount(self): return self.ipyChinNPCLen  | 
|     def GetChinNPCByIndex(self, index): return self.ipyChinNPCCache[index]  | 
|     def GetPlayerLVCount(self): return self.ipyPlayerLVLen  | 
|     def GetPlayerLVByIndex(self, index): return self.ipyPlayerLVCache[index]  | 
|     def GetActSpringSaleCount(self): return self.ipyActSpringSaleLen  | 
|     def GetActSpringSaleByIndex(self, index): return self.ipyActSpringSaleCache[index]  | 
|     def GetActFlashGiftbagCount(self): return self.ipyActFlashGiftbagLen  | 
|     def GetActFlashGiftbagByIndex(self, index): return self.ipyActFlashGiftbagCache[index]  | 
|     def GetActExpRateCount(self): return self.ipyActExpRateLen  | 
|     def GetActExpRateByIndex(self, index): return self.ipyActExpRateCache[index]  | 
|     def GetActCostRebateCount(self): return self.ipyActCostRebateLen  | 
|     def GetActCostRebateByIndex(self, index): return self.ipyActCostRebateCache[index]  | 
|     def GetActBossRebornCount(self): return self.ipyActBossRebornLen  | 
|     def GetActBossRebornByIndex(self, index): return self.ipyActBossRebornCache[index]  | 
|     def GetActFairyCeremonyCount(self): return self.ipyActFairyCeremonyLen  | 
|     def GetActFairyCeremonyByIndex(self, index): return self.ipyActFairyCeremonyCache[index]  | 
|     def GetUniquenessArriveCount(self): return self.ipyUniquenessArriveLen  | 
|     def GetUniquenessArriveByIndex(self, index): return self.ipyUniquenessArriveCache[index]  | 
|     def GetActRealmPointCount(self): return self.ipyActRealmPointLen  | 
|     def GetActRealmPointByIndex(self, index): return self.ipyActRealmPointCache[index]  | 
|     def GetActFlashSaleCount(self): return self.ipyActFlashSaleLen  | 
|     def GetActFlashSaleByIndex(self, index): return self.ipyActFlashSaleCache[index]  | 
|     def GetStoreCount(self): return self.ipyStoreLen  | 
|     def GetStoreByIndex(self, index): return self.ipyStoreCache[index]  | 
|     def GetActWishingWellCount(self): return self.ipyActWishingWellLen  | 
|     def GetActWishingWellByIndex(self, index): return self.ipyActWishingWellCache[index]  | 
|   | 
| IPYData = IPY_DataMgr()  | 
| def IPY_Data(): return IPYData  | 
|   | 
| def GetConfigEx(key):  | 
|     '''»ñÈ¡×Ô¶¨Òåkey»º´æÊý¾Ý  | 
|     '''  | 
|     if key in IPYData.ipyConfigEx:  | 
|         return IPYData.ipyConfigEx[key]  | 
|     return  | 
| def SetConfigEx(key, configData):  | 
|     '''ÉèÖÃ×Ô¶¨Òåkey»º´æÊý¾Ý  | 
|     ÓÐЩ±íµÄÅäÖÃÄÚÈÝ¿ÉÄÜÔÚʵ¼Ê¹¦ÄÜʹÓÃÖÐÖ±½ÓʹÓñíÊý¾ÝµÄ»°»á±È½ÏÂé·³£¬±ÈÈçÿ´Î¶¼Òª±éÀú»ñȡһЩ±íÊý¾Ý  | 
|     Èç¹û¾¹ýÒ»²ãÊý¾Ýת»»ºóÔÙÀ´Ê¹ÓøÃÊý¾ÝµÄ»°»á¼ò»¯¹¦ÄÜÂß¼»òÌá¸ßЧÂÊ£¬Ôò¿ÉÒÔͨ¹ýº¯Êý±£´æÒ»Ð©×Ô¶¨ÒåµÄ»º´æÄÚÈÝ£¬·½±ã¹¦ÄÜʹÓà  | 
|     Ò²¿ÉÒÔÊÊÓÃÓÚÆäËû×Ô¶¨Ò建´æ´æ´¢  | 
|     '''  | 
|     IPYData.ipyConfigEx[key] = configData  | 
|     return configData  | 
|   | 
| def GetIpyGameData(dtName, *args):  | 
|     '''»ñÈ¡±íÊý¾Ý£¬ÊÊÓÃÓÚÊý¾ÝΨһµÄ£¬·µ»Øµ¥ÌõÊý¾ÝʵÀý  | 
|     @param dtName: ±íÃû£¬²»º¬tag  | 
|     @param args: ½¨±íʱÉèÖõÄË÷Òý×Ö¶Î˳Ðò¶ÔÓ¦µÄ²éѯֵ  | 
|     @return: ¶ÔÓ¦²éѯÌõ¼þµÄ ipyData Êý¾ÝʵÀý£¬Ö»·µ»Øµ¥¸öʵÀý  | 
|     @ʹÓÃ˵Ã÷: IpyGameDataPY.GetIpyGameData(±íÃû, Ë÷Òý1²éѯֵ, Ë÷Òý2²éѯֵ, ¡ )  | 
|     '''  | 
|     if dtName not in IPYData.ipyDataIndexMap:  | 
|         ErrLog("Can not found ipyData dtName=%s" % (dtName))  | 
|         return  | 
|     indexDict = IPYData.ipyDataIndexMap[dtName]  | 
|     if args not in indexDict:  | 
|         ErrLog("Can not found ipyData dtName=%s,indexValue=%s" % (dtName, args))  | 
|         return  | 
|     indexList = indexDict[args]  | 
|     return getattr(IPYData, "ipy%sCache" % dtName)[indexList[0]]  | 
|   | 
| def GetIpyGameDataList(dtName, *args):  | 
|     '''»ñÈ¡±íÊý¾Ý£¬ÊÊÓÃÓÚ²éѯ½á¹ûÓжàÌõÊý¾ÝµÄ  | 
|     @param dtName: ±íÃû£¬²»º¬tag  | 
|     @param args: ½¨±íʱÉèÖõÄË÷Òý×Ö¶Î˳Ðò¶ÔÓ¦µÄ²éѯֵ  | 
|     @return: ¶ÔÓ¦²éѯÌõ¼þµÄ ipyData Êý¾ÝʵÀýÁÐ±í  | 
|     @ʹÓÃ˵Ã÷: Óë GetIpyGameData º¯ÊýÏàͬ  | 
|     '''  | 
|     if dtName not in IPYData.ipyDataIndexMap:  | 
|         ErrLog("Can not found ipyDataList dtName=%s" % (dtName))  | 
|         return  | 
|     indexDict = IPYData.ipyDataIndexMap[dtName]  | 
|     if args not in indexDict:  | 
|         ErrLog("Can not found ipyDataList dtName=%s,indexValue=%s" % (dtName, args))  | 
|         return  | 
|     indexList = indexDict[args]  | 
|     dataCache = getattr(IPYData, "ipy%sCache" % dtName)  | 
|     return [dataCache[i] for i in indexList]  | 
|   | 
| def GetIpyGameDataNotLog(dtName, *args):  | 
|     '''Óë GetIpyGameData º¯ÊýÏàͬ, Ö»ÊÇÕÒ²»µ½Êý¾Ýʱ²»»áÊä³öÈÕÖ¾  | 
|     '''  | 
|     if dtName not in IPYData.ipyDataIndexMap:  | 
|         #ErrLog("Can not found ipyData dtName=%s" % (dtName))  | 
|         return  | 
|     indexDict = IPYData.ipyDataIndexMap[dtName]  | 
|     if args not in indexDict:  | 
|         #ErrLog("Can not found ipyData dtName=%s,indexValue=%s" % (dtName, args))  | 
|         return  | 
|     indexList = indexDict[args]  | 
|     return getattr(IPYData, "ipy%sCache" % dtName)[indexList[0]]  | 
|   | 
| def GetIpyGameDataListNotLog(dtName, *args):  | 
|     '''Óë GetIpyGameDataList º¯ÊýÏàͬ, Ö»ÊÇÕÒ²»µ½Êý¾Ýʱ²»»áÊä³öÈÕÖ¾  | 
|     '''  | 
|     if dtName not in IPYData.ipyDataIndexMap:  | 
|         #ErrLog("Can not found ipyDataList dtName=%s" % (dtName))  | 
|         return  | 
|     indexDict = IPYData.ipyDataIndexMap[dtName]  | 
|     if args not in indexDict:  | 
|         #ErrLog("Can not found ipyDataList dtName=%s,indexValue=%s" % (dtName, args))  | 
|         return  | 
|     indexList = indexDict[args]  | 
|     dataCache = getattr(IPYData, "ipy%sCache" % dtName)  | 
|     return [dataCache[i] for i in indexList]  | 
|   | 
| def GetIpyGameDataByCondition(dtName, keyDict={}, returnList=False, isLogNone=True):  | 
|     '''¸ù¾Ý×Ô¶¨Òå²éѯÌõ¼þ²éѯ±íÊý¾Ý£¬ÓÉÓÚĿǰֻ֧³Ö½¨Á¢Ò»×é²éѯË÷Òý£¬ËùÒÔʹÓÃÆäËû²éѯÌõ¼þ²é±íʱֻÄÜͨ¹ý¸Ãº¯Êý²éÕÒ  | 
|     @param dtName: ±íÃû£¬²»º¬tag  | 
|     @param keyDict: ²éѯÌõ¼þ×Öµä {²éѯ×Ö¶ÎÃû:²éѯֵ, ...}  | 
|     @param returnList: ÊÇ·ñÒÔÁбíµÄÐÎʽ·µ»Ø²éѯÊý¾Ý£¬Ä¬ÈÏ·ñ  | 
|     @param isLogNone: ÕÒ²»µ½Êý¾ÝʱÊÇ·ñÊý¾ÝÈÕÖ¾£¬Ä¬ÈÏÊÇ  | 
|     @return: ÕÒ²»µ½Êý¾Ýʱ·µ»Ø None£¬ÓÐÊý¾Ýʱ¸ù¾Ý²ÎÊýÊÇ·ñ·µ»ØÁÐ±í·µ»Ø¶ÔÓ¦µÄÊý¾ÝʵÀý»òÊý¾ÝʵÀýÁÐ±í  | 
|     '''  | 
|     fieldList = keyDict.keys()  | 
|     valueList = keyDict.values()  | 
|     findFieldKey = "%s_%s" % (dtName, fieldList)  | 
|     findValueKey = tuple(valueList)  | 
|       | 
|     cacheList = getattr(IPYData, "ipy%sCache" % dtName)  | 
|     if findFieldKey not in IPYData.ipyDataIndexMapEx:  | 
|         indexMapDict = {}  | 
|         for index, iData in enumerate(cacheList):  | 
|             valuekey = tuple([getattr(iData, "%s" % field) for field in fieldList])  | 
|             indexList = indexMapDict.get(valuekey, [])  | 
|             indexList.append(index)  | 
|             indexMapDict[valuekey] = indexList          | 
|         IPYData.ipyDataIndexMapEx[findFieldKey] = indexMapDict  | 
|           | 
|     indexMapDict = IPYData.ipyDataIndexMapEx[findFieldKey]  | 
|     if findValueKey not in indexMapDict:  | 
|         if isLogNone:  | 
|             ErrLog("GetIpyGameDataByCondition can not found data! %s %s" % (dtName, keyDict))  | 
|         return  | 
|     indexList = indexMapDict[findValueKey]  | 
|     if not returnList:  | 
|         return cacheList[indexList[0]]  | 
|     return [cacheList[index] for index in indexList]  | 
|   | 
| def GetFuncCfgIpyData(key):  | 
|     '''¶Á¹¦ÄÜÅäÖñíÅäÖÃʵÀý  | 
|     @param key: ÅäÖÃkey  | 
|     @return: Ö±½Ó·µ»Ø¸ÃÅäÖÃkey¶ÔÓ¦µÄÅäÖÃipyDataʵÀý  | 
|     '''  | 
|     if key not in IPYData.ipyFuncConfigDict:  | 
|         ErrLog("Can not found ipyData FuncConfig key=%s!" % key)  | 
|         return ""  | 
|     return IPYData.ipyFuncConfigDict[key]  | 
|   | 
| def GetFuncCfg(key, index=1):  | 
|     '''¶Á¹¦ÄÜÅäÖñíÅäÖÃרÓú¯Êý  | 
|     @param key: ÅäÖÃkey  | 
|     @param index: µÚ¼¸¸öÅäÖÃÖµ£¬Ö§³Ö1~5  | 
|     @return: Ö±½Ó·µ»Ø¶ÔÓ¦µÄÊý¾ÝÀàÐÍ int¡¢str£¬²»ÓÃÔÙÊÖ¶¯×ªint  | 
|     '''  | 
|     if key not in IPYData.ipyFuncConfigDict:  | 
|         ErrLog("Can not found ipyData FuncConfig key=%s!" % key)  | 
|         return ""  | 
|     cfgObj = IPYData.ipyFuncConfigDict[key]  | 
|     if index == 1:  | 
|         return cfgObj.Numerical1  | 
|     if index == 2:  | 
|         return cfgObj.Numerical2  | 
|     if index == 3:  | 
|         return cfgObj.Numerical3  | 
|     if index == 4:  | 
|         return cfgObj.Numerical4  | 
|     if index == 5:  | 
|         return cfgObj.Numerical5  | 
|     ErrLog("Can not found ipyData FuncConfig key=%s,index=%s!" % (key, index))  | 
|     return ""  | 
|   | 
| def GetFuncEvalCfg(key, index=1, defaultValue=[]):  | 
|     '''¶ÁÈ¡¹¦ÄÜÅäÖñíÅäÖÃÁÐ±í¡¢×Öµä¸ñʽרÓú¯Êý  | 
|     @param key: ÅäÖÃkey  | 
|     @param index: µÚ¼¸¸öÅäÖÃÖµ£¬Ö§³Ö1~5  | 
|     @return: Ö±½Ó·µ»Ø¶ÔÓ¦µÄÊý¾ÝÀàÐÍ list¡¢dict¡¢tuple£¬²»ÓÃÔÙeval  | 
|       | 
|     ÓÉÓڲ߻®ÓÐ×Ô¶¨ÒåµÄÁбí½á¹¹ obj|¡ , µ±¸ÃÁбíÅäÖÃÖ»ÓÐÒ»¸öÔªËØÊ±£¬´ËʱÅäÖõÄÄÚÈÝΪµ¥¸öÊýÖµ£¬¼ÓÔØµÄÅäÖõÄʱºò´ËÌõÊý¾Ý»á±»×ªÎªintÐÍ  | 
|     ¹ÊʹÓøÃרÓú¯Êý·µ»ØÁбí½á¹¹£¬·½±ã¹¦ÄÜ¿ª·¢Ê±²»ÓÃÔÙ¿¼ÂÇÁбíΪintʱµÄÇé¿ö£»  | 
|     µ±È»Èç¹ûÅäÖõÄÄÚÈݱ¾Éí¾ÍΪpythonµÄÁÐ±í¡¢×Öµä½á¹¹µÄ»°¿ÉʹÓÃÉÏÃæµÄº¯Êý  | 
|     ²»¹ýΪÁËͳһ£¬½¨Ò鹦ÄÜÅäÖñí¶ÁÁÐ±í¡¢×Öµäʱ¶¼Ê¹Óøú¯Êý  | 
|     '''  | 
|     if key not in IPYData.ipyFuncConfigDict:  | 
|         ErrLog("Can not found ipyData FuncConfig key=%s!" % key)  | 
|         return defaultValue  | 
|     cfgObj = IPYData.ipyFuncConfigDict[key]  | 
|     if index == 1:  | 
|         curConfig = cfgObj.Numerical1  | 
|     elif index == 2:  | 
|         curConfig = cfgObj.Numerical2  | 
|     elif index == 3:  | 
|         curConfig = cfgObj.Numerical3  | 
|     elif index == 4:  | 
|         curConfig = cfgObj.Numerical4  | 
|     elif index == 5:  | 
|         curConfig = cfgObj.Numerical5  | 
|     else:  | 
|         ErrLog("Can not found ipyData FuncConfig key=%s,index=%s!" % (key, index))  | 
|         return defaultValue  | 
|     curType = type(curConfig)  | 
|     if curType in [list, tuple, dict]:  | 
|         return curConfig  | 
|     if curType == int:  | 
|         return [curConfig]  | 
|     return defaultValue  | 
|   | 
| def GetFuncCompileCfg(key, index=1):  | 
|     '''»ñÈ¡¹¦ÄÜÅäÖñíÒѱàÒë¹ýµÄ¹«Ê½  | 
|     @param key: ÅäÖÃkey  | 
|     @param index: µÚ¼¸¸öÅäÖÃÖµ£¬Ö§³Ö1~5  | 
|     @return: ·µ»ØÒѱàÒë¹ýµÄ¹«Ê½  | 
|     '''  | 
|     return FormulaControl.GetCompileFormula(key + str(index), str(GetFuncCfg(key, index)))  | 
|   | 
| def InterpolationSearch(dtName, keyName, keyValue, conditionDict={}):  | 
|     '''²éѯÌõ¼þÏÂÓë¶ÔÓ¦²éѯ×ֶβο¼ÖµÏà½üµÄÊý¾ÝʵÀý£»²Î¿¼ÖµÐ¡ÓÚÅäÖñí×îСֵʱ·µ»Ønone£¬´óÓÚ×î´óֵʱ·µ»Ø×î´óÖµ¶ÔÓ¦µÄʵÀý  | 
|     @param dtName: ±íÃû£¬²»º¬tag  | 
|     @param keyName: ²Î¿¼×Ö¶ÎÃû  | 
|     @param keyValue: ²Î¿¼×Ö¶ÎÖµ£¬´óÓÚµÈÓÚ×Ö¶Îֵʱ·µ»Ø¶ÔÓ¦Êý¾Ý  | 
|     @param conditionDict: ²éѯÌõ¼þ£¬{²éѯ×Ö¶ÎÃû:×Ö¶ÎÖµ, ...}  | 
|     @return: ÕÒ²»µ½Êý¾Ý·µ»Ø None £¬ ·ñÔò·µ»Ø¶ÔÓ¦µÄ ipyData Êý¾ÝʵÀý  | 
|     '''  | 
|     if not conditionDict:  | 
|         dataList = getattr(IPYData, "ipy%sCache" % dtName)  | 
|     else:  | 
|         dataList = GetIpyGameDataByCondition(dtName, conditionDict, True)  | 
|     if not dataList:  | 
|         return  | 
|       | 
|     low = 0  | 
|     lowData = dataList[0]  | 
|     lowValue = getattr(lowData, "%s" % keyName)  | 
|     if keyValue < lowValue:  | 
|         return  | 
|       | 
|     high = len(dataList) - 1  | 
|     highData = dataList[high]  | 
|     highValue = getattr(highData, "%s" % keyName)  | 
|     if keyValue >= highValue:  | 
|         return highData  | 
|       | 
|     near = low + int((high - low) * (keyValue - lowValue)/(highValue - lowValue))  | 
|       | 
|     nearData = dataList[near]  | 
|     nearValue = getattr(nearData, "%s" % keyName)  | 
|       | 
|     if keyValue < nearValue:  | 
|         for i in xrange(near - 1, low - 1, -1):  | 
|             nearData = dataList[i]  | 
|             nearValue = getattr(nearData, "%s" % keyName)  | 
|             if nearValue <= keyValue:  | 
|                 return nearData  | 
|               | 
|     elif keyValue > nearValue:  | 
|         for i in xrange(near + 1, high + 1):  | 
|             nearData = dataList[i]  | 
|             nearValue = getattr(nearData, "%s" % keyName)  | 
|             if nearValue > keyValue:  | 
|                 return dataList[i - 1]  | 
|               | 
|     return nearData  | 
|   |