hxp
2021-02-20 71a5b8c236d7538053a3a893adccaa0d59798521
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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GameWorldOpenServerCampaign
#
# @todo:¿ª·þ»î¶¯
# @author hxp
# @date 2018-03-06
# @version 1.0
#
# ÏêϸÃèÊö: ¿ª·þ»î¶¯
#
#-------------------------------------------------------------------------------
#"""Version = 2018-03-06 11:00"""
#-------------------------------------------------------------------------------
 
 
import GameWorld
import ShareDefine
 
 
def CanGiveCampaignAward(curPlayer, msgList):
    ## ¿É·ñÁìÈ¡¿ª·þ»î¶¯°ñµ¥½±Àø
    
    if not curPlayer:
        return msgList
    
    campTypeList, isEndMail = msgList
    
    queryResultList = []
    for oscType in campTypeList:
        queryResultList.append(__GetGiveCampaignAwardInfo(curPlayer, oscType))
    msgList.append(queryResultList)
    
    GameWorld.DebugLog("ÇëÇóÁìÈ¡¿ª·þ»î¶¯½±Àø: campTypeList=%s,isEndMail=%s,queryResultList=%s" 
                       % (campTypeList, isEndMail, queryResultList), curPlayer.GetPlayerID())
    return msgList
 
def __GetGiveCampaignAwardInfo(curPlayer, campaignType):
    ## »ñÈ¡Áì½±ËùÐèµÄÐÅÏ¢
    
    awardBillboardType = ShareDefine.Def_Campaign_Billboard_Dict.get(campaignType)
    if not awardBillboardType:
        return 0
    
    billBoard = GameWorld.GetBillboard().FindBillboard(awardBillboardType)
    if not billBoard:
        return 0
    
    curPlayerID = curPlayer.GetPlayerID()
    order = billBoard.IndexOfByID(curPlayerID) + 1  # Íæ¼ÒÔÚÅÅÐаñÖеÄÃû´Î
    GameWorld.DebugLog("    ½±Àø°ñ: campaignType=%s,order=%s" % (campaignType, order), curPlayerID)
    return order