Compare commits
2 commits
d92b6f2bac
...
1084402c28
Author | SHA1 | Date | |
---|---|---|---|
Artemis Tosini | 1084402c28 | ||
Artemis Tosini | ac065b60f7 |
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -1,3 +1,6 @@
|
||||||
[submodule "proto/proto"]
|
[submodule "proto/proto"]
|
||||||
path = proto/proto
|
path = proto/proto
|
||||||
url = https://github.com/SteamDatabase/Protobufs
|
url = https://github.com/SteamDatabase/Protobufs
|
||||||
|
[submodule "abigen/proton"]
|
||||||
|
path = abigen/proton
|
||||||
|
url = https://github.com/ValveSoftware/Proton
|
||||||
|
|
37
Cargo.lock
generated
37
Cargo.lock
generated
|
@ -197,6 +197,26 @@ version = "1.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "clang"
|
||||||
|
version = "2.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "84c044c781163c001b913cd018fc95a628c50d0d2dfea8bca77dad71edb16e37"
|
||||||
|
dependencies = [
|
||||||
|
"clang-sys",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "clang-sys"
|
||||||
|
version = "1.8.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4"
|
||||||
|
dependencies = [
|
||||||
|
"glob",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "color-eyre"
|
name = "color-eyre"
|
||||||
version = "0.6.3"
|
version = "0.6.3"
|
||||||
|
@ -552,6 +572,12 @@ version = "0.28.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
|
checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "glob"
|
||||||
|
version = "0.3.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hashbrown"
|
name = "hashbrown"
|
||||||
version = "0.14.5"
|
version = "0.14.5"
|
||||||
|
@ -1955,6 +1981,17 @@ dependencies = [
|
||||||
"vapore-struct",
|
"vapore-struct",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "vapore-abigen"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"clang",
|
||||||
|
"color-eyre",
|
||||||
|
"env_logger",
|
||||||
|
"log",
|
||||||
|
"regex",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vapore-client"
|
name = "vapore-client"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
[workspace]
|
[workspace]
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
members = [
|
members = [
|
||||||
|
"abigen",
|
||||||
"client",
|
"client",
|
||||||
"lib",
|
"lib",
|
||||||
"proto",
|
"proto",
|
||||||
|
|
11
abigen/Cargo.toml
Normal file
11
abigen/Cargo.toml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
[package]
|
||||||
|
name = "vapore-abigen"
|
||||||
|
edition = "2021"
|
||||||
|
version.workspace = true
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
clang = { version = "2.0.0", features = ["clang_10_0"] }
|
||||||
|
color-eyre.workspace = true
|
||||||
|
env_logger.workspace = true
|
||||||
|
log.workspace = true
|
||||||
|
regex = "1.10.6"
|
1
abigen/proton
Submodule
1
abigen/proton
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 962bbc4e74dde0643a6edab7c845bc628601f23f
|
62
abigen/src/main.rs
Normal file
62
abigen/src/main.rs
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
use std::{
|
||||||
|
collections::BTreeMap,
|
||||||
|
env,
|
||||||
|
fs::{self, File},
|
||||||
|
io::Read,
|
||||||
|
path::{Path, PathBuf},
|
||||||
|
};
|
||||||
|
|
||||||
|
use color_eyre::eyre;
|
||||||
|
use regex::Regex;
|
||||||
|
|
||||||
|
fn main() -> eyre::Result<()> {
|
||||||
|
env_logger::init();
|
||||||
|
color_eyre::install()?;
|
||||||
|
|
||||||
|
let lsteamclient_path =
|
||||||
|
PathBuf::from(env::var_os("PROTON_SOURCE").unwrap_or_else(|| "proton".into()))
|
||||||
|
.join("lsteamclient");
|
||||||
|
|
||||||
|
let mut versions = BTreeMap::new();
|
||||||
|
|
||||||
|
for maybe_sdk in fs::read_dir(lsteamclient_path)? {
|
||||||
|
let sdk = maybe_sdk?;
|
||||||
|
if !sdk.file_type()?.is_dir() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
let this_versions = interface_versions(&sdk.path())?;
|
||||||
|
versions.insert(sdk.file_name(), this_versions);
|
||||||
|
}
|
||||||
|
|
||||||
|
println!("{:#?}", versions);
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn interface_versions(path: &Path) -> eyre::Result<BTreeMap<String, String>> {
|
||||||
|
let re = Regex::new(r#"#define\s*(STEAM[A-Z]*)_INTERFACE_VERSION\s*"([a-zA-Z0-9_]*)""#)?;
|
||||||
|
|
||||||
|
let mut versions = BTreeMap::new();
|
||||||
|
|
||||||
|
for maybe_file in fs::read_dir(path)? {
|
||||||
|
let file = maybe_file?;
|
||||||
|
if !file.file_name().to_string_lossy().ends_with(".h") {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut content_bytes = Vec::new();
|
||||||
|
if let Err(e) = File::open(file.path())?.read_to_end(&mut content_bytes) {
|
||||||
|
log::warn!("Got error in {:?}: {}", file.path(), e)
|
||||||
|
}
|
||||||
|
|
||||||
|
let content: String = content_bytes.into_iter().map(|c| c as char).collect();
|
||||||
|
|
||||||
|
for capture in re.captures_iter(&content) {
|
||||||
|
versions.insert(
|
||||||
|
capture.get(1).unwrap().as_str().to_string(),
|
||||||
|
capture.get(2).unwrap().as_str().to_string(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ok(versions)
|
||||||
|
}
|
|
@ -18,7 +18,7 @@
|
||||||
{
|
{
|
||||||
devShells.default =
|
devShells.default =
|
||||||
with pkgs;
|
with pkgs;
|
||||||
mkShell {
|
(mkShell.override { stdenv = llvmPackages.stdenv; }) {
|
||||||
packages = [
|
packages = [
|
||||||
rustPackages.cargo
|
rustPackages.cargo
|
||||||
rustPackages.rustc
|
rustPackages.rustc
|
||||||
|
@ -27,6 +27,8 @@
|
||||||
|
|
||||||
protobuf
|
protobuf
|
||||||
];
|
];
|
||||||
|
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
||||||
|
|
||||||
RUST_SRC_PATH = "${rustPackages.rustPlatform.rustLibSrc}";
|
RUST_SRC_PATH = "${rustPackages.rustPlatform.rustLibSrc}";
|
||||||
RUST_LOG = "debug,vapore=trace,vapore-client=trace";
|
RUST_LOG = "debug,vapore=trace,vapore-client=trace";
|
||||||
RUST_BACKTRACE = "1";
|
RUST_BACKTRACE = "1";
|
||||||
|
|
Loading…
Reference in a new issue