def tr(uid, gacha_point_table, total): model_mgr = ModelRequestMgr() if gacha_point_table: for iid, point in gacha_point_table.items(): if point < 1: continue def forUpdateGacha(model, inserted, point): model.point = point model_mgr.add_forupdate_task( GachaConsumePoint, GachaConsumePoint.makeID(uid, iid), forUpdateGacha, point) # 生涯課金額. def forUpdatePlayerConsumePoint(model, inserted, total): model.point_total = total model_mgr.add_forupdate_task(PlayerConsumePoint, uid, forUpdatePlayerConsumePoint, total) model_mgr.write_all() return model_mgr
def tr_write(self, uid): model_mgr = ModelRequestMgr() def forUpdate(instance, inserted): instance.resetcount = 0 model_mgr.add_forupdate_task(GachaBoxResetPlayerData, uid, forUpdate) model_mgr.write_all() model_mgr.write_end()
def tr(data): model_mgr = ModelRequestMgr() def forUpdate(model, inserted): for k, v in data.items(): setattr(model, k, v) model_mgr.add_forupdate_task(PcMoviePlayList, mid, forUpdate) model_mgr.write_all() return model_mgr
def tr(self, target_uid): model_mgr = ModelRequestMgr() def forUpdate(model, inserted): model.resetcount = 2 model_mgr.add_forupdate_task(GachaBoxResetPlayerData, target_uid, forUpdate) model_mgr.write_all() model_mgr.write_end()
def tr_update(self, resetdata): model_mgr = ModelRequestMgr() def forUpdate(instance, inserted): instance.is_get_targetrarity = True for data in resetdata: model_mgr.add_forupdate_task(GachaBoxResetPlayerData, data.id, forUpdate) model_mgr.write_all() model_mgr.write_end()
def tr_incentive(self, uid, is_set_conversion, is_set_incentive, is_prize_incentive): model_mgr = ModelRequestMgr() def forUpdateIncentive(model, inserted, is_received): model.is_set_conversion = is_set_conversion model.is_set_incentive = is_set_incentive model.is_prize_incentive = is_prize_incentive model.is_received = is_received if is_set_conversion and is_set_incentive and is_prize_incentive: prizelist = BackendApi.get_prizelist(model_mgr, [Defines.DXP.insentive_prize_masterid]) BackendApi.tr_add_prize(model_mgr, uid, prizelist, Defines.DXP.textid) is_received = True else: is_received = False model_mgr.add_forupdate_task(PlayerDXPWallConversion, uid, forUpdateIncentive, is_received) model_mgr.write_all() model_mgr.write_end()