| #!/usr/bin/python  | 
| # -*- coding: GBK -*-  | 
|   | 
| ##@package GY_GM_SetExpRate  | 
| # ÉèÖÃÈ«·þ¾Ñé±¶ÂÊÔö¼Ó  | 
| #  | 
| # @author mark  | 
| # @date 2010-3-31  | 
| # @version 1.1  | 
| #  | 
| # ÐÞ¸Äʱ¼ä ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ  | 
| # @change: "2014-01-07 15:30" hxp ÏµÍ³markÐÞ¸Ä  | 
| #  | 
| # VER = "2014-01-07 15:30" zhengyang Ìí¼Ó×¢ÊÍ  | 
| #  | 
| # Ä£¿éÏêϸ˵  | 
| #½Å±¾ËµÃ÷  | 
| #ÉèÖÃÈ«·þ¾Ñé±¶ÂÊÔö¼Ó  | 
| #¿Í»§¶Ë·¢·â°ü [¾Ñé±¶ÂÊ , ¿ªÊ¼Ê±¼ä , ½áÊøÊ±¼ä]  | 
| #---------------------------------------------------------------------  | 
| #µ¼Èë  | 
| import GameWorld  | 
| import PlayerControl  | 
| import datetime  | 
| import ChConfig  | 
| import GMCommon  | 
| #---------------------------------------------------------------------  | 
| #È«¾Ö±äÁ¿  | 
| #---------------------------------------------------------------------  | 
|   | 
| #---------------------------------------------------------------------  | 
| #Â߼ʵÏÖ  | 
| ## Ö´ÐÐÂß¼  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @param playerList [¾Ñé±¶ÂÊ , ¿ªÊ¼Ê±¼ä , ½áÊøÊ±¼ä]  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def OnExec(curPlayer , playerList):  | 
|     if len(playerList) != 3:  | 
|         return   | 
|       | 
|     expRate = int(playerList[0])  | 
|       | 
|     if not (10000 <= expRate <= 30000):  | 
|         GameWorld.Log('###GMÉèÖû¾Ñé±¶ÂÊ´íÎó = %s'%(expRate) , curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     #»î¶¯¿ªÆôʱ¼ä #"2007-11-23 11:23:00"  | 
|     eventStartTime = GameWorld.GetDateTimeByStr(playerList[1])  | 
|     #»î¶¯¹Ø±Õʱ¼ä #"2009-11-23 11:23:00"  | 
|     eventCloseTime = GameWorld.GetDateTimeByStr(playerList[2])  | 
|       | 
|     if not eventStartTime or not eventCloseTime:  | 
|         GameWorld.Log('¿ªÊ¼ÓÎÏ··þÎñÆ÷»î¶¯ , ·â°üÒì³£ = %s,%s'%(playerList[1] , playerList[2]), curPlayer.GetPlayerID())  | 
|         return  | 
|       | 
|     if eventStartTime < datetime.datetime.today():  | 
|         #GM_Activity_OpenTimeNoLegal ¶Ô²»Æð£¬ÄúÊäÈëµÄ¿ªÊ¼Ê±¼äСÓÚµ±Ç°ÏµÍ³Ê±¼ä£¬GMÖ¸Áî²Ù×÷ʧ°Ü  | 
|         PlayerControl.NotifyCode(curPlayer , "GM_Activity_OpenTimeNoLegal")  | 
|         return  | 
|       | 
|     if eventStartTime > eventCloseTime:  | 
|         #GM_Activity_CloseTimeNoLegal02 ¶Ô²»Æð£¬ÄúÊäÈëµÄ½áÊøÊ±¼äСÓÚ¿ªÊ¼Ê±¼ä£¬GMÖ¸Áî²Ù×÷ʧ°Ü  | 
|         PlayerControl.NotifyCode(curPlayer , "GM_Activity_CloseTimeNoLegal02")  | 
|         return  | 
|       | 
|     eventManager = GameWorld.GetGameWorldEventManager()  | 
|     eventID = ChConfig.Def_GY_GM_Game_DoubleExp  | 
|       | 
|     #Èç¹û»î¶¯ÒѾ¿ªÆô,Ö´Ðи²¸Ç»î¶¯Âß¼  | 
|     GMCommon.CloseProcessingEvent(eventID)  | 
|       | 
|     #ÉèÖûÄÚÈݽø»î¶¯¹ÜÀíÆ÷  | 
|     addEvent = eventManager.AddActiveEvent(eventID)  | 
|     addEvent.SetEventID(eventID)  | 
|     addEvent.SetStartTime('%s'%eventStartTime)  | 
|     addEvent.SetEndTime('%s'%eventCloseTime)  | 
|     addEvent.SetAccID(curPlayer.GetAccID())  | 
|     addEvent.SetPar('%s'%(expRate))  | 
|       | 
|     #ÉèÖÃΪδ¼¤»î״̬  | 
|     addEvent.SetIsProcessing(False)  | 
|       | 
|     #GeRen_chenxin_673416 GMÖ¸ÁîÒÑÉúЧ£¬²Ù×÷³É¹¦  | 
|     PlayerControl.NotifyCode(curPlayer,"GeRen_chenxin_673416")  | 
|       | 
|     #ÍÑ»ú¹¤¾ßʹÓà  | 
|     curPlayer.GMAnswer('%s;%s'%('GY_GM_SetExpRate', True))  | 
|       | 
|     return  |