1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Complete bare minimum to seem logged in

This commit is contained in:
NGnius (Graham)
2025-03-01 16:22:57 -05:00
parent fe30e783ad
commit 7e31f6fe1d
55 changed files with 1147 additions and 81 deletions

View File

@@ -0,0 +1,14 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed};
const TEST_PARAM_KEY: u8 = 166;
const TEST_GROUP_PARAM_KEY: u8 = 167;
pub(super) fn test_group_provider() -> SimpleFunc<55, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(TEST_PARAM_KEY, Typed::Str("RE_AB_test".into()));
params.insert(TEST_GROUP_PARAM_KEY, Typed::Str("RE_AB_test_group".into()));
Ok(params.into())
})
}

View File

@@ -19,9 +19,9 @@ pub(super) fn all_customisations_provider() -> SimpleFunc<216, crate::UserTy, im
ty: 104, // hashtable
items: vec![
CustomisationData {
id: "skin0".to_string(),
localised_name: "Default".to_string(),
skin_scene_name: "TODO_skin".to_string(),
id: "RC_MothershipSkin_Neptune_01".to_string(),
localised_name: "Neptune 01".to_string(),
skin_scene_name: "RC_MothershipSkin_Neptune_01".to_string(),
simulation_prefab: "TODO_sim_prefab".to_string(),
preview_image_name: "TODO_preview_img".to_string(),
is_default: true,

View File

@@ -0,0 +1,16 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed};
const PROGRESS_PARAM_KEY: u8 = 199;
const LEVEL_PARAM_KEY: u8 = 81;
const GAINED_XP_PARAM_KEY: u8 = 205;
pub(super) fn building_xp_save_provider() -> SimpleFunc<170, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PROGRESS_PARAM_KEY, Typed::Float(1.0));
params.insert(LEVEL_PARAM_KEY, Typed::Int(31337));
params.insert(GAINED_XP_PARAM_KEY, Typed::Int(0));
Ok(params.into())
})
}

View File

@@ -0,0 +1,21 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
const PARAM_KEY: u8 = 79;
pub(super) fn building_xp_config_provider() -> SimpleFunc<199, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 104, // hashtable
items: vec![
(Typed::Str("BuildXPSettings".into()), Typed::HashMap(vec![
(Typed::Str("buildModePeriodUserEarnXP".into()), Typed::Float(1.0)), // TODO what are the time units?
(Typed::Str("buildModePeriodUserInactivity".into()), Typed::Float(2.0)),
].into())),
],
}));
Ok(params.into())
})
}

View File

@@ -0,0 +1,14 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed};
const PARAM_KEY: u8 = 17;
pub(super) fn chat_settings_provider() -> SimpleFunc<18, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::HashMap(vec![
(Typed::Str("chatEnabled".into()), Typed::Bool(true.into())),
].into()));
Ok(params.into())
})
}

View File

@@ -0,0 +1,15 @@
use polariton_server::operations::SimpleFunc;
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();
params.insert(PARAM_KEY, Typed::HashMap(vec![
(Typed::Str("submissionCount".into()), Typed::Int(0)),
(Typed::Str("maxSubmissions".into()), Typed::Int(10)),
].into()));
Ok(params.into())
})
}

View File

@@ -0,0 +1,15 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Arr};
const PARAM_KEY: u8 = 216;
pub(super) fn cube_awards_provider() -> SimpleFunc<206, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Arr(Arr {
ty: 115, // str
items: Vec::default(),
}));
Ok(params.into())
})
}

View File

@@ -6,7 +6,7 @@ use polariton::operation::{ParameterTable, Typed, Dict};
use crate::data::cube_list::*;
const PARAM_KEY: u8 = 1;
// const DEFAULT_CUBE_ID: u32 = 227205318;
const DEFAULT_CUBE_ID: u32 = 227205318;
pub(super) fn cube_list_provider() -> SimpleFunc<2, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
@@ -16,7 +16,7 @@ pub(super) fn cube_list_provider() -> SimpleFunc<2, crate::UserTy, impl (Fn(Para
val_ty: 104, // hashtable
items: vec![
//(u32 in base16 aka hex, hashtable)
(Typed::Str("DEADBEEF".into()), CubeInfo {
CubeInfo {
cpu: 1,
health: 1,
health_boost: 1.0,
@@ -36,7 +36,7 @@ pub(super) fn cube_list_provider() -> SimpleFunc<2, crate::UserTy, impl (Fn(Para
cosmetic: false,
variant_of: "0".to_string(),
ignore_in_weapon_list: true,
}.as_transmissible()),
}.as_transmissible_key_val(DEFAULT_CUBE_ID),
CubeInfo {
cpu: 1,
health: 1,

View File

@@ -0,0 +1,15 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed};
use crate::data::custom_games::*;
const PARAM_KEY: u8 = 168;
//const INVITE_PARAM_KEY: u8 = 189; // hashtable (refer to C# CheckIfHasBeenInvitedToCustomGameSessionRequest)
pub(super) fn pending_invite_provider() -> SimpleFunc<0, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Int(CustomGameInviteCode::NoInvite as _));
Ok(params.into())
})
}

View File

@@ -0,0 +1,25 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use crate::data::custom_games::*;
const PARAM_KEY: u8 = 168;
pub(super) fn team_setup_provider() -> SimpleFunc<162, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 105, // int
items: vec![
(Typed::Str(GameMode::BattleArena.as_str().into()), Typed::Int(10)),
(Typed::Str(GameMode::SuddenDeath.as_str().into()), Typed::Int(10)),
(Typed::Str(GameMode::Pit.as_str().into()), Typed::Int(10)),
(Typed::Str(GameMode::TestMode.as_str().into()), Typed::Int(10)),
(Typed::Str(GameMode::SinglePlayer.as_str().into()), Typed::Int(1)),
(Typed::Str(GameMode::TeamDeathmatch.as_str().into()), Typed::Int(10)),
(Typed::Str(GameMode::Campaign.as_str().into()), Typed::Int(6)),
] }));
Ok(params.into())
})
}

View File

@@ -0,0 +1,31 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::ParameterTable;
use crate::data::quest::*;
const PARAM_KEY: u8 = 155; // int
pub(super) fn player_daily_quests_provider() -> SimpleFunc<13, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, DailyQuestsInfo {
can_remove_quest: true,
player_quests: vec![
QuestInfo {
id: "RE_quest_id0".to_owned(),
name: "RE_quest_name0".to_owned(),
description: "RE_quest_description0".to_owned(),
xp: 1_000,
premium_xp: 2_000,
robits: 1_000,
premium_robits: 1_000,
progress_count: 1,
target_count: 3,
seen: true,
}
],
completed_quests: Vec::default(),
}.as_transmissible());
Ok(params.into())
})
}

View File

@@ -2,6 +2,7 @@ use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use crate::data::garage_bay::*;
use crate::data::weapon_list::ItemCategory;
const SLOTS_PARAM_KEY: u8 = 44;
const SELECTED_SLOT_PARAM_KEY: u8 = 43;
@@ -15,11 +16,11 @@ pub(super) fn garage_slot_provider() -> SimpleFunc<40, crate::UserTy, impl (Fn(P
val_ty: 104, // hashmap
items: vec![
(Typed::Int(0), GarageSlotInfo {
name: "Reverse-engineer great success!".to_owned(),
name: "Reverse-engineer great success! slot_name".to_owned(),
cubes: 1,
crf_id: 0,
was_rated: false,
movement_categories: vec![MovementCategory::Wheel],
movement_categories: vec![ItemCategory::Wheel],
uuid: (2,4),
thumbnail_version: 0,
total_robot_cpu: 1,

View File

@@ -8,8 +8,8 @@ pub(super) fn garage_upgrades_provider() -> SimpleFunc<1, crate::UserTy, impl (F
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::HashMap(vec![
(Typed::Str("cpuIncreaseCost".into()), Typed::Dict(Dict {
key_ty: 110, // int
val_ty: 110, // int
key_ty: 105, // int
val_ty: 105, // int
items: vec![
// (CPU limit, upgrade cost)
(Typed::Int(100), Typed::Int(100)),

View File

@@ -0,0 +1,14 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed};
// const CAMPAIGN_ID_PARAM_KEY: u8 = 22; // str
// const DIFFICULTY_PARAM_KEY: u8 = 22; // int
const AVAILABLE_PARAM_KEY: u8 = 89; // bool
pub(super) fn completed_campaign_provider() -> SimpleFunc<77, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(AVAILABLE_PARAM_KEY, Typed::Bool(false.into()));
Ok(params.into())
})
}

View File

@@ -0,0 +1,19 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
const PARAM_KEY: u8 = 1;
pub(super) fn league_battle_parameters_provider() -> SimpleFunc<57, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: 115, //str
val_ty: 42, // obj
items: vec![
(Typed::Str("playerLevelRequired".into()), Typed::Int(10)),
(Typed::Str("minCpu".into()), Typed::Int(100)),
],
}));
Ok(params.into())
})
}

View File

@@ -0,0 +1,33 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed};
use crate::data::weapon_list::ItemCategory;
use crate::data::garage_bay::*;
const SLOT_PARAM_KEY: u8 = 45; // uint
const DATA_PARAM_KEY: u8 = 49; // byte arr
const CUBES_COUNT_PARAM_KEY: u8 = 51; // int
const WEAPON_ORDER_PARAM_KEY: u8 = 52; // int arr
const MOVEMENT_CATEGORIES_PARAM_KEY: u8 = 56; // int arr
const CONTROL_TYPE_PARAM_KEY: u8 = 59; // int
const CONTROL_OPTIONS_PARAM_KEY: u8 = 60; // bool arr
const MASTERY_LEVEL_PARAM_KEY: u8 = 18; // int
pub(super) fn garage_machine_provider() -> SimpleFunc<43, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
if let Some(garage_slot) = params.get(&SLOT_PARAM_KEY) {
log::debug!("Got machine request for slot {:?}", garage_slot);
} else {
params.insert(SLOT_PARAM_KEY, Typed::Int(0));
}
params.insert(DATA_PARAM_KEY, Typed::Bytes(vec![0u8, 0u8, 0u8, 0u8].into())); // first 4 bytes are i32 for length of rest of data
params.insert(CUBES_COUNT_PARAM_KEY, Typed::Int(1));
params.insert(WEAPON_ORDER_PARAM_KEY, Typed::IntArr(vec![0].into()));
params.insert(MOVEMENT_CATEGORIES_PARAM_KEY, Typed::IntArr(vec![ItemCategory::Wheel.but_bigger()].into()));
params.insert(CONTROL_TYPE_PARAM_KEY, Typed::Int(ControlType::Camera as _));
params.insert(CONTROL_OPTIONS_PARAM_KEY, ControlOptions { vertical_strafing: false, sideways_driving: false, tracks_turn_on_spot: false, }.as_transmissible());
params.insert(MASTERY_LEVEL_PARAM_KEY, Typed::Int(0));
Ok(params.into())
})
}

View File

@@ -0,0 +1,19 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed};
// const USERNAME_PARAM_KEY: u8 = 30; // str
const SLOT_PARAM_KEY: u8 = 31; // int
const DATA_PARAM_KEY: u8 = 33; // byte arr
pub(super) fn garage_machine_colour_provider() -> SimpleFunc<33, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
if let Some(garage_slot) = params.get(&SLOT_PARAM_KEY) {
log::debug!("Got machine colour request for slot {:?}", garage_slot);
} else {
params.insert(SLOT_PARAM_KEY, Typed::Int(0));
}
params.insert(DATA_PARAM_KEY, Typed::Bytes(vec![0u8, 0u8, 0u8, 0u8].into())); // first 4 bytes are i32 for length of rest of data
Ok(params.into())
})
}

View File

@@ -43,6 +43,34 @@ mod game_event_params;
mod garage_bay_uuid;
mod tech_tree_data;
mod item_shop_bundles;
mod robot_customisations;
mod player_data;
mod player_robopass;
mod weapon_upgrades;
mod player_rank;
mod ab_test_group;
mod league_limits;
mod crf_limits;
mod robot_mastery_settings;
mod player_started_purchase;
mod custom_games_team;
mod custom_games_invite;
mod chat_settings;
mod prebuilt_robots;
mod prebuilt_colours;
mod robopass_preview_items;
mod singleplayer_campaigns;
mod purchases;
mod building_xp_config;
mod weapon_rating_static;
mod weapon_xp_static;
mod machine;
mod machine_colour;
mod last_completed_campaign;
mod daily_quests;
mod cube_awards;
mod robot_sanction;
mod building_xp;
use polariton_server::operations::OperationsHandler;
@@ -95,5 +123,37 @@ pub fn handler() -> OperationsHandler<crate::UserTy> {
.without_state(garage_bay_uuid::garage_id_provider())
.without_state(tech_tree_data::tech_tree_layout_provider())
.without_state(item_shop_bundles::item_bundle_provider())
.without_state(robot_customisations::bay_customisations_provider())
.without_state(player_data::player_data_provider())
.without_state(player_robopass::player_robopass_season_provider())
.without_state(weapon_upgrades::weapons_upgrade_provider())
.without_state(polariton_server::operations::Ack::<172, _>::default()) // custom game change robot tier (param 67 is tier)
.without_state(player_rank::rank_provider())
.without_state(player_rank::rank_static_provider())
.without_state(ab_test_group::test_group_provider())
.without_state(league_limits::league_battle_parameters_provider())
.without_state(crf_limits::robot_shop_submission_infos_provider())
.without_state(robot_mastery_settings::robot_mastery_settings_provider())
.without_state(player_started_purchase::started_purchase_provider())
.without_state(custom_games_team::team_setup_provider())
.without_state(polariton_server::operations::Ack::<152, _>::default()) // custom game player state changed (188 is desired state)
.without_state(custom_games_invite::pending_invite_provider())
.without_state(chat_settings::chat_settings_provider())
.without_state(prebuilt_robots::garage_robot_data_provider())
.without_state(prebuilt_colours::garage_colour_combo_provider())
.without_state(robopass_preview_items::robopass_preview_provider())
.without_state(singleplayer_campaigns::singleplayer_campaigns_provider())
.without_state(purchases::pending_purchases_provider())
.without_state(building_xp_config::building_xp_config_provider())
.without_state(weapon_rating_static::weapon_rating_provider())
.without_state(weapon_xp_static::weapon_xp_provider())
.without_state(machine::garage_machine_provider())
.without_state(machine_colour::garage_machine_colour_provider())
.without_state(last_completed_campaign::completed_campaign_provider())
.without_state(daily_quests::player_daily_quests_provider())
.without_state(tech_points::tech_points_awards_provider())
.without_state(cube_awards::cube_awards_provider())
.without_state(robot_sanction::robot_sanction_provider())
.without_state(building_xp::building_xp_save_provider())
//.without_state(polariton_server::operations::Ack::<70, _>::default())
}

View File

@@ -0,0 +1,38 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Arr};
use crate::data::{garage_bay::*, weapon_list::ItemCategory};
const GARAGE_SLOT_KEY: u8 = 45;
const NAME_KEY: u8 = 42;
const CRF_ID_KEY: u8 = 35;
const ROBOT_CPU_KEY: u8 = 177;
const CONTROL_TYPE_KEY: u8 = 59;
const CONTROL_OPTIONS_KEY: u8 = 60;
const WEAPON_ORDER_KEY: u8 = 52;
const ITEM_CATEGORY_KEY: u8 = 56;
pub(super) fn player_data_provider() -> SimpleFunc<61, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(GARAGE_SLOT_KEY, Typed::Int(0));
params.insert(NAME_KEY, Typed::Str("Reverse-engineer great success!".into()));
params.insert(CRF_ID_KEY, Typed::Int(0));
params.insert(ROBOT_CPU_KEY, Typed::Int(1));
params.insert(CONTROL_TYPE_KEY, Typed::Int(ControlType::Camera as _));
params.insert(CONTROL_OPTIONS_KEY, ControlOptions { vertical_strafing: false, sideways_driving: false, tracks_turn_on_spot: false, }.as_transmissible());
params.insert(WEAPON_ORDER_KEY, Typed::Arr(Arr {
ty: 105, // int
items: vec![
Typed::Int(0),
],
}));
params.insert(ITEM_CATEGORY_KEY, Typed::Arr(Arr {
ty: 105, // int
items: vec![
Typed::Int(ItemCategory::Wheel.but_bigger()),
],
}));
Ok(params.into())
})
}

View File

@@ -0,0 +1,26 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed};
use crate::data::player_rank::*;
const PARAM_KEY: u8 = 80;
pub(super) fn rank_provider() -> SimpleFunc<80, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Int(3));
Ok(params.into())
})
}
const STATIC_PARAM_KEY: u8 = 1;
pub(super) fn rank_static_provider() -> SimpleFunc<126, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(STATIC_PARAM_KEY, PlayerRankStaticInfo {
sub_rank_thresholds: vec![1, 2, 3, 4, 5],
}.as_transmissible());
Ok(params.into())
})
}

View File

@@ -0,0 +1,20 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::ParameterTable;
use crate::data::player_robopass_season::*;
const PARAM_KEY: u8 = 237;
pub(super) fn player_robopass_season_provider() -> SimpleFunc<178, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, PlayerRoboPassSeasonInfo {
delta_xp_to_show: 42,
grade: 1,
has_deluxe: true,
progress_in_grade: 0.5,
xp_from_start: 12345,
}.as_transmissible());
Ok(params.into())
})
}

View File

@@ -0,0 +1,12 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed};
const PARAM_KEY: u8 = 135;
pub(super) fn started_purchase_provider() -> SimpleFunc<54, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Bool(false.into()));
Ok(params.into())
})
}

View File

@@ -0,0 +1,12 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed};
const PARAM_KEY: u8 = 1;
pub(super) fn garage_colour_combo_provider() -> SimpleFunc<37, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Str("[[0,1,2,3]]".into())); // why tf is this a JSON in a string??? (list of lists of bytes)
Ok(params.into())
})
}

View File

@@ -0,0 +1,26 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use crate::data::robot_data::*;
const PARAM_KEY: u8 = 1;
pub(super) fn garage_robot_data_provider() -> SimpleFunc<4, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 104, // hashmap
items: vec![
(Typed::Str(format!("{}_{}", 12345, 54321).into()), PrebuiltRobotInfo {
name: "Reverse-engineer great success! prebuilt_name".to_owned(),
class: "RE_robot_class0".to_owned(),
category: "RE_robot_category0".to_owned(),
robot_data: vec![0u8, 0u8, 0u8, 0u8], // first 4 bytes are i32 for the cube count (we want it to be 0)
colour_data: vec![0u8, 0u8, 0u8, 0u8],
}.as_transmissible()),
]
}));
Ok(params.into())
})
}

View File

@@ -0,0 +1,17 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
const PARAM_KEY: u8 = 88;
pub(super) fn pending_purchases_provider() -> SimpleFunc<81, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
// TODO implement purchases system
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 104, // hashtable
items: vec![],
}));
Ok(params.into())
})
}

View File

@@ -0,0 +1,16 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
const PARAM_KEY: u8 = 1;
pub(super) fn robopass_preview_provider() -> SimpleFunc<167, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 104, // hashtable
items: vec![],
}));
Ok(params.into())
})
}

View File

@@ -0,0 +1,17 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed};
//const BAY_ID_KEY: u8 = 54; // in
const BAY_SKIN_KEY: u8 = 234;
const SPAWN_EFFECT_KEY: u8 = 235;
const DEATH_EFFECT_KEY: u8 = 236;
pub(super) fn bay_customisations_provider() -> SimpleFunc<218, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(BAY_SKIN_KEY, Typed::Str("RC_MothershipSkin_Neptune_01".into()));
params.insert(SPAWN_EFFECT_KEY, Typed::Str("RE_todo_spawn_effect".into()));
params.insert(DEATH_EFFECT_KEY, Typed::Str("RE_todo_death_effect".into()));
Ok(params.into())
})
}

View File

@@ -0,0 +1,14 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed};
const PARAM_KEY: u8 = 193;
pub(super) fn robot_mastery_settings_provider() -> SimpleFunc<73, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::HashMap(vec![
(Typed::Str("RobitsRewardForCRFRobotCreator".into()), Typed::Int(1_000)),
].into()));
Ok(params.into())
})
}

View File

@@ -0,0 +1,19 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Arr};
const ROBOT_ID_PARAM_KEY: u8 = 54; // str (in)
const SANCTION_JSONS_PARAM_KEY: u8 = 102; // str arr (out; list of jsons)
pub(super) fn robot_sanction_provider() -> SimpleFunc<174, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
if let Some(Typed::Str(s)) = params.get(&ROBOT_ID_PARAM_KEY) {
log::debug!("Got sanction check for robot {}", s.string);
}
params.insert(SANCTION_JSONS_PARAM_KEY, Typed::Arr(Arr {
ty: 115, // str
items: Vec::default(),
}));
Ok(params.into())
})
}

View File

@@ -0,0 +1,22 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed};
const CAMPAIGNS_BYTES_PARAM_KEY: u8 = 64; // list of bytes (serialised data)
const CAMPAIGNS_WAVES_PARAM_KEY: u8 = 70; // hashtable
const CAMPAIGNS_VERSIONS_PARAM_KEY: u8 = 69; // hashtable
pub(super) fn singleplayer_campaigns_provider() -> SimpleFunc<65, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
// TODO implement serialisation of Campaign[] properly
params.insert(CAMPAIGNS_BYTES_PARAM_KEY, Typed::Bytes(vec![0u8, 0u8, 0u8, 0u8].into())); // first 4 bytes are i32 for length of the rest
params.insert(CAMPAIGNS_WAVES_PARAM_KEY, Typed::HashMap(vec![].into()));
params.insert(CAMPAIGNS_VERSIONS_PARAM_KEY, Typed::HashMap(vec![
(Typed::Str("CurrentVersionNumber".into()), Typed::Int(0)),
(Typed::Str("LockedCampaignsInfo".into()), Typed::HashMap(vec![
(Typed::Str("0".into()), Typed::Bool(false.into()))
].into())),
].into()));
Ok(params.into())
})
}

View File

@@ -1,12 +1,22 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed};
const PARAM_KEY: u8 = 214;
const CURRENT_PARAM_KEY: u8 = 214;
pub(super) fn tech_points_provider() -> SimpleFunc<187, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Int(1337));
params.insert(CURRENT_PARAM_KEY, Typed::Int(1337));
Ok(params.into())
})
}
const UNCLAIMED_PARAM_KEY: u8 = 212;
pub(super) fn tech_points_awards_provider() -> SimpleFunc<185, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(UNCLAIMED_PARAM_KEY, Typed::Int(0));
Ok(params.into())
})
}

View File

@@ -0,0 +1,33 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
const PARAM_KEY: u8 = 1;
pub(super) fn weapon_rating_provider() -> SimpleFunc<127, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::HashMap(vec![
(Typed::Str("subRankCount".into()), Typed::Int(2)),
(Typed::Str("subRankInterval".into()), Typed::Int(10)),
(Typed::Str("gainsPerRank".into()), Typed::ObjArr(vec![
Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 42, // obj
items: vec![
(Typed::Str("win".into()), Typed::Int(7)),
(Typed::Str("loss".into()), Typed::Int(3)),
],
}),
Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 42, // obj
items: vec![
(Typed::Str("win".into()), Typed::Int(11)),
(Typed::Str("loss".into()), Typed::Int(3)),
],
})
].into())),
].into()));
Ok(params.into())
})
}

View File

@@ -0,0 +1,23 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed};
use crate::data::weapon_upgrade::*;
const PARAM_KEY: u8 = 38;
pub(super) fn weapons_upgrade_provider() -> SimpleFunc<82, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::ObjArr(vec![
WeaponUpgradeInfo {
tier: crate::data::cube_list::ItemTier::T0,
type_: crate::data::weapon_list::ItemCategory::Laser,
xp: 4.2,
rating: 1,
rank: 1,
power: 1,
}.as_transmissible(),
].into()));
Ok(params.into())
})
}

View File

@@ -0,0 +1,42 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use crate::data::cube_list::ItemTier;
const PARAM_KEY: u8 = 1;
pub(super) fn weapon_xp_provider() -> SimpleFunc<129, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result<ParameterTable, i16>) + Sync + Sync> {
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::HashMap(vec![
(Typed::Str("maxPower".into()), Typed::Int(2)),
(Typed::Str("powerLevelsPerTier".into()), Typed::Dict(Dict {
key_ty: 105, // int
val_ty: 122, // obj arr
items: vec![
(Typed::Int(ItemTier::T0 as _), Typed::ObjArr(vec![
Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 42, // obj
items: vec![
(Typed::Str("xp".into()), Typed::Int(1_000)),
(Typed::Str("costRobits".into()), Typed::Int(1_000)),
(Typed::Str("damageMultiplier".into()), Typed::Float(1.1)),
],
}),
Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 42, // obj
items: vec![
(Typed::Str("xp".into()), Typed::Int(2_000)),
(Typed::Str("costRobits".into()), Typed::Int(2_000)),
(Typed::Str("damageMultiplier".into()), Typed::Float(1.2)),
],
}),
].into())),
],
})),
].into()));
Ok(params.into())
})
}