hxp
2021-11-17 ffa8a645ed6a92a3c723bbf5c7f1eb4d5425c826
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GM.Commands.BillboardData
#
# @todo:°ñµ¥Êý¾Ý
# @author hxp
# @date 2019-03-30
# @version 1.0
#
# ÏêϸÃèÊö: °ñµ¥Êý¾Ý
#
#-------------------------------------------------------------------------------
#"""Version = 2019-03-30 17:00"""
#-------------------------------------------------------------------------------
 
import GameWorld
import ShareDefine
import PlayerBillboard
 
def __Help(curPlayer, errInfo=""):
    GameWorld.DebugAnswer(curPlayer, "---------- %s" % GameWorld.GetCurrentDataTimeStr())
    if errInfo:
        GameWorld.DebugAnswer(curPlayer, errInfo)
    GameWorld.DebugAnswer(curPlayer, "ÐÂÔö°ñµ¥¼ÙÊý¾Ý: BillboardData ÀàÐÍ ÌõÊý ±È½ÏÖµ1 ¿ÉÑ¡²ÎÊý(±È½ÏÖµ2 ³£¹æÖµ1 ³£¹æÖµ2)")
    GameWorld.DebugAnswer(curPlayer, "ɾ³ý°ñµ¥¼ÙÊý¾Ý: BillboardData ÀàÐÍ")
    GameWorld.DebugAnswer(curPlayer, "°ñµ¥ÀàÐÍ:0-Õ½Á¦,1-Áú»ê,2-ÁéÑþ,4-µÈ¼¶,5-×øÆï,6-Áé³è,7-·ûÓ¡,8-ÍÑ»ú,9-¾³½ç,19-ÖúÕ½")
    GameWorld.DebugAnswer(curPlayer, "¿ª·þ»î¶¯°ñÀàÐÍ:11-Ç¿»¯,12-×øÆï,13-±¦Ê¯,14-³å¼¶,15-¾³½ç,16-Õ½Á¦,18-·ûÓ¡,20-Éñ±ø,21-³äÖµ,22-Áé³è,24-Áé¸ù,25-ÉýÐÇ")
    GameWorld.DebugAnswer(curPlayer, "ÔËÓª»î¶¯°ñÀàÐÍ:17-ÏɽçÊ¢µä,23-ÏɽçÊ¢µä2")
    GameWorld.DebugAnswer(curPlayer, "÷ÈÁ¦°ñµ¥ÀàÐÍ:30-×ܰñ,31-Öܰñ,31-ÈÕ°ñ")
    return
 
## Ö´ÐÐÂß¼­
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param gmList []
#  @return None
def OnExec(curPlayer, gmList):
    
    paramLen = len(gmList)
    if not paramLen:
        __Help(curPlayer)
        return
    
    billboardIndex = gmList[0]
    if billboardIndex < 0 or billboardIndex >= ShareDefine.Def_BT_Max:
        __Help(curPlayer, "°ñµ¥ÀàÐͲ»´æÔÚ!")
        return
    billBoard = GameWorld.GetBillboard().FindBillboard(billboardIndex)
    curDataCount = billBoard.GetCount()
    maxDataCount = billBoard.GetMaxCount()
    
    # Çå³ý°ñµ¥¼ÙÊý¾Ý
    if paramLen == 1:
        delCount = 0
        while curDataCount > 0:
            curDataCount -= 1
            index = curDataCount
            billBoardData = billBoard.At(index)
            if billBoardData.GetID() <= maxDataCount:
                billBoard.DeleteByIndex(index)
                delCount += 1
                
        GameWorld.DebugAnswer(curPlayer, "ɾ³ý°ñµ¥(%s)Êý¾Ý: %s Ìõ" % (billboardIndex, delCount))
        return
    
    if paramLen < 3:
        __Help(curPlayer)
        return
    
    billboardIndex, count, cmpValue1 = gmList[:3]
    cmpValue2 = gmList[3] if len(gmList) > 3 else 0
    value1 = gmList[4] if len(gmList) > 4 else 0
    value2 = gmList[5] if len(gmList) > 5 else 0
    
    autoSort = False
    bType2 = 0
    curPlayerOpInfo = ""
    
    count = min(count, maxDataCount - curDataCount)
    FakeName = "¼ÙÃû×Ö".decode(ShareDefine.Def_Game_Character_Encoding).encode(GameWorld.GetCharacterEncoding())
    
    for i in xrange(count):
        dataPlayerID = curDataCount + 1 + i
        dataPlayerName = "%s%s" % (FakeName, i)
        dataCmpValue1 = max(0, cmpValue1 - i)
        dataCmpValue2 = max(0, cmpValue2 - i)
        PlayerBillboard.UpdatePlayerBillboard(dataPlayerID, dataPlayerName, curPlayerOpInfo, billboardIndex, bType2, value1, value2, dataCmpValue1, autoSort, dataCmpValue2)
        
    billBoard.Sort()
    
    GameWorld.DebugAnswer(curPlayer, "Ìí¼Ó°ñµ¥(%s)Êý¾Ý: %s Ìõ" % (billboardIndex, count))
    return