mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Filter out broken part IDs
This commit is contained in:
@@ -43,8 +43,11 @@ impl ArcAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
fn parse_cube_amounts(&self, cube_amounts: &str) -> std::collections::HashMap<u32, u32> {
|
||||
serde_json::from_str(cube_amounts).unwrap_or_default()
|
||||
fn parse_cube_amounts(&self, cube_amounts: &str) -> HashMap<u32, u32> {
|
||||
let mut m: HashMap<u32, u32> = serde_json::from_str(cube_amounts).unwrap_or_default();
|
||||
let bad_ids = super::bad_part_ids::bad_part_id_set();
|
||||
m.retain(|part_id, _| !bad_ids.contains(part_id));
|
||||
m
|
||||
}
|
||||
|
||||
fn calculate_cube_amounts(&self, data: &[u8]) -> String {
|
||||
|
||||
135
rc_factory/src/arc/bad_part_ids.rs
Normal file
135
rc_factory/src/arc/bad_part_ids.rs
Normal file
@@ -0,0 +1,135 @@
|
||||
use std::collections::HashSet;
|
||||
use std::sync::OnceLock;
|
||||
|
||||
pub const BAD_IDS: &[u32] = &[
|
||||
11838567,
|
||||
31120410,
|
||||
31677565,
|
||||
46150324,
|
||||
78846819,
|
||||
81509462,
|
||||
184010445,
|
||||
237466288,
|
||||
293027766,
|
||||
314459661,
|
||||
338131112,
|
||||
457113130,
|
||||
467120522,
|
||||
496862599,
|
||||
501172250,
|
||||
543064582,
|
||||
551604040,
|
||||
578334861,
|
||||
591201606,
|
||||
592303238,
|
||||
676556157,
|
||||
721292346,
|
||||
731082751,
|
||||
784541921,
|
||||
816829485,
|
||||
845358402,
|
||||
890194475,
|
||||
928867324,
|
||||
974084625,
|
||||
1018457748,
|
||||
1090038504,
|
||||
1128696351,
|
||||
1168698870,
|
||||
1240629822,
|
||||
1309620559,
|
||||
1315241999,
|
||||
1325949898,
|
||||
1352133458,
|
||||
1362505337,
|
||||
1403070239,
|
||||
1413101008,
|
||||
1439149132,
|
||||
1459104119,
|
||||
1478755203,
|
||||
1493281059,
|
||||
1536521034,
|
||||
1549313867,
|
||||
1558067031,
|
||||
1562104498,
|
||||
1575105860,
|
||||
1598408503,
|
||||
1637622047,
|
||||
1669509564,
|
||||
1684930476,
|
||||
1702383688,
|
||||
1727367589,
|
||||
1730552257,
|
||||
1749849161,
|
||||
1787337066,
|
||||
1834283861,
|
||||
1857534838,
|
||||
1876483700,
|
||||
1877040659,
|
||||
2006058694,
|
||||
2048719521,
|
||||
2135735743,
|
||||
2234346032,
|
||||
2276594985,
|
||||
2287632793,
|
||||
2292045362,
|
||||
2324128786,
|
||||
2366806805,
|
||||
2367586215,
|
||||
2388981877,
|
||||
2460830034,
|
||||
2537767682,
|
||||
2549943884,
|
||||
2581522917,
|
||||
2626596603,
|
||||
2638983060,
|
||||
2648952126,
|
||||
2662788350,
|
||||
2752826359,
|
||||
2759478449,
|
||||
2766875446,
|
||||
2786019734,
|
||||
2792029874,
|
||||
2898948238,
|
||||
3003461135,
|
||||
3013040640,
|
||||
3014580839,
|
||||
3070139769,
|
||||
3075124016,
|
||||
3111721879,
|
||||
3123991804,
|
||||
3186238732,
|
||||
3186524732,
|
||||
3188616903,
|
||||
3197803309,
|
||||
3224129949,
|
||||
3293765065,
|
||||
3328512085,
|
||||
3360783547,
|
||||
3393310392,
|
||||
3439410085,
|
||||
3461973291,
|
||||
3504767074,
|
||||
3553732357,
|
||||
3567218872,
|
||||
3594602569,
|
||||
3607909941,
|
||||
3636797296,
|
||||
3662230097,
|
||||
3719092233,
|
||||
3799999755,
|
||||
3805965640,
|
||||
3837584923,
|
||||
3884591702,
|
||||
3918108448,
|
||||
3994839079,
|
||||
4039842231,
|
||||
4071959794,
|
||||
4162167502,
|
||||
4200979110,
|
||||
4277093178,
|
||||
];
|
||||
|
||||
pub fn bad_part_id_set() -> &'static HashSet<u32> {
|
||||
static SET: OnceLock<HashSet<u32>> = OnceLock::new();
|
||||
SET.get_or_init(|| BAD_IDS.iter().copied().collect())
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
//! Adapter for sqlite database generated by https://github.com/NGnius/arc
|
||||
|
||||
mod adapter;
|
||||
mod bad_part_ids;
|
||||
pub use adapter::ArcAdapter;
|
||||
|
||||
mod entities;
|
||||
|
||||
@@ -38,6 +38,7 @@ BINARIES_TO_INCLUDE = {
|
||||
"oj_rc_social": lambda name: generate_ip_redirect_script(name, 4535), "oj_rc_social_room": generate_ip_script,
|
||||
"oj_rc_lobby": lambda name: generate_ip_redirect_script(name, 4541), "oj_rc_lobby_room": lambda name: generate_ip_redirect_script(name, 4542),
|
||||
"oj_rc_multiplayer": generate_ip_script,
|
||||
"oj_factory_web": generate_ip_script,
|
||||
}
|
||||
|
||||
PROJECT_FOLDERS_TO_INCLUDE = [
|
||||
|
||||
Reference in New Issue
Block a user