mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Make factory upload limit configurable and increase default to mitigate #105
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
use polariton_server::operations::SimpleFunc;
|
||||
use polariton_server::operations::Immediate;
|
||||
use polariton::operation::{ParameterTable, Typed};
|
||||
|
||||
const PARAM_KEY: u8 = 100;
|
||||
|
||||
pub(super) fn robot_shop_submission_infos_provider() -> SimpleFunc<95, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
|
||||
SimpleFunc::new(|params, _| {
|
||||
let mut params = params.to_dict();
|
||||
pub(super) fn robot_shop_submission_infos_provider(config: &oj_rc_core::ConfigImpl) -> Immediate<95, crate::UserTy> {
|
||||
let max_subs = <oj_rc_core::ConfigImpl as oj_rc_core::ConfigProvider<()>>::factory_config(config).upload_limit;
|
||||
Immediate::new(|| {
|
||||
let mut params = ParameterTable::with_capacity(2);
|
||||
params.insert(PARAM_KEY, Typed::HashMap(vec![
|
||||
(Typed::Str("submissionCount".into()), Typed::Int(0)),
|
||||
(Typed::Str("maxSubmissions".into()), Typed::Int(10)),
|
||||
(Typed::Str("maxSubmissions".into()), Typed::Int(max_subs)),
|
||||
].into()));
|
||||
Ok(params.into())
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ pub fn handler(init_ctx: &crate::InitConfig) -> OperationsHandler<crate::UserTy>
|
||||
.add(player_rank::rank_static_provider())
|
||||
.add(ab_test_group::test_group_provider())
|
||||
.add(league_limits::league_battle_parameters_provider())
|
||||
.add(crf_limits::robot_shop_submission_infos_provider())
|
||||
.add(crf_limits::robot_shop_submission_infos_provider(&init_ctx.cubes))
|
||||
.add(robot_mastery_settings::robot_mastery_settings_provider())
|
||||
.add(player_started_purchase::started_purchase_provider())
|
||||
.add(custom_games_team::team_setup_provider())
|
||||
|
||||
Reference in New Issue
Block a user