| #!/usr/bin/python  | 
| # -*- coding: GBK -*-  | 
| #-------------------------------------------------------------------------------  | 
| #  | 
| ##@package Script.Player.GMTExec.CrossPK  | 
| #  | 
| # @todo:ÉèÖÿç·þPKÍæ¼ÒÊý¾Ý  | 
| # @author hxp  | 
| # @date 2023-02-16  | 
| # @version 1.0  | 
| #  | 
| # ÏêϸÃèÊö: ÉèÖÿç·þPKÍæ¼ÒÊý¾Ý  | 
| #  | 
| #-------------------------------------------------------------------------------  | 
| #"""Version = 2023-02-16 18:30"""  | 
| #-------------------------------------------------------------------------------  | 
|   | 
| def runMyTest(exec_locals):  | 
|     ''' ÔËÐÐÃüÁÊý  | 
|     @param exec_locals: GY_Query_GMTExecfile Ä£¿éÖеĠDoLogic º¯Êý locals()  | 
|       | 
|     import ÆäËûÄ£¿éÐèҪдÔڴ˺¯ÊýÀ²»È»ÎÞ·¨ÒýÓõ½  | 
|     '''  | 
|     import GameWorld  | 
|     import CrossRealmPlayer  | 
|     import PlayerCrossRealmPK  | 
|     import PlayerControl  | 
|     import ShareDefine  | 
|     import ChConfig  | 
|       | 
|     orderId = exec_locals["orderId"]  | 
|     cmdInfo = exec_locals["cmdInfo"]  | 
|     curPlayer = exec_locals["curPlayer"]  | 
|     resultDict = exec_locals["resultDict"] # ½¨Òé¶¼½øÐиüнá¹û×Öµä¼Ç¼Ïêϸ´¦ÀíÐÅÏ¢£¬GY_Query_GMTExecfile Ä£¿é»áͳһдÈëÁ÷Ïò  | 
|       | 
|     # ÒÔÏÂΪÏêϸ´¦ÀíÂß¼  | 
|     #  ============================ ÅäÖÃÐÅÏ¢ ============================  | 
|     '''ÉèÖúóÐèÒª¼ì²éÊý¾ÝÊÇ·ñÕýȷͬ²½µ½¿ç·þ·þÎñÆ÷  | 
|     1. ºǫ́·µ»ØÈç¹ûÓйؼü×Ö "errorMsg":"OK"£¬´ú±í±¾·þÉèÖóɹ¦£»  | 
|                     Èç¹û errorMsg ÊÇÆäËûÐÅÏ¢£¬´ú±í±¾·þ¾ÍÒѾÉèÖÃʧ°ÜÁË£¬±ÈÈçÎÞÈü¼¾ÐÅÏ¢»òÈü¼¾ÒѽáÊøÊÇÎÞ·¨Ö´ÐÐÃüÁîµÄ£»  | 
|     2. ºǫ́³É¹¦´ú±í±¾·þÊý¾ÝÒѳɹ¦ÉèÖã¬ÐèÒªÔÙ¼ì²éÊÇ·ñ³É¹¦Í¬²½¿ç·þ·þÎñÆ÷£»Ö±½Ó¿´°ñµ¥£¬Èç¹ûÒѾ¸üÐÂÖ¤Ã÷ͬ²½³É¹¦£»  | 
|     3. Èç¹ûû¿´µ½°ñµ¥¸üУ¬¼ì²é¿ç·þ·þÎñÆ÷ÈÕÖ¾£¬ËÑË÷ GMSetCrossPK, ¿´ÊÇ·ñÓÐÏà¹Ø´íÎóÈÕÖ¾£»  | 
|     4. Ò²¿ÉÒÔÖ±½Ó¿´¿ç·þÁ÷Ïò CrossPK_GMSet_xxx.txt£¬¿´ÊÇ·ñÓÐÏà¹ØÉèÖÃÁ÷Ïò¼Ç¼£¬Óеϰ´ú±í³É¹¦£»  | 
|           ×¢£ºÈç¹û¿ç·þÊý¾ÝûÓгɹ¦Í¬²½£¬ÔòÐèÒªºóÌ¨ÖØ¸´Ö´ÐÐÃüÁîÖ±µ½³É¹¦  | 
|     '''  | 
|     danLV = 20 # ¶ÎλµÈ¼¶£¬ÐèÓëËùÉèÖõĻý·ÖËùÊô¶ÎλƥÅ䣬²Î¿¼ K.¿ç·þ¾º¼¼³¡¶Îλ±í  | 
|     pkScore = 32000 # »ý·Ö  | 
|     cWinCount = 50 # Á¬Ê¤  | 
|     #  =================================================================  | 
|       | 
|     zoneID = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKZoneID)  | 
|     seasonID = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKSeasonID)  | 
|     seasonState = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKSeasonState)  | 
|       | 
|     errorMsg = "OK"   | 
|     if not zoneID or not seasonID or seasonState == 2:  | 
|         errorMsg = "zone season or state error."  | 
|     else:  | 
|         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_DanLV, danLV)  | 
|         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TotalScore, pkScore)  | 
|         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_CWinCount, cWinCount)  | 
|         if cWinCount > 0:  | 
|             PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_CLoseCount, 0)  | 
|               | 
|         # ÇëÇó²éѯ¿ç·þ·þÎñÆ÷  | 
|         playerInfoDict = {"accID":curPlayer.GetAccID(),  | 
|                           "playerID":curPlayer.GetPlayerID(),  | 
|                           "playerName":CrossRealmPlayer.GetCrossPlayerName(curPlayer),  | 
|                           "playerJob":curPlayer.GetJob(),  | 
|                           "fightPower":PlayerControl.GetFightPower(curPlayer),  | 
|                           "realmLV":curPlayer.GetOfficialRank(),  | 
|                           "ondayScore":curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CrossPK_OnDayScore),  | 
|                           "pkScore":pkScore, "danLV":danLV, "cWinCount":cWinCount,  | 
|                           }  | 
|         resultDict.update({"PlayerInfo":playerInfoDict})  | 
|         dataMsg = {"ZoneID":zoneID, "SeasonID":seasonID, "GMSetCrossPK":1, "PlayerInfo":playerInfoDict}  | 
|         GameWorld.SendMsgToCrossServer(ShareDefine.ClientServerMsg_PKBillboard, dataMsg)  | 
|         PlayerCrossRealmPK.SyncCrossRealmPKPlayerInfo(curPlayer)  | 
|           | 
|     GameWorld.Log("This is MameServer GMT_Execfile run %s. orderId=%s" % (cmdInfo, orderId), curPlayer.GetPlayerID())  | 
|     resultDict.update({"zoneID":zoneID, "seasonID":seasonID, "seasonState":seasonState, "errorMsg":errorMsg})  | 
|     return  | 
|   | 
| exec_locals = locals()  | 
| if exec_locals.get("cmdInfo"):  | 
|     runMyTest(exec_locals)  | 
|       |