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

Update to work with polariton v0.2

This commit is contained in:
NGnius (Graham)
2025-03-08 17:16:02 -05:00
parent f004ca8565
commit be37f8913a
83 changed files with 428 additions and 1202 deletions

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Arr};
use polariton::{operation::{Arr, ParameterTable, Typed}, serdes::TypePrefix};
use crate::data::customisation_info::CustomisationData;
@@ -16,7 +16,7 @@ pub(super) fn all_customisations_provider() -> SimpleFunc<216, crate::UserTy, im
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(SKINS_KEY, Typed::Arr(Arr {
ty: 104, // hashtable
ty: TypePrefix::HashMap, // hashtable
items: vec![
CustomisationData {
id: "RC_MothershipSkin_Neptune_01".to_string(),
@@ -29,7 +29,7 @@ pub(super) fn all_customisations_provider() -> SimpleFunc<216, crate::UserTy, im
],
}));
params.insert(SPAWNS_KEY, Typed::Arr(Arr {
ty: 104, // hashtable
ty: TypePrefix::HashMap, // hashtable
items: vec![
CustomisationData {
id: "spawn0".to_string(),
@@ -42,7 +42,7 @@ pub(super) fn all_customisations_provider() -> SimpleFunc<216, crate::UserTy, im
],
}));
params.insert(DEATHS_KEY, Typed::Arr(Arr {
ty: 104, // hashtable
ty: TypePrefix::HashMap, // hashtable
items: vec![
CustomisationData {
id: "death0".to_string(),

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
use crate::data::battle_arena_config::*;
@@ -9,8 +9,8 @@ pub(super) fn battle_arena_config_provider() -> SimpleFunc<53, crate::UserTy, im
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 104, // obj
key_ty: TypePrefix::Str, // str
val_ty: TypePrefix::HashMap, // hashmap
items: vec![
(Typed::Str("BattleArenaSettings".into()), BattleArenaData {
protonium_health: 1_000,

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
const PARAM_KEY: u8 = 79;
@@ -7,8 +7,8 @@ pub(super) fn building_xp_config_provider() -> SimpleFunc<199, crate::UserTy, im
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 104, // hashtable
key_ty: TypePrefix::Str, // str
val_ty: TypePrefix::HashMap, // hashtable
items: vec![
(Typed::Str("BuildXPSettings".into()), Typed::HashMap(vec![
(Typed::Str("buildModePeriodUserEarnXP".into()), Typed::Float(1.0)), // TODO what are the time units?

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
use crate::data::client_config::*;
@@ -9,8 +9,8 @@ pub(super) fn client_config_provider() -> SimpleFunc<34, crate::UserTy, impl (Fn
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 104, // hashtable
key_ty: TypePrefix::Str, // str
val_ty: TypePrefix::HashMap, // hashtable
items: vec![
(Typed::Str("GameplaySettings".into()), GameplaySettings {
show_tutorial_after_date: "2025-01-01".to_owned(),

View File

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

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
const PARAM_KEY: u8 = 16;
@@ -7,8 +7,8 @@ pub(super) fn cube_inv_provider() -> SimpleFunc<16, crate::UserTy, impl (Fn(Para
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: 105, // int
val_ty: 105, // int
key_ty: TypePrefix::Int, // int
val_ty: TypePrefix::Int, // int
items: vec![
(Typed::Int(0), Typed::Int(99)),
] }));

View File

@@ -1,7 +1,7 @@
use std::collections::HashMap;
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
use crate::data::cube_list::*;
@@ -12,8 +12,8 @@ pub(super) fn cube_list_provider() -> SimpleFunc<2, crate::UserTy, impl (Fn(Para
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 104, // hashtable
key_ty: TypePrefix::Str, // str
val_ty: TypePrefix::HashMap, // hashtable
items: vec![
//(u32 in base16 aka hex, hashtable)
CubeInfo {

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
use crate::data::custom_games::*;
@@ -10,8 +10,8 @@ pub(super) fn allowed_maps_provider() -> SimpleFunc<146, crate::UserTy, impl (Fn
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(MODE_MAP_PARAM_KEY, Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 122, // obj arr
key_ty: TypePrefix::Str, // str
val_ty: TypePrefix::ObjArr, // obj arr
items: vec![
(Typed::Str(GameMode::BattleArena.as_str().into()), Typed::ObjArr(vec![
Typed::Str("RC_Planet_Neptune_02_BA".into()),
@@ -30,8 +30,8 @@ pub(super) fn allowed_maps_provider() -> SimpleFunc<146, crate::UserTy, impl (Fn
],
}));
params.insert(MAP_NAMES_PARAM_KEY, Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 115, // str
key_ty: TypePrefix::Str, // str
val_ty: TypePrefix::Str, // str
items: vec![
(Typed::Str("RC_Planet_Neptune_02_BA".into()), Typed::Str("strCustomGameMapNameRC_Planet_Neptune_02_BA".into())),
(Typed::Str("RC_Planet_Neptune_01_CTF".into()), Typed::Str("strCustomGameMapNameRC_Planet_Neptune_01_CTF".into())),

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
use crate::data::custom_games::*;
@@ -9,8 +9,8 @@ pub(super) fn team_setup_provider() -> SimpleFunc<162, crate::UserTy, impl (Fn(P
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 105, // int
key_ty: TypePrefix::Str, // str
val_ty: TypePrefix::Int, // int
items: vec![
(Typed::Str(GameMode::BattleArena.as_str().into()), Typed::Int(10)),
(Typed::Str(GameMode::SuddenDeath.as_str().into()), Typed::Int(10)),

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
use crate::data::damage_boost::*;
@@ -9,8 +9,8 @@ pub(super) fn damage_boost_provider() -> SimpleFunc<163, crate::UserTy, impl (Fn
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 42, // obj
key_ty: TypePrefix::Str, // str
val_ty: TypePrefix::Any, // obj
items: vec![
(Typed::Str("damageBoost".into()), DamageBoostData {
damage_map: vec![

View File

@@ -2,11 +2,11 @@ use polariton_server::operations::{Operation, OperationCode};
pub struct EacChallengeIgnorer;
impl Operation for EacChallengeIgnorer {
impl <C> Operation<C> for EacChallengeIgnorer {
type State = ();
type User = crate::UserTy;
fn handle(&self, params: polariton::operation::ParameterTable, _: &mut Self::State, _: &Self::User) -> polariton::operation::OperationResponse {
fn handle(&self, params: polariton::operation::ParameterTable<C>, _: &mut Self::State, _: &Self::User) -> polariton::operation::OperationResponse<C> {
polariton::operation::OperationResponse {
code: 161, // skip the challenge (hopefully)
return_code: 0,

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Arr};
use polariton::{operation::{Arr, ParameterTable, Typed}, serdes::TypePrefix};
use crate::data::custom_games::*;
@@ -13,28 +13,28 @@ pub(super) fn event_system_params_provider() -> SimpleFunc<24, crate::UserTy, im
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(MAP_NAMES_PARAM_KEY, Typed::Arr(Arr {
ty: 115, // str
ty: TypePrefix::Str, // str
items: vec![
Typed::Str("RC_Planet_Neptune_03_BA".into()),
Typed::Str("RC_Planet_Earth_01_BA".into()),
],
}));
params.insert(VISIBILITY_PARAM_KEY, Typed::Arr(Arr {
ty: 105, // int
ty: TypePrefix::Int, // int
items: vec![
Typed::Int(GameMode::BattleArena as _),
Typed::Int(GameMode::BattleArena as _),
],
}));
params.insert(MODE_PARAM_KEY, Typed::Arr(Arr {
ty: 105, // int
ty: TypePrefix::Int, // int
items: vec![
Typed::Int(MapVisibility::Good as _),
Typed::Int(MapVisibility::Bad as _),
],
}));
params.insert(AUTO_HEAL_PARAM_KEY, Typed::Arr(Arr {
ty: 111, // bool
ty: TypePrefix::Bool, // bool
items: vec![
Typed::Bool(true.into()),
Typed::Bool(false.into()),

View File

@@ -1,51 +1,51 @@
use std::collections::HashMap;
use polariton::operation::{Typed, ParameterTable, OperationResponse, Dict};
use polariton::{operation::{Dict, OperationResponse, ParameterTable, Typed}, serdes::TypePrefix};
use polariton_server::operations::{Operation, OperationCode};
pub struct QualityConfigTeller;
impl Operation for QualityConfigTeller {
impl <C> Operation<C> for QualityConfigTeller {
type State = ();
type User = crate::UserTy;
fn handle(&self, _: ParameterTable, _: &mut Self::State, _: &Self::User) -> OperationResponse {
fn handle(&self, _: ParameterTable<C>, _: &mut Self::State, _: &Self::User) -> OperationResponse<C> {
let quality_levels = Typed::HashMap(vec![
(Typed::Str("extremLow".into()), Typed::Dict(Dict {
key_ty: 115,
val_ty: 42,
key_ty: TypePrefix::Str,
val_ty: TypePrefix::Any,
items: vec![
(Typed::Str("Level".into()), Typed::Long(0)),
(Typed::Str("default".into()), Typed::Float(0.0)),
],
})),
(Typed::Str("low".into()), Typed::Dict(Dict {
key_ty: 115,
val_ty: 42,
key_ty: TypePrefix::Str,
val_ty: TypePrefix::Any,
items: vec![
(Typed::Str("Level".into()), Typed::Long(1)),
(Typed::Str("default".into()), Typed::Float(0.0)),
],
})),
(Typed::Str("normal".into()), Typed::Dict(Dict {
key_ty: 115,
val_ty: 42,
key_ty: TypePrefix::Str,
val_ty: TypePrefix::Any,
items: vec![
(Typed::Str("Level".into()), Typed::Long(2)),
(Typed::Str("default".into()), Typed::Float(0.0)),
],
})),
(Typed::Str("beautiful".into()), Typed::Dict(Dict {
key_ty: 115,
val_ty: 42,
key_ty: TypePrefix::Str,
val_ty: TypePrefix::Any,
items: vec![
(Typed::Str("Level".into()), Typed::Long(3)),
(Typed::Str("default".into()), Typed::Float(0.0)),
],
})),
(Typed::Str("fantastic".into()), Typed::Dict(Dict {
key_ty: 115,
val_ty: 42,
key_ty: TypePrefix::Str,
val_ty: TypePrefix::Any,
items: vec![
(Typed::Str("Level".into()), Typed::Long(4)),
(Typed::Str("default".into()), Typed::Float(f32::MAX)),
@@ -59,8 +59,8 @@ impl Operation for QualityConfigTeller {
let mut resp_params = HashMap::new();
resp_params.insert(1 /* dict<string, hashtable> */, Typed::Dict(
Dict {
key_ty: 115, // str
val_ty: 104, // hash table
key_ty: TypePrefix::Str, // str
val_ty: TypePrefix::HashMap, // hash table
items: vec![
(Typed::Str("qualityLevels".into()), quality_levels),
(Typed::Str("systemMemoryThresholds".into()), mem_thresholds),

View File

@@ -1,3 +1,4 @@
use polariton::serdes::TypePrefix;
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
@@ -12,8 +13,8 @@ pub(super) fn garage_slot_provider() -> SimpleFunc<40, crate::UserTy, impl (Fn(P
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(SLOTS_PARAM_KEY, Typed::Dict(Dict {
key_ty: 105, // int
val_ty: 104, // hashmap
key_ty: TypePrefix::Int, // int
val_ty: TypePrefix::HashMap, // hashmap
items: vec![
(Typed::Int(0), GarageSlotInfo {
name: "Reverse-engineer great success! slot_name".to_owned(),

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
const PARAM_KEY: u8 = 1;
@@ -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: 105, // int
val_ty: 105, // int
key_ty: TypePrefix::Int, // int
val_ty: TypePrefix::Int, // int
items: vec![
// (CPU limit, upgrade cost)
(Typed::Int(100), Typed::Int(100)),

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
const PARAM_KEY: u8 = 1;
@@ -7,8 +7,8 @@ pub(super) fn league_battle_parameters_provider() -> SimpleFunc<57, crate::UserT
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: 115, //str
val_ty: 42, // obj
key_ty: TypePrefix::Str, //str
val_ty: TypePrefix::Any, // obj
items: vec![
(Typed::Str("playerLevelRequired".into()), Typed::Int(10)),
(Typed::Str("minCpu".into()), Typed::Int(100)),

View File

@@ -1,4 +1,4 @@
use polariton::operation::Dict;
use polariton::{operation::Dict, serdes::TypePrefix};
use polariton_server::operations::{Operation, OperationCode};
pub struct NoAnalytics;
@@ -7,15 +7,15 @@ impl NoAnalytics {
const ANALYTICS_DICT_KEY: u8 = 83;
}
impl Operation for NoAnalytics {
impl <C> Operation<C> for NoAnalytics {
type State = ();
type User = crate::UserTy;
fn handle(&self, _: polariton::operation::ParameterTable, _: &mut Self::State, _: &Self::User) -> polariton::operation::OperationResponse {
fn handle(&self, _: polariton::operation::ParameterTable<C>, _: &mut Self::State, _: &Self::User) -> polariton::operation::OperationResponse<C> {
let mut resp_params = std::collections::HashMap::new();
resp_params.insert(Self::ANALYTICS_DICT_KEY, polariton::operation::Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 115, // str
key_ty: TypePrefix::Str, // str
val_ty: TypePrefix::Str, // str
items: Vec::new(),
}));
polariton::operation::OperationResponse {

View File

@@ -14,11 +14,11 @@ impl UserFlagsTeller {
const AB_GROUP_KEY: u8 = 167;
}
impl Operation for UserFlagsTeller {
impl <C> Operation<C> for UserFlagsTeller {
type State = ();
type User = crate::UserTy;
fn handle(&self, _: polariton::operation::ParameterTable, _: &mut Self::State, _: &Self::User) -> polariton::operation::OperationResponse {
fn handle(&self, _: polariton::operation::ParameterTable<C>, _: &mut Self::State, _: &Self::User) -> polariton::operation::OperationResponse<C> {
let mut resp_params = std::collections::HashMap::new();
resp_params.insert(Self::REMOVE_OBSOLETE_CUBES_KEY, polariton::operation::Typed::Bool(false.into()));
resp_params.insert(Self::REMOVE_UNOWNED_CUBES_KEY, polariton::operation::Typed::Bool(false.into()));

View File

@@ -4,11 +4,11 @@ use polariton_server::operations::{Operation, OperationCode};
pub struct MaintenanceModeTeller;
impl Operation for MaintenanceModeTeller {
impl <C> Operation<C> for MaintenanceModeTeller {
type State = ();
type User = crate::UserTy;
fn handle(&self, _: polariton::operation::ParameterTable, _: &mut Self::State, _: &Self::User) -> polariton::operation::OperationResponse {
fn handle(&self, _: polariton::operation::ParameterTable<C>, _: &mut Self::State, _: &Self::User) -> polariton::operation::OperationResponse<C> {
let mut resp_params = HashMap::new();
resp_params.insert(20 /* is in maintenance mode? */, polariton::operation::Typed::Bool(false.into()));
resp_params.insert(19 /* maintenace mode message */, polariton::operation::Typed::Str("OpenJam's servers are currently undergoing maintenance".into()));

View File

@@ -7,11 +7,11 @@ impl MoreLobbyAuth {
const AUTH_PAYLOAD_KEY: u8 = 245;
}
impl Operation for MoreLobbyAuth {
impl <C> Operation<C> for MoreLobbyAuth {
type State = ();
type User = crate::UserTy;
fn handle(&self, params: polariton::operation::ParameterTable, _: &mut Self::State, user: &Self::User) -> polariton::operation::OperationResponse {
fn handle(&self, params: polariton::operation::ParameterTable<C>, _: &mut Self::State, user: &Self::User) -> polariton::operation::OperationResponse<C> {
let params_dict = params.to_dict();
if let Some(Typed::Str(auth_payload)) = params_dict.get(&Self::AUTH_PAYLOAD_KEY) {
let mut write_lock = user.write().unwrap();

View File

@@ -1,3 +1,4 @@
use polariton::serdes::TypePrefix;
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
@@ -11,8 +12,8 @@ pub(super) fn movement_config_provider() -> SimpleFunc<62, crate::UserTy, impl (
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 104, // hashtable
key_ty: TypePrefix::Str, // str
val_ty: TypePrefix::HashMap, // hashtable
items: vec![
(Typed::Str("Global".into()), Typed::HashMap(vec![
(Typed::Str("lerpValue".into()), Typed::Float(10.0)),

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Arr};
use polariton::{operation::{Arr, ParameterTable, Typed}, serdes::TypePrefix};
const PARAM_KEY: u8 = 50;
@@ -7,7 +7,7 @@ pub(super) fn owned_cosmetics_provider() -> SimpleFunc<23, crate::UserTy, impl (
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Arr(Arr {
ty: 115, // str
ty: TypePrefix::Str, // str
items: vec![Typed::Str("1".into())],
}));
Ok(params.into())
@@ -18,7 +18,7 @@ pub(super) fn selected_cosmetics_provider() -> SimpleFunc<21, crate::UserTy, imp
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Arr(Arr {
ty: 115, // str
ty: TypePrefix::Str, // str
items: vec![Typed::Str("1".into())],
}));
Ok(params.into())

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
const PLATFORM_CONFIG_KEY: u8 = 197;
@@ -7,8 +7,8 @@ pub(super) fn platform_config_provider() -> SimpleFunc<165, crate::UserTy, impl
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PLATFORM_CONFIG_KEY, Typed::Dict(Dict {
key_ty: 42, // obj
val_ty: 42, // obj
key_ty: TypePrefix::Any, // obj
val_ty: TypePrefix::Any, // obj
items: vec![
(Typed::Str("BuyPremiumAvailable".into()), Typed::Bool(false.into())),
(Typed::Str("MainShopButtonAvailable".into()), Typed::Bool(false.into())),

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Arr};
use polariton::{operation::{Arr, ParameterTable, Typed}, serdes::TypePrefix};
use crate::data::{garage_bay::*, weapon_list::ItemCategory};
@@ -22,13 +22,13 @@ pub(super) fn player_data_provider() -> SimpleFunc<61, crate::UserTy, impl (Fn(P
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
ty: TypePrefix::Int, // int
items: vec![
Typed::Int(0),
],
}));
params.insert(ITEM_CATEGORY_KEY, Typed::Arr(Arr {
ty: 105, // int
ty: TypePrefix::Int, // int
items: vec![
Typed::Int(ItemCategory::Wheel.but_bigger()),
],

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
const PARAM_KEY: u8 = 1;
@@ -7,8 +7,8 @@ pub(super) fn player_level_info_provider() -> SimpleFunc<3, crate::UserTy, impl
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: 105, // int
val_ty: 105, // int
key_ty: TypePrefix::Int, // int
val_ty: TypePrefix::Int, // int
items: vec![
(Typed::Int(0), Typed::Int(99)),
(Typed::Int(10_000), Typed::Int(99_000)),

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
use crate::data::robot_data::*;
@@ -9,8 +9,8 @@ pub(super) fn garage_robot_data_provider() -> SimpleFunc<4, crate::UserTy, impl
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 104, // hashmap
key_ty: TypePrefix::Str, // str
val_ty: TypePrefix::HashMap, // hashmap
items: vec![
(Typed::Str(format!("{}_{}", 12345, 54321).into()), PrebuiltRobotInfo {
name: "Reverse-engineer great success! prebuilt_name".to_owned(),

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
const PARAM_KEY: u8 = 88;
@@ -8,8 +8,8 @@ pub(super) fn pending_purchases_provider() -> SimpleFunc<81, crate::UserTy, impl
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
key_ty: TypePrefix::Str, // str
val_ty: TypePrefix::HashMap, // hashtable
items: vec![],
}));
Ok(params.into())

View File

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

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Arr};
use polariton::{operation::{Arr, ParameterTable, Typed}, serdes::TypePrefix};
const ROBOT_ID_PARAM_KEY: u8 = 54; // str (in)
const SANCTION_JSONS_PARAM_KEY: u8 = 102; // str arr (out; list of jsons)
@@ -11,7 +11,7 @@ pub(super) fn robot_sanction_provider() -> SimpleFunc<174, crate::UserTy, impl (
log::debug!("Got sanction check for robot {}", s.string);
}
params.insert(SANCTION_JSONS_PARAM_KEY, Typed::Arr(Arr {
ty: 115, // str
ty: TypePrefix::Str, // str
items: Vec::default(),
}));
Ok(params.into())
@@ -22,7 +22,7 @@ pub(super) fn all_robot_sanctions_provider() -> SimpleFunc<176, crate::UserTy, i
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(SANCTION_JSONS_PARAM_KEY, Typed::Arr(Arr {
ty: 115, // str
ty: TypePrefix::Str, // str
items: Vec::default(),
}));
Ok(params.into())

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
use crate::data::special_item::*;
@@ -9,8 +9,8 @@ pub(super) fn special_item_list_provider() -> SimpleFunc<6, crate::UserTy, impl
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 104, // hashtable
key_ty: TypePrefix::Str, // str
val_ty: TypePrefix::HashMap, // hashtable
items: vec![
//(u32 in base16 aka hex, hashtable)
(Typed::Str("DEADBEEF".into()), SpecialItem {

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed};
use polariton::{operation::{ParameterTable, Typed}, serdes::TypePrefix};
use crate::data::taunts_config::*;
@@ -9,8 +9,8 @@ pub(super) fn taunts_config_provider() -> SimpleFunc<164, crate::UserTy, impl (F
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(polariton::operation::Dict {
key_ty: 115,
val_ty: 42,
key_ty: TypePrefix::Str,
val_ty: TypePrefix::Any,
items: vec![
(Typed::Str("taunts".into()), TauntsData {
taunts: vec![

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
use crate::data::tech_tree::*;
@@ -9,8 +9,8 @@ pub(super) fn tech_tree_layout_provider() -> SimpleFunc<183, crate::UserTy, impl
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 104, // hashmap
key_ty: TypePrefix::Str, // str
val_ty: TypePrefix::HashMap, // hashmap
items: vec![
TechTreeNode {
main_cube_id: 227205318, // default cube id

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
const PARAM_KEY: u8 = 1;
@@ -7,8 +7,8 @@ pub(super) fn tiers_banding_provider() -> SimpleFunc<7, crate::UserTy, impl (Fn(
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 42, // obj
key_ty: TypePrefix::Str, // str
val_ty: TypePrefix::Any, // obj
items: vec![
(Typed::Str("tiersbands".into()), Typed::IntArr(vec![
1

View File

@@ -7,11 +7,11 @@ impl VersionTeller {
const LATEST_VERSION: i32 = 2855;
}
impl Operation for VersionTeller {
impl <C> Operation<C> for VersionTeller {
type State = ();
type User = crate::UserTy;
fn handle(&self, _: polariton::operation::ParameterTable, _: &mut Self::State, _: &Self::User) -> polariton::operation::OperationResponse {
fn handle(&self, _: polariton::operation::ParameterTable<C>, _: &mut Self::State, _: &Self::User) -> polariton::operation::OperationResponse<C> {
let mut resp_params = std::collections::HashMap::new();
resp_params.insert(Self::VERSION_NUMBER_KEY, polariton::operation::Typed::Int(Self::LATEST_VERSION));
polariton::operation::OperationResponse {

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
const PARAM_KEY: u8 = 1;
@@ -11,16 +11,16 @@ pub(super) fn weapon_rating_provider() -> SimpleFunc<127, crate::UserTy, impl (F
(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
key_ty: TypePrefix::Str,
val_ty: TypePrefix::Any,
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
key_ty: TypePrefix::Str,
val_ty: TypePrefix::Any,
items: vec![
(Typed::Str("win".into()), Typed::Int(11)),
(Typed::Str("loss".into()), Typed::Int(3)),

View File

@@ -1,3 +1,4 @@
use polariton::serdes::TypePrefix;
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
@@ -10,8 +11,8 @@ pub(super) fn weapon_config_provider() -> SimpleFunc<47, crate::UserTy, impl (Fn
SimpleFunc::new(|params, _| {
let mut params = params.to_dict();
params.insert(PARAM_KEY, Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 104, // hashtable
key_ty: TypePrefix::Str, // str
val_ty: TypePrefix::HashMap, // hashtable
items: vec![
// (Item category, map<tier, weapon stats>)
(Typed::Str(ItemCategory::Laser.as_str().into()), Typed::HashMap(vec![

View File

@@ -1,5 +1,5 @@
use polariton_server::operations::SimpleFunc;
use polariton::operation::{ParameterTable, Typed, Dict};
use polariton::{operation::{Dict, ParameterTable, Typed}, serdes::TypePrefix};
use crate::data::cube_list::ItemTier;
@@ -11,13 +11,13 @@ pub(super) fn weapon_xp_provider() -> SimpleFunc<129, crate::UserTy, impl (Fn(Pa
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
key_ty: TypePrefix::Int, // int
val_ty: TypePrefix::ObjArr, // obj arr
items: vec![
(Typed::Int(ItemTier::T0 as _), Typed::ObjArr(vec![
Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 42, // obj
key_ty: TypePrefix::Str,
val_ty: TypePrefix::Any,
items: vec![
(Typed::Str("xp".into()), Typed::Int(1_000)),
(Typed::Str("costRobits".into()), Typed::Int(1_000)),
@@ -25,8 +25,8 @@ pub(super) fn weapon_xp_provider() -> SimpleFunc<129, crate::UserTy, impl (Fn(Pa
],
}),
Typed::Dict(Dict {
key_ty: 115, // str
val_ty: 42, // obj
key_ty: TypePrefix::Str,
val_ty: TypePrefix::Any,
items: vec![
(Typed::Str("xp".into()), Typed::Int(2_000)),
(Typed::Str("costRobits".into()), Typed::Int(2_000)),