Beispiel #1
0
    def update_after_action(cls, act_id, act_data, data):
        """竞技场获得更好名次

        Args:
            data :新名次
        """
        # 更新进度
        if data >= act_data["data"]:
            return act_data
        else:
            act_data["data"] = data
            canget, awarded = act_data["canget"], act_data["awarded"]

            # 检查是否达成某几个阶段的目标
            index_list = game_config.act_sample_detail_cfg.get(act_id)
            for index in index_list:
                # 领过奖励的和已经知晓完成状态的步数上不再检测
                if utils.bit_test(canget, index) == 0 and utils.bit_test(awarded, index) == 0:
                    cfg = game_config.act_detail_cfg.get("%s-%s" % (act_id, index))
                    # 完成了
                    if act_data["data"] <= cfg["cond_a"]:
                        canget = utils.bit_set(canget, index)

            act_data["canget"] = canget

            return act_data
Beispiel #2
0
    def update_after_action(cls, act_id, act_data, data):
        """有可以影响数据的操作之后,更新数据

        此方法只适用于最基本的活动:
            1.类似累计获得金币达到指定数量

        Args:
            act_id :活动ID
            act_data :活动数据
            data :操作数值 类如:消费xx钻石
        """
        # 更新进度
        act_data["data"] += data

        canget, awarded = act_data["canget"], act_data["awarded"]

        # 检查是否达成某几个阶段的目标
        index_list = game_config.act_sample_detail_cfg.get(act_id)
        for index in index_list:
            # 领过奖励的和已经知晓完成状态的步数上不再检测
            if utils.bit_test(canget, index) == 0 and utils.bit_test(awarded, index) == 0:
                cfg = game_config.act_detail_cfg.get("%s-%s" % (act_id, index))
                if act_data["data"] >= cfg["cond_a"]:
                    canget = utils.bit_set(canget, index)

        act_data["canget"] = canget

        return act_data
Beispiel #3
0
    def update_after_action(cls, act_id, act_data, data):
        """竞技场获得更好名次

        Args:
            data :新名次
        """
        # 更新进度
        if data >= act_data["data"]:
            return act_data
        else:
            act_data["data"] = data
            canget, awarded = act_data["canget"], act_data["awarded"]

            # 检查是否达成某几个阶段的目标
            index_list = game_config.act_sample_detail_cfg.get(act_id)
            for index in index_list:
                # 领过奖励的和已经知晓完成状态的步数上不再检测
                if utils.bit_test(canget, index) == 0 and utils.bit_test(
                        awarded, index) == 0:
                    cfg = game_config.act_detail_cfg.get("%s-%s" %
                                                         (act_id, index))
                    # 完成了
                    if act_data["data"] <= cfg["cond_a"]:
                        canget = utils.bit_set(canget, index)

            act_data["canget"] = canget

            return act_data
Beispiel #4
0
    def update_after_action(cls, act_id, act_data, data):
        """通关试炼指定层数

        Args:
            data :新楼层
        """
        if data <= act_data["data"]:
            return act_data

        act_data["data"] = data
        canget, awarded = act_data["canget"], act_data["awarded"]

        # 检查是否达成某几个阶段的目标
        index_list = game_config.act_sample_detail_cfg.get(act_id)
        for index in index_list:
            # 领过奖励的和已经知晓完成状态的步数上不再检测
            if utils.bit_test(canget, index) == 0 and utils.bit_test(
                    awarded, index) == 0:
                cfg = game_config.act_detail_cfg.get("%s-%s" % (act_id, index))
                if act_data["data"] >= cfg["cond_a"]:
                    canget = utils.bit_set(canget, index)

        act_data["canget"] = canget

        return act_data
Beispiel #5
0
    def update_after_action(cls, act_id, act_data, data):
        """有可以影响数据的操作之后,更新数据

        此方法只适用于最基本的活动:
            1.类似累计获得金币达到指定数量

        Args:
            act_id :活动ID
            act_data :活动数据
            data :操作数值 类如:消费xx钻石
        """
        # 更新进度
        act_data["data"] += data

        canget, awarded = act_data["canget"], act_data["awarded"]

        # 检查是否达成某几个阶段的目标
        index_list = game_config.act_sample_detail_cfg.get(act_id)
        for index in index_list:
            # 领过奖励的和已经知晓完成状态的步数上不再检测
            if utils.bit_test(canget, index) == 0 and utils.bit_test(
                    awarded, index) == 0:
                cfg = game_config.act_detail_cfg.get("%s-%s" % (act_id, index))
                if act_data["data"] >= cfg["cond_a"]:
                    canget = utils.bit_set(canget, index)

        act_data["canget"] = canget

        return act_data
Beispiel #6
0
    def update_card_when_charge(self, rmb):
        """成功充值时,计算玩家是否激活月卡(金、银)两种

        Args:
            data {"state": 0, "count1": 0, "count2": 0, "time1": 1454401585, "time2": 1454401585}
                state: 0 / 1 / 2 / 3 状态 转 -》 二进制
                count1: 当前银卡充值累计 月卡失效时归0
                count2: 当前金卡充值累计 月卡失效时归0
                time1: 激活银卡的时间戳
                time2: 激活金卡的时间戳

        Returns:
            data
        """
        # 两种都已激活
        if self.card_data["state"] == 3:
            return

        # 检测银卡是否激活
        now = int(time.time())
        if not utils.bit_test(self.card_data["state"], 1):
            self.card_data["count1"] += rmb
            if self.card_data[
                    "count1"] >= static_const.VIP_SILVER_CARD_NEED_RMB:
                self.card_data["state"] += 1
                self.card_data["time1"] = now

        if not utils.bit_test(self.card_data["state"], 2):
            self.card_data["count2"] += rmb
            if self.card_data["count2"] >= static_const.VIP_GOLD_CARD_NEED_RMB:
                self.card_data["state"] += 2
                self.card_data["time2"] = now

        self.put()
Beispiel #7
0
    def update_card_when_charge(self, rmb):
        """成功充值时,计算玩家是否激活月卡(金、银)两种

        Args:
            data {"state": 0, "count1": 0, "count2": 0, "time1": 1454401585, "time2": 1454401585}
                state: 0 / 1 / 2 / 3 状态 转 -》 二进制
                count1: 当前银卡充值累计 月卡失效时归0
                count2: 当前金卡充值累计 月卡失效时归0
                time1: 激活银卡的时间戳
                time2: 激活金卡的时间戳

        Returns:
            data
        """
        # 两种都已激活
        if self.card_data["state"] == 3:
            return

        # 检测银卡是否激活
        now = int(time.time())
        if not utils.bit_test(self.card_data["state"], 1):
            self.card_data["count1"] += rmb
            if self.card_data["count1"] >= static_const.VIP_SILVER_CARD_NEED_RMB:
                self.card_data["state"] += 1
                self.card_data["time1"] = now

        if not utils.bit_test(self.card_data["state"], 2):
            self.card_data["count2"] += rmb
            if self.card_data["count2"] >= static_const.VIP_GOLD_CARD_NEED_RMB:
                self.card_data["state"] += 2
                self.card_data["time2"] = now

        self.put()
Beispiel #8
0
    def update_after_action(cls, act_id, act_data, data):
        """有可以影响数据的操作之后,更新数据

        此方法只适用于通关指定副本活动:
            1.类似第一步,通关A,B两个副本,第二步,通关C,D两个副本。

        Args:
            act_id :活动ID
            act_data :活动数据
            data :通关副本ID
        """
        missions = [
            cfg["cond_a"] for key, cfg in game_config.act_detail_cfg.items()
            if key.startswith("%s-" % act_id)
        ]

        if data not in missions:
            return act_data

        # 更新进度
        if data not in act_data["past"]:
            act_data["past"].append(data)

        canget, awarded = act_data["canget"], act_data["awarded"]

        def check_past_missions(past, cfg):
            conds = filter(
                lambda x: x,
                [cfg[attr] for attr in cfg.keys() if attr.startswith("cond_")])
            # 判断conds 是否为past的子集即可判断条件是否都已满足
            if len(set(conds).difference(past)) == 0:
                return True
            else:
                return False

        # 检查是否达成某几个阶段的目标
        index_list = game_config.act_sample_detail_cfg.get(act_id)
        for index in index_list:
            # 领过奖励的和已经知晓完成状态的步数上不再检测
            if utils.bit_test(canget, index) == 0 and utils.bit_test(
                    awarded, index) == 0:
                cfg = game_config.act_detail_cfg.get("%s-%s" % (act_id, index))
                # 完成了
                if check_past_missions(act_data["past"], cfg):
                    canget = utils.bit_set(canget, index)

        act_data["canget"] = canget

        return act_data
Beispiel #9
0
def do_charge(order, player):
    # 判断额外赠送钻石
    index = order["charge_id"]
    cfg = game_config.charge_cfg.get(index)

    if int(order["charged_amount"]) != int(order["price"]):
        amount = int(order["charged_amount"])
        add_diamond = amount * 10
    else:
        amount = order["price"]
        extra = 0 if utils.bit_test(player.vip.charged_index, index) else cfg["first_extra"]
        add_diamond = amount * 10 + extra

    # 更新数据库里状态, 为防止出错玩家刷单  先更新 然后加元宝
    charge_service.update_order_comleted(order["orderid"])

    # 加元宝,加vip经验
    player.game_info.diamond += add_diamond
    player.game_info.add_vip_exp(amount * 10, instant_save=True)

    # 充值和应该充值符合时候才额外赠送
    if int(order["charged_amount"]) == int(order["price"]):
        player.vip.charge(index)

    player.game_info.put()
    charge_service.rem_uid_paid_set(player.uid) # 从已完成付费的集合中删除已经刷新钻石的玩家ID

    try:
        stat_service.charge(player.platform, player.account_id, player.uid, order["orderid"], amount, ORDER_USED)
    except:
        logging.error("ERROR:【order status: 2 record charge log failed. 】")

    return add_diamond, amount
Beispiel #10
0
def _act_add_awards_mail(sid, actid):
    """
    """
    receivers = rank_service.get_all_players(sid)
    for uid in receivers:
        user = User.get(uid)
        if not isinstance(user, User):
            print "uid: [ %s ] not exist." % uid
        else:
            if actid not in user.activity.acts:
                continue

            act_data = user.activity.acts[actid]
            index_list = game_config.act_sample_detail_cfg.get(actid)
            awards_indexes = [
                index for index in index_list
                if utils.bit_test(act_data["canget"], index)
            ]
            if not awards_indexes:
                print "[act:%s] act add mail awards: receiver: %s, count: %s, award_level: 0, awards: {}" % (
                    actid, uid, act_data["data"])
                continue

            award_index = max(awards_indexes)
            award_cfg = game_config.act_detail_cfg.get("%s-%s" %
                                                       (actid, award_index))
            MailService.send_game(uid, 3008, [act_data["data"]],
                                  award_cfg["awards"])

            print "[act:%s] act add mail awards: receiver: %s, count: %s, award_level: %s, awards: %s" % (
                actid, uid, act_data["data"], award_index, award_cfg["awards"])
Beispiel #11
0
    def charge(self, index):
        """充值
        """
        if not utils.bit_test(self.charged_index, index):
            self.charged_index = utils.bit_set(self.charged_index, index)

        self.put()
Beispiel #12
0
    def charge(self, index):
        """充值
        """
        if not utils.bit_test(self.charged_index, index):
            self.charged_index = utils.bit_set(self.charged_index, index)

        self.put()
Beispiel #13
0
def buy(context):
    """购买特权礼包

    Args:
        index 与vip相对应

    Returns:
        mc
    """
    ki_user = context.user

    index = context.get_parameter("index")
    if index > ki_user.game_info.vip_level:
        context.result['mc'] = MsgCode['UserVipTooLow']
        return

    # 只能买一次
    if utils.bit_test(ki_user.vip.bought_gifts, index):
        context.result['mc'] = MsgCode['VipGiftAlreadyBought']
        return

    cfg = game_config.vip_priv_cfg.get(index, {})
    if not cfg:
        context.result['mc'] = MsgCode['VipGiftNotExist']
        return

    if not user_logic.check_game_values1(ki_user, diamond=cfg["priv_gift_price"]):
        context.result['mc'] = MsgCode['DiamondNotEnough']
        return

    ki_user.vip.buy(index)
    pack_logic.add_items(ki_user, cfg["priv_gift"])
    user_logic.consume_game_values1(ki_user, diamond=cfg["priv_gift_price"])

    context.result['mc'] = MsgCode['VipGiftBuySuccess']
Beispiel #14
0
def do_charge(order, player):
    # 判断额外赠送钻石
    index = order["charge_id"]
    cfg = game_config.charge_cfg.get(index)

    if int(order["charged_amount"]) != int(order["price"]):
        amount = int(order["charged_amount"])
        add_diamond = amount * 10
    else:
        amount = order["price"]
        extra = 0 if utils.bit_test(player.vip.charged_index,
                                    index) else cfg["first_extra"]
        add_diamond = amount * 10 + extra

    # 更新数据库里状态, 为防止出错玩家刷单  先更新 然后加元宝
    charge_service.update_order_comleted(order["orderid"])

    # 加元宝,加vip经验
    player.game_info.diamond += add_diamond
    player.game_info.add_vip_exp(amount * 10, instant_save=True)

    # 充值和应该充值符合时候才额外赠送
    if int(order["charged_amount"]) == int(order["price"]):
        player.vip.charge(index)

    player.game_info.put()
    charge_service.rem_uid_paid_set(player.uid)  # 从已完成付费的集合中删除已经刷新钻石的玩家ID

    try:
        stat_service.charge(player.platform, player.account_id, player.uid,
                            order["orderid"], amount, ORDER_USED)
    except:
        logging.error("ERROR:【order status: 2 record charge log failed. 】")

    return add_diamond, amount
Beispiel #15
0
    def check_award_can_get(cls, act_data, index):
        """检查奖励是否满足条件了

        Returns:
            0 / 1
        """
        # TODO 须扩展  领取时再次详细检查活动达成条件
        return utils.bit_test(act_data["canget"], index)
Beispiel #16
0
    def check_award_can_get(cls, act_data, index):
        """检查奖励是否满足条件了

        Returns:
            0 / 1
        """
        # TODO 须扩展  领取时再次详细检查活动达成条件
        return utils.bit_test(act_data["canget"], index)
Beispiel #17
0
    def update_after_action(cls, act_id, act_data, data):
        """有可以影响数据的操作之后,更新数据

        此方法只适用于通关指定副本活动:
            1.类似第一步,通关A,B两个副本,第二步,通关C,D两个副本。

        Args:
            act_id :活动ID
            act_data :活动数据
            data :当前获得机甲ID列表
        """
        if data == act_data["have"]:
            return act_data

        # 更新进度
        if data != act_data["have"]:
            act_data["have"] = data

        canget, awarded = act_data["canget"], act_data["awarded"]

        def check_have_heros(have, cfg):
            conds = filter(
                lambda x: x,
                [cfg[attr] for attr in cfg.keys() if attr.startswith("cond_")])
            # 判断conds 是否为have的子集即可判断条件是否都已满足
            if len(set(conds).difference(have)) == 0:
                return True
            else:
                return False

        # 检查是否达成某几个阶段的目标
        index_list = game_config.act_sample_detail_cfg.get(act_id)
        for index in index_list:
            # 领过奖励的和已经知晓完成状态的步数上不再检测
            if utils.bit_test(canget, index) == 0 and utils.bit_test(
                    awarded, index) == 0:
                cfg = game_config.act_detail_cfg.get("%s-%s" % (act_id, index))
                # 完成了
                if check_have_heros(act_data["have"], cfg):
                    canget = utils.bit_set(canget, index)

        act_data["canget"] = canget

        return act_data
Beispiel #18
0
    def update_after_action(cls, act_id, act_data, data):
        """有可以影响数据的操作之后,更新数据

        此方法只适用于通关指定副本活动:
            1.类似第一步,通关A,B两个副本,第二步,通关C,D两个副本。

        Args:
            act_id :活动ID
            act_data :活动数据
            data :通关副本ID
        """
        missions = [cfg["cond_a"] for key, cfg in game_config.act_detail_cfg.items() if key.startswith("%s-" % act_id)]

        if data not in missions:
            return act_data

        # 更新进度
        if data not in act_data["past"]:
            act_data["past"].append(data)

        canget, awarded = act_data["canget"], act_data["awarded"]

        def check_past_missions(past, cfg):
            conds = filter(lambda x: x, [cfg[attr] for attr in cfg.keys() if attr.startswith("cond_")])
            # 判断conds 是否为past的子集即可判断条件是否都已满足
            if len(set(conds).difference(past)) == 0:
                return True
            else:
                return False

        # 检查是否达成某几个阶段的目标
        index_list = game_config.act_sample_detail_cfg.get(act_id)
        for index in index_list:
            # 领过奖励的和已经知晓完成状态的步数上不再检测
            if utils.bit_test(canget, index) == 0 and utils.bit_test(awarded, index) == 0:
                cfg = game_config.act_detail_cfg.get("%s-%s" % (act_id, index))
                # 完成了
                if check_past_missions(act_data["past"], cfg):
                    canget = utils.bit_set(canget, index)

        act_data["canget"] = canget

        return act_data
Beispiel #19
0
    def update_after_action(cls, act_id, act_data, data):
        """ 更新进度
        """
        act_data["data"][data[0]] += data[1]

        canget, awarded = act_data["canget"], act_data["awarded"]

        # 检查是否达成某几个阶段的目标
        index_list = game_config.act_sample_detail_cfg.get(act_id)
        for index in index_list:
            # 领过奖励的和已经知晓完成状态的步数上不再检测
            if utils.bit_test(canget, index) == 0 and utils.bit_test(awarded, index) == 0:
                cfg = game_config.act_detail_cfg.get("%s-%s" % (act_id, index))

                if tuple(act_data["data"]) >= (cfg["cond_a"], cfg["cond_b"], cfg["cond_c"], cfg["cond_d"], cfg["cond_e"]):
                    canget = utils.bit_set(canget, index)

        act_data["canget"] = canget

        return act_data
Beispiel #20
0
    def update_after_action(cls, act_id, act_data, sid, data):
        """
        """
        act_info = act_service.get_act_info(sid, act_id)
        if not act_info:
            return act_data

        daydiff = (datetime.date.today() - datetime.date.fromtimestamp(act_info["start"])).days + 1

        canget, awarded = act_data["canget"], act_data["awarded"]
        index_list = game_config.act_sample_detail_cfg.get(act_id)
        for index in index_list:
            if utils.bit_test(canget, index) == 0 and utils.bit_test(awarded, index) == 0:
                cfg = game_config.act_detail_cfg.get("%s-%s" % (act_id, index))
                if daydiff >= cfg["cond_a"]:
                    canget = utils.bit_set(canget, index)

        act_data["canget"] = canget

        return act_data
Beispiel #21
0
    def update_card_when_request(self):
        """玩家每次操作时,计算玩家的月卡是否失效【重要数据,必须严格】
        """
        if self.card_data["state"] == 0:
            return

        # 检测银卡是否激活
        now = int(time.time())

        if utils.bit_test(self.card_data["state"], 1) and \
            now - self.card_data["time1"] >= static_const.VIP_CARD_REMAIN_SECONDS:
            self.card_data["state"] -= 1
            self.card_data["time1"], self.card_data["count1"] = 0, 0

        if utils.bit_test(self.card_data["state"], 2) and \
            now - self.card_data["time2"] >= static_const.VIP_CARD_REMAIN_SECONDS:
            self.card_data["state"] -= 2
            self.card_data["time2"], self.card_data["count2"] = 0, 0

        self.put()
Beispiel #22
0
    def update_card_when_request(self):
        """玩家每次操作时,计算玩家的月卡是否失效【重要数据,必须严格】
        """
        if self.card_data["state"] == 0:
            return

        # 检测银卡是否激活
        now = int(time.time())

        if utils.bit_test(self.card_data["state"], 1) and \
            now - self.card_data["time1"] >= static_const.VIP_CARD_REMAIN_SECONDS:
                self.card_data["state"] -= 1
                self.card_data["time1"], self.card_data["count1"] = 0, 0

        if utils.bit_test(self.card_data["state"], 2) and \
            now - self.card_data["time2"] >= static_const.VIP_CARD_REMAIN_SECONDS:
                self.card_data["state"] -= 2
                self.card_data["time2"], self.card_data["count2"] = 0, 0

        self.put()
Beispiel #23
0
    def update_after_action(cls, act_id, act_data, data):
        """有可以影响数据的操作之后,更新数据

        此方法只适用于通关指定副本活动:
            1.类似第一步,通关A,B两个副本,第二步,通关C,D两个副本。

        Args:
            act_id :活动ID
            act_data :活动数据
            data :当前获得机甲ID列表
        """
        if data == act_data["have"]:
            return act_data

        # 更新进度
        if data != act_data["have"]:
            act_data["have"] = data

        canget, awarded = act_data["canget"], act_data["awarded"]

        def check_have_heros(have, cfg):
            conds = filter(lambda x: x, [cfg[attr] for attr in cfg.keys() if attr.startswith("cond_")])
            # 判断conds 是否为have的子集即可判断条件是否都已满足
            if len(set(conds).difference(have)) == 0:
                return True
            else:
                return False

        # 检查是否达成某几个阶段的目标
        index_list = game_config.act_sample_detail_cfg.get(act_id)
        for index in index_list:
            # 领过奖励的和已经知晓完成状态的步数上不再检测
            if utils.bit_test(canget, index) == 0 and utils.bit_test(awarded, index) == 0:
                cfg = game_config.act_detail_cfg.get("%s-%s" % (act_id, index))
                # 完成了
                if check_have_heros(act_data["have"], cfg):
                    canget = utils.bit_set(canget, index)

        act_data["canget"] = canget

        return act_data
Beispiel #24
0
    def update_after_action(cls, act_id, act_data, sid, data):
        """
        """
        act_info = act_service.get_act_info(sid, act_id)
        if not act_info:
            return act_data

        daydiff = (datetime.date.today() -
                   datetime.date.fromtimestamp(act_info["start"])).days + 1

        canget, awarded = act_data["canget"], act_data["awarded"]
        index_list = game_config.act_sample_detail_cfg.get(act_id)
        for index in index_list:
            if utils.bit_test(canget, index) == 0 and utils.bit_test(
                    awarded, index) == 0:
                cfg = game_config.act_detail_cfg.get("%s-%s" % (act_id, index))
                if daydiff >= cfg["cond_a"]:
                    canget = utils.bit_set(canget, index)

        act_data["canget"] = canget

        return act_data
Beispiel #25
0
    def update_after_action(cls, act_id, act_data, data):
        """ 更新进度
        """
        act_data["data"][data[0]] += data[1]

        canget, awarded = act_data["canget"], act_data["awarded"]

        # 检查是否达成某几个阶段的目标
        index_list = game_config.act_sample_detail_cfg.get(act_id)
        for index in index_list:
            # 领过奖励的和已经知晓完成状态的步数上不再检测
            if utils.bit_test(canget, index) == 0 and utils.bit_test(
                    awarded, index) == 0:
                cfg = game_config.act_detail_cfg.get("%s-%s" % (act_id, index))

                if tuple(act_data["data"]) >= (cfg["cond_a"], cfg["cond_b"],
                                               cfg["cond_c"], cfg["cond_d"],
                                               cfg["cond_e"]):
                    canget = utils.bit_set(canget, index)

        act_data["canget"] = canget

        return act_data
Beispiel #26
0
    def update_after_action(cls, act_id, act_data, data):
        """通关试炼指定层数

        Args:
            data :新楼层
        """
        if data <= act_data["data"]:
            return act_data

        act_data["data"] = data
        canget, awarded = act_data["canget"], act_data["awarded"]

        # 检查是否达成某几个阶段的目标
        index_list = game_config.act_sample_detail_cfg.get(act_id)
        for index in index_list:
            # 领过奖励的和已经知晓完成状态的步数上不再检测
            if utils.bit_test(canget, index) == 0 and utils.bit_test(awarded, index) == 0:
                cfg = game_config.act_detail_cfg.get("%s-%s" % (act_id, index))
                if act_data["data"] >= cfg["cond_a"]:
                    canget = utils.bit_set(canget, index)

        act_data["canget"] = canget

        return act_data
Beispiel #27
0
def buy(context):
    """购买特权礼包

    Args:
        index 与vip相对应

    Returns:
        mc
    """
    ki_user = context.user

    index = context.get_parameter("index")
    if index > ki_user.game_info.vip_level:
        context.result['mc'] = MsgCode['UserVipTooLow']
        return

    # 只能买一次
    if utils.bit_test(ki_user.vip.bought_gifts, index):
        context.result['mc'] = MsgCode['VipGiftAlreadyBought']
        return

    cfg = game_config.vip_priv_cfg.get(index, {})
    if not cfg:
        context.result['mc'] = MsgCode['VipGiftNotExist']
        return

    if not user_logic.check_game_values1(ki_user,
                                         diamond=cfg["priv_gift_price"]):
        context.result['mc'] = MsgCode['DiamondNotEnough']
        return

    ki_user.vip.buy(index)
    pack_logic.add_items(ki_user, cfg["priv_gift"])
    user_logic.consume_game_values1(ki_user, diamond=cfg["priv_gift_price"])

    context.result['mc'] = MsgCode['VipGiftBuySuccess']
Beispiel #28
0
 def check_award_repeat(cls, act_data, index):
     """检查奖励是否重复领取了
     """
     return utils.bit_test(act_data["awarded"], index)
Beispiel #29
0
 def check_award_repeat(cls, act_data, index):
     """检查奖励是否重复领取了
     """
     return utils.bit_test(act_data["awarded"], index)