diff --git a/samples/ChatApp/ChatApp.Unity/Assets/Scripts/Generated/MessagePack.Generated.cs b/samples/ChatApp/ChatApp.Unity/Assets/Scripts/Generated/MessagePack.Generated.cs index 3a3271db1..3dcdd5eb5 100644 --- a/samples/ChatApp/ChatApp.Unity/Assets/Scripts/Generated/MessagePack.Generated.cs +++ b/samples/ChatApp/ChatApp.Unity/Assets/Scripts/Generated/MessagePack.Generated.cs @@ -1,204 +1,204 @@ -// -// THIS (.cs) FILE IS GENERATED BY MPC(MessagePack-CSharp). DO NOT CHANGE IT. -// - -#pragma warning disable 618 -#pragma warning disable 612 -#pragma warning disable 414 -#pragma warning disable 168 -#pragma warning disable CS1591 // document public APIs - -#pragma warning disable SA1312 // Variable names should begin with lower-case letter -#pragma warning disable SA1649 // File name should match first type name - -namespace MessagePack.Resolvers -{ - public class GeneratedResolver : global::MessagePack.IFormatterResolver - { - public static readonly global::MessagePack.IFormatterResolver Instance = new GeneratedResolver(); - - private GeneratedResolver() - { - } - - public global::MessagePack.Formatters.IMessagePackFormatter GetFormatter() - { - return FormatterCache.Formatter; - } - - private static class FormatterCache - { - internal static readonly global::MessagePack.Formatters.IMessagePackFormatter Formatter; - - static FormatterCache() - { - var f = GeneratedResolverGetFormatterHelper.GetFormatter(typeof(T)); - if (f != null) - { - Formatter = (global::MessagePack.Formatters.IMessagePackFormatter)f; - } - } - } - } - - internal static class GeneratedResolverGetFormatterHelper - { - private static readonly global::System.Collections.Generic.Dictionary lookup; - - static GeneratedResolverGetFormatterHelper() - { - lookup = new global::System.Collections.Generic.Dictionary(2) - { - { typeof(global::ChatApp.Shared.MessagePackObjects.JoinRequest), 0 }, - { typeof(global::ChatApp.Shared.MessagePackObjects.MessageResponse), 1 }, - }; - } - - internal static object GetFormatter(global::System.Type t) - { - int key; - if (!lookup.TryGetValue(t, out key)) - { - return null; - } - - switch (key) - { - case 0: return new MessagePack.Formatters.ChatApp.Shared.MessagePackObjects.JoinRequestFormatter(); - case 1: return new MessagePack.Formatters.ChatApp.Shared.MessagePackObjects.MessageResponseFormatter(); - default: return null; - } - } - } -} - -#pragma warning restore 168 -#pragma warning restore 414 -#pragma warning restore 618 -#pragma warning restore 612 - -#pragma warning restore SA1312 // Variable names should begin with lower-case letter -#pragma warning restore SA1649 // File name should match first type name - - - - -// -// THIS (.cs) FILE IS GENERATED BY MPC(MessagePack-CSharp). DO NOT CHANGE IT. -// - -#pragma warning disable 618 -#pragma warning disable 612 -#pragma warning disable 414 -#pragma warning disable 168 -#pragma warning disable CS1591 // document public APIs - -#pragma warning disable SA1129 // Do not use default value type constructor -#pragma warning disable SA1309 // Field names should not begin with underscore -#pragma warning disable SA1312 // Variable names should begin with lower-case letter -#pragma warning disable SA1403 // File may only contain a single namespace -#pragma warning disable SA1649 // File name should match first type name - -namespace MessagePack.Formatters.ChatApp.Shared.MessagePackObjects -{ - public sealed class JoinRequestFormatter : global::MessagePack.Formatters.IMessagePackFormatter - { - - public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::ChatApp.Shared.MessagePackObjects.JoinRequest value, global::MessagePack.MessagePackSerializerOptions options) - { - global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; - writer.WriteArrayHeader(2); - global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.RoomName, options); - global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.UserName, options); - } - - public global::ChatApp.Shared.MessagePackObjects.JoinRequest Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) - { - if (reader.TryReadNil()) - { - throw new global::System.InvalidOperationException("typecode is null, struct not supported"); - } - - options.Security.DepthStep(ref reader); - global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; - var length = reader.ReadArrayHeader(); - var ____result = new global::ChatApp.Shared.MessagePackObjects.JoinRequest(); - - for (int i = 0; i < length; i++) - { - switch (i) - { - case 0: - ____result.RoomName = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); - break; - case 1: - ____result.UserName = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); - break; - default: - reader.Skip(); - break; - } - } - - reader.Depth--; - return ____result; - } - } - - public sealed class MessageResponseFormatter : global::MessagePack.Formatters.IMessagePackFormatter - { - - public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::ChatApp.Shared.MessagePackObjects.MessageResponse value, global::MessagePack.MessagePackSerializerOptions options) - { - global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; - writer.WriteArrayHeader(2); - global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.UserName, options); - global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Message, options); - } - - public global::ChatApp.Shared.MessagePackObjects.MessageResponse Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) - { - if (reader.TryReadNil()) - { - throw new global::System.InvalidOperationException("typecode is null, struct not supported"); - } - - options.Security.DepthStep(ref reader); - global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; - var length = reader.ReadArrayHeader(); - var ____result = new global::ChatApp.Shared.MessagePackObjects.MessageResponse(); - - for (int i = 0; i < length; i++) - { - switch (i) - { - case 0: - ____result.UserName = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); - break; - case 1: - ____result.Message = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); - break; - default: - reader.Skip(); - break; - } - } - - reader.Depth--; - return ____result; - } - } - -} - -#pragma warning restore 168 -#pragma warning restore 414 -#pragma warning restore 618 -#pragma warning restore 612 - -#pragma warning restore SA1129 // Do not use default value type constructor -#pragma warning restore SA1309 // Field names should not begin with underscore -#pragma warning restore SA1312 // Variable names should begin with lower-case letter -#pragma warning restore SA1403 // File may only contain a single namespace -#pragma warning restore SA1649 // File name should match first type name - +// +// THIS (.cs) FILE IS GENERATED BY MPC(MessagePack-CSharp). DO NOT CHANGE IT. +// + +#pragma warning disable 618 +#pragma warning disable 612 +#pragma warning disable 414 +#pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs + +#pragma warning disable SA1312 // Variable names should begin with lower-case letter +#pragma warning disable SA1649 // File name should match first type name + +namespace MessagePack.Resolvers +{ + public class GeneratedResolver : global::MessagePack.IFormatterResolver + { + public static readonly global::MessagePack.IFormatterResolver Instance = new GeneratedResolver(); + + private GeneratedResolver() + { + } + + public global::MessagePack.Formatters.IMessagePackFormatter GetFormatter() + { + return FormatterCache.Formatter; + } + + private static class FormatterCache + { + internal static readonly global::MessagePack.Formatters.IMessagePackFormatter Formatter; + + static FormatterCache() + { + var f = GeneratedResolverGetFormatterHelper.GetFormatter(typeof(T)); + if (f != null) + { + Formatter = (global::MessagePack.Formatters.IMessagePackFormatter)f; + } + } + } + } + + internal static class GeneratedResolverGetFormatterHelper + { + private static readonly global::System.Collections.Generic.Dictionary lookup; + + static GeneratedResolverGetFormatterHelper() + { + lookup = new global::System.Collections.Generic.Dictionary(2) + { + { typeof(global::ChatApp.Shared.MessagePackObjects.JoinRequest), 0 }, + { typeof(global::ChatApp.Shared.MessagePackObjects.MessageResponse), 1 }, + }; + } + + internal static object GetFormatter(global::System.Type t) + { + int key; + if (!lookup.TryGetValue(t, out key)) + { + return null; + } + + switch (key) + { + case 0: return new MessagePack.Formatters.ChatApp.Shared.MessagePackObjects.JoinRequestFormatter(); + case 1: return new MessagePack.Formatters.ChatApp.Shared.MessagePackObjects.MessageResponseFormatter(); + default: return null; + } + } + } +} + +#pragma warning restore 168 +#pragma warning restore 414 +#pragma warning restore 618 +#pragma warning restore 612 + +#pragma warning restore SA1312 // Variable names should begin with lower-case letter +#pragma warning restore SA1649 // File name should match first type name + + + + +// +// THIS (.cs) FILE IS GENERATED BY MPC(MessagePack-CSharp). DO NOT CHANGE IT. +// + +#pragma warning disable 618 +#pragma warning disable 612 +#pragma warning disable 414 +#pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs + +#pragma warning disable SA1129 // Do not use default value type constructor +#pragma warning disable SA1309 // Field names should not begin with underscore +#pragma warning disable SA1312 // Variable names should begin with lower-case letter +#pragma warning disable SA1403 // File may only contain a single namespace +#pragma warning disable SA1649 // File name should match first type name + +namespace MessagePack.Formatters.ChatApp.Shared.MessagePackObjects +{ + public sealed class JoinRequestFormatter : global::MessagePack.Formatters.IMessagePackFormatter + { + + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::ChatApp.Shared.MessagePackObjects.JoinRequest value, global::MessagePack.MessagePackSerializerOptions options) + { + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; + writer.WriteArrayHeader(2); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.RoomName, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.UserName, options); + } + + public global::ChatApp.Shared.MessagePackObjects.JoinRequest Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + { + if (reader.TryReadNil()) + { + throw new global::System.InvalidOperationException("typecode is null, struct not supported"); + } + + options.Security.DepthStep(ref reader); + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; + var length = reader.ReadArrayHeader(); + var ____result = new global::ChatApp.Shared.MessagePackObjects.JoinRequest(); + + for (int i = 0; i < length; i++) + { + switch (i) + { + case 0: + ____result.RoomName = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); + break; + case 1: + ____result.UserName = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); + break; + default: + reader.Skip(); + break; + } + } + + reader.Depth--; + return ____result; + } + } + + public sealed class MessageResponseFormatter : global::MessagePack.Formatters.IMessagePackFormatter + { + + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::ChatApp.Shared.MessagePackObjects.MessageResponse value, global::MessagePack.MessagePackSerializerOptions options) + { + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; + writer.WriteArrayHeader(2); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.UserName, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Message, options); + } + + public global::ChatApp.Shared.MessagePackObjects.MessageResponse Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + { + if (reader.TryReadNil()) + { + throw new global::System.InvalidOperationException("typecode is null, struct not supported"); + } + + options.Security.DepthStep(ref reader); + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; + var length = reader.ReadArrayHeader(); + var ____result = new global::ChatApp.Shared.MessagePackObjects.MessageResponse(); + + for (int i = 0; i < length; i++) + { + switch (i) + { + case 0: + ____result.UserName = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); + break; + case 1: + ____result.Message = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); + break; + default: + reader.Skip(); + break; + } + } + + reader.Depth--; + return ____result; + } + } + +} + +#pragma warning restore 168 +#pragma warning restore 414 +#pragma warning restore 618 +#pragma warning restore 612 + +#pragma warning restore SA1129 // Do not use default value type constructor +#pragma warning restore SA1309 // Field names should not begin with underscore +#pragma warning restore SA1312 // Variable names should begin with lower-case letter +#pragma warning restore SA1403 // File may only contain a single namespace +#pragma warning restore SA1649 // File name should match first type name +