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:
@@ -16,3 +16,29 @@ pub mod garage_bay;
|
||||
pub mod custom_games;
|
||||
pub mod tech_tree;
|
||||
pub mod item_shop_bundle;
|
||||
pub mod player_robopass_season;
|
||||
pub mod weapon_upgrade;
|
||||
pub mod player_rank;
|
||||
pub mod robot_data;
|
||||
pub mod quest;
|
||||
|
||||
pub(self) fn encode_7_bit_i32(mut src: i32) -> Vec<u8> {
|
||||
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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user