V3.0.0#5
Merged
Merged
Conversation
- cargo bench -p samp-sdk: evita erro 'save-baseline' nos unit tests dos demais crates - actions/checkout: v4 → v6 - actions/upload-artifact: v4 → v7 - actions/cache/restore e cache/save: v4 → v5
…ganization
Pure-Rust implementation of the Open Multiplayer component ABI
(Itanium on Linux, MSVC on Windows). A single binary now works as a
SA-MP plugin and as a native Open Multiplayer component with no
extra configuration. No C/C++, no bindgen.
Breaking changes
- SampPlugin::process_tick renamed to on_server_tick; it now fires on
both servers (ProcessTick on SA-MP, 5 ms ITimersComponent timer on
native Open Multiplayer).
- samp::plugin::enable_process_tick renamed to enable_server_tick.
- samp::cell::string::put_in_buffer is now pub(crate). The public API
for writing strings is Buffer::write_str / UnsizedBuffer::write_str.
- samp_sdk::raw::functions::Logprintf changed from variadic to fixed
arity (fn(*const i8)) — the SDK formats in Rust and passes a single
C string, ABI-equivalent to logprintf("%s", msg).
- Example crates renamed: example-hello/ -> examples/hello/,
example-counter/ -> examples/counter/, plugin-example/ -> examples/advanced/.
Added
- samp_sdk::omp module with eight submodules (component,
component_api, core, events, server, timers, types, vtable)
covering IComponent, IUIDProvider, IPawnComponent, IPawnScript,
IEventDispatcher, ITimersComponent and ICore::ILogger.
- samp::plugin: enable_server_tick, omp_core, omp_query_component,
omp_query::<T> (typed wrapper via OmpComponentHandle).
- SampPlugin: new hooks on_server_tick, on_omp_ready,
on_component_free (the last two gated by not(feature = "samp-only")).
- initialize_plugin!: optional uid, component_name and
component_version fields. Resolution chain
macro > [package.metadata.samp] > derived; UID generated via
FNV-1a 64 of CARGO_PKG_NAME@CARGO_PKG_VERSION and persisted to
Cargo.toml.
- #[native] accepts associated functions, bare T returns (in addition
to Result/AmxResult), &T arguments with auto-borrow, compile-time
validation of interior NULs in the name literal, and panic capture
via catch_unwind.
- samp-only feature on samp and samp-sdk: full opt-out of every Open
Multiplayer code path.
- pub use log in the samp crate so the macro does not require the
log crate as a direct dependency of user plugins.
- scripts/build-{linux,windows}.sh plus Python helpers for the
benchmark pipeline.
- New workflows: docs.yml, release.yml, release-drafter.yml,
labels.yml, bench-release.yml. rust.yml action versions bumped.
- 4 READMEs under examples/ (index + one per plugin).
- Test coverage: 80 -> 207 (+127) unit tests.
- buffer_bench (Criterion); string_bench reworked with
std::hint::black_box.
Changed
- SDK diagnostics routed through log::warn! with the [rust-samp]
prefix.
- Default log routing on native Open Multiplayer goes through
ICore::logLnU8, mapping log::Level -> samp_sdk::omp::LogLevel.
- Adaptive bootstrap of getAmxFunctions(): tried in on_init, retried
in on_ready; AMX scripts that arrive before the function table is
available are queued and processed once it is.
- omp_cleanup kills the tick timer and removes the PawnEventHandler
from the dispatcher before unload, preventing use-after-free.
- samp-codegen error messages are fully in English.
- Compile-time OmpComponent layout asserts (offset_of / size_of) for
Linux i686 and MSVC i686.
Documentation
- mdBook removed (docs/book.toml + docs/src/*) and replaced by a
MkDocs Material site under docs/, entirely in English. New pages:
exec-public, build-scripts, diagnostics, internals/omp-abi.
- README, samp-sdk/readme.md, samp-codegen/readme.md and
migration.md rewritten in English.
- CHANGELOG split: current release at the root, previous ones under
changelog/ (v1.x.md, v2.x.md, historical.md for the pre-fork samp-rs).
- Source docstrings translated to English.
Repository hygiene
- .gitignore consolidated; new ignores for dist/, site/, bench
artefacts, __pycache__, release_body.md, rust-samp-*-src.tar.gz
and editor/OS junk.
- New .gitattributes with export-ignore so docs, examples, scripts,
.github/, changelog/, notes/, mkdocs.yml, ROADMAP.md, CHANGELOG.md
and migration.md are excluded from GitHub's auto-generated source
archives. Also normalizes eol=lf for Windows checkouts.
- release.yml hardened: defensive --exclude flags on tar plus a
verification step that fails the release if any forbidden path
slips into the SDK source tarball.
- Cargo.lock now committed.
Versions
- samp 2.2.0 -> 3.0.0
- samp-sdk 2.2.0 -> 3.0.0
- samp-codegen 1.2.0 -> 1.3.0
Compatibility
- i686-unknown-linux-gnu: SA-MP + native Open Multiplayer (Itanium).
- i686-pc-windows-msvc: SA-MP + native Open Multiplayer (MSVC).
- i686-pc-windows-gnu: SA-MP (combine with the samp-only feature).
Benchmark resultsBefore:
Summary: 48 compared · 0 faster · 48 slower · 0 new · 0 removed Emoji legend: 🚀 large speedup · ✨ minor speedup · |
Replace the unified server tick hook with `on_tick(TickContext)` and add `TickConfig`, `TickSource`, `enable_tick`, and `enable_tick_with`. Track elapsed time between tick dispatches, expose the tick source for SA-MP and Open Multiplayer, and allow plugins to configure per-server tick behavior and Open Multiplayer timer intervals. Update codegen, runtime dispatch, examples, migration notes, API docs, and the changelog for the new tick API.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.