mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Move common components to shared lib
This commit is contained in:
@@ -1,56 +1,30 @@
|
||||
pub mod cube_list;
|
||||
pub use rc_core::data::cube_list;
|
||||
pub mod special_item;
|
||||
pub mod premium_config;
|
||||
pub mod palette;
|
||||
pub mod client_config;
|
||||
pub mod crf_config;
|
||||
pub mod weapon_list;
|
||||
pub mod movement_list;
|
||||
pub use rc_core::data::weapon_list;
|
||||
//pub use rc_core::data::movement_list;
|
||||
pub mod damage_boost;
|
||||
pub mod battle_arena_config;
|
||||
pub mod cpu_limits;
|
||||
pub mod cosmetic_limits;
|
||||
pub mod taunts_config;
|
||||
pub mod customisation_info;
|
||||
pub mod garage_bay;
|
||||
pub use rc_core::data::garage_bay;
|
||||
pub mod custom_games;
|
||||
pub mod tech_tree;
|
||||
//pub use rc_core::data::tech_tree;
|
||||
pub mod item_shop_bundle;
|
||||
pub mod player_robopass_season;
|
||||
pub mod weapon_upgrade;
|
||||
//pub use rc_core::data::weapon_upgrade;
|
||||
pub mod player_rank;
|
||||
pub mod robot_data;
|
||||
pub mod quest;
|
||||
pub mod auto_regen;
|
||||
pub mod voting;
|
||||
//pub use rc_core::data::auto_regen;
|
||||
//pub use rc_core::data::voting;
|
||||
pub mod lobby;
|
||||
pub mod error_codes;
|
||||
pub mod game_mode;
|
||||
pub use rc_core::data::error_codes;
|
||||
//pub use rc_core::data::game_mode;
|
||||
pub mod score_multipliers;
|
||||
pub mod campaign;
|
||||
|
||||
pub(self) fn encode_7_bit_i32(mut src: i32) -> Vec<u8> {
|
||||
if src == 0 { return vec![0] }
|
||||
let mut out = Vec::with_capacity(5);
|
||||
while src != 0 {
|
||||
let last_7 = (src & 0x7F) as u8;
|
||||
src = src >> 7;
|
||||
if src != 0 {
|
||||
out.push(last_7 | 0x80);
|
||||
} else {
|
||||
out.push(last_7);
|
||||
}
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
pub(self) fn write_str_for_binreader(s: &str, writer: &mut dyn std::io::Write) -> std::io::Result<usize> {
|
||||
let s_bytes = s.as_bytes();
|
||||
let mut total_len = writer.write(&encode_7_bit_i32(s_bytes.len() as i32))?;
|
||||
total_len += writer.write(s_bytes)?;
|
||||
Ok(total_len)
|
||||
}
|
||||
|
||||
pub(self) fn cube_id_to_str(id: u32) -> String {
|
||||
hex::encode(id.to_be_bytes()).into()
|
||||
}
|
||||
//pub use rc_core::data::campaign;
|
||||
|
||||
Reference in New Issue
Block a user