ComponentUpdateDeserialize(global::System.UInt32 componentId,
                            global::System.UIntPtr userData,
                            global::Improbable.Worker.CInterop.SchemaComponentUpdate source,
                            out global::System.UIntPtr handleOut)
 {
     handleOut = global::System.UIntPtr.Zero;
     try
     {
         var data               = new Update();
         var fieldsToClear      = new global::System.Collections.Generic.HashSet <uint>();
         var fieldsToClearCount = source.GetClearedFieldCount();
         for (uint i = 0; i < fieldsToClearCount; ++i)
         {
             fieldsToClear.Add(source.IndexClearedField(i));
         }
         var fields = source.GetFields();
         if (fields.GetObjectCount(1) > 0)
         {
             global::Improbable.Restricted.PlayerIdentity field;
             {
                 field = global::Improbable.Restricted.PlayerIdentity_Internal.Read(fields.GetObject(1));
             }
             data.playerIdentity.Set(field);
         }
         var handle = global::Improbable.Worker.Internal.ClientHandles.HandleAlloc();
         *handle   = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
         handleOut = (global::System.UIntPtr)handle;
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
         return(false);
     }
     return(true);
 }
Esempio n. 2
0
 ComponentUpdateDeserialize(global::System.UInt32 componentId,
                            global::System.UIntPtr userData,
                            global::Improbable.Worker.CInterop.SchemaComponentUpdate source,
                            out global::System.UIntPtr handleOut)
 {
     handleOut = global::System.UIntPtr.Zero;
     try
     {
         var data               = new Update();
         var fieldsToClear      = new global::System.Collections.Generic.HashSet <uint>();
         var fieldsToClearCount = source.GetClearedFieldCount();
         for (uint i = 0; i < fieldsToClearCount; ++i)
         {
             fieldsToClear.Add(source.IndexClearedField(i));
         }
         var fields = source.GetFields();
         if (fields.GetBoolCount(1) > 0)
         {
             bool field;
             {
                 field = fields.GetBool(1);
             }
             data.curIsAlive.Set(field);
         }
         if (fields.GetUint64Count(2) > 0)
         {
             ulong field;
             {
                 field = fields.GetUint64(2);
             }
             data.curSequenceId.Set(field);
         }
         if (fields.GetBoolCount(3) > 0)
         {
             bool field;
             {
                 field = fields.GetBool(3);
             }
             data.prevIsAlive.Set(field);
         }
         if (fields.GetUint64Count(4) > 0)
         {
             ulong field;
             {
                 field = fields.GetUint64(4);
             }
             data.prevSequenceId.Set(field);
         }
         var handle = global::Improbable.Worker.Internal.ClientHandles.HandleAlloc();
         *handle   = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
         handleOut = (global::System.UIntPtr)handle;
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
         return(false);
     }
     return(true);
 }
Esempio n. 3
0
 ClientDeserialize(global::System.UInt32 componentId,
                   void *userData,
                   global::System.Byte handleType,
                   global::Improbable.Worker.Internal.Pbio.Object *root,
                   global::Improbable.Worker.Internal.ComponentProtocol.ClientHandle **handleOut)
 {
     *handleOut = null;
     try
     {
         *handleOut = global::Improbable.Worker.Internal.ClientHandles.HandleAlloc();
         if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Update)
         {
             var data               = new Update();
             var fieldsToClear      = new global::System.Collections.Generic.HashSet <uint>();
             var fieldsToClearCount = global::Improbable.Worker.Internal.Pbio.GetUint32Count(root, /* fields to clear */ 1);
             for (uint i = 0; i < fieldsToClearCount; ++i)
             {
                 fieldsToClear.Add(global::Improbable.Worker.Internal.Pbio.IndexUint32(root, /* fields to clear */ 1, i));
             }
             var stateObject = global::Improbable.Worker.Internal.Pbio.GetObject(
                 global::Improbable.Worker.Internal.Pbio.GetObject(root, /* entity_state */ 2), 103);
             if (global::Improbable.Worker.Internal.Pbio.GetBoolCount(stateObject, 1) > 0)
             {
                 bool field;
                 {
                     field = global::Improbable.Worker.Internal.Pbio.GetBool(stateObject, 1) != 0;
                 }
                 data.isAlive.Set(field);
             }
             **handleOut = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Snapshot)
         {
             var data = new Data(global::Cell.IsAliveData_Internal.Read(
                                     global::Improbable.Worker.Internal.Pbio.GetObject(root, 103)));
             **handleOut = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Request)
         {
             var data = new global::Improbable.Worker.Internal.GenericCommandObject();
             **handleOut = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
             return(0);
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Response)
         {
             var data = new global::Improbable.Worker.Internal.GenericCommandObject();
             **handleOut = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
             return(0);
         }
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
         return(0);
     }
     return(1);
 }
Esempio n. 4
0
 ComponentUpdateDeserialize(global::System.UInt32 componentId,
                            global::System.UIntPtr userData,
                            global::Improbable.Worker.CInterop.SchemaComponentUpdate source,
                            out global::System.UIntPtr handleOut)
 {
     handleOut = global::System.UIntPtr.Zero;
     try
     {
         var data               = new Update();
         var fieldsToClear      = new global::System.Collections.Generic.HashSet <uint>();
         var fieldsToClearCount = source.GetClearedFieldCount();
         for (uint i = 0; i < fieldsToClearCount; ++i)
         {
             fieldsToClear.Add(source.IndexClearedField(i));
         }
         var fields = source.GetFields();
         if (fields.GetObjectCount(1) > 0)
         {
             global::Improbable.WorkerRequirementSet field;
             {
                 field = global::Improbable.WorkerRequirementSet_Internal.Read(fields.GetObject(1));
             }
             data.readAcl.Set(field);
         }
         if (fields.GetObjectCount(2) > 0 || fieldsToClear.Contains(2))
         {
             global::Improbable.Collections.Map <uint, global::Improbable.WorkerRequirementSet> field;
             {
                 var _count = fields.GetObjectCount(2);
                 field = new global::Improbable.Collections.Map <uint, global::Improbable.WorkerRequirementSet>((int)_count);
                 for (uint _i = 0; _i < _count; ++_i)
                 {
                     var _pair = fields.IndexObject(2, _i);
                     field.Add(_pair.GetUint32(1), global::Improbable.WorkerRequirementSet_Internal.Read(_pair.GetObject(2)));
                 }
             }
             data.componentWriteAcl.Set(field);
         }
         var handle = global::Improbable.Worker.Internal.ClientHandles.HandleAlloc();
         *handle   = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
         handleOut = (global::System.UIntPtr)handle;
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
         return(false);
     }
     return(true);
 }
Esempio n. 5
0
 ComponentUpdateDeserialize(global::System.UInt32 componentId,
                            global::System.UIntPtr userData,
                            global::Improbable.Worker.CInterop.SchemaComponentUpdate source,
                            out global::System.UIntPtr handleOut)
 {
     handleOut = global::System.UIntPtr.Zero;
     try
     {
         var data               = new Update();
         var fieldsToClear      = new global::System.Collections.Generic.HashSet <uint>();
         var fieldsToClearCount = source.GetClearedFieldCount();
         for (uint i = 0; i < fieldsToClearCount; ++i)
         {
             fieldsToClear.Add(source.IndexClearedField(i));
         }
         var fields = source.GetFields();
         if (fields.GetInt64Count(1) > 0 || fieldsToClear.Contains(1))
         {
             global::Improbable.Collections.List <global::Improbable.EntityId> field;
             {
                 var _count = fields.GetInt64Count(1);
                 field = new global::Improbable.Collections.List <global::Improbable.EntityId>((int)_count);
                 for (uint _i = 0; _i < _count; ++_i)
                 {
                     field.Add(new global::Improbable.EntityId(fields.IndexInt64(1, _i)));
                 }
             }
             data.neighborList.Set(field);
         }
         var handle = global::Improbable.Worker.Internal.ClientHandles.HandleAlloc();
         *handle   = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
         handleOut = (global::System.UIntPtr)handle;
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
         return(false);
     }
     return(true);
 }
Esempio n. 6
0
 ClientDeserialize(global::System.UInt32 componentId,
                   global::System.Byte handleType,
                   global::Improbable.Worker.Internal.Pbio.Object *root,
                   global::Improbable.Worker.Internal.ComponentProtocol.ClientHandle **handleOut)
 {
     *handleOut = null;
     try
     {
         *handleOut = global::Improbable.Worker.Internal.ClientHandles.HandleAlloc();
         if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Update)
         {
             var data               = new Update();
             var fieldsToClear      = new global::System.Collections.Generic.HashSet <uint>();
             var fieldsToClearCount = global::Improbable.Worker.Internal.Pbio.GetUint32Count(root, /* fields to clear */ 1);
             for (uint i = 0; i < fieldsToClearCount; ++i)
             {
                 fieldsToClear.Add(global::Improbable.Worker.Internal.Pbio.IndexUint32(root, /* fields to clear */ 1, i));
             }
             var stateObject = global::Improbable.Worker.Internal.Pbio.GetObject(
                 global::Improbable.Worker.Internal.Pbio.GetObject(root, /* entity_state */ 2), 197717);
             if (global::Improbable.Worker.Internal.Pbio.GetFloatCount(stateObject, 2) > 0 || fieldsToClear.Contains(2))
             {
                 global::Improbable.Collections.List <float> field;
                 {
                     var _count = global::Improbable.Worker.Internal.Pbio.GetFloatCount(stateObject, 2);
                     field = new global::Improbable.Collections.List <float>((int)_count);
                     for (uint _i = 0; _i < _count; ++_i)
                     {
                         field.Add(global::Improbable.Worker.Internal.Pbio.IndexFloat(stateObject, 2, _i));
                     }
                 }
                 data.field2.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetInt32Count(stateObject, 4) > 0 || fieldsToClear.Contains(4))
             {
                 global::Improbable.Collections.List <int> field;
                 {
                     var _count = global::Improbable.Worker.Internal.Pbio.GetInt32Count(stateObject, 4);
                     field = new global::Improbable.Collections.List <int>((int)_count);
                     for (uint _i = 0; _i < _count; ++_i)
                     {
                         field.Add(global::Improbable.Worker.Internal.Pbio.IndexInt32(stateObject, 4, _i));
                     }
                 }
                 data.field4.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetInt64Count(stateObject, 5) > 0 || fieldsToClear.Contains(5))
             {
                 global::Improbable.Collections.List <long> field;
                 {
                     var _count = global::Improbable.Worker.Internal.Pbio.GetInt64Count(stateObject, 5);
                     field = new global::Improbable.Collections.List <long>((int)_count);
                     for (uint _i = 0; _i < _count; ++_i)
                     {
                         field.Add(global::Improbable.Worker.Internal.Pbio.IndexInt64(stateObject, 5, _i));
                     }
                 }
                 data.field5.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetDoubleCount(stateObject, 6) > 0 || fieldsToClear.Contains(6))
             {
                 global::Improbable.Collections.List <double> field;
                 {
                     var _count = global::Improbable.Worker.Internal.Pbio.GetDoubleCount(stateObject, 6);
                     field = new global::Improbable.Collections.List <double>((int)_count);
                     for (uint _i = 0; _i < _count; ++_i)
                     {
                         field.Add(global::Improbable.Worker.Internal.Pbio.IndexDouble(stateObject, 6, _i));
                     }
                 }
                 data.field6.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetBytesCount(stateObject, 7) > 0 || fieldsToClear.Contains(7))
             {
                 global::Improbable.Collections.List <string> field;
                 {
                     var _count = global::Improbable.Worker.Internal.Pbio.GetBytesCount(stateObject, 7);
                     field = new global::Improbable.Collections.List <string>((int)_count);
                     for (uint _i = 0; _i < _count; ++_i)
                     {
                         field.Add(global::System.Text.Encoding.UTF8.GetString(global::Improbable.Worker.Bytes.CopyOf(global::Improbable.Worker.Internal.Pbio.IndexBytes(stateObject, 7, _i), global::Improbable.Worker.Internal.Pbio.IndexBytesLength(stateObject, 7, _i)).BackingArray));
                     }
                 }
                 data.field7.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetUint32Count(stateObject, 8) > 0 || fieldsToClear.Contains(8))
             {
                 global::Improbable.Collections.List <uint> field;
                 {
                     var _count = global::Improbable.Worker.Internal.Pbio.GetUint32Count(stateObject, 8);
                     field = new global::Improbable.Collections.List <uint>((int)_count);
                     for (uint _i = 0; _i < _count; ++_i)
                     {
                         field.Add(global::Improbable.Worker.Internal.Pbio.IndexUint32(stateObject, 8, _i));
                     }
                 }
                 data.field8.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetUint64Count(stateObject, 9) > 0 || fieldsToClear.Contains(9))
             {
                 global::Improbable.Collections.List <ulong> field;
                 {
                     var _count = global::Improbable.Worker.Internal.Pbio.GetUint64Count(stateObject, 9);
                     field = new global::Improbable.Collections.List <ulong>((int)_count);
                     for (uint _i = 0; _i < _count; ++_i)
                     {
                         field.Add(global::Improbable.Worker.Internal.Pbio.IndexUint64(stateObject, 9, _i));
                     }
                 }
                 data.field9.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetSint32Count(stateObject, 10) > 0 || fieldsToClear.Contains(10))
             {
                 global::Improbable.Collections.List <int> field;
                 {
                     var _count = global::Improbable.Worker.Internal.Pbio.GetSint32Count(stateObject, 10);
                     field = new global::Improbable.Collections.List <int>((int)_count);
                     for (uint _i = 0; _i < _count; ++_i)
                     {
                         field.Add(global::Improbable.Worker.Internal.Pbio.IndexSint32(stateObject, 10, _i));
                     }
                 }
                 data.field10.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetSint64Count(stateObject, 11) > 0 || fieldsToClear.Contains(11))
             {
                 global::Improbable.Collections.List <long> field;
                 {
                     var _count = global::Improbable.Worker.Internal.Pbio.GetSint64Count(stateObject, 11);
                     field = new global::Improbable.Collections.List <long>((int)_count);
                     for (uint _i = 0; _i < _count; ++_i)
                     {
                         field.Add(global::Improbable.Worker.Internal.Pbio.IndexSint64(stateObject, 11, _i));
                     }
                 }
                 data.field11.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetFixed32Count(stateObject, 12) > 0 || fieldsToClear.Contains(12))
             {
                 global::Improbable.Collections.List <uint> field;
                 {
                     var _count = global::Improbable.Worker.Internal.Pbio.GetFixed32Count(stateObject, 12);
                     field = new global::Improbable.Collections.List <uint>((int)_count);
                     for (uint _i = 0; _i < _count; ++_i)
                     {
                         field.Add(global::Improbable.Worker.Internal.Pbio.IndexFixed32(stateObject, 12, _i));
                     }
                 }
                 data.field12.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetFixed64Count(stateObject, 13) > 0 || fieldsToClear.Contains(13))
             {
                 global::Improbable.Collections.List <ulong> field;
                 {
                     var _count = global::Improbable.Worker.Internal.Pbio.GetFixed64Count(stateObject, 13);
                     field = new global::Improbable.Collections.List <ulong>((int)_count);
                     for (uint _i = 0; _i < _count; ++_i)
                     {
                         field.Add(global::Improbable.Worker.Internal.Pbio.IndexFixed64(stateObject, 13, _i));
                     }
                 }
                 data.field13.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetSfixed32Count(stateObject, 14) > 0 || fieldsToClear.Contains(14))
             {
                 global::Improbable.Collections.List <int> field;
                 {
                     var _count = global::Improbable.Worker.Internal.Pbio.GetSfixed32Count(stateObject, 14);
                     field = new global::Improbable.Collections.List <int>((int)_count);
                     for (uint _i = 0; _i < _count; ++_i)
                     {
                         field.Add(global::Improbable.Worker.Internal.Pbio.IndexSfixed32(stateObject, 14, _i));
                     }
                 }
                 data.field14.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetSfixed64Count(stateObject, 15) > 0 || fieldsToClear.Contains(15))
             {
                 global::Improbable.Collections.List <long> field;
                 {
                     var _count = global::Improbable.Worker.Internal.Pbio.GetSfixed64Count(stateObject, 15);
                     field = new global::Improbable.Collections.List <long>((int)_count);
                     for (uint _i = 0; _i < _count; ++_i)
                     {
                         field.Add(global::Improbable.Worker.Internal.Pbio.IndexSfixed64(stateObject, 15, _i));
                     }
                 }
                 data.field15.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetInt64Count(stateObject, 16) > 0 || fieldsToClear.Contains(16))
             {
                 global::Improbable.Collections.List <global::Improbable.EntityId> field;
                 {
                     var _count = global::Improbable.Worker.Internal.Pbio.GetInt64Count(stateObject, 16);
                     field = new global::Improbable.Collections.List <global::Improbable.EntityId>((int)_count);
                     for (uint _i = 0; _i < _count; ++_i)
                     {
                         field.Add(new global::Improbable.EntityId(global::Improbable.Worker.Internal.Pbio.IndexInt64(stateObject, 16, _i)));
                     }
                 }
                 data.field16.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetObjectCount(stateObject, 17) > 0 || fieldsToClear.Contains(17))
             {
                 global::Improbable.Collections.List <global::Improbable.Gdk.Tests.SomeType> field;
                 {
                     var _count = global::Improbable.Worker.Internal.Pbio.GetObjectCount(stateObject, 17);
                     field = new global::Improbable.Collections.List <global::Improbable.Gdk.Tests.SomeType>((int)_count);
                     for (uint _i = 0; _i < _count; ++_i)
                     {
                         field.Add(global::Improbable.Gdk.Tests.SomeType_Internal.Read(global::Improbable.Worker.Internal.Pbio.IndexObject(stateObject, 17, _i)));
                     }
                 }
                 data.field17.Set(field);
             }
             **handleOut = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Snapshot)
         {
             var data = new Data(global::Improbable.Gdk.Tests.ExhaustiveRepeatedData_Internal.Read(
                                     global::Improbable.Worker.Internal.Pbio.GetObject(root, 197717)));
             **handleOut = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Request)
         {
             var data = new global::Improbable.Worker.Internal.GenericCommandObject();
             **handleOut = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
             return(0);
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Response)
         {
             var data = new global::Improbable.Worker.Internal.GenericCommandObject();
             **handleOut = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
             return(0);
         }
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
         return(0);
     }
     return(1);
 }
 ClientDeserialize(global::System.UInt32 componentId,
                   global::System.Byte handleType,
                   global::Improbable.Worker.Internal.Pbio.Object *root,
                   global::Improbable.Worker.Internal.ComponentProtocol.ClientHandle **handleOut)
 {
     *handleOut = null;
     try
     {
         *handleOut = global::Improbable.Worker.Internal.ClientHandles.HandleAlloc();
         if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Update)
         {
             var data               = new Update();
             var fieldsToClear      = new global::System.Collections.Generic.HashSet <uint>();
             var fieldsToClearCount = global::Improbable.Worker.Internal.Pbio.GetUint32Count(root, /* fields to clear */ 1);
             for (uint i = 0; i < fieldsToClearCount; ++i)
             {
                 fieldsToClear.Add(global::Improbable.Worker.Internal.Pbio.IndexUint32(root, /* fields to clear */ 1, i));
             }
             var stateObject = global::Improbable.Worker.Internal.Pbio.GetObject(
                 global::Improbable.Worker.Internal.Pbio.GetObject(root, /* entity_state */ 2), 197720);
             if (global::Improbable.Worker.Internal.Pbio.GetBoolCount(stateObject, 1) > 0)
             {
                 bool field;
                 {
                     field = global::Improbable.Worker.Internal.Pbio.GetBool(stateObject, 1) != 0;
                 }
                 data.field1.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetFloatCount(stateObject, 2) > 0)
             {
                 float field;
                 {
                     field = global::Improbable.Worker.Internal.Pbio.GetFloat(stateObject, 2);
                 }
                 data.field2.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetInt32Count(stateObject, 4) > 0)
             {
                 int field;
                 {
                     field = global::Improbable.Worker.Internal.Pbio.GetInt32(stateObject, 4);
                 }
                 data.field4.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetInt64Count(stateObject, 5) > 0)
             {
                 long field;
                 {
                     field = global::Improbable.Worker.Internal.Pbio.GetInt64(stateObject, 5);
                 }
                 data.field5.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetDoubleCount(stateObject, 6) > 0)
             {
                 double field;
                 {
                     field = global::Improbable.Worker.Internal.Pbio.GetDouble(stateObject, 6);
                 }
                 data.field6.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetUint32Count(stateObject, 8) > 0)
             {
                 uint field;
                 {
                     field = global::Improbable.Worker.Internal.Pbio.GetUint32(stateObject, 8);
                 }
                 data.field8.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetUint64Count(stateObject, 9) > 0)
             {
                 ulong field;
                 {
                     field = global::Improbable.Worker.Internal.Pbio.GetUint64(stateObject, 9);
                 }
                 data.field9.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetSint32Count(stateObject, 10) > 0)
             {
                 int field;
                 {
                     field = global::Improbable.Worker.Internal.Pbio.GetSint32(stateObject, 10);
                 }
                 data.field10.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetSint64Count(stateObject, 11) > 0)
             {
                 long field;
                 {
                     field = global::Improbable.Worker.Internal.Pbio.GetSint64(stateObject, 11);
                 }
                 data.field11.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetFixed32Count(stateObject, 12) > 0)
             {
                 uint field;
                 {
                     field = global::Improbable.Worker.Internal.Pbio.GetFixed32(stateObject, 12);
                 }
                 data.field12.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetFixed64Count(stateObject, 13) > 0)
             {
                 ulong field;
                 {
                     field = global::Improbable.Worker.Internal.Pbio.GetFixed64(stateObject, 13);
                 }
                 data.field13.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetSfixed32Count(stateObject, 14) > 0)
             {
                 int field;
                 {
                     field = global::Improbable.Worker.Internal.Pbio.GetSfixed32(stateObject, 14);
                 }
                 data.field14.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetSfixed64Count(stateObject, 15) > 0)
             {
                 long field;
                 {
                     field = global::Improbable.Worker.Internal.Pbio.GetSfixed64(stateObject, 15);
                 }
                 data.field15.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetInt64Count(stateObject, 16) > 0)
             {
                 global::Improbable.EntityId field;
                 {
                     field = new global::Improbable.EntityId(global::Improbable.Worker.Internal.Pbio.GetInt64(stateObject, 16));
                 }
                 data.field16.Set(field);
             }
             if (global::Improbable.Worker.Internal.Pbio.GetObjectCount(stateObject, 17) > 0)
             {
                 global::Improbable.Gdk.Tests.SomeType field;
                 {
                     field = global::Improbable.Gdk.Tests.SomeType_Internal.Read(global::Improbable.Worker.Internal.Pbio.GetObject(stateObject, 17));
                 }
                 data.field17.Set(field);
             }
             **handleOut = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Snapshot)
         {
             var data = new Data(global::Improbable.Gdk.Tests.ExhaustiveBlittableSingularData_Internal.Read(
                                     global::Improbable.Worker.Internal.Pbio.GetObject(root, 197720)));
             **handleOut = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Request)
         {
             var data = new global::Improbable.Worker.Internal.GenericCommandObject();
             **handleOut = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
             return(0);
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Response)
         {
             var data = new global::Improbable.Worker.Internal.GenericCommandObject();
             **handleOut = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
             return(0);
         }
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
         return(0);
     }
     return(1);
 }
Esempio n. 8
0
 ClientDeserialize(global::System.UInt32 componentId,
                   void *userData,
                   global::System.Byte handleType,
                   global::Improbable.Worker.Internal.Pbio.Object *root,
                   global::Improbable.Worker.Internal.ComponentProtocol.ClientHandle **handleOut)
 {
     *handleOut = null;
     try
     {
         *handleOut = global::Improbable.Worker.Internal.ClientHandles.HandleAlloc();
         if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Update)
         {
             var data               = new Update();
             var fieldsToClear      = new global::System.Collections.Generic.HashSet <uint>();
             var fieldsToClearCount = global::Improbable.Worker.Internal.Pbio.GetUint32Count(root, /* fields to clear */ 1);
             for (uint i = 0; i < fieldsToClearCount; ++i)
             {
                 fieldsToClear.Add(global::Improbable.Worker.Internal.Pbio.IndexUint32(root, /* fields to clear */ 1, i));
             }
             var stateObject = global::Improbable.Worker.Internal.Pbio.GetObject(
                 global::Improbable.Worker.Internal.Pbio.GetObject(root, /* entity_state */ 2), 58);
             if (global::Improbable.Worker.Internal.Pbio.GetObjectCount(stateObject, 1) > 0 || fieldsToClear.Contains(1))
             {
                 global::Improbable.Collections.Map <uint, global::Improbable.ComponentInterest> field;
                 {
                     var _count = global::Improbable.Worker.Internal.Pbio.GetObjectCount(stateObject, 1);
                     field = new global::Improbable.Collections.Map <uint, global::Improbable.ComponentInterest>((int)_count);
                     for (uint _i = 0; _i < _count; ++_i)
                     {
                         var _pair = global::Improbable.Worker.Internal.Pbio.IndexObject(stateObject, 1, _i);
                         field.Add(global::Improbable.Worker.Internal.Pbio.GetUint32(_pair, 1), global::Improbable.ComponentInterest_Internal.Read(global::Improbable.Worker.Internal.Pbio.GetObject(_pair, 2)));
                     }
                 }
                 data.componentInterest.Set(field);
             }
             **handleOut = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Snapshot)
         {
             var data = new Data(global::Improbable.InterestData_Internal.Read(
                                     global::Improbable.Worker.Internal.Pbio.GetObject(root, 58)));
             **handleOut = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Request)
         {
             var data = new global::Improbable.Worker.Internal.GenericCommandObject();
             **handleOut = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
             return(0);
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Response)
         {
             var data = new global::Improbable.Worker.Internal.GenericCommandObject();
             **handleOut = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
             return(0);
         }
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
         return(0);
     }
     return(1);
 }