#add-on #guild-wars-2 #框架 #安全抽象 #ffi #api 绑定

arcdps

Rust 对 Guild Wars 2 dps 计数的绑定,侧重于易用性和性能

7 个不稳定版本

0.10.1 2024 年 6 月 6 日
0.10.0 2024 年 5 月 20 日
0.9.0 2023 年 7 月 4 日
0.8.1 2023 年 3 月 8 日
0.7.0 2022 年 2 月 27 日

#888游戏

Download history 5/week @ 2024-04-19 2/week @ 2024-04-26 163/week @ 2024-05-17 18/week @ 2024-05-24 96/week @ 2024-05-31 55/week @ 2024-06-07 13/week @ 2024-06-14 3/week @ 2024-06-28 27/week @ 2024-07-05 166/week @ 2024-07-26 15/week @ 2024-08-02

每月 181 次下载

MIT/Apache

51KB
972

Arcdps 插件绑定 最新版本

这提供具有安全、零成本的抽象的 arcdps 插件绑定。

只需几行代码即可轻松集成到 arcdps。

功能

当前功能包括

  • 通过 Cargo.toml 版本化插件
  • 所有回调的简单接口
  • 可选放弃安全抽象以直接访问 arcdps C 接口
  • 通过 imgui-rs 进行 Imgui 接口
  • 通过 log crate 记录到 arcdps
  • 非官方额外 绑定

仍在开发中

  • 公开 arcdps 设置

仍在探索技术边界

  • 类似于 arcdps 的 Imgui 窗口吸附

如何使用

一个小示例展示了提供的许多功能中的 2 个。如果 init 返回错误,arcdps 不会将插件视为已加载,并将显示错误。除了非官方-extras 函数之外,不会调用其他任何函数。

use std::error::Error;

use arcdps::UserInfoIter;

arcdps::arcdps_export! {
    name: "example addon",
    sig: 123, // change this to a random number
    unofficial_extras_squad_update: crate::squad_update,
    init: crate::init,
}

fn squad_update(users: UserInfoIter) {
    for user in users.into_iter() {
        println!("{:?}", user);
    }
}

fn init(swapchain: Option<NonNull<c_void>>) -> Result<(), Box<dyn Error>> {
    match swapchain {
        Some(swapchain) => {
            println!("init: initialized with swapchain: {:?}", swapchain);
            Ok(())
        }
        None => Err("init: swapchain is None".into()),
    }
}

依赖关系

~6.5MB
~123K SLoC