Exemple #1
0
    def _pray_failed(self, err, req, timer):
        logger.fatal("Pray failed[reason=%s]" % err)

        res = pray_pb2.PrayRes()
        res.status = -1
        response = res.SerializeToString()
        logger.notice("Pray failed[user_id=%d][req=%s][res=%s][consume=%d]" %
                      (timer.id, req, res, timer.count_ms()))
        return response
Exemple #2
0
    def _giveup_pray_succeed(self, data, req, timer):
        res = pray_pb2.PrayRes()
        res.status = 0
        pack.pack_pray_info(data.pray.get(True), res.pray_info, timer.now)
        response = res.SerializeToString()

        log = log_formater.output(data, "Giveup pray succeed", req, res,
                                  timer.count_ms())
        logger.notice(log)
        return response
Exemple #3
0
    def _choose_card_succeed(self, data, req, timer):
        res = pray_pb2.PrayRes()
        res.status = 0
        pack.pack_pray_info(data.pray.get(True), res.pray_info, timer.now)
        pack.pack_resource_info(data.resource.get(True), res.resource)
        response = res.SerializeToString()

        log = log_formater.output(data, "Choose card succeed", req, res,
                                  timer.count_ms())
        logger.notice(log)
        return response