Skip to content

Repository files navigation

Concord

Concord

Concord lets a mod change target runtime behavior while it is running. No runtime files touched, no IL to learn. You write C# that looks like it belongs next to the target code, and Concord handles runtime patch application.

It's a Harmony alternative built for .NET 10, type-safe, zero-allocation on the hot path.

A quick taste

Every campfire should run 5 degrees warmer:

[Patch]
abstract class CampfireWarmthPatch : Campfire
{
    [Inject(At.Tail, nameof(GetWarmth))]
    void AfterGetWarmth(ControlHandle<int> ch)
    {
        ch.ReturnValue += 5;
    }
}

That's the whole patch. The target code doesn't move.

Docs

Everything's at concordlib.dev:

Packages

  • Concord.Ref — compile-time reference assembly for authoring mods against the Concord API.
  • Concord.Analyzers — build-time Roslyn analyzers that validate patch declarations.
  • Concord.Generators — optional source generators + IDE refactorings (patch registry, [Shadow] members, scaffolding).
  • Concord — the runtime assembly a target ships to load and apply patches.

Where things stand

Concord 1.0 covers the whole patch model: head, tail, return, around, and invoke injections; ControlHandle cancel and return-value control; private target fields; reverse patches; attached data on target instances; the [Patch] declaration model; and the apply/undo API. The Roadmap covers what comes next.

Contributing

PRs are welcome. If you want to dig into the internals, the Contributor Architecture page is a good starting point. Target main: the pull-request checklist will guide you from there.

About

A .NET 10 runtime method-patching library for mod authors.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages