1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 20:05:29 +08:00

Add signalr json type handling specification

This commit is contained in:
Dean Herbert 2021-08-02 14:37:47 +09:00
parent 4cf2c6188d
commit 1cd967b351

View File

@ -150,7 +150,16 @@ namespace osu.Game.Online
{ {
// eventually we will precompile resolvers for messagepack, but this isn't working currently // eventually we will precompile resolvers for messagepack, but this isn't working currently
// see https://github.com/neuecc/MessagePack-CSharp/issues/780#issuecomment-768794308. // see https://github.com/neuecc/MessagePack-CSharp/issues/780#issuecomment-768794308.
builder.AddNewtonsoftJsonProtocol(options => { options.PayloadSerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; }); builder.AddNewtonsoftJsonProtocol(options =>
{
options.PayloadSerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
options.PayloadSerializerSettings = new JsonSerializerSettings
{
// TODO: This should only be required to be `TypeNameHandling.Auto`.
// See usage in osu-server-spectator for further documentation as to why this is required.
TypeNameHandling = TypeNameHandling.All
};
});
} }
var newConnection = builder.Build(); var newConnection = builder.Build();