feat: skip version
Allows to skip the game buiold number version check. Related to #13.
This commit is contained in:
parent
212c88efaa
commit
900e5d2acc
@ -28,6 +28,10 @@ pub struct Cli {
|
|||||||
/// Verbosity level for logging to the console
|
/// Verbosity level for logging to the console
|
||||||
#[arg(value_enum, long, short, ignore_case = true, default_value_t = Loglevel::Warn)]
|
#[arg(value_enum, long, short, ignore_case = true, default_value_t = Loglevel::Warn)]
|
||||||
pub loglevel: Loglevel,
|
pub loglevel: Loglevel,
|
||||||
|
|
||||||
|
/// Skip the dwBuildNumber check, allows for running with *possibly* outdated offsets.
|
||||||
|
#[arg(long)]
|
||||||
|
pub skip_version: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn version() -> String {
|
fn version() -> String {
|
||||||
|
@ -31,7 +31,7 @@ impl DmaCtx {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn setup(connector: Connector, pcileech_device: String) -> anyhow::Result<DmaCtx> {
|
pub fn setup(connector: Connector, pcileech_device: String, skip_version: bool) -> anyhow::Result<DmaCtx> {
|
||||||
let inventory = Inventory::scan();
|
let inventory = Inventory::scan();
|
||||||
|
|
||||||
let os = {
|
let os = {
|
||||||
@ -66,7 +66,9 @@ impl DmaCtx {
|
|||||||
engine_module,
|
engine_module,
|
||||||
};
|
};
|
||||||
|
|
||||||
ctx.check_version()?;
|
if !skip_version {
|
||||||
|
ctx.check_version()?;
|
||||||
|
}
|
||||||
|
|
||||||
Ok(ctx)
|
Ok(ctx)
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,8 @@ mod cs2dumper;
|
|||||||
|
|
||||||
pub use context::Connector;
|
pub use context::Connector;
|
||||||
|
|
||||||
pub async fn run(radar_data: ArcRwlockRadarData, connector: Connector, pcileech_device: String) -> anyhow::Result<()> {
|
pub async fn run(radar_data: ArcRwlockRadarData, connector: Connector, pcileech_device: String, skip_version: bool) -> anyhow::Result<()> {
|
||||||
let mut ctx = DmaCtx::setup(connector, pcileech_device)?;
|
let mut ctx = DmaCtx::setup(connector, pcileech_device, skip_version)?;
|
||||||
let mut data = CsData::default();
|
let mut data = CsData::default();
|
||||||
|
|
||||||
// For read timing
|
// For read timing
|
||||||
|
@ -30,7 +30,7 @@ async fn main() -> anyhow::Result<()> {
|
|||||||
|
|
||||||
let radar_clone = radar_data.clone();
|
let radar_clone = radar_data.clone();
|
||||||
let dma_handle = tokio::spawn(async move {
|
let dma_handle = tokio::spawn(async move {
|
||||||
if let Err(err) = dma::run(radar_clone, cli.connector, cli.pcileech_device).await {
|
if let Err(err) = dma::run(radar_clone, cli.connector, cli.pcileech_device, cli.skip_version).await {
|
||||||
log::error!("Error in dma thread: [{}]", err.to_string());
|
log::error!("Error in dma thread: [{}]", err.to_string());
|
||||||
} else {
|
} else {
|
||||||
println!("CS2 Process exited, exiting program...")
|
println!("CS2 Process exited, exiting program...")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user