hxp
2025-06-12 edc3910a9d090e5df4deb2dbc37709a740375938
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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GM.Commands.SetVIP
#
# @todo:ÉèÖÃVIPÐÅÏ¢
# @author hxp
# @date 2018-02-06
# @version 1.0
#
# ÏêϸÃèÊö: ÉèÖÃVIPÐÅÏ¢
#
#-------------------------------------------------------------------------------
#"""Version = 2018-02-06 11:00"""
#-------------------------------------------------------------------------------
 
import ChConfig
import PlayerControl
import GameWorld
import PlayerVip
 
import time
 
 
## Âß¼­ÊµÏÖ
#  @param curPlayer
#  @param cmdList ²ÎÊýÁбí
#  @return None
def OnExec(curPlayer, cmdList):
    if not cmdList:
        GameWorld.DebugAnswer(curPlayer, "SetVIP µÈ¼¶ ¾­Ñé »¹Óм¸Ãë¹ýÆÚ")
        GameWorld.DebugAnswer(curPlayer, "µÈ¼¶±ØÐë²ÎÊý£¬ÆäËû¿ÉÑ¡")
        GameWorld.DebugAnswer(curPlayer, "ÖØÖÃ: SetVIP 0")
        return
    
    vipLV = cmdList[0]
    if not vipLV:
        curPlayer.SetChangeCoinPointTotal(0)
        curPlayer.SetVIPLv(0)
        PlayerControl.SetVIPLVUpTime(curPlayer, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_VipExp, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_VipAwardRecord, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_VipBuyRecord, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_VIPLastTime, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_VipTimeOutRecord, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_VIPKillLV, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_VIPKillLVExp, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_VIPKillLVExpPoint, 0)
        PlayerControl.SetVIPExpireTime(curPlayer, 0)
        PlayerVip.Sycn_VIPMsg(curPlayer)
        PlayerVip.Sycn_VIPAwardRecord(curPlayer)
        PlayerVip.Sycn_VIPTime(curPlayer, isForce=True)
        PlayerVip.SyncVIPKillNPCLVInfo(curPlayer)
        PlayerVip.RefreshVIPAttr(curPlayer)
        GameWorld.DebugAnswer(curPlayer, 'ClearVIP OK!')
        return
    
    curPlayer.SetVIPLv(vipLV)
    PlayerControl.SetVIPLVUpTime(curPlayer, int(time.time()))
    
    vipExp = cmdList[1] if len(cmdList) > 1 else None
    if vipExp != None:
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_VipExp, vipExp)
        
    PlayerVip.Sycn_VIPMsg(curPlayer)
    
    expireTime = cmdList[2] if len(cmdList) > 2 else None
    if expireTime != None:
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_VipTimeOutRecord, 0)
        PlayerControl.SetVIPExpireTime(curPlayer, int(time.time()) + expireTime)
        PlayerVip.Sycn_VIPTime(curPlayer, isForce=True)
        
    PlayerVip.RefreshVIPAttr(curPlayer)
    return