RaphaelSharp 1.1.10
dotnet add package RaphaelSharp --version 1.1.10
NuGet\Install-Package RaphaelSharp -Version 1.1.10
<PackageReference Include="RaphaelSharp" Version="1.1.10" />
<PackageVersion Include="RaphaelSharp" Version="1.1.10" />
<PackageReference Include="RaphaelSharp" />
paket add RaphaelSharp --version 1.1.10
#r "nuget: RaphaelSharp, 1.1.10"
#:package RaphaelSharp@1.1.10
#addin nuget:?package=RaphaelSharp&version=1.1.10
#tool nuget:?package=RaphaelSharp&version=1.1.10
RaphaelSharp
C# bindings for the Raphael FFXIV crafting solver and its recipe data, used by RebornBuddy.
This is a fork of WorkingRobot/Raphael.Net (remote upstream). Upstream
exports only the solver, so its caller must supply recipe data and simulate the result itself. RaphaelSharp also links
raphael-data and exposes everything raphael-cli offered, in-process.
| Path | Output | Contents |
|---|---|---|
native/ |
raphaelsharp_native.dll |
Rust crate: raphael-rs behind a C ABI (raphael_* exports) |
RaphaelSharp/ |
RaphaelSharp.dll |
C# library: loads the native DLL and mirrors its ABI |
Install
dotnet add package RaphaelSharp
The package targets net10.0 on Windows x64 and carries raphaelsharp_native.dll as a runtimes/win-x64/native
asset, so RaphaelLibrary.Load() finds it without further setup.
API
var raphael = RaphaelLibrary.Load(); // runtime native probing; Load(path) for an explicit location
Recipe[] recipes = raphael.FindRecipesByItem(itemId); // replaces raphael-cli search --item-id
Ingredient[]? mats = raphael.GetIngredients(recipeId); // replaces raphael-cli ingredients -r; null if unknown
var input = new SolveArgs
{
RecipeId = recipeId,
Craftsmanship = 4500, Control = 4200, Cp = 620, Level = 100,
TargetQualityPercent = 100,
Manipulation = true,
};
input.HqIngredients[0] = 2; // indexed like GetIngredients
using var timeout = new CancellationTokenSource(TimeSpan.FromSeconds(30));
Solution solution = await raphael.SolveAsync(input, timeout.Token); // replaces raphael-cli solve
Solution carries the SolveStatus, the macro as CraftingAction[], and the simulated final state (progress,
quality including HQ ingredients, durability, CP, duration). Cancellation ends a solve with SolveStatus.Interrupted
rather than throwing. A solve uses one worker thread per logical CPU while it runs.
A caller that has the game sheets itself can skip the bundled recipe data entirely and pass the simulator settings it computed; only the solver runs natively, so recipes newer than the bundled data still solve:
var custom = new CustomSolveArgs
{
MaxProgress = 1000, MaxQuality = 5200, MaxDurability = 80, Cp = 620, // recipe level × recipe factors
BaseProgress = 262, BaseQuality = 300, // from craftsmanship / control and the rlvl dividers
Level = 100, TargetQualityPercent = 100, InitialQuality = 0,
Manipulation = true, TrainedEye = false,
};
Solution solution = await raphael.SolveAsync(custom, timeout.Token); // raphael_solve_custom; never UnknownRecipe
CustomSolveArgs mirrors raphael_sim::Settings plus the initial quality and target: compute them the way
raphael-data's get_game_settings and get_initial_quality do from your own copy of the Recipe, RecipeLevelTable,
GathererCrafterLvAdjustTable and Item sheets. raphael.GetCustomArgs(SolveArgs) returns the CustomSolveArgs the
bundled data would solve for a recipe without solving, which is how such a port is checked against the bundled data.
native/src/lib.rs is the ABI contract; RaphaelSharp/Types.cs and RaphaelSharp/RaphaelLibrary.cs mirror it. Any
change to a signature, #[repr(C)] layout, status or action code must be made on both sides together with a bump of
ABI_VERSION / RaphaelLibrary.AbiVersion. RaphaelLibrary.Load rejects a native DLL reporting another version.
Build
Requires the stable x86_64-pc-windows-msvc Rust toolchain, the MSVC build tools and the .NET 10 SDK.
cargo test --release --locked # in native/
dotnet build RaphaelSharp.slnx -c Release
The C# build runs cargo build --release --locked first, so RaphaelSharp/bin/Release/net10.0/ always holds a
matching RaphaelSharp.dll, RaphaelSharp.xml and raphaelsharp_native.dll. Pass -p:CargoPath=<path to cargo.exe>
when cargo is not on PATH. A Release build also writes RaphaelSharp.<version>.nupkg and .snupkg to artifacts/.
Publishing
Every TeamCity build of main packs version 1.1.<build number> and pushes it to nuget.org with --skip-duplicate.
Bump the 1.1 in RaphaelSharp/RaphaelSharp.csproj for breaking API or ABI changes. Builds outside TeamCity are
versioned 1.1.0-dev.
Deploying to RebornBuddy
RebornBuddy references the RaphaelSharp package as Version="*", the newest listed stable version. NuGet re-resolves
that only when a restore is not a no-op, so run dotnet restore --force --no-http-cache to take a version published
since the last restore. With its win-x64 runtime identifier, raphaelsharp_native.dll lands in the application root,
where RaphaelLibrary.Load() finds it. .NET Reactor packs RaphaelSharp.dll as a separate embedded assembly inside
RebornBuddy.dll for releases; it must not merge its types or assembly attributes into the host.
DisableRuntimeMarshalling=true is intentional: the binding uses unmanaged function pointers and blittable ABI
types. Merging its DisableRuntimeMarshallingAttribute into RebornBuddy also disables the host's required string
marshalling and causes a startup MarshalDirectiveException. Packing keeps that policy scoped to RaphaelSharp.
RebornBuddy generates type forwarders for RaphaelSharp's public API to preserve previously merged type identities.
Updating game data
Recipe, item and level tables come from raphael-data, compiled into the native DLL; they serve FindRecipesByItem,
GetIngredients and the recipe-id Solve. After an FFXIV patch, once raphael-rs publishes the new data, point all
three raphael-* dependencies in native/Cargo.toml at the same new revision, run
cargo update -p raphael-data -p raphael-sim -p raphael-solver in native/, rebuild, test and push. Then run the
TeamCity build; RebornBuddy takes the published version on its next forced restore. RebornBuddy itself solves through
CustomSolveArgs from its own client export, so it only needs this when the simulator or solver changes.
License
MIT (see LICENSE). The native DLL statically links raphael-rs, licensed under Apache-2.0; the package ships its
license as THIRD-PARTY-NOTICES.txt.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.