Skip to content

fix(clrcore-v2): Fix PR #2546 and Add Delegate Serialization Support#3409

Closed
manups4e wants to merge 39 commits intocitizenfx:masterfrom
manups4e:master
Closed

fix(clrcore-v2): Fix PR #2546 and Add Delegate Serialization Support#3409
manups4e wants to merge 39 commits intocitizenfx:masterfrom
manups4e:master

Conversation

@manups4e
Copy link
Contributor

@manups4e manups4e commented May 19, 2025

Goal of this PR

Re-enable (De)Serialization using the new custom msgpack provided in #2546

How is this PR achieving the goal

This PR adds back all Thorium's modifications and some extras to be fully compatible with the new MsgPack (de)serialization.

Warning

This PR applies to the following area(s)

Successfully tested on

FXServer and FiveM client

Game builds: N/A

Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

fixes #2653, #2613, #2590, #2582, #2571,

@github-actions github-actions bot added the invalid Requires changes before it's considered valid and can be (re)triaged label May 19, 2025
@manups4e manups4e changed the title Fix PR #2546 and Add Delegate Serialization Support [MonoV2] Fix PR #2546 and Add Delegate Serialization Support May 19, 2025
@manups4e
Copy link
Contributor Author

i see the commits have wrong naming convention 🤔 question is how do i change the names XD

@Gogsi
Copy link
Contributor

Gogsi commented May 19, 2025

If you use the Git in Visual Studio (I assume other clients are similar), right click on the commit before your oldest commit, Reset -> Keep changes.

image

This will remove all of your commits, but will keep all of your changes in the uncommitted changes on the right. So you can can make 1 new commit with all of the changes in it and the right naming.

Once you do that to overwrite your changes to github, you will need to force push. Git -> Open In Command Prompt, and type in git push --force

EDIT: Apparently you can also select all of your commits and right click -> Squash commits, instead of resetting and making a new one. Still needs a force push

@manups4e manups4e changed the title [MonoV2] Fix PR #2546 and Add Delegate Serialization Support fix(clrcore-v2): Fix PR #2546 and Add Delegate Serialization Support May 22, 2025
manups4e and others added 2 commits May 22, 2025 16:38
@github-actions github-actions bot added triage Needs a preliminary assessment to determine the urgency and required action and removed invalid Requires changes before it's considered valid and can be (re)triaged labels May 22, 2025
@github-actions github-actions bot added invalid Requires changes before it's considered valid and can be (re)triaged and removed triage Needs a preliminary assessment to determine the urgency and required action labels May 26, 2025
manups4e added 11 commits June 11, 2025 10:49
Previously, MsgPackReferenceRegistrar.CreateFunc was only set in a specific case. It is now properly initialized during startup to avoid missing reference handling.
- Async exports will require a full rewrite as in the current state this commit is more like a patch
This update adds strongly-typed support for local and remote exports, avoiding the use of dynamic
objects. The new system uses Coroutine<T> and Promise<T> for async handling, while keeping compatibility with old Exports[] system

Before:
    var result = await Exports["my_script", "GetUser"](); // dynamic

After:
    var user = await Exports.Get<User>("my_script", "GetUser")();

This change improves safety and intellisense support.
Allows calling typed exports like:
  var result = await Exports.Get<int>("myres", "sum", 1, 2);
Same logic for Exports.Local.Get<T>
@github-actions github-actions bot added triage Needs a preliminary assessment to determine the urgency and required action and removed invalid Requires changes before it's considered valid and can be (re)triaged labels Jul 1, 2025
@github-actions github-actions bot added invalid Requires changes before it's considered valid and can be (re)triaged and removed triage Needs a preliminary assessment to determine the urgency and required action labels Jul 2, 2025
@IstuntmanI
Copy link

IstuntmanI commented Oct 10, 2025

Any news about this? Are more changes still needed?
Maybe this finishes the Mono v2 implementation, and it could be finally out of beta. Also publishing on nuget.org would be great.

Great work here!

@manups4e
Copy link
Contributor Author

the whole monov2 can still be enhanced but in this current state of the PR along side with the pending PR in msgpack-cs

is considered stable as it fixes all the bugs present in msgpack when it came out.
I don't think it'll ever be merged because CFX dropped support completely to the mono runtime to work on a new future .net runtime.

@manups4e
Copy link
Contributor Author

Closing pull request due to support dropping for the Mono runtime.
Thanks for the fun ride ❤️

@manups4e manups4e closed this Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid Requires changes before it's considered valid and can be (re)triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

C# Export Server Crash 8978+

4 participants