#!/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
|