xdh
2019-03-05 0cb288fc2cad76d7cd8150a3e0b15bbe0eff2c1e
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/SetRedPacket.py
@@ -19,6 +19,7 @@
import PlayerControl
import ChConfig
import PlayerFamilyRedPacket
import PlayerFeastRedPacket
import IpyGameDataPY
import PlayerSuccess
@@ -29,17 +30,23 @@
#  @remarks 函数详细说明.
def OnExec(curPlayer, paramList):
    if not paramList:
        GameWorld.DebugAnswer(curPlayer, "重置红包:SetRedPacket 0")
        GameWorld.DebugAnswer(curPlayer, "SetRedPacket 红包功能  可抢个数 已抢额度")
        GameWorld.DebugAnswer(curPlayer, "重置所有红包领取:SetRedPacket 0")
        GameWorld.DebugAnswer(curPlayer, "清除所有类型红包:SetRedPacket 0 0")
        GameWorld.DebugAnswer(curPlayer, "清除指定类型红包:SetRedPacket 0 类型A 类型B ...")
        GameWorld.DebugAnswer(curPlayer, "设置功能红包数据:SetRedPacket 红包功能  可抢个数 已抢额度")
        GameWorld.DebugAnswer(curPlayer, "红包功能: 1-开服红包;2-节日红包")
        return
    
    paramA = paramList[0]
    # 重置所有红包数据
    if len(paramList) == 1 and paramList[0] == 0:
    if paramA == 0:
        __DOResetSuccRedPack(curPlayer)
        __DoResetRedPackFunc(curPlayer, 1, None, 0)
        __DoResetRedPackFunc(curPlayer, 2, None, 0)
        curPlayer.GameServer_GMCmd("SetRedPacket 0") # 发送到GameServer清除红包
        paramStr = ""
        for param in paramList:
            paramStr += " %s" % param
        curPlayer.GameServer_GMCmd("SetRedPacket%s" % paramStr) # 发送到GameServer清除红包
        return
    
    if len(paramList) == 3:
@@ -84,8 +91,9 @@
    elif redPackFuncType == 2:
        if not isinstance(grabCount, int):
            grabCount = IpyGameDataPY.GetFuncCfg('FeastRedPacket', 1)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OSRedPacketCanGrabCnt, grabCount)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OSRedPacketGrabMoney, grabMoney)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastRedPacketCanGrabCnt, grabCount)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastRedPacketGrabMoney, grabMoney)
        PlayerFeastRedPacket.Sync_FeastRedPackInfo(curPlayer)
    return