| #!/usr/bin/python  | 
| # -*- coding: GBK -*-  | 
| #---------------------------------------------------------------------  | 
| #  | 
| #---------------------------------------------------------------------  | 
| ##@package GameServerRefresh  | 
| # @todo: GameServer·â°ü¹ÜÀíÆ÷  | 
| #  | 
| # @author: eggxp  | 
| # @date 2010-4-28  | 
| # @version 2.7  | 
| #  | 
| # @note: ½ÓÊÕGameServer·â°ü, Ö´ÐÐÂß¼   | 
| #  | 
| # @change: "2010-08-19 17:30" panwei °´¸ñʽ¹æ·¶µ÷Õû, ¹Ø±Õµ÷ÊÔÐÅÏ¢  | 
| # @change: "2010-12-27 17:10" panwei µØÍ¼±¶ÂʸüÐÂ֪ͨȫ·þÍæ¼Ò  | 
| # @change: "2011-01-09 18:00" panwei Ôª±¦½»Òׯ½Ì¨¹ýÆÚ¶©µ¥, Î´ÁìȡԪ±¦¶©µ¥ÐÂÔö»º´æ  | 
| # @change: "2011-06-21 16:00" panwei ÐÂÔöRouteServerInitOKº¯Êý´¦Àí, Èçδ³õʼ»¯²»¿ÉÇл»¸±±¾  | 
| # @change: "2011-06-30 17:00" panwei ÐÂÔö0405, GameServer_PlayerCoinToGold·â°ü´¦Àí  | 
| # @change: "2012-01-30 19:00" wdb µãȯ¶Ò»»Ôª±¦·â°üÔö¼ÓÔùË͵ãȯ×Ö¶Î  | 
| # @change: "2012-01-31 10:00" wdb ´«µÝ²ÎÊýÐÞ¸Ä  | 
| # @change: "2012-03-29 17:00" jiang ½ÇÉ«ÔÚGameServer³õʼ»¯Íê³ÉÒÔºó²éѯһ´ÎÊÇ·ñÔÚÉêÇëµÄ¼Ò×åÉóºËÖÐ  | 
| # @change: "2012-05-06 19:30" jiang ½ÇÉ«ÔÚGameServer³õʼ»¯Íê³ÉÒÔºóÇëÇó¼ÇÂ¼Íæ¼Ò¼Ò×åÐÅÏ¢ÓÃÓÚ¿ª·þ»î¶¯½±ÀøÁìÈ¡  | 
| # @change: "2012-05-14 16:00" jiang È¥³ýÇëÇó¼ÇÂ¼Íæ¼Ò¼Ò×åÐÅÏ¢ÓÃÓÚ¿ª·þ»î¶¯½±ÀøÁìÈ¡  | 
| # @change: "2012-06-29 15:00" whx ²¹³¥ÔÚGameServer Initʱ´¥·¢  | 
| # @change: "2014-02-11 15:00" Alee Ê±¼ä´¦ÀíÖ®ºóÔÙÖ´Ðй¦ÄÜÂß¼(½ÚÈÕÀñ°ü)  | 
| # @change: "2014-12-25 15:10" xmnathan ÅÅÐаñ³ÆºÅÉÏÏßˢзÅÔÚGameSever_PlayerInitOKÖ®ºóÖ´ÐÐ  | 
| # @change: "2015-06-24 17:50" xmnathan InterfaceServer_Dll_CashRequest³äÖµµãȯ¶Ò»»£¬Ôö¼Óͬ¶©µ¥·â°üÖØÈë·À·¶  | 
| # @change: "2016-07-20 14:30" hxp µãȯ¶Ò»»Ë¢ÐÂÔö¼ÓÁ÷ÏòÀàÐÍ  | 
| #------------------------------------------------------------------------------   | 
| """Version = 2016-07-20 14:30"""  | 
| #------------------------------------------------------------------------------   | 
| import GameWorld  | 
| import EventShell  | 
| import PlayerControl  | 
| import IPY_GameWorld  | 
| import PlayerEventCounter  | 
| import ChConfig  | 
| import PlayerCoin  | 
| import ChPlayer  | 
| import ShareDefine  | 
| #---------------------------------------------------------------------  | 
| #¼ÇÂ¼Íæ¼Ò³õʼ»¯¹ý³ÌÖС£»ýÀ۵ķâ°ü  | 
| OnHourKey = 'PlayerGSInitOK_OnHourKey'  | 
| OnDayKey = 'PlayerGSInitOK_OnDayKey'  | 
| OnWeekKey = 'PlayerGSInitOK_OnWeekKey'  | 
| OnMonthKey = 'PlayerGSInitOK_OnMonthKey'  | 
| OnYearKey = 'PlayerGSInitOK_OnYearKey'  | 
| OnDayExKey = 'PlayerGSInitOK_OnDayExKey'  | 
| OnWeekExKey = 'PlayerGSInitOK_OnWeekExKey'  | 
| OnMonthExKey = 'PlayerGSInitOK_OnMonthExKey'  | 
| #---------------------------------------------------------------------  | 
| #¼ÇÂ¼Íæ¼ÒÈÎÎñÐÅÏ¢£¬»ýÀ۵ķâ°ü( ÎÞÈÎÎñID )  | 
| Mission_No_ID_OnLeaveFamily = 'Mission_No_ID_OnLeaveFamily'                      #À뿪¼Ò×å´¥·¢  | 
| Mission_No_ID_OnMemberChange = 'Mission_No_ID_OnMemberChange'                    #¼Ò×峤±ä¸ü  | 
| #---------------------------------------------------------------------  | 
| #¼ÇÂ¼Íæ¼ÒÈÎÎñÐÅÏ¢£¬»ýÀ۵ķâ°ü( ÓÐÈÎÎñID )  | 
| Mission_Have_ID_OnActive = 'Mission_Have_ID_OnActive'                            #GM¿ªÆô»î¶¯  | 
| Mission_Have_ID_OnDeActive = 'Mission_Have_ID_OnDeActive'                        #GM¹Ø±Õ»î¶¯  | 
| Mission_Have_ID_OnMissionPub = 'Mission_Have_ID_OnMissionPub'                    #·¢²¼ÈÎÎñ  | 
| #---------------------------------------------------------------------  | 
| #Íæ¼ÒÀ뿪¸±±¾  | 
| Def_RouteServerInitOK_LeaveFBKey = 'RouteServerInitOK_LeaveFBKey'                #Íæ¼ÒÀ뿪¸±±¾  | 
| #---------------------------------------------------------------------  | 
| #class   IPY_MLeaveEvent  | 
| #{  | 
| #public:  | 
| #  | 
| #    int      GetPlayerID();  | 
| #  | 
| #    int      GetType();  | 
| #};  | 
|   | 
|   | 
| ## GameServerÍ¨ÖªÍæ¼ÒÀ뿪ʼþ  | 
| #  @param index Íæ¼ÒË÷Òý  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def GameServer_LeaveEvent(index, tick):  | 
|     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
|     pack = IPY_GameWorld.IPY_MLeaveEvent()  | 
|     if curPlayer.GetID() != pack.GetPlayerID():  | 
|         #²»ÊÇ×Ô¼º  | 
|         return  | 
|       | 
|     EventShell.DoExitEvent(curPlayer)  | 
|     return  | 
|       | 
| #//////////////////////////////////////////////////////////////  | 
| #//04 02 Íæ¼Ò¿ÛÇ®#tagMPayMoney  | 
| #tagMPayMoney       *   GettagMPayMoney();  | 
| #  | 
| #class   IPY_MPayMoney  | 
| #{  | 
| #public:  | 
| #    //½ðÇ®ÀàÐÍ  | 
| #    int      GetMoneyType();  | 
| #    //½ðÇ®  | 
| #    int      GetMoney();  | 
| #};  | 
|   | 
|   | 
| ## ¸¶Ç® 04 02 Íæ¼Ò¿ÛÇ®  | 
| #  @param index Íæ¼ÒË÷Òý  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def GameServer_PayMoney(index, tick):  | 
|     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
|     pack = IPY_GameWorld.IPY_MPayMoney()  | 
|       | 
|     if curPlayer.GetID() != pack.GetPlayerID():  | 
|         #²»ÊÇ×Ô¼º  | 
|         return  | 
|     moneyType = pack.GetMoneyType()  | 
|     moneyNum = pack.GetMoney()  | 
|     if moneyType == ShareDefine.TYPE_Price_Gold_Paper_Money:  | 
|         costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, ShareDefine.TYPE_Price_Gold_Paper_Money, moneyNum)  | 
|     else:  | 
|         costMoneyList = [[moneyType, moneyNum]]  | 
|     if not costMoneyList:  | 
|         return  | 
|     for moneyType, moneyCnt in costMoneyList:  | 
|         PlayerControl.PayMoney(curPlayer, moneyType, moneyCnt, ChConfig.Def_Cost_GameServer)  | 
|     return  | 
|       | 
| #//////////////////////////////////////////////////////////////  | 
| #//01 07 ¾Ñé±¶Âʸıä#tagMExpRateChange  | 
| #tagMExpRateChange       *   GettagMExpRateChange();  | 
| #  | 
| #class   IPY_MExpRateChange  | 
| #{  | 
| #public:  | 
| #  | 
| #    int      GetExpRate();  | 
| #};  | 
|   | 
| ## 01 07 ¾Ñé±¶ÂÊ¸Ä±ä  | 
| #  @param index Íæ¼ÒË÷Òý  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def GameServer_SetExpRate(index, tick):  | 
|     gameServerPack = IPY_GameWorld.IPY_MExpRateChange()  | 
|     expRate = gameServerPack.GetExpRate()  | 
|     #---ͬ²½ÊÀ½ç·þÎñÆ÷¾Ñé±¶ÂÊ---  | 
|     GameWorld.GetGameWorld().SetExpRate(expRate)  | 
|     GameWorld.Log("֪ͨµØÍ¼·þÎñÆ÷¾Ñé±¶Âʱä¸ü = %s"%(expRate))  | 
|   | 
|     #---֪ͨȫ·þÍæ¼Ò¾Ñé±¶Âʱä¸ü---  | 
|     playerManager = GameWorld.GetPlayerManager()  | 
|       | 
|     for i in range(0, playerManager.GetActivePlayerCount()):  | 
|         curPlayer = playerManager.GetActivePlayerByIndex(i)  | 
|   | 
|         if curPlayer.GetID() == 0:  | 
|             continue  | 
|           | 
|         PlayerControl.Sync_ExpRateChange(curPlayer)  | 
|       | 
|     return  | 
|   | 
|   | 
| #//////////////////////////////////////////////////////////////  | 
| #//01 08 ¼¤»î»î¶¯#tagMActiveEvent  | 
| #tagMActiveEvent       *   GettagMActiveEvent();  | 
| #  | 
| #class   IPY_MActiveEvent  | 
| #{  | 
| #public:  | 
| #  | 
| #    int      GetEventID();  | 
| #    //ÊÇ·ñ¼¤»î  | 
| #    int      GetIsActive();  | 
| #    //ÊÇ·ñÖ»Õë¶ÔËùÑ¡µØÍ¼  | 
| #    int      GetSelectMap();  | 
| #    //µØÍ¼ÊýÄ¿  | 
| #    int      GetMapListCount();  | 
| #    //size = MapListCount  | 
| #    int      GetMapList(int index);  | 
| #};  | 
|   | 
| ## »î¶¯µØÍ¼Ê±µ±Ç°µØÍ¼  | 
| #  @param pack ·â°ü  | 
| #  @return True or False  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def __IsCurrentMapInGameEventSelectMap(pack):  | 
|     for i in range(pack.GetMapListCount()):  | 
|         if pack.GetMapList(i) == GameWorld.GetGameWorld().GetMapID():  | 
|             return True  | 
|           | 
|     return False  | 
|   | 
| ## 01 08 ¼¤»î»î¶¯  | 
| #  @param index Íæ¼ÒË÷Òý  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def GameServer_ActiveEvent(index, tick):  | 
|     pack = IPY_GameWorld.IPY_MActiveEvent()  | 
|       | 
|     if pack.GetSelectMap():  | 
|         #ҪѡÔñµØÍ¼µÄ  | 
|         if not __IsCurrentMapInGameEventSelectMap(pack):  | 
|             return  | 
|       | 
|     if pack.GetIsActive():  | 
|         GameWorld.GetGameWorld().AddActiveEvent(pack.GetEventID())  | 
|         __ActiveGMEvent(pack.GetEventID())  | 
|     else:  | 
|         __DeActiveGMEvent(pack.GetEventID())  | 
|         GameWorld.GetGameWorld().DelActiveEvent(pack.GetEventID())  | 
|           | 
|     return  | 
|   | 
| ## È«·þÍæ¼Ò¶¼´¥·¢Õâ¸öÈÎÎñ  | 
| #  @param missionID Ê¼þID  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def __ActiveGMEvent(missionID):  | 
|     #È«·þÍæ¼Ò¶¼´¥·¢Õâ¸öÈÎÎñ  | 
|     playerManager = GameWorld.GetPlayerManager()  | 
|   | 
|     for i in range(playerManager.OnlineCount()):  | 
|         curPlayer = playerManager.OnlineAt(i)  | 
|         if curPlayer.IsEmpty():  | 
|             continue  | 
|           | 
|         EventShell.EventResponse_OnActive(curPlayer, missionID)  | 
|       | 
|     return  | 
|   | 
| ## È«·þÍæ¼Ò¶¼È¡ÏûÕâ¸öÈÎÎñ  | 
| #  @param missionID Ê¼þID  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def __DeActiveGMEvent(missionID):  | 
|     #È«·þÍæ¼Ò¶¼´¥·¢Õâ¸öÈÎÎñ  | 
|     playerManager = GameWorld.GetPlayerManager()  | 
|   | 
|     for i in range(playerManager.OnlineCount()):  | 
|         curPlayer = playerManager.OnlineAt(i)  | 
|         if curPlayer.IsEmpty():  | 
|             continue  | 
|           | 
|         EventShell.EventResponse_OnDeActive(curPlayer, missionID)  | 
|       | 
|     return  | 
|   | 
| #//////////////////////////////////////////////////////////////  | 
| #//01 10 ÈÎÎñ·¢²¼#tagMMissionPub  | 
| #tagMMissionPub       *   GettagMMissionPub();  | 
| #  | 
| #class   IPY_MMissionPub  | 
| #{  | 
| #public:  | 
| #    //·¢²¼ÈÎÎñID  | 
| #    int      GetMissionID();  | 
| #    //·¢²¼ÀàÐÍ(¼Ò×å, ¹ú¼Ò) TMissinoPubType  | 
| #    int      GetMissinoPubType();  | 
| #    //·¢²¼ID  | 
| #    int      GetPubID();  | 
| #};  | 
| ## 01 10 ÈÎÎñ·¢²¼  | 
| #  @param index Íæ¼ÒË÷Òý  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def GameServer_MissionPub(index, tick):  | 
|     pack = IPY_GameWorld.IPY_MMissionPub()  | 
|     missionPubManager = GameWorld.GetGameWorld().GetDBMissionPubManager()  | 
|     curMissionPub = missionPubManager.AddDBMissionPub(pack.GetMissionID())  | 
|     curMissionPub.SetMissinoPubType(pack.GetMissinoPubType())  | 
|     curMissionPub.SetPubID(pack.GetPubID())  | 
|     GameWorld.Log('ÈÎÎñ·¢²¼, ID = %s'%pack.GetPubID())  | 
|     __MissionPub(curMissionPub)  | 
|     return  | 
|   | 
| ## È«·þÍæ¼Ò¶¼´¥·¢Õâ¸öÈÎÎñ  | 
| #  @param curMissionPub ÈÎÎñ·¢²¼±í  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def __MissionPub(curMissionPub):  | 
|     #È«·þÍæ¼Ò¶¼´¥·¢Õâ¸öÈÎÎñ  | 
|     playerManager = GameWorld.GetPlayerManager()  | 
|   | 
|     for i in range(playerManager.OnlineCount()):  | 
|         curPlayer = playerManager.OnlineAt(i)  | 
|         if curPlayer.IsEmpty():  | 
|             continue  | 
|           | 
|         EventShell.CheckTrigMissionPub(curPlayer, curMissionPub)  | 
|           | 
|     return  | 
|   | 
| #//////////////////////////////////////////////////////////////  | 
| #//04 03 ½ûÖ¹¼ÌÐøµôÂä#tagMForbiddenDrop  | 
| #tagMForbiddenDrop       *   GettagMForbiddenDrop();  | 
| #  | 
| #class   IPY_MForbiddenDrop  | 
| #{  | 
| #public:  | 
| #    //ÊÇ·ñÄܹ»¼ÌÐøµôÂä  | 
| #    int      GetCanDrop();  | 
| #  | 
| #    int      GetItemID();  | 
| #  | 
| #    int      GetDropFunctionType();  | 
| #};  | 
| ## 04 03 ½ûÖ¹¼ÌÐøµôÂä  | 
| #  @param index Íæ¼ÒË÷Òý  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def GameServer_ForbiddenDrop(index, tick):  | 
|     pack = IPY_GameWorld.IPY_MForbiddenDrop()  | 
|     itemID = pack.GetItemID()  | 
|     functionType = pack.GetDropFunctionType()  | 
|     gameWorld = GameWorld.GetGameWorld()  | 
|     if pack.GetCanDrop():  | 
|         gameWorld.DelForbiddenDrop(itemID, functionType)  | 
|     else:  | 
|         gameWorld.AddForbiddenDrop(itemID, functionType)  | 
|   | 
|     return  | 
|   | 
| ## Çå¿Õ½ûÖ¹µôÂäÎïÆ·  | 
| #  @param index Íæ¼ÒË÷Òý  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def GameServer_ClearForbiddenDrop(index, tick):  | 
|     GameWorld.GetGameWorld().ClearForbiddenDrop()  | 
|     return  | 
|   | 
| ## GameServer֪ͨµØÍ¼·þÎñÆ÷, Íæ¼Ò±£´æÊý¾Ýµ½Êý¾Ý¿â  | 
| #  @param index Íæ¼ÒË÷Òý  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def GameServer_PlayerSave(index, tick):  | 
|     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
|     #2009-07-04 ÒòµØÍ¼·þÎñÆ÷ÓпÉÄܹرÕÖØ¿ª£¬ÕâÀïÒªÅж¨¿Õ  | 
|     if not curPlayer:  | 
|         return  | 
|       | 
|     # 1Ϊ±£´æ 0ΪÕý³£ÏÂÏß  | 
|     curPlayer.SetFacePic(1) # ÀûÓôË×Ö¶Î֪ͨΪ±£´æÊý¾Ý£¬·ÇÏÂÏßÊý¾Ý  | 
|     curPlayer.PushSaveData()  | 
|     curPlayer.SetFacePic(0) # ÀûÓôË×Ö¶Î֪ͨΪ±£´æÊý¾Ý£¬·ÇÏÂÏßÊý¾Ý  | 
|     return  | 
|   | 
| #===============================================================================  | 
| # //////////////////////////////////////////////////////////////  | 
| # //01 14 Íæ¼ÒÔÚGameServer³õʼ»¯³É¹¦#tagMPlayerGameServerInitOK  | 
| # tagMPlayerGameServerInitOK       *   GettagMPlayerGameServerInitOK();  | 
| #   | 
| # class   IPY_MPlayerGameServerInitOK  | 
| # {  | 
| # public:  | 
| #    //ÎÞÒâÒå  | 
| #    int      GetType();  | 
| # };  | 
| #===============================================================================  | 
| ## 01 14 Íæ¼ÒÔÚGameServer³õʼ»¯³É¹¦  | 
| #  @param index Íæ¼ÒË÷Òý  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def GameSever_PlayerInitOK(index , tick):  | 
|     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
|     #2009-12-17 ÒòµØÍ¼·þÎñÆ÷ÓпÉÄܹرÕÖØ¿ª£¬ÕâÀïÒªÅж¨¿Õ  | 
|     if not curPlayer:  | 
|         GameWorld.ErrLog('GameSever_PlayerInitError playerIndex = %s'%(index))  | 
|         return  | 
|       | 
|     #ÉèÖóõʼ»¯³É¹¦  | 
|     curPlayer.SetGameServerInitOK(True)  | 
|       | 
|     #´¥·¢GM¿ª¹Ø»î¶¯  | 
|     #EventShell.PlayerGMEventTrig(curPlayer)  | 
|     #´¥·¢ËûÈË·¢²¼»î¶¯  | 
|     #EventShell.PlayerMissionPubEventTrig(curPlayer)  | 
|       | 
|     #ʱ¼ä»º´æ·â°ü  | 
|     if Get_PlayerGameServerInitOK_OnHour(curPlayer):  | 
|         PlayerEventCounter.PlayerOnHour(curPlayer)  | 
|         Set_PlayerGameServerInitOK_OnHour(curPlayer, 0)  | 
|       | 
|     if Get_PlayerGameServerInitOK_OnDay(curPlayer):  | 
|         PlayerEventCounter.PlayerOnDay(curPlayer)  | 
|         Set_PlayerGameServerInitOK_OnDay(curPlayer, 0)  | 
|       | 
|     if Get_PlayerGameServerInitOK_OnDayEx(curPlayer):  | 
|         PlayerEventCounter.PlayerOnDayEx(curPlayer)  | 
|         Set_PlayerGameServerInitOK_OnDayEx(curPlayer, 0)  | 
|           | 
|     if Get_PlayerGameServerInitOK_OnWeek(curPlayer):  | 
|         PlayerEventCounter.PlayerOnWeek(curPlayer)  | 
|         Set_PlayerGameServerInitOK_OnWeek(curPlayer, 0)  | 
|           | 
|     if Get_PlayerGameServerInitOK_OnWeekEx(curPlayer):  | 
|         PlayerEventCounter.PlayerOnWeekEx(curPlayer)  | 
|         Set_PlayerGameServerInitOK_OnWeekEx(curPlayer, 0)  | 
|           | 
|     if Get_PlayerGameServerInitOK_OnMonth(curPlayer):  | 
|         PlayerEventCounter.PlayerOnMonth(curPlayer)  | 
|         Set_PlayerGameServerInitOK_OnMonth(curPlayer, 0)  | 
|           | 
|     if Get_PlayerGameServerInitOK_OnMonthEx(curPlayer):  | 
|         PlayerEventCounter.PlayerOnMonthEx(curPlayer)  | 
|         Set_PlayerGameServerInitOK_OnMonthEx(curPlayer, 0)  | 
|       | 
|     if Get_PlayerGameServerInitOK_OnYear(curPlayer):  | 
|         PlayerEventCounter.PlayerOnYear(curPlayer)  | 
|         Set_PlayerGameServerInitOK_OnYear(curPlayer, 0)  | 
|           | 
|     #ÎÞÈÎÎñIDµÄÈÎÎñ»º´æ´¦Àí  | 
|     #===========================================================================  | 
|     # if Get_Mission_No_ID_OnLeaveFamily(curPlayer):  | 
|     #    EventShell.EventResponse_OnLeaveFamily(curPlayer)  | 
|     #    Set_Mission_No_ID_OnLeaveFamily(curPlayer, 0)  | 
|     #   | 
|     # if Get_Mission_No_ID_OnMemberChange(curPlayer):  | 
|     #    EventShell.EventResponse_OnMemberChange(curPlayer)  | 
|     #    Set_Mission_No_ID_OnMemberChange(curPlayer, 0)  | 
|     #   | 
|     # #ÓÐÈÎÎñIDµÄÈÎÎñ»º´æ´¦Àí     | 
|     # if Get_Mission_Have_ID_OnActive(curPlayer):  | 
|     #    EventShell.EventResponse_OnActive(curPlayer , Get_Mission_Have_ID_OnActive(curPlayer))  | 
|     #    Set_Mission_Have_ID_OnActive(curPlayer, 0)  | 
|     #      | 
|     # if Get_Mission_Have_ID_OnDeActive(curPlayer):  | 
|     #    EventShell.EventResponse_OnDeActive(curPlayer , Get_Mission_Have_ID_OnDeActive(curPlayer))  | 
|     #    Set_Mission_Have_ID_OnDeActive(curPlayer, 0)  | 
|     #   | 
|     # if Get_Mission_Have_ID_OnMissionPub(curPlayer):  | 
|     #    EventShell.EventResponse_OnMissionPub(curPlayer , Get_Mission_Have_ID_OnMissionPub(curPlayer))  | 
|     #    Set_Mission_Have_ID_OnMissionPub(curPlayer, 0)  | 
|     #===========================================================================  | 
|       | 
|     #²éѯÊÇ·ñ»¹ÔÚÉêÇë¼Ò×åÁбíÖÐ  | 
|     ChPlayer.QueryIsResFamily(curPlayer)  | 
|     #Óʼþ  | 
|     PlayerControl.SendUnLoginOKPlayerMailCache(curPlayer)  | 
|     #Ë¢ÐÂÅÅÐаñ³ÆºÅ  | 
|     #PlayerDienstgrad.RefreshBillBoardDienstgrad(curPlayer)  | 
|       | 
|     GameWorld.Log('GameSever_PlayerInitOK' , curPlayer.GetID())  | 
|     ChPlayer.DoPlayerRealLoginOK(curPlayer, tick)  | 
|     return  | 
| #---------------------------------------------------------------------  | 
| ## ±£´æOnHour  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @param value keyÖµ  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Set_PlayerGameServerInitOK_OnHour(curPlayer, value):  | 
|     curPlayer.SetDict(OnHourKey, value)  | 
|     #GameWorld.Log('Set_PlayerGameServerInitOK_OnHour , value = %s'%( value ) , curPlayer.GetID())  | 
|     return  | 
|   | 
| ## »ñÈ¡Íæ¼Ò×Öµä OnHour  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Get_PlayerGameServerInitOK_OnHour(curPlayer):  | 
|     return curPlayer.GetDictByKey(OnHourKey)  | 
|   | 
| ## ±£´æOnDay  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @param value keyÖµ  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Set_PlayerGameServerInitOK_OnDay(curPlayer, value):  | 
|     curPlayer.SetDict(OnDayKey, value)  | 
|     #GameWorld.Log('Set_PlayerGameServerInitOK_OnDay, value = %s'%( value ) , curPlayer.GetID())  | 
|     return  | 
|   | 
| ## »ñÈ¡Íæ¼Ò×Öµä OnDay  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Get_PlayerGameServerInitOK_OnDay(curPlayer):  | 
|     return curPlayer.GetDictByKey(OnDayKey)  | 
|   | 
| def Set_PlayerGameServerInitOK_OnDayEx(curPlayer, value): return curPlayer.SetDict(OnDayExKey, value)  | 
| def Get_PlayerGameServerInitOK_OnDayEx(curPlayer): return curPlayer.GetDictByKey(OnDayExKey)  | 
|       | 
| ## ±£´æOnWeek  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @param value keyÖµ  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Set_PlayerGameServerInitOK_OnWeek(curPlayer, value):  | 
|     curPlayer.SetDict(OnWeekKey, value)  | 
|     #GameWorld.Log('Set_PlayerGameServerInitOK_OnWeek, value = %s'%( value ) , curPlayer.GetID())  | 
|     return  | 
|   | 
| ## »ñÈ¡Íæ¼Ò×Öµä OnWeek  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Get_PlayerGameServerInitOK_OnWeek(curPlayer):  | 
|     return curPlayer.GetDictByKey(OnWeekKey)  | 
|   | 
| def Set_PlayerGameServerInitOK_OnWeekEx(curPlayer, value): return curPlayer.SetDict(OnWeekExKey, value)  | 
| def Get_PlayerGameServerInitOK_OnWeekEx(curPlayer): return curPlayer.GetDictByKey(OnWeekExKey)  | 
|   | 
| ## ±£´æOnMonth  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @param value keyÖµ  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Set_PlayerGameServerInitOK_OnMonth(curPlayer , value):  | 
|     curPlayer.SetDict(OnMonthKey , value)  | 
|     #GameWorld.Log('Set_PlayerGameServerInitOK_OnMonth, value = %s'%( value ) , curPlayer.GetID())  | 
|     return  | 
|   | 
| ## »ñÈ¡Íæ¼Ò×Öµä OnMonth  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Get_PlayerGameServerInitOK_OnMonth(curPlayer):  | 
|     return curPlayer.GetDictByKey(OnMonthKey)  | 
|   | 
| def Set_PlayerGameServerInitOK_OnMonthEx(curPlayer, value): return curPlayer.SetDict(OnMonthExKey, value)  | 
| def Get_PlayerGameServerInitOK_OnMonthEx(curPlayer): return curPlayer.GetDictByKey(OnMonthExKey)  | 
|   | 
| ## ±£´æOnYear  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @param value keyÖµ  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Set_PlayerGameServerInitOK_OnYear(curPlayer, value):  | 
|     curPlayer.SetDict(OnYearKey, value)  | 
|     #GameWorld.Log('Set_PlayerGameServerInitOK_OnYear, value = %s'%( value ) , curPlayer.GetID())  | 
|     return  | 
|   | 
| ## »ñÈ¡Íæ¼Ò×Öµä OnYear  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Get_PlayerGameServerInitOK_OnYear(curPlayer):  | 
|     return curPlayer.GetDictByKey(OnYearKey)  | 
|   | 
| #---------------------------------------------------------------------  | 
|   | 
| ## ÉèÖÃÀ뿪¼Ò×å´¥·¢  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @param value keyÖµ  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Set_Mission_No_ID_OnLeaveFamily(curPlayer, value):  | 
|     curPlayer.SetDict(Mission_No_ID_OnLeaveFamily, value)  | 
|     #GameWorld.Log('Set_Mission_No_ID_OnLeaveFamily, value = %s'%( value ) , curPlayer.GetID())  | 
|     return  | 
|   | 
| ## »ñÈ¡Íæ¼Ò×Öµä À뿪¼Ò×å  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Get_Mission_No_ID_OnLeaveFamily(curPlayer):  | 
|     return curPlayer.GetDictByKey(Mission_No_ID_OnLeaveFamily)  | 
|   | 
| ## ÉèÖüÒ×峤±ä¸ü  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @param value keyÖµ  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Set_Mission_No_ID_OnMemberChange(curPlayer, value):  | 
|     curPlayer.SetDict(Mission_No_ID_OnMemberChange, value)  | 
|     #GameWorld.Log('Set_Mission_No_ID_OnMemberChange, value = %s'%( value ) , curPlayer.GetID())  | 
|     return  | 
|   | 
| ## »ñÈ¡Íæ¼Ò×ֵ䠼Ò×峤±ä¸ü  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Get_Mission_No_ID_OnMemberChange(curPlayer):  | 
|     return curPlayer.GetDictByKey(Mission_No_ID_OnMemberChange)  | 
| #---------------------------------------------------------------------  | 
| #  | 
| ## ÉèÖÃGM¿ªÆô»î¶¯  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @param value keyÖµ  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Set_Mission_Have_ID_OnActive(curPlayer, value):  | 
|     curPlayer.SetDict(Mission_Have_ID_OnActive, value)  | 
|     #GameWorld.Log('Set_Mission_Have_ID_OnActive, value = %s'%( value ) , curPlayer.GetID())  | 
|     return  | 
|   | 
| ## »ñÈ¡Íæ¼Ò×Öµä GM¿ªÆô»î¶¯  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Get_Mission_Have_ID_OnActive(curPlayer):  | 
|     return curPlayer.GetDictByKey(Mission_Have_ID_OnActive)  | 
|   | 
| #GM¹Ø±Õ»î¶¯  | 
| ## ÉèÖÃGM¹Ø±Õ»î¶¯  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @param value keyÖµ  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Set_Mission_Have_ID_OnDeActive(curPlayer, value):  | 
|     curPlayer.SetDict(Mission_Have_ID_OnDeActive, value)  | 
|     #GameWorld.Log('Set_Mission_Have_ID_OnDeActive, value = %s'%( value ) , curPlayer.GetID())  | 
|     return  | 
|   | 
| ## »ñÈ¡Íæ¼Ò×Öµä GM¹Ø±Õ»î¶¯  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Get_Mission_Have_ID_OnDeActive(curPlayer):  | 
|     return curPlayer.GetDictByKey(Mission_Have_ID_OnDeActive)  | 
|   | 
| #·¢²¼ÈÎÎñ  | 
| ## ÉèÖ÷¢²¼ÈÎÎñ  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @param value keyÖµ  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Set_Mission_Have_ID_OnMissionPub(curPlayer, value):  | 
|     curPlayer.SetDict(Mission_Have_ID_OnMissionPub, value)  | 
|     #GameWorld.Log('Set_Mission_Have_ID_OnMissionPub, value = %s'%( value ) , curPlayer.GetID())  | 
|     return  | 
|   | 
| ## »ñÈ¡Íæ¼Ò×ֵ䠷¢²¼ÈÎÎñ  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Get_Mission_Have_ID_OnMissionPub(curPlayer):  | 
|     return curPlayer.GetDictByKey(Mission_Have_ID_OnMissionPub)  | 
|   | 
| #---------------------------------------------------------------------  | 
| #===============================================================================  | 
| # //01 15 Íæ¼ÒÔÚRouteServer³õʼ»¯³É¹¦#tagPlayerRouteServerInitOK  | 
| # structtagPlayerRouteServerInitOK  | 
| # {  | 
| # tag    HeadHead;  | 
| # BYTE   Type;    //±£Áô£¬ÎÞÒâÒå  | 
| # };  | 
| #===============================================================================  | 
| ## 01 15 Íæ¼ÒÔÚRouteServer³õʼ»¯³É¹¦#tagPlayerRouteServerInitOK  | 
| #  @param index Íæ¼ÒË÷Òý  | 
| #  @param tick µ±Ç°Ê±¼ä  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def RouteServer_PlayerInitOK(index, tick):  | 
| #===============================================================================  | 
| #    #Õâ¸öº¯Êý½öÔÚÍæ¼ÒµÇ½³É¹¦ºó²Å´¥·¢Ò»´Î  | 
| #===============================================================================  | 
|     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
|     #ÕâÀïÒªÅж¨¿Õ  | 
|     if not curPlayer:  | 
|         GameWorld.ErrLog('RouteServer_PlayerInitError playerIndex = %s'%(index))  | 
|         return  | 
|       | 
| #===============================================================================  | 
| #    #ÉèÖÃRouteServer³õʼ»¯³É¹¦  | 
| #    curPlayer.SetRouteServerInitOK(True)  | 
| #===============================================================================  | 
|     #ÉèÖýű¾×Öµä½Ó¿Ú, ´Ë½Ó¿Ú´æÊý¾Ý¿â, ÏÂÏßÇå³ýÒ»´Î  | 
|     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_RouteServerInitOK, 1)  | 
|   | 
|     #»º´æµÄÀ뿪¸±±¾·â°ü  | 
|     if Get_PlayerRouteServerInitOK_OnLeaveFB(curPlayer):  | 
|         PlayerControl.PlayerLeaveFB(curPlayer)  | 
|         Set_PlayerRouteServerInitOK_OnLeaveFB(curPlayer, 0)  | 
|   | 
|     return  | 
|   | 
| #---------------------------------------------------------------------  | 
| ## ±£´æÀ뿪¸±±¾ÐÅÏ¢  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @param value keyÖµ  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Set_PlayerRouteServerInitOK_OnLeaveFB(curPlayer, value):  | 
|     curPlayer.SetDict(Def_RouteServerInitOK_LeaveFBKey, value)  | 
|     return  | 
|   | 
| ## »ñÈ¡±£´æÀ뿪¸±±¾ÐÅÏ¢  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def Get_PlayerRouteServerInitOK_OnLeaveFB(curPlayer):  | 
|     return curPlayer.GetDictByKey(Def_RouteServerInitOK_LeaveFBKey)  | 
|   | 
| #---------------------------------------------------------------------  | 
| #===============================================================================  | 
| # //04 05Íæ¼Òµãȯ¶Ò»»Ôª±¦#tagPlayerCoinToGold  | 
| # struct    tagPlayerCoinToGold  | 
| # {  | 
| # tagHead    Head;  | 
| # DWORD    PlayerID;  | 
| # DWORD    Coin;//±¾´Î¶Ò»»µÄµãÊý  | 
| # DWORD PrizeCoin; //ÔùË͵ĵãÊý   | 
| # };  | 
| #===============================================================================  | 
| ##04 05Íæ¼Òµãȯ¶Ò»»Ôª±¦#tagPlayerCoinToGold  | 
| # @param index Íæ¼ÒË÷Òý  | 
| # @param tick Ê±¼ä´Á  | 
| # @return ·µ»ØÖµÎÞÒâÒå  | 
| # @remarks ¿Í»§¶Ë·â°üÏìÓ¦ 04 05Íæ¼Òµãȯ¶Ò»»Ôª±¦#tagPlayerCoinToGold  | 
| def GameServer_PlayerCoinToGold(index, tick):  | 
|     #===========================================================================  | 
|     # curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
|     # pack = IPY_GameWorld.IPY_PlayerCoinToGold()  | 
|     # if curPlayer.GetLastOrderId() == "":  | 
|     #    return  | 
|     # PlayerCoin.PlayerCoinToGold(curPlayer, pack, ChConfig.Def_GiveMoney_CoinToGold)  | 
|     #===========================================================================  | 
|     return  | 
|   | 
| # DBÍÆË͹ýÀ´µÄ³äÖµÐÅÏ¢  | 
| def PushRecharge(index, tick):  | 
|     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)  | 
|     cPlayerCoin = PlayerCoin.CPY_PlayerCoinToGold()  | 
|     cPlayerCoin.useCoin = curPlayer.GetOrderAmount()  | 
|     cPlayerCoin.orderID = curPlayer.GetOrderID()  | 
|     cPlayerCoin.orderInfo = curPlayer.GetOrderInfo()  | 
|     cPlayerCoin.isAddBourseMoney = True  | 
|       | 
|     GameWorld.DebugLog("PushRecharge-%s-%s-%s"%(cPlayerCoin.useCoin, cPlayerCoin.orderID, cPlayerCoin.orderInfo))  | 
|     PlayerCoin.PlayerCoinToGold(curPlayer, cPlayerCoin, ChConfig.Def_GiveMoney_CoinToGold)  | 
|     return  | 
|   |