Skip to content

About

Rust bindings for the Source SDK

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

679 Commits

Folders and files

Repository files navigation

Source SDK 2013 for Rust

crates.io docs.rs
"Somewhat Higher" level Rust Bindings

For now, this is:

  • Only for x86_64-pc-windows-msvc and x86_64-unknown-linux-gnu
  • Focused for Team Fortress 2 server plugin development

Usage

Use nightly Rust; the runtime crates declare Rust 1.99.0 as their minimum and use unstable language features. TF2-specific wrappers are opt-in:

[dependencies]
source_sdk_2013 = { version = "0.1.0-alpha.8", features = ["tf2"] }

tf2_loadout also enables tf2 and adds the loadout re-applier. The internal _test-support feature is for tests, not normal plugin builds. See the SDK documentation for callback-scoped Server access and the safety contracts of individual operations.

Build Inputs

Ordinary SDK builds use the checked-in generated bindings and need neither Valve's C++ SDK nor libclang. To regenerate them intentionally from a repository checkout, follow the binding-generation instructions.

The separate Metamod:Source bindings also build native C++17 plugin shells and require both supported Metamod source checkouts. Their build inputs are not required by source_sdk_2013 itself.

SLoC

Code conventions

  • Modules that declare non-inline submodules are directory modules: foo/mod.rs with the submodules in foo/, never foo.rs next to a foo/ directory. Modules without submodules stay plain foo.rs.
  • Tests cover logic that is not obvious from reading it: parsing and protocol edge cases, non-trivial math or geometry, state machines, cleanup and panic containment, ABI layouts and regressions for bugs that were hit. Do not add tests for no-brainers, such as a constant, a table or allow-list restating its source, a one-line predicate, or an accessor, builder or derive.

License

For Valve's Source SDK 2013, see the SOURCE 1 SDK LICENSE. For AlliedModders' Metamod:Source, see their "zLib/libpng" license

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in rust_source_sdk_2013 by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

Rust bindings for the Source SDK

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages