#!/usr/bin/python  
 | 
# -*- coding: GBK -*-  
 | 
#-------------------------------------------------------------------------------  
 | 
#  
 | 
##@package GM.Commands.SetCrossPK  
 | 
#  
 | 
# @todo:ÉèÖÃÍæ¼Ò¿ç·þPK»î¶¯Êý¾Ý  
 | 
# @author hxp  
 | 
# @date 2018-12-25  
 | 
# @version 1.0  
 | 
#  
 | 
# ÏêϸÃèÊö: ÉèÖÃÍæ¼Ò¿ç·þPK»î¶¯Êý¾Ý  
 | 
#  
 | 
#-------------------------------------------------------------------------------  
 | 
#"""Version = 2018-12-25 21:30"""  
 | 
#-------------------------------------------------------------------------------  
 | 
  
 | 
import GameWorld  
 | 
import PlayerControl  
 | 
import PlayerCrossRealmPK  
 | 
import ShareDefine  
 | 
import ChConfig  
 | 
  
 | 
#---------------------------------------------------------------------  
 | 
#Â߼ʵÏÖ  
 | 
## GMÃüÁîÖ´ÐÐÈë¿Ú  
 | 
#  @param curPlayer µ±Ç°Íæ¼Ò  
 | 
#  @param list ²ÎÊýÁбí [npcID]  
 | 
#  @return None  
 | 
#  @remarks º¯ÊýÏêϸ˵Ã÷.  
 | 
def OnExec(curPlayer, msgList):  
 | 
      
 | 
    if not msgList:  
 | 
        __PrintHelp(curPlayer)  
 | 
        return  
 | 
      
 | 
    if len(msgList) == 1:  
 | 
        if msgList[0] != 0:  
 | 
            __PrintHelp(curPlayer)  
 | 
            return  
 | 
          
 | 
        # ÖØÖÃÊý¾Ý  
 | 
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TotalScore, 0)  
 | 
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_OnDayScore, 0)  
 | 
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_DanLV, 0)  
 | 
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_PKCount, 0)  
 | 
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_WinCount, 0)  
 | 
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_CWinCount, 0)  
 | 
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TodayPKCount, 0)  
 | 
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TodayWinCount, 0)  
 | 
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TodayBuyCount, 0)  
 | 
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_DayPKCountAwardState, 0)  
 | 
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_DayWinCountAwardState, 0)  
 | 
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_DanLVAwardState, 0)  
 | 
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_SeasonAwardState, 0)  
 | 
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_ZoneID, 0)  
 | 
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_SeasonID, 0)  
 | 
        for i in xrange(1, 20):  
 | 
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_SeasonDanLV % i, 0)  
 | 
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_SeasonScore % i, 0)  
 | 
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_SeasonOrder % i, 0)  
 | 
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_SeasonAwardLV % i, 0)  
 | 
              
 | 
        GameWorld.DebugAnswer(curPlayer, "ÖØÖÿç·þPKÊý¾ÝOK£¡")  
 | 
        PlayerCrossRealmPK.SyncCrossRealmPKPlayerInfo(curPlayer)  
 | 
        PlayerCrossRealmPK.SyncCrossRealmPKAwardState(curPlayer)  
 | 
        PlayerCrossRealmPK.SyncCrossRealmPKHisSeasonInfo(curPlayer)  
 | 
        return  
 | 
      
 | 
    if len(msgList) == 2 or len(msgList) % 2 == 0:  
 | 
        setTypeDict = {0:[ChConfig.Def_PDict_CrossPK_TotalScore, "»ý·Ö"],  
 | 
                       1:[ChConfig.Def_PDict_CrossPK_OnDayScore, "¹ýÌì»ý·Ö"],  
 | 
                       2:[ChConfig.Def_PDict_CrossPK_DanLV, "¶Îλ"],  
 | 
                       3:[ChConfig.Def_PDict_CrossPK_PKCount, "PK´ÎÊý"],  
 | 
                       4:[ChConfig.Def_PDict_CrossPK_WinCount, "ʤÀû´ÎÊý"],  
 | 
                       5:[ChConfig.Def_PDict_CrossPK_CWinCount, "Á¬Ê¤´ÎÊý"],  
 | 
                       6:[ChConfig.Def_PDict_CrossPK_TodayPKCount, "½ñÈÕPK´ÎÊý"],  
 | 
                       7:[ChConfig.Def_PDict_CrossPK_TodayWinCount, "½ñÈÕʤÀû´ÎÊý"],  
 | 
                       8:[ChConfig.Def_PDict_CrossPK_TodayBuyCount, "½ñÈÕ¹ºÂò´ÎÊý"],  
 | 
                       }  
 | 
        indexList = range(len(msgList))  
 | 
        for i in indexList[::2]:  
 | 
            setType, value = msgList[i:i+2]  
 | 
            if setType not in setTypeDict:  
 | 
                continue  
 | 
            dictName, chName = setTypeDict[setType]  
 | 
            PlayerControl.NomalDictSetProperty(curPlayer, dictName, value)  
 | 
            GameWorld.DebugAnswer(curPlayer, "ÉèÖÃ%s: %s" % (chName, value))  
 | 
              
 | 
        mapZoneID = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKZoneID)  
 | 
        mapSeasonID = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_CrossPKSeasonID)  
 | 
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_ZoneID, mapZoneID)  
 | 
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_SeasonID, mapSeasonID)  
 | 
        PlayerCrossRealmPK.SyncCrossRealmPKPlayerInfo(curPlayer)  
 | 
        return  
 | 
      
 | 
    if len(msgList) == 3:  
 | 
        seasonID, setType, value = msgList  
 | 
        setTypeDict = {0:[ChConfig.Def_PDict_CrossPK_SeasonDanLV, "¶Îλ"],  
 | 
                       1:[ChConfig.Def_PDict_CrossPK_SeasonOrder, "Ãû´Î"],  
 | 
                       2:[ChConfig.Def_PDict_CrossPK_SeasonScore, "»ý·Ö"],  
 | 
                       3:[ChConfig.Def_PDict_CrossPK_SeasonAwardLV, "½±ÀøµÈ¼¶"],  
 | 
                       }  
 | 
        if setType not in setTypeDict:  
 | 
            __PrintHelp(curPlayer)  
 | 
            return  
 | 
        dictName, chName = setTypeDict[setType]  
 | 
        PlayerControl.NomalDictSetProperty(curPlayer, dictName % seasonID, value)  
 | 
        GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÈü¼¾%s%s: %s" % (seasonID, chName, value))  
 | 
        return  
 | 
      
 | 
    __PrintHelp(curPlayer)  
 | 
    return  
 | 
  
 | 
def __PrintHelp(curPlayer):  
 | 
    GameWorld.DebugAnswer(curPlayer, "ÖØÖÃÊý¾Ý: SetCrossPK 0")  
 | 
    GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÊý¾Ý: SetCrossPK ÀàÐÍ  Öµ")  
 | 
    GameWorld.DebugAnswer(curPlayer, "ÀàÐÍ:0-»ý·Ö,1-¹ýÌì»ý·Ö,2-¶Îλ,3-PK´ÎÊý,4-ʤÀû´ÎÊý,5-Á¬Ê¤´ÎÊý")  
 | 
    GameWorld.DebugAnswer(curPlayer, "6-½ñÈÕPK´ÎÊý,7-½ñÈÕʤÀû´ÎÊý,8-½ñÈÕ¹ºÂò´ÎÊý")  
 | 
    GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÀúÊ·¼Ç¼: SetCrossPK Èü¼¾ID ÀàÐÍ ÊýÖµ")  
 | 
    GameWorld.DebugAnswer(curPlayer, "ÀàÐÍ:0-¶Îλ,1-Ãû´Î,2-»ý·Ö,3-½±ÀøµÈ¼¶")  
 | 
    return  
 | 
  
 | 
  
 |