Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 32.57 KB | None | 0 0
  1. #pragma warning disable 618
  2. #pragma warning disable 612
  3. #pragma warning disable 414
  4. #pragma warning disable 168
  5.  
  6. namespace MessagePack.Resolvers
  7. {
  8.     using System;
  9.     using MessagePack;
  10.  
  11.     public class GeneratedResolver : global::MessagePack.IFormatterResolver
  12.     {
  13.         public static readonly global::MessagePack.IFormatterResolver Instance = new GeneratedResolver();
  14.  
  15.         GeneratedResolver()
  16.         {
  17.  
  18.         }
  19.  
  20.         public global::MessagePack.Formatters.IMessagePackFormatter<T> GetFormatter<T>()
  21.         {
  22.             return FormatterCache<T>.formatter;
  23.         }
  24.  
  25.         static class FormatterCache<T>
  26.         {
  27.             public static readonly global::MessagePack.Formatters.IMessagePackFormatter<T> formatter;
  28.  
  29.             static FormatterCache()
  30.             {
  31.                 var f = GeneratedResolverGetFormatterHelper.GetFormatter(typeof(T));
  32.                 if (f != null)
  33.                 {
  34.                     formatter = (global::MessagePack.Formatters.IMessagePackFormatter<T>)f;
  35.                 }
  36.             }
  37.         }
  38.     }
  39.  
  40.     internal static class GeneratedResolverGetFormatterHelper
  41.     {
  42.         static readonly global::System.Collections.Generic.Dictionary<Type, int> lookup;
  43.  
  44.         static GeneratedResolverGetFormatterHelper()
  45.         {
  46.             lookup = new global::System.Collections.Generic.Dictionary<Type, int>(14)
  47.             {
  48.                 {typeof(global::AzurInteractiveGames.KingOfSails.Share.Client.Spawn[]), 0 },
  49.                 {typeof(global::System.Collections.Generic.Dictionary<int, global::AzurInteractiveGames.KingOfSails.Share.Client.EntitySync>), 1 },
  50.                 {typeof(global::System.Collections.Generic.Dictionary<int, global::AzurInteractiveGames.KingOfSails.Share.Client.EntityInputSync>), 2 },
  51.                 {typeof(global::AzurInteractiveGames.KingOfSails.Share.Client.MatchMode), 3 },
  52.                 {typeof(global::AzurInteractiveGames.KingOfSails.Share.Client.ResponseStatus), 4 },
  53.                 {typeof(global::AzurInteractiveGames.KingOfSails.Share.Client.EntitySync), 5 },
  54.                 {typeof(global::AzurInteractiveGames.KingOfSails.Share.Client.EntityInputSync), 6 },
  55.                 {typeof(global::AzurInteractiveGames.KingOfSails.Share.Client.Spawn), 7 },
  56.                 {typeof(global::AzurInteractiveGames.KingOfSails.Share.Client.SpawnData), 8 },
  57.                 {typeof(global::AzurInteractiveGames.KingOfSails.Share.Client.BattleResult), 9 },
  58.                 {typeof(global::AzurInteractiveGames.KingOfSails.Share.Client.JoinBattleRequest), 10 },
  59.                 {typeof(global::AzurInteractiveGames.KingOfSails.Share.Client.JoinBattleResponse), 11 },
  60.                 {typeof(global::AzurInteractiveGames.KingOfSails.Share.Client.UpdateBattleResponse), 12 },
  61.                 {typeof(global::AzurInteractiveGames.KingOfSails.Share.Client.UpdateBattleInputResponse), 13 },
  62.             };
  63.         }
  64.  
  65.         internal static object GetFormatter(Type t)
  66.         {
  67.             int key;
  68.             if (!lookup.TryGetValue(t, out key)) return null;
  69.  
  70.             switch (key)
  71.             {
  72.                 case 0: return new global::MessagePack.Formatters.ArrayFormatter<global::AzurInteractiveGames.KingOfSails.Share.Client.Spawn>();
  73.                 case 1: return new global::MessagePack.Formatters.DictionaryFormatter<int, global::AzurInteractiveGames.KingOfSails.Share.Client.EntitySync>();
  74.                 case 2: return new global::MessagePack.Formatters.DictionaryFormatter<int, global::AzurInteractiveGames.KingOfSails.Share.Client.EntityInputSync>();
  75.                 case 3: return new MessagePack.Formatters.AzurInteractiveGames.KingOfSails.Share.Client.MatchModeFormatter();
  76.                 case 4: return new MessagePack.Formatters.AzurInteractiveGames.KingOfSails.Share.Client.ResponseStatusFormatter();
  77.                 case 5: return new MessagePack.Formatters.AzurInteractiveGames.KingOfSails.Share.Client.EntitySyncFormatter();
  78.                 case 6: return new MessagePack.Formatters.AzurInteractiveGames.KingOfSails.Share.Client.EntityInputSyncFormatter();
  79.                 case 7: return new MessagePack.Formatters.AzurInteractiveGames.KingOfSails.Share.Client.SpawnFormatter();
  80.                 case 8: return new MessagePack.Formatters.AzurInteractiveGames.KingOfSails.Share.Client.SpawnDataFormatter();
  81.                 case 9: return new MessagePack.Formatters.AzurInteractiveGames.KingOfSails.Share.Client.BattleResultFormatter();
  82.                 case 10: return new MessagePack.Formatters.AzurInteractiveGames.KingOfSails.Share.Client.JoinBattleRequestFormatter();
  83.                 case 11: return new MessagePack.Formatters.AzurInteractiveGames.KingOfSails.Share.Client.JoinBattleResponseFormatter();
  84.                 case 12: return new MessagePack.Formatters.AzurInteractiveGames.KingOfSails.Share.Client.UpdateBattleResponseFormatter();
  85.                 case 13: return new MessagePack.Formatters.AzurInteractiveGames.KingOfSails.Share.Client.UpdateBattleInputResponseFormatter();
  86.                 default: return null;
  87.             }
  88.         }
  89.     }
  90. }
  91.  
  92. #pragma warning restore 168
  93. #pragma warning restore 414
  94. #pragma warning restore 618
  95. #pragma warning restore 612
  96.  
  97. #pragma warning disable 618
  98. #pragma warning disable 612
  99. #pragma warning disable 414
  100. #pragma warning disable 168
  101.  
  102. namespace MessagePack.Formatters.AzurInteractiveGames.KingOfSails.Share.Client
  103. {
  104.     using System;
  105.     using MessagePack;
  106.  
  107.     public sealed class MatchModeFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::AzurInteractiveGames.KingOfSails.Share.Client.MatchMode>
  108.     {
  109.         public int Serialize(ref byte[] bytes, int offset, global::AzurInteractiveGames.KingOfSails.Share.Client.MatchMode value, global::MessagePack.IFormatterResolver formatterResolver)
  110.         {
  111.             return MessagePackBinary.WriteByte(ref bytes, offset, (Byte)value);
  112.         }
  113.        
  114.         public global::AzurInteractiveGames.KingOfSails.Share.Client.MatchMode Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
  115.         {
  116.             return (global::AzurInteractiveGames.KingOfSails.Share.Client.MatchMode)MessagePackBinary.ReadByte(bytes, offset, out readSize);
  117.         }
  118.     }
  119.  
  120.     public sealed class ResponseStatusFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::AzurInteractiveGames.KingOfSails.Share.Client.ResponseStatus>
  121.     {
  122.         public int Serialize(ref byte[] bytes, int offset, global::AzurInteractiveGames.KingOfSails.Share.Client.ResponseStatus value, global::MessagePack.IFormatterResolver formatterResolver)
  123.         {
  124.             return MessagePackBinary.WriteByte(ref bytes, offset, (Byte)value);
  125.         }
  126.        
  127.         public global::AzurInteractiveGames.KingOfSails.Share.Client.ResponseStatus Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
  128.         {
  129.             return (global::AzurInteractiveGames.KingOfSails.Share.Client.ResponseStatus)MessagePackBinary.ReadByte(bytes, offset, out readSize);
  130.         }
  131.     }
  132.  
  133.  
  134. }
  135.  
  136. #pragma warning restore 168
  137. #pragma warning restore 414
  138. #pragma warning restore 618
  139. #pragma warning restore 612
  140.  
  141.  
  142. #pragma warning disable 618
  143. #pragma warning disable 612
  144. #pragma warning disable 414
  145. #pragma warning disable 168
  146.  
  147. namespace MessagePack.Formatters.AzurInteractiveGames.KingOfSails.Share.Client
  148. {
  149.     using System;
  150.     using MessagePack;
  151.  
  152.  
  153.     public sealed class EntitySyncFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::AzurInteractiveGames.KingOfSails.Share.Client.EntitySync>
  154.     {
  155.  
  156.         public int Serialize(ref byte[] bytes, int offset, global::AzurInteractiveGames.KingOfSails.Share.Client.EntitySync value, global::MessagePack.IFormatterResolver formatterResolver)
  157.         {
  158.            
  159.             var startOffset = offset;
  160.             offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 2);
  161.             offset += formatterResolver.GetFormatterWithVerify<global::UnityEngine.Vector3>().Serialize(ref bytes, offset, value.Position, formatterResolver);
  162.             offset += formatterResolver.GetFormatterWithVerify<global::UnityEngine.Quaternion>().Serialize(ref bytes, offset, value.Rotation, formatterResolver);
  163.             return offset - startOffset;
  164.         }
  165.  
  166.         public global::AzurInteractiveGames.KingOfSails.Share.Client.EntitySync Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
  167.         {
  168.             if (global::MessagePack.MessagePackBinary.IsNil(bytes, offset))
  169.             {
  170.                 throw new InvalidOperationException("typecode is null, struct not supported");
  171.             }
  172.  
  173.             var startOffset = offset;
  174.             var length = global::MessagePack.MessagePackBinary.ReadArrayHeader(bytes, offset, out readSize);
  175.             offset += readSize;
  176.  
  177.             var __Position__ = default(global::UnityEngine.Vector3);
  178.             var __Rotation__ = default(global::UnityEngine.Quaternion);
  179.  
  180.             for (int i = 0; i < length; i++)
  181.             {
  182.                 var key = i;
  183.  
  184.                 switch (key)
  185.                 {
  186.                     case 0:
  187.                         __Position__ = formatterResolver.GetFormatterWithVerify<global::UnityEngine.Vector3>().Deserialize(bytes, offset, formatterResolver, out readSize);
  188.                         break;
  189.                     case 1:
  190.                         __Rotation__ = formatterResolver.GetFormatterWithVerify<global::UnityEngine.Quaternion>().Deserialize(bytes, offset, formatterResolver, out readSize);
  191.                         break;
  192.                     default:
  193.                         readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
  194.                         break;
  195.                 }
  196.                 offset += readSize;
  197.             }
  198.  
  199.             readSize = offset - startOffset;
  200.  
  201.             var ____result = new global::AzurInteractiveGames.KingOfSails.Share.Client.EntitySync();
  202.             ____result.Position = __Position__;
  203.             ____result.Rotation = __Rotation__;
  204.             return ____result;
  205.         }
  206.     }
  207.  
  208.  
  209.     public sealed class EntityInputSyncFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::AzurInteractiveGames.KingOfSails.Share.Client.EntityInputSync>
  210.     {
  211.  
  212.         public int Serialize(ref byte[] bytes, int offset, global::AzurInteractiveGames.KingOfSails.Share.Client.EntityInputSync value, global::MessagePack.IFormatterResolver formatterResolver)
  213.         {
  214.            
  215.             var startOffset = offset;
  216.             offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 2);
  217.             offset += MessagePackBinary.WriteSingle(ref bytes, offset, value.Speed);
  218.             offset += MessagePackBinary.WriteSingle(ref bytes, offset, value.Steer);
  219.             return offset - startOffset;
  220.         }
  221.  
  222.         public global::AzurInteractiveGames.KingOfSails.Share.Client.EntityInputSync Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
  223.         {
  224.             if (global::MessagePack.MessagePackBinary.IsNil(bytes, offset))
  225.             {
  226.                 throw new InvalidOperationException("typecode is null, struct not supported");
  227.             }
  228.  
  229.             var startOffset = offset;
  230.             var length = global::MessagePack.MessagePackBinary.ReadArrayHeader(bytes, offset, out readSize);
  231.             offset += readSize;
  232.  
  233.             var __Speed__ = default(float);
  234.             var __Steer__ = default(float);
  235.  
  236.             for (int i = 0; i < length; i++)
  237.             {
  238.                 var key = i;
  239.  
  240.                 switch (key)
  241.                 {
  242.                     case 0:
  243.                         __Speed__ = MessagePackBinary.ReadSingle(bytes, offset, out readSize);
  244.                         break;
  245.                     case 1:
  246.                         __Steer__ = MessagePackBinary.ReadSingle(bytes, offset, out readSize);
  247.                         break;
  248.                     default:
  249.                         readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
  250.                         break;
  251.                 }
  252.                 offset += readSize;
  253.             }
  254.  
  255.             readSize = offset - startOffset;
  256.  
  257.             var ____result = new global::AzurInteractiveGames.KingOfSails.Share.Client.EntityInputSync();
  258.             ____result.Speed = __Speed__;
  259.             ____result.Steer = __Steer__;
  260.             return ____result;
  261.         }
  262.     }
  263.  
  264.  
  265.     public sealed class SpawnFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::AzurInteractiveGames.KingOfSails.Share.Client.Spawn>
  266.     {
  267.  
  268.         public int Serialize(ref byte[] bytes, int offset, global::AzurInteractiveGames.KingOfSails.Share.Client.Spawn value, global::MessagePack.IFormatterResolver formatterResolver)
  269.         {
  270.            
  271.             var startOffset = offset;
  272.             offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 6);
  273.             offset += MessagePackBinary.WriteInt32(ref bytes, offset, value.OwnerId);
  274.             offset += MessagePackBinary.WriteByte(ref bytes, offset, value.SpawnId);
  275.             offset += MessagePackBinary.WriteInt32(ref bytes, offset, value.ShipId);
  276.             offset += MessagePackBinary.WriteInt32(ref bytes, offset, value.Team);
  277.             offset += MessagePackBinary.WriteInt32(ref bytes, offset, value.EntityId);
  278.             offset += MessagePackBinary.WriteBoolean(ref bytes, offset, value.IsBot);
  279.             return offset - startOffset;
  280.         }
  281.  
  282.         public global::AzurInteractiveGames.KingOfSails.Share.Client.Spawn Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
  283.         {
  284.             if (global::MessagePack.MessagePackBinary.IsNil(bytes, offset))
  285.             {
  286.                 throw new InvalidOperationException("typecode is null, struct not supported");
  287.             }
  288.  
  289.             var startOffset = offset;
  290.             var length = global::MessagePack.MessagePackBinary.ReadArrayHeader(bytes, offset, out readSize);
  291.             offset += readSize;
  292.  
  293.             var __OwnerId__ = default(int);
  294.             var __SpawnId__ = default(byte);
  295.             var __ShipId__ = default(int);
  296.             var __Team__ = default(int);
  297.             var __EntityId__ = default(int);
  298.             var __IsBot__ = default(bool);
  299.  
  300.             for (int i = 0; i < length; i++)
  301.             {
  302.                 var key = i;
  303.  
  304.                 switch (key)
  305.                 {
  306.                     case 0:
  307.                         __OwnerId__ = MessagePackBinary.ReadInt32(bytes, offset, out readSize);
  308.                         break;
  309.                     case 1:
  310.                         __SpawnId__ = MessagePackBinary.ReadByte(bytes, offset, out readSize);
  311.                         break;
  312.                     case 2:
  313.                         __ShipId__ = MessagePackBinary.ReadInt32(bytes, offset, out readSize);
  314.                         break;
  315.                     case 3:
  316.                         __Team__ = MessagePackBinary.ReadInt32(bytes, offset, out readSize);
  317.                         break;
  318.                     case 4:
  319.                         __EntityId__ = MessagePackBinary.ReadInt32(bytes, offset, out readSize);
  320.                         break;
  321.                     case 5:
  322.                         __IsBot__ = MessagePackBinary.ReadBoolean(bytes, offset, out readSize);
  323.                         break;
  324.                     default:
  325.                         readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
  326.                         break;
  327.                 }
  328.                 offset += readSize;
  329.             }
  330.  
  331.             readSize = offset - startOffset;
  332.  
  333.             var ____result = new global::AzurInteractiveGames.KingOfSails.Share.Client.Spawn();
  334.             ____result.OwnerId = __OwnerId__;
  335.             ____result.SpawnId = __SpawnId__;
  336.             ____result.ShipId = __ShipId__;
  337.             ____result.Team = __Team__;
  338.             ____result.EntityId = __EntityId__;
  339.             ____result.IsBot = __IsBot__;
  340.             return ____result;
  341.         }
  342.     }
  343.  
  344.  
  345.     public sealed class SpawnDataFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::AzurInteractiveGames.KingOfSails.Share.Client.SpawnData>
  346.     {
  347.  
  348.         public int Serialize(ref byte[] bytes, int offset, global::AzurInteractiveGames.KingOfSails.Share.Client.SpawnData value, global::MessagePack.IFormatterResolver formatterResolver)
  349.         {
  350.            
  351.             var startOffset = offset;
  352.             offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 1);
  353.             offset += formatterResolver.GetFormatterWithVerify<global::AzurInteractiveGames.KingOfSails.Share.Client.Spawn[]>().Serialize(ref bytes, offset, value.Entities, formatterResolver);
  354.             return offset - startOffset;
  355.         }
  356.  
  357.         public global::AzurInteractiveGames.KingOfSails.Share.Client.SpawnData Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
  358.         {
  359.             if (global::MessagePack.MessagePackBinary.IsNil(bytes, offset))
  360.             {
  361.                 throw new InvalidOperationException("typecode is null, struct not supported");
  362.             }
  363.  
  364.             var startOffset = offset;
  365.             var length = global::MessagePack.MessagePackBinary.ReadArrayHeader(bytes, offset, out readSize);
  366.             offset += readSize;
  367.  
  368.             var __Entities__ = default(global::AzurInteractiveGames.KingOfSails.Share.Client.Spawn[]);
  369.  
  370.             for (int i = 0; i < length; i++)
  371.             {
  372.                 var key = i;
  373.  
  374.                 switch (key)
  375.                 {
  376.                     case 0:
  377.                         __Entities__ = formatterResolver.GetFormatterWithVerify<global::AzurInteractiveGames.KingOfSails.Share.Client.Spawn[]>().Deserialize(bytes, offset, formatterResolver, out readSize);
  378.                         break;
  379.                     default:
  380.                         readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
  381.                         break;
  382.                 }
  383.                 offset += readSize;
  384.             }
  385.  
  386.             readSize = offset - startOffset;
  387.  
  388.             var ____result = new global::AzurInteractiveGames.KingOfSails.Share.Client.SpawnData();
  389.             ____result.Entities = __Entities__;
  390.             return ____result;
  391.         }
  392.     }
  393.  
  394.  
  395.     public sealed class BattleResultFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::AzurInteractiveGames.KingOfSails.Share.Client.BattleResult>
  396.     {
  397.  
  398.         public int Serialize(ref byte[] bytes, int offset, global::AzurInteractiveGames.KingOfSails.Share.Client.BattleResult value, global::MessagePack.IFormatterResolver formatterResolver)
  399.         {
  400.            
  401.             var startOffset = offset;
  402.             offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 1);
  403.             offset += formatterResolver.GetFormatterWithVerify<string>().Serialize(ref bytes, offset, value.test, formatterResolver);
  404.             return offset - startOffset;
  405.         }
  406.  
  407.         public global::AzurInteractiveGames.KingOfSails.Share.Client.BattleResult Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
  408.         {
  409.             if (global::MessagePack.MessagePackBinary.IsNil(bytes, offset))
  410.             {
  411.                 throw new InvalidOperationException("typecode is null, struct not supported");
  412.             }
  413.  
  414.             var startOffset = offset;
  415.             var length = global::MessagePack.MessagePackBinary.ReadArrayHeader(bytes, offset, out readSize);
  416.             offset += readSize;
  417.  
  418.             var __test__ = default(string);
  419.  
  420.             for (int i = 0; i < length; i++)
  421.             {
  422.                 var key = i;
  423.  
  424.                 switch (key)
  425.                 {
  426.                     case 0:
  427.                         __test__ = formatterResolver.GetFormatterWithVerify<string>().Deserialize(bytes, offset, formatterResolver, out readSize);
  428.                         break;
  429.                     default:
  430.                         readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
  431.                         break;
  432.                 }
  433.                 offset += readSize;
  434.             }
  435.  
  436.             readSize = offset - startOffset;
  437.  
  438.             var ____result = new global::AzurInteractiveGames.KingOfSails.Share.Client.BattleResult();
  439.             ____result.test = __test__;
  440.             return ____result;
  441.         }
  442.     }
  443.  
  444.  
  445.     public sealed class JoinBattleRequestFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::AzurInteractiveGames.KingOfSails.Share.Client.JoinBattleRequest>
  446.     {
  447.  
  448.         public int Serialize(ref byte[] bytes, int offset, global::AzurInteractiveGames.KingOfSails.Share.Client.JoinBattleRequest value, global::MessagePack.IFormatterResolver formatterResolver)
  449.         {
  450.            
  451.             var startOffset = offset;
  452.             offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 3);
  453.             offset += formatterResolver.GetFormatterWithVerify<string>().Serialize(ref bytes, offset, value.Token, formatterResolver);
  454.             offset += MessagePackBinary.WriteInt32(ref bytes, offset, value.ShipId);
  455.             offset += formatterResolver.GetFormatterWithVerify<global::AzurInteractiveGames.KingOfSails.Share.Client.MatchMode>().Serialize(ref bytes, offset, value.Mode, formatterResolver);
  456.             return offset - startOffset;
  457.         }
  458.  
  459.         public global::AzurInteractiveGames.KingOfSails.Share.Client.JoinBattleRequest Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
  460.         {
  461.             if (global::MessagePack.MessagePackBinary.IsNil(bytes, offset))
  462.             {
  463.                 throw new InvalidOperationException("typecode is null, struct not supported");
  464.             }
  465.  
  466.             var startOffset = offset;
  467.             var length = global::MessagePack.MessagePackBinary.ReadArrayHeader(bytes, offset, out readSize);
  468.             offset += readSize;
  469.  
  470.             var __Token__ = default(string);
  471.             var __ShipId__ = default(int);
  472.             var __Mode__ = default(global::AzurInteractiveGames.KingOfSails.Share.Client.MatchMode);
  473.  
  474.             for (int i = 0; i < length; i++)
  475.             {
  476.                 var key = i;
  477.  
  478.                 switch (key)
  479.                 {
  480.                     case 0:
  481.                         __Token__ = formatterResolver.GetFormatterWithVerify<string>().Deserialize(bytes, offset, formatterResolver, out readSize);
  482.                         break;
  483.                     case 1:
  484.                         __ShipId__ = MessagePackBinary.ReadInt32(bytes, offset, out readSize);
  485.                         break;
  486.                     case 2:
  487.                         __Mode__ = formatterResolver.GetFormatterWithVerify<global::AzurInteractiveGames.KingOfSails.Share.Client.MatchMode>().Deserialize(bytes, offset, formatterResolver, out readSize);
  488.                         break;
  489.                     default:
  490.                         readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
  491.                         break;
  492.                 }
  493.                 offset += readSize;
  494.             }
  495.  
  496.             readSize = offset - startOffset;
  497.  
  498.             var ____result = new global::AzurInteractiveGames.KingOfSails.Share.Client.JoinBattleRequest();
  499.             ____result.Token = __Token__;
  500.             ____result.ShipId = __ShipId__;
  501.             ____result.Mode = __Mode__;
  502.             return ____result;
  503.         }
  504.     }
  505.  
  506.  
  507.     public sealed class JoinBattleResponseFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::AzurInteractiveGames.KingOfSails.Share.Client.JoinBattleResponse>
  508.     {
  509.  
  510.         public int Serialize(ref byte[] bytes, int offset, global::AzurInteractiveGames.KingOfSails.Share.Client.JoinBattleResponse value, global::MessagePack.IFormatterResolver formatterResolver)
  511.         {
  512.            
  513.             var startOffset = offset;
  514.             offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 4);
  515.             offset += formatterResolver.GetFormatterWithVerify<global::AzurInteractiveGames.KingOfSails.Share.Client.ResponseStatus>().Serialize(ref bytes, offset, value.Status, formatterResolver);
  516.             offset += formatterResolver.GetFormatterWithVerify<string>().Serialize(ref bytes, offset, value.Description, formatterResolver);
  517.             offset += MessagePackBinary.WriteInt32(ref bytes, offset, value.Id);
  518.             offset += MessagePackBinary.WriteInt32(ref bytes, offset, value.Timer);
  519.             return offset - startOffset;
  520.         }
  521.  
  522.         public global::AzurInteractiveGames.KingOfSails.Share.Client.JoinBattleResponse Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
  523.         {
  524.             if (global::MessagePack.MessagePackBinary.IsNil(bytes, offset))
  525.             {
  526.                 throw new InvalidOperationException("typecode is null, struct not supported");
  527.             }
  528.  
  529.             var startOffset = offset;
  530.             var length = global::MessagePack.MessagePackBinary.ReadArrayHeader(bytes, offset, out readSize);
  531.             offset += readSize;
  532.  
  533.             var __Status__ = default(global::AzurInteractiveGames.KingOfSails.Share.Client.ResponseStatus);
  534.             var __Description__ = default(string);
  535.             var __Id__ = default(int);
  536.             var __Timer__ = default(int);
  537.  
  538.             for (int i = 0; i < length; i++)
  539.             {
  540.                 var key = i;
  541.  
  542.                 switch (key)
  543.                 {
  544.                     case 0:
  545.                         __Status__ = formatterResolver.GetFormatterWithVerify<global::AzurInteractiveGames.KingOfSails.Share.Client.ResponseStatus>().Deserialize(bytes, offset, formatterResolver, out readSize);
  546.                         break;
  547.                     case 1:
  548.                         __Description__ = formatterResolver.GetFormatterWithVerify<string>().Deserialize(bytes, offset, formatterResolver, out readSize);
  549.                         break;
  550.                     case 2:
  551.                         __Id__ = MessagePackBinary.ReadInt32(bytes, offset, out readSize);
  552.                         break;
  553.                     case 3:
  554.                         __Timer__ = MessagePackBinary.ReadInt32(bytes, offset, out readSize);
  555.                         break;
  556.                     default:
  557.                         readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
  558.                         break;
  559.                 }
  560.                 offset += readSize;
  561.             }
  562.  
  563.             readSize = offset - startOffset;
  564.  
  565.             var ____result = new global::AzurInteractiveGames.KingOfSails.Share.Client.JoinBattleResponse();
  566.             ____result.Status = __Status__;
  567.             ____result.Description = __Description__;
  568.             ____result.Id = __Id__;
  569.             ____result.Timer = __Timer__;
  570.             return ____result;
  571.         }
  572.     }
  573.  
  574.  
  575.     public sealed class UpdateBattleResponseFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::AzurInteractiveGames.KingOfSails.Share.Client.UpdateBattleResponse>
  576.     {
  577.  
  578.         public int Serialize(ref byte[] bytes, int offset, global::AzurInteractiveGames.KingOfSails.Share.Client.UpdateBattleResponse value, global::MessagePack.IFormatterResolver formatterResolver)
  579.         {
  580.            
  581.             var startOffset = offset;
  582.             offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 1);
  583.             offset += formatterResolver.GetFormatterWithVerify<global::System.Collections.Generic.Dictionary<int, global::AzurInteractiveGames.KingOfSails.Share.Client.EntitySync>>().Serialize(ref bytes, offset, value.Entities, formatterResolver);
  584.             return offset - startOffset;
  585.         }
  586.  
  587.         public global::AzurInteractiveGames.KingOfSails.Share.Client.UpdateBattleResponse Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
  588.         {
  589.             if (global::MessagePack.MessagePackBinary.IsNil(bytes, offset))
  590.             {
  591.                 throw new InvalidOperationException("typecode is null, struct not supported");
  592.             }
  593.  
  594.             var startOffset = offset;
  595.             var length = global::MessagePack.MessagePackBinary.ReadArrayHeader(bytes, offset, out readSize);
  596.             offset += readSize;
  597.  
  598.             var __Entities__ = default(global::System.Collections.Generic.Dictionary<int, global::AzurInteractiveGames.KingOfSails.Share.Client.EntitySync>);
  599.  
  600.             for (int i = 0; i < length; i++)
  601.             {
  602.                 var key = i;
  603.  
  604.                 switch (key)
  605.                 {
  606.                     case 0:
  607.                         __Entities__ = formatterResolver.GetFormatterWithVerify<global::System.Collections.Generic.Dictionary<int, global::AzurInteractiveGames.KingOfSails.Share.Client.EntitySync>>().Deserialize(bytes, offset, formatterResolver, out readSize);
  608.                         break;
  609.                     default:
  610.                         readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
  611.                         break;
  612.                 }
  613.                 offset += readSize;
  614.             }
  615.  
  616.             readSize = offset - startOffset;
  617.  
  618.             var ____result = new global::AzurInteractiveGames.KingOfSails.Share.Client.UpdateBattleResponse();
  619.             ____result.Entities = __Entities__;
  620.             return ____result;
  621.         }
  622.     }
  623.  
  624.  
  625.     public sealed class UpdateBattleInputResponseFormatter : global::MessagePack.Formatters.IMessagePackFormatter<global::AzurInteractiveGames.KingOfSails.Share.Client.UpdateBattleInputResponse>
  626.     {
  627.  
  628.         public int Serialize(ref byte[] bytes, int offset, global::AzurInteractiveGames.KingOfSails.Share.Client.UpdateBattleInputResponse value, global::MessagePack.IFormatterResolver formatterResolver)
  629.         {
  630.            
  631.             var startOffset = offset;
  632.             offset += global::MessagePack.MessagePackBinary.WriteFixedArrayHeaderUnsafe(ref bytes, offset, 1);
  633.             offset += formatterResolver.GetFormatterWithVerify<global::System.Collections.Generic.Dictionary<int, global::AzurInteractiveGames.KingOfSails.Share.Client.EntityInputSync>>().Serialize(ref bytes, offset, value.Entities, formatterResolver);
  634.             return offset - startOffset;
  635.         }
  636.  
  637.         public global::AzurInteractiveGames.KingOfSails.Share.Client.UpdateBattleInputResponse Deserialize(byte[] bytes, int offset, global::MessagePack.IFormatterResolver formatterResolver, out int readSize)
  638.         {
  639.             if (global::MessagePack.MessagePackBinary.IsNil(bytes, offset))
  640.             {
  641.                 throw new InvalidOperationException("typecode is null, struct not supported");
  642.             }
  643.  
  644.             var startOffset = offset;
  645.             var length = global::MessagePack.MessagePackBinary.ReadArrayHeader(bytes, offset, out readSize);
  646.             offset += readSize;
  647.  
  648.             var __Entities__ = default(global::System.Collections.Generic.Dictionary<int, global::AzurInteractiveGames.KingOfSails.Share.Client.EntityInputSync>);
  649.  
  650.             for (int i = 0; i < length; i++)
  651.             {
  652.                 var key = i;
  653.  
  654.                 switch (key)
  655.                 {
  656.                     case 0:
  657.                         __Entities__ = formatterResolver.GetFormatterWithVerify<global::System.Collections.Generic.Dictionary<int, global::AzurInteractiveGames.KingOfSails.Share.Client.EntityInputSync>>().Deserialize(bytes, offset, formatterResolver, out readSize);
  658.                         break;
  659.                     default:
  660.                         readSize = global::MessagePack.MessagePackBinary.ReadNextBlock(bytes, offset);
  661.                         break;
  662.                 }
  663.                 offset += readSize;
  664.             }
  665.  
  666.             readSize = offset - startOffset;
  667.  
  668.             var ____result = new global::AzurInteractiveGames.KingOfSails.Share.Client.UpdateBattleInputResponse();
  669.             ____result.Entities = __Entities__;
  670.             return ____result;
  671.         }
  672.     }
  673.  
  674. }
  675.  
  676. #pragma warning restore 168
  677. #pragma warning restore 414
  678. #pragma warning restore 618
  679. #pragma warning restore 612
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement