New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could you please update the Readme to show how to implemented the Generated Resolver with mpc.exe #593
Comments
+1, having the same issue. Too bad the confusion hasn't been cleaned up yet. To the original poster: Have you got it to work, because I couldn't and I'm fairly lost. Any help would be greatly appreciated. |
This is due to the default branch in GitHub being master. |
Thank you for the quick response, I finally got it to work. There is still one more question I have: I am using Unity (2019.3beta) and the only version of MessagePack-C# I got to work was from the .unitypackage from the Ver 1.7.3.5 release. Is that fine? Felt a bit outdated since the newest release is v1.8.74. But wasn't able to get it to work in Unity, are there some instructions I've missed on how to get it to work with Unity? |
Ok to use 1.7.3.5. But of course, better to ship the latest version to Unity. |
I've never coded up a build/pipeline that pushes to GitHub Releases automatically, but I'm interested in learning for other reasons as well. |
Thank you for your effort! |
@AArnott I've added PackageExporter(direct pushed). to upload GitHub Releases, I'm using ghr in another project. |
Hello! Is there any sample / doc to illustrate this ? Or the current and above referenced doc is valid ? MessagePack is used by SignalR as referenced [here] Not sure which version of MessagePack-Csharp is used by msft as the suggested package is Microsoft.AspNetCore.SignalR.Protocols.MessagePack Nevertheless the SignalR docs point here for any material regarding mpc.exe. More clarity or sample on generating and using resolvers would be highly appreciated. |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Is your feature request related to a problem? Please describe.
In your readme I can see this code to use the generated resolver
`
// Do this once and store it for reuse.
var resolver = MessagePack.Resolvers.CompositeResolver.Create(
Array.Empty(),
new IFormatterResolver[]
{
MessagePack.Resolvers.GeneratedResolver.Instance,
MessagePack.Resolvers.StandardResolver.Instance,
});
var options = MessagePackSerializerOptions.Standard.WithResolver(resolver);
// Each time you serialize/deserialize, specify the options:
byte[] msgpackBytes = MessagePackSerializer.Serialize(myObject, options);
T myObject2 = MessagePackSerializer.Deserialize(msgpackBytes, options);
`
But the method CompositeResolver.Create doesn't exist anymore and this object
MessagePackSerializerOptions neither
Describe the solution you'd like
I assume we have to use instead of the Create the register method, but I am not sure about the serializerOptions
I assume it will be something like this
IFormatterResolver options = null; void Awake () { var resolver = CompositeResolver.Instance; CompositeResolver.Register ( Array.Empty<IMessagePackFormatter> (), new IFormatterResolver[] { GeneratedResolver.Instance, StandardResolver.Instance, }); // options = MessagePackSerializerOptions.Standard.WithResolver (resolver); options = resolver; }
and then in another method I will call it as shown in your readme
s_rpc_object toObjectFast (byte[] dat) { return MessagePackSerializer.Deserialize<s_rpc_object> (dat, options); }
Could you confirm please?
Describe alternatives you've considered
Additional context
Btw thank you so much for this library, I am using it on Oculus Quest and I can see 5 times better performance than with binary serializer, I am about to try this on the android if it works ( hopefully yes )
The text was updated successfully, but these errors were encountered: