mirror of
https://github.com/LCE-Hub/LCE-Emerald-Launcher.git
synced 2026-09-23 08:32:51 +00:00
feat: initial steamworks support
This commit is contained in:
Generated
+25
@@ -1000,6 +1000,7 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"steam_shortcuts_util",
|
"steam_shortcuts_util",
|
||||||
|
"steamworks",
|
||||||
"tauri",
|
"tauri",
|
||||||
"tauri-build",
|
"tauri-build",
|
||||||
"tauri-plugin-drpc",
|
"tauri-plugin-drpc",
|
||||||
@@ -2971,6 +2972,12 @@ dependencies = [
|
|||||||
"windows-link 0.2.1",
|
"windows-link 0.2.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "paste"
|
||||||
|
version = "1.0.15"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pathdiff"
|
name = "pathdiff"
|
||||||
version = "0.2.3"
|
version = "0.2.3"
|
||||||
@@ -4254,6 +4261,24 @@ dependencies = [
|
|||||||
"nom_locate",
|
"nom_locate",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "steamworks"
|
||||||
|
version = "0.13.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0974cb1b6b5588f788a3edcb7e6e5e964388ae9d317c723b1009d2699790f66d"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.11.0",
|
||||||
|
"paste",
|
||||||
|
"steamworks-sys",
|
||||||
|
"thiserror 2.0.18",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "steamworks-sys"
|
||||||
|
version = "0.13.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ae139f051204a4af015d4f0ed3a1f7a51020d03a44c7cf249168c543d88131e9"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "string_cache"
|
name = "string_cache"
|
||||||
version = "0.8.9"
|
version = "0.8.9"
|
||||||
|
|||||||
@@ -29,3 +29,4 @@ libc = "0.2"
|
|||||||
image = "0.24"
|
image = "0.24"
|
||||||
percent-encoding = "2.3"
|
percent-encoding = "2.3"
|
||||||
steam_shortcuts_util = "1.1.8"
|
steam_shortcuts_util = "1.1.8"
|
||||||
|
steamworks = "0.13.0"
|
||||||
|
|||||||
@@ -1,7 +1,33 @@
|
|||||||
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
||||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||||
|
use steamworks::{Client, FriendFlags, AppId};
|
||||||
|
fn list_steam_friends() {
|
||||||
|
match Client::init() {
|
||||||
|
Ok(client) => {
|
||||||
|
println!("[Emerald.Test] Steamworks initialized successfully!");
|
||||||
|
let utils = client.utils();
|
||||||
|
println!("[Emerald.Test] AppId: {:?}", utils.app_id());
|
||||||
|
let friends = client.friends();
|
||||||
|
let friends_list = friends.get_friends(FriendFlags::IMMEDIATE);
|
||||||
|
println!("[Emerald.Test] Steam Friends:");
|
||||||
|
if friends_list.is_empty() {
|
||||||
|
println!("[Emerald.Test] no friends found (or Steam hasnt cached them yet).");
|
||||||
|
}
|
||||||
|
|
||||||
|
for friend in friends_list {
|
||||||
|
println!(" - Name: {} | {:?}", friend.name(), friend.id());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
eprintln!("[Emerald.Test] failed to initialize Steamworks: {}", e);
|
||||||
|
eprintln!("[Emerald.Test] check if Steam is open and steam_appid.txt is 480");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
list_steam_friends(); //neo: dont remove unless Workshop Update has been released.
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
{
|
{
|
||||||
use std::env;
|
use std::env;
|
||||||
|
|||||||
Reference in New Issue
Block a user