MCPcopy Index your code
hub / github.com/Noxime/steamworks-rs

github.com/Noxime/steamworks-rs @v0.13.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.13.1 ↗ · + Follow
5,398 symbols 8,225 edges 83 files 759 documented · 14%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

steamworks

crates.io Documentation License

This crate provides Rust bindings to the Steamworks SDK.

Usage

Add the following to your Cargo.toml:

[dependencies]
steamworks = "0.13.0"
Crate SDK MSRV
git 1.64 1.80.0
0.13.0 1.64 1.80.0
0.12.0 1.62 1.80.0
0.11.0 1.58a 1.71.1
0.10.0 1.54 1.56.1
0.9.0 1.53a 1.56.1

Example

You can find more examples in examples.

use steamworks::AppId;
use steamworks::Client;
use steamworks::FriendFlags;
use steamworks::PersonaStateChange;

fn main() {
    let client = Client::init().unwrap();

    let _cb = client.register_callback(|p: PersonaStateChange| {
        println!("Got callback: {:?}", p);
    });

    let utils = client.utils();
    println!("Utils:");
    println!("AppId: {:?}", utils.app_id());
    println!("UI Language: {}", utils.ui_language());

    let apps = client.apps();
    println!("Apps");
    println!("IsInstalled(480): {}", apps.is_app_installed(AppId(480)));
    println!("InstallDir(480): {}", apps.app_install_dir(AppId(480)));
    println!("BuildId: {}", apps.app_build_id());
    println!("AppOwner: {:?}", apps.app_owner());
    println!("Langs: {:?}", apps.available_game_languages());
    println!("Lang: {}", apps.current_game_language());
    println!("Beta: {:?}", apps.current_beta_name());

    let friends = client.friends();
    println!("Friends");
    let list = friends.get_friends(FriendFlags::IMMEDIATE);
    println!("{:?}", list);
    for f in &list {
        println!("Friend: {:?} - {}({:?})", f.id(), f.name(), f.state());
        friends.request_user_information(f.id(), true);
    }

    for _ in 0..50 {
        client.run_callbacks();
        ::std::thread::sleep(::std::time::Duration::from_millis(100));
    }
}

Features

serde: This feature enables serialization and deserialization of some types with serde. image: This feature allows accessing image data like icons with image crate.

License

This crate is dual-licensed under Apache and MIT, except for the files in [steamworks-sys/lib/steam/]

Help, I can't run my game!

If you are seeing errors like STATUS_DLL_NOT_FOUND, Image not found etc. You are likely missing the Steamworks SDK Redistributable files. Steamworks-rs loads the SDK dynamically, so the libraries need to exist somewhere the operating system can find them. This is likely next to your game binary (.exe on windows). You can find the required files in the SDK release ZIP, under lib\steam\redistributable_bin. See #63 for further details

Extension points exported contracts — how you extend this code

Callback (Interface)
(no doc)
src/callback.rs

Core symbols most depended-on inside this repo

as_ptr
called by 1087
src/networking_types.rs
clone
called by 60
src/lib.rs
into
called by 57
src/ugc.rs
as_mut_ptr
called by 55
src/networking_types.rs
run_callbacks
called by 17
src/lib.rs
set
called by 14
steamworks-sys/src/linuxarm_bindings.rs
set
called by 14
steamworks-sys/src/windows_bindings.rs
set
called by 14
steamworks-sys/src/macos_bindings.rs

Shape

Class 1,791
Enum 1,572
Function 1,231
Method 803
Interface 1

Languages

Rust88%
C++12%

Modules by API surface

steamworks-sys/src/macos_bindings.rs1,007 symbols
steamworks-sys/src/linux_bindings.rs1,003 symbols
steamworks-sys/src/linuxarm_bindings.rs1,001 symbols
steamworks-sys/src/windows_bindings.rs993 symbols
src/networking_types.rs109 symbols
src/ugc.rs100 symbols
steamworks-sys/lib/steam/public/steam/steamnetworkingtypes.h76 symbols
steamworks-sys/lib/steam/public/steam/steamclientpublic.h76 symbols
src/matchmaking.rs62 symbols
src/lib.rs51 symbols
src/networking_sockets.rs45 symbols
src/server.rs44 symbols

For agents

$ claude mcp add steamworks-rs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page