mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Implement minimal chat service, fix some implement bugs
This commit is contained in:
@@ -6,6 +6,7 @@ use polariton::operation::{ParameterTable, Typed, Dict};
|
||||
use crate::data::cube_list::*;
|
||||
|
||||
const PARAM_KEY: u8 = 1;
|
||||
// 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, _| {
|
||||
@@ -22,7 +23,7 @@ pub(super) fn cube_list_provider() -> SimpleFunc<2, crate::UserTy, impl (Fn(Para
|
||||
grey_out_in_tutorial: false,
|
||||
visibility: VisibilityMode::All,
|
||||
indestructible: true,
|
||||
category: 1,
|
||||
category: crate::data::weapon_list::ItemCategory::NoFunction,
|
||||
placements: 63,
|
||||
protonium: false,
|
||||
unlocked_by_league: false,
|
||||
@@ -35,7 +36,133 @@ 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()),
|
||||
(Typed::Str("0".into()), CubeInfo {
|
||||
cpu: 1,
|
||||
health: 1,
|
||||
health_boost: 1.0,
|
||||
grey_out_in_tutorial: false,
|
||||
visibility: VisibilityMode::All,
|
||||
indestructible: true,
|
||||
category: crate::data::weapon_list::ItemCategory::Laser,
|
||||
placements: 63,
|
||||
protonium: false,
|
||||
unlocked_by_league: false,
|
||||
league_unlock_index: 1,
|
||||
stats: HashMap::default(),
|
||||
description: "This is a very descriptive description".to_string(),
|
||||
size: ItemTier::T0,
|
||||
type_: ItemType::Weapon,
|
||||
ranking: 1,
|
||||
cosmetic: false,
|
||||
variant_of: "0".to_string(),
|
||||
ignore_in_weapon_list: true,
|
||||
}.as_transmissible()),
|
||||
(Typed::Str("1".into()), CubeInfo {
|
||||
cpu: 1,
|
||||
health: 1,
|
||||
health_boost: 1.0,
|
||||
grey_out_in_tutorial: false,
|
||||
visibility: VisibilityMode::All,
|
||||
indestructible: true,
|
||||
category: crate::data::weapon_list::ItemCategory::Laser,
|
||||
placements: 63,
|
||||
protonium: false,
|
||||
unlocked_by_league: false,
|
||||
league_unlock_index: 1,
|
||||
stats: HashMap::default(),
|
||||
description: "This is a very descriptive description".to_string(),
|
||||
size: ItemTier::T1,
|
||||
type_: ItemType::Weapon,
|
||||
ranking: 1,
|
||||
cosmetic: false,
|
||||
variant_of: "0".to_string(),
|
||||
ignore_in_weapon_list: true,
|
||||
}.as_transmissible()),
|
||||
(Typed::Str("2".into()), CubeInfo {
|
||||
cpu: 1,
|
||||
health: 1,
|
||||
health_boost: 1.0,
|
||||
grey_out_in_tutorial: false,
|
||||
visibility: VisibilityMode::All,
|
||||
indestructible: true,
|
||||
category: crate::data::weapon_list::ItemCategory::Laser,
|
||||
placements: 63,
|
||||
protonium: false,
|
||||
unlocked_by_league: false,
|
||||
league_unlock_index: 1,
|
||||
stats: HashMap::default(),
|
||||
description: "This is a very descriptive description".to_string(),
|
||||
size: ItemTier::T2,
|
||||
type_: ItemType::Weapon,
|
||||
ranking: 1,
|
||||
cosmetic: false,
|
||||
variant_of: "0".to_string(),
|
||||
ignore_in_weapon_list: true,
|
||||
}.as_transmissible()),
|
||||
(Typed::Str("3".into()), CubeInfo {
|
||||
cpu: 1,
|
||||
health: 1,
|
||||
health_boost: 1.0,
|
||||
grey_out_in_tutorial: false,
|
||||
visibility: VisibilityMode::All,
|
||||
indestructible: true,
|
||||
category: crate::data::weapon_list::ItemCategory::Laser,
|
||||
placements: 63,
|
||||
protonium: false,
|
||||
unlocked_by_league: false,
|
||||
league_unlock_index: 1,
|
||||
stats: HashMap::default(),
|
||||
description: "This is a very descriptive description".to_string(),
|
||||
size: ItemTier::T3,
|
||||
type_: ItemType::Weapon,
|
||||
ranking: 1,
|
||||
cosmetic: false,
|
||||
variant_of: "0".to_string(),
|
||||
ignore_in_weapon_list: true,
|
||||
}.as_transmissible()),
|
||||
(Typed::Str("4".into()), CubeInfo {
|
||||
cpu: 1,
|
||||
health: 1,
|
||||
health_boost: 1.0,
|
||||
grey_out_in_tutorial: false,
|
||||
visibility: VisibilityMode::All,
|
||||
indestructible: true,
|
||||
category: crate::data::weapon_list::ItemCategory::Laser,
|
||||
placements: 63,
|
||||
protonium: false,
|
||||
unlocked_by_league: false,
|
||||
league_unlock_index: 1,
|
||||
stats: HashMap::default(),
|
||||
description: "This is a very descriptive description".to_string(),
|
||||
size: ItemTier::T4,
|
||||
type_: ItemType::Weapon,
|
||||
ranking: 1,
|
||||
cosmetic: false,
|
||||
variant_of: "0".to_string(),
|
||||
ignore_in_weapon_list: true,
|
||||
}.as_transmissible()),
|
||||
(Typed::Str("5".into()), CubeInfo {
|
||||
cpu: 1,
|
||||
health: 1,
|
||||
health_boost: 1.0,
|
||||
grey_out_in_tutorial: false,
|
||||
visibility: VisibilityMode::All,
|
||||
indestructible: true,
|
||||
category: crate::data::weapon_list::ItemCategory::Laser,
|
||||
placements: 63,
|
||||
protonium: false,
|
||||
unlocked_by_league: false,
|
||||
league_unlock_index: 1,
|
||||
stats: HashMap::default(),
|
||||
description: "This is a very descriptive description".to_string(),
|
||||
size: ItemTier::T5,
|
||||
type_: ItemType::Weapon,
|
||||
ranking: 1,
|
||||
cosmetic: false,
|
||||
variant_of: "0".to_string(),
|
||||
ignore_in_weapon_list: true,
|
||||
}.as_transmissible()),
|
||||
].into(),
|
||||
}));
|
||||
Ok(params.into())
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use polariton_server::operations::SimpleFunc;
|
||||
use polariton::operation::{ParameterTable, Typed, Dict, Arr};
|
||||
use polariton::operation::{ParameterTable, Typed, Dict};
|
||||
|
||||
use crate::data::custom_games::*;
|
||||
|
||||
@@ -11,26 +11,22 @@ pub(super) fn allowed_maps_provider() -> SimpleFunc<146, crate::UserTy, impl (Fn
|
||||
let mut params = params.to_dict();
|
||||
params.insert(MODE_MAP_PARAM_KEY, Typed::Dict(Dict {
|
||||
key_ty: 115, // str
|
||||
val_ty: 121, // arr
|
||||
val_ty: 122, // obj arr
|
||||
items: vec![
|
||||
(Typed::Str(GameMode::BattleArena.as_str().into()), Typed::Arr(Arr {
|
||||
ty: 115, // str
|
||||
items: vec![
|
||||
(Typed::Str(GameMode::BattleArena.as_str().into()), Typed::ObjArr(vec![
|
||||
Typed::Str("Assets/Scenes/Planet_Neptune/RC_Planet_Neptune_02_BA".into()),
|
||||
Typed::Str("Assets/Scenes/Planet_Mars/RC_Planet_Mars_03_BA".into()),
|
||||
Typed::Str("Assets/Scenes/Planet_Mars/RC_Planet_Mars_02_BA".into()),
|
||||
Typed::Str("Assets/Scenes/Planet_Earth/RC_Planet_Earth_02_BA".into()),
|
||||
Typed::Str("Assets/Scenes/Planet_Earth/RC_Planet_Earth_01_BA".into()),
|
||||
Typed::Str("Assets/Scenes/Planet_Neptune/RC_Planet_Neptune_03_BA".into()),
|
||||
]
|
||||
})),
|
||||
(Typed::Str(GameMode::TeamDeathmatch.as_str().into()), Typed::Arr(Arr {
|
||||
ty: 115, // str
|
||||
items: vec![
|
||||
].into())
|
||||
),
|
||||
(Typed::Str(GameMode::TeamDeathmatch.as_str().into()), Typed::ObjArr(vec![
|
||||
Typed::Str("Assets/Scenes/Planet_Neptune/RC_Planet_Neptune_01_CTF".into()),
|
||||
Typed::Str("Assets/Scenes/Planet_Mars/RC_Planet_Mars_01_CTF".into()),
|
||||
]
|
||||
})),
|
||||
].into())
|
||||
),
|
||||
],
|
||||
}));
|
||||
params.insert(MAP_NAMES_PARAM_KEY, Typed::Dict(Dict {
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
use polariton_server::operations::SimpleFunc;
|
||||
use polariton::operation::{ParameterTable, Typed};
|
||||
|
||||
const PARAM_KEY: u8 = 2;
|
||||
const MESSAGE_PARAM_KEY: u8 = 2;
|
||||
const DISPLAY_TIME_PARAM_KEY: u8 = 15;
|
||||
|
||||
pub(super) fn dev_message_provider() -> SimpleFunc<8, 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::Bytes(Vec::from("No jam was harmed in the reverse-engineering of this game".as_bytes()).into()));
|
||||
params.insert(MESSAGE_PARAM_KEY, Typed::Bytes(Vec::from("No jam was harmed in the reverse-engineering of this game".as_bytes()).into()));
|
||||
params.insert(DISPLAY_TIME_PARAM_KEY, Typed::Int(60 /* seconds??? */));
|
||||
Ok(params.into())
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use polariton_server::operations::SimpleFunc;
|
||||
use polariton::operation::{ParameterTable, Typed, Dict, Arr};
|
||||
use polariton::operation::{ParameterTable, Typed, Dict};
|
||||
|
||||
use crate::data::garage_bay::*;
|
||||
|
||||
@@ -28,8 +28,8 @@ pub(super) fn garage_slot_provider() -> SimpleFunc<40, crate::UserTy, impl (Fn(P
|
||||
bay_cpu: 2_000,
|
||||
tutorial_robot: false,
|
||||
starter_robot_index: -1,
|
||||
control_type: 0,
|
||||
control_options: vec![false, false],
|
||||
control_type: ControlType::Camera,
|
||||
control_options: ControlOptions { vertical_strafing: false, sideways_driving: false, tracks_turn_on_spot: false, },
|
||||
mastery_level: 1,
|
||||
bay_skin_id: "".to_owned(), // TODO
|
||||
weapon_order: vec![0],
|
||||
@@ -37,10 +37,9 @@ pub(super) fn garage_slot_provider() -> SimpleFunc<40, crate::UserTy, impl (Fn(P
|
||||
],
|
||||
}));
|
||||
params.insert(SELECTED_SLOT_PARAM_KEY, Typed::Int(0));
|
||||
params.insert(SLOT_ORDER_PARAM_KEY, Typed::Arr(Arr {
|
||||
ty: 105, // int
|
||||
items: vec![Typed::Int(0)],
|
||||
}));
|
||||
params.insert(SLOT_ORDER_PARAM_KEY, Typed::ObjArr(vec![
|
||||
Typed::Int(0),
|
||||
].into()));
|
||||
Ok(params.into())
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user