def _add_succeed(self, data, req, timer): res = broadcast_pb2.AddBroadcastInfoRes() res.status = 0 response = res.SerializeToString() logger.notice("Add broadcast succeed[req=%s][res=%s][consume=%d]" % (req, res, timer.count_ms())) return response
def _check_add_technology_broadcast_result(self, response): res = broadcast_pb2.AddBroadcastInfoRes() res.ParseFromString(response) if res.status != 0: raise Exception("Add technology broadcast result failed") return True
def _add_failed(self, err, req, timer): logger.fatal("Add broadcast failed[reason=%s]" % err) res = broadcast_pb2.AddBroadcastInfoRes() res.status = -1 response = res.SerializeToString() logger.notice("Add broadcast failed[req=%s][res=%s][consume=%d]" % (req, res, timer.count_ms())) return response
def _check_add_melee_broadcast_title_result(self, response): res = broadcast_pb2.AddBroadcastInfoRes() res.ParseFromString(response) if res.status != 0: raise Exception("Add melee broadcast title result failed") return True
def _check_add_upgrade_evolution_level_broadcast_result(self, response): res = broadcast_pb2.AddBroadcastInfoRes() res.ParseFromString(response) if res.status != 0: raise Exception("Add arena broadcast result failed") return True
def _check_add_battle_defeated_broadcast_result(self, response): res = broadcast_pb2.AddBroadcastInfoRes() res.ParseFromString(response) if res.status != 0: raise Exception( "Add battle defeated broadcast win num result failed") return True
def _check_add_broadcast_record_result(self, response, data, req, timer): res = broadcast_pb2.AddBroadcastInfoRes() res.ParseFromString(response) if res.status != 0: raise Exception("Add broadcast record result failed") #log = log_formater.output(data, "Add notice succeed", req, res, timer.count_ms()) #logger.notice(log) logger.notice("Add notice succeed[req=%s][res=%s][consume=%d]" % (req, res, timer.count_ms())) return response
def _update_broadcast_result(self, response): res = broadcast_pb2.AddBroadcastInfoRes() res.ParseFromString(response) return res.status == 0