#!/usr/bin/python  
 | 
# -*- coding: GBK -*-  
 | 
#-------------------------------------------------------------------------------  
 | 
#  
 | 
#-------------------------------------------------------------------------------  
 | 
#  
 | 
##@package PlayerLVAward  
 | 
#  
 | 
# @todo:µÈ¼¶½±Àø  
 | 
# @author xdh  
 | 
# @date 2017-03-07  
 | 
# @version 1.0  
 | 
#  
 | 
#  
 | 
# ÏêϸÃèÊö: µÈ¼¶½±Àø  
 | 
#  
 | 
#---------------------------------------------------------------------  
 | 
"""Version = 2017-03-07 17:00"""  
 | 
  
 | 
import GameWorld  
 | 
import PlayerUniversalGameRec  
 | 
import ShareDefine  
 | 
import PlayerControl  
 | 
  
 | 
RecType = ShareDefine.Def_UniversalGameRecType_LVAwardRecord  
 | 
  
 | 
## Íæ¼ÒµÇ¼  
 | 
#  @param None  
 | 
#  @return None  
 | 
def OnPlayerLogin(curPlayer):  
 | 
    PlayerUniversalGameRec.SendUniversalGameRecInfo(curPlayer, RecType)  
 | 
    return  
 | 
  
 | 
  
 | 
## µÈ¼¶Àñ°üÁìÈ¡²éѯ½á¹û  
 | 
#  @param curPlayer Íæ¼ÒʵÀý  
 | 
#  @param msgList ÐÅÏ¢ÁÐ±í  
 | 
#  @return awardID  
 | 
def DoLVAwardQueryResult(curPlayer, msgList):  
 | 
    awardID = msgList[0]  
 | 
    serverLimitCnt = msgList[1]  
 | 
    awardLV = msgList[2]  
 | 
      
 | 
    curGotCnt = 0  
 | 
      
 | 
    universalRecMgr = GameWorld.GetUniversalRecMgr()  
 | 
    recTypeListData = universalRecMgr.GetTypeList(RecType)  
 | 
    findRecData = None   
 | 
    for index in range(recTypeListData.Count()):  
 | 
        recData = recTypeListData.At(index)  
 | 
        curAwardID = recData.GetValue1()  
 | 
        if awardID == curAwardID:  
 | 
            findRecData = recData  
 | 
            curGotCnt = recData.GetValue2()  
 | 
            break  
 | 
      
 | 
    if curGotCnt >= serverLimitCnt:  
 | 
        return  
 | 
    if not findRecData:  
 | 
        findRecData = recTypeListData.AddRec()  
 | 
        findRecData.SetValue1(awardID)  
 | 
    findRecData.SetValue2(curGotCnt+1)  
 | 
    #֪ͨ  
 | 
    PlayerUniversalGameRec.SendUniversalGameRecInfo(None, RecType)  
 | 
    #¹ã²¥  
 | 
    if curGotCnt == 0:  
 | 
        PlayerControl.WorldNotify(0, 'LVRewardFirst', [curPlayer.GetName(), awardLV])  
 | 
    else:  
 | 
        PlayerControl.WorldNotify(0, 'LVReward', [curPlayer.GetName(), awardLV])  
 | 
    return awardID  
 |