| #!/usr/bin/python  | 
| # -*- coding: GBK -*-  | 
| #-------------------------------------------------------------------------------  | 
| #  | 
| ##@package GM.Commands.SetOSCRecordData  | 
| #  | 
| # @todo:ÉèÖÿª·þ»î¶¯¼Ç¼Êý¾Ý  | 
| # @author hxp  | 
| # @date 2016-06-30  | 
| # @version 1.1  | 
| #  | 
| # @change: "2016-10-11 15:00" hxp ¿ª·þ»î¶¯Ôö¼ÓÉñÆ÷  | 
| # ÏêϸÃèÊö: ÉèÖÿª·þ»î¶¯¼Ç¼Êý¾Ý  | 
| #  | 
| #-------------------------------------------------------------------------------  | 
| #"""Version = 2016-10-11 15:00"""  | 
| #-------------------------------------------------------------------------------  | 
|   | 
|   | 
| import OpenServerCampaign  | 
| import PlayerControl  | 
| import ShareDefine  | 
| import ChConfig  | 
| import GameWorld  | 
| #---------------------------------------------------------------------  | 
| ## Ö´ÐÐÂß¼  | 
| #  @param curPlayer µ±Ç°Íæ¼Ò  | 
| #  @param cmdList ²ÎÊý  | 
| #  @return None  | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷.  | 
| def OnExec(curPlayer, cmdList):  | 
|                                    | 
|     oscTypeDict = {  | 
|                    ShareDefine.Def_Campaign_Type_PlusLV:"Ç¿»¯",  | 
|                    ShareDefine.Def_Campaign_Type_HorseLV:"×øÆï",  | 
|                    ShareDefine.Def_Campaign_Type_StoneLV:"±¦Ê¯",  | 
|                    ShareDefine.Def_Campaign_Type_LV:"µÈ¼¶",  | 
|                    ShareDefine.Def_Campaign_Type_RealmLV:"¾³½ç",  | 
|                    ShareDefine.Def_Campaign_Type_FightPower:"Õ½Á¦",  | 
|                    }  | 
|       | 
|     if len(cmdList) == 1:  | 
|         recordData = cmdList[0]  | 
|         for oscType, name in oscTypeDict.items():  | 
|             PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OSC_RecordData % oscType, recordData)  | 
|             GameWorld.DebugAnswer(curPlayer, "ÉèÖÃ[%s]»î¶¯ÊýÖµ: %s OK!" % (name, recordData))  | 
|         OpenServerCampaign.Sync_OpenServerCampaignAward(curPlayer)  | 
|         return  | 
|       | 
|     if len(cmdList) != 2:  | 
|         __AnswerHelp(curPlayer, oscTypeDict)  | 
|         return  | 
|       | 
|     campaignType, recordData = cmdList  | 
|     if campaignType not in oscTypeDict:  | 
|         GameWorld.DebugAnswer(curPlayer, "¸Ã»î¶¯ÀàÐͲ»ÐèÒªÉèÖûÊý¾Ý!")  | 
|         __AnswerHelp(curPlayer, oscTypeDict)  | 
|         return  | 
|       | 
|     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OSC_RecordData % campaignType, recordData)  | 
|     OpenServerCampaign.Sync_OpenServerCampaignAward(curPlayer, campaignType)  | 
|     GameWorld.DebugAnswer(curPlayer, "ÉèÖÃ[%s]»î¶¯ÊýÖµ: %s OK!" % (oscTypeDict.get(campaignType), recordData))  | 
|     return  | 
|   | 
|   | 
| def __AnswerHelp(curPlayer, oscTypeDict):  | 
|     helpTypeStr = ""  | 
|     for oscType, name in oscTypeDict.items():  | 
|         helpTypeStr += "%s-%s," % (oscType, name)  | 
|           | 
|     GameWorld.DebugAnswer(curPlayer, "SetOSCRecordData [»î¶¯ÀàÐÍ, ÊýÖµ]")  | 
|     GameWorld.DebugAnswer(curPlayer, "»î¶¯ÀàÐÍ:%s" % helpTypeStr)  | 
|     return  | 
|   |