hxp
2019-04-18 c562008bec642a25245295eeec567081bc4e4c42
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/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