コード例 #1
0
ファイル: Persistence.cs プロジェクト: DB823/unity
            public static global::Improbable.Persistence.Update DeserializeUpdate(global::Improbable.Worker.CInterop.SchemaComponentData data)
            {
                var update = new global::Improbable.Persistence.Update();
                var obj    = data.GetFields();

                return(update);
            }
コード例 #2
0
            public static global::Improbable.Worker.CInterop.ComponentData CreateSchemaComponentData(
                )
            {
                var schemaComponentData = new global::Improbable.Worker.CInterop.SchemaComponentData(1004);
                var obj = schemaComponentData.GetFields();

                return(new global::Improbable.Worker.CInterop.ComponentData(schemaComponentData));
            }
コード例 #3
0
ファイル: Metadata.cs プロジェクト: DB823/unity
            public static global::Improbable.Metadata.Update DeserializeUpdate(global::Improbable.Worker.CInterop.SchemaComponentData data)
            {
                var update = new global::Improbable.Metadata.Update();
                var obj    = data.GetFields();

                update.EntityType = obj.GetString(1);

                return(update);
            }
コード例 #4
0
 ComponentDataSerialize(global::System.UInt32 componentId,
                        global::System.UIntPtr userData,
                        global::System.UIntPtr handle)
 {
     try
     {
         var _pool      = global::Improbable.Worker.Internal.ClientHandles.Instance.GetGcHandlePool(handle);
         var data       = (Data)global::Improbable.Worker.Internal.ClientHandles.Instance.Dereference(handle);
         var dataObject = new global::Improbable.Worker.CInterop.SchemaComponentData(55);
         global::Improbable.PersistenceData_Internal.Write(_pool, data.Value, dataObject.GetFields());
         return(dataObject);
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
         return(null);
     }
 }
コード例 #5
0
 ComponentDataDeserialize(global::System.UInt32 componentId,
                          global::System.UIntPtr userData,
                          global::Improbable.Worker.CInterop.SchemaComponentData source,
                          out global::System.UIntPtr handleOut)
 {
     handleOut = global::System.UIntPtr.Zero;
     try
     {
         var data   = new Data(global::Improbable.PersistenceData_Internal.Read(source.GetFields()));
         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);
 }
コード例 #6
0
ファイル: Interest.cs プロジェクト: DB823/unity
            public static global::Improbable.Interest.Update DeserializeUpdate(global::Improbable.Worker.CInterop.SchemaComponentData data)
            {
                var update = new global::Improbable.Interest.Update();
                var obj    = data.GetFields();

                {
                    var map     = new global::System.Collections.Generic.Dictionary <uint, global::Improbable.ComponentInterest>();
                    var mapSize = obj.GetObjectCount(1);
                    update.ComponentInterest = map;

                    for (var i = 0; i < mapSize; i++)
                    {
                        var mapObj = obj.IndexObject(1, (uint)i);
                        var key    = mapObj.GetUint32(1);
                        var value  = global::Improbable.ComponentInterest.Serialization.Deserialize(mapObj.GetObject(2));
                        map.Add(key, value);
                    }
                }

                return(update);
            }
コード例 #7
0
            public static Improbable.EntityAcl.Update DeserializeUpdate(global::Improbable.Worker.CInterop.SchemaComponentData data)
            {
                var update = new Improbable.EntityAcl.Update();
                var obj    = data.GetFields();

                {
                    var value = global::Improbable.WorkerRequirementSet.Serialization.Deserialize(obj.GetObject(1));
                    update.ReadAcl = new global::Improbable.Gdk.Core.Option <global::Improbable.WorkerRequirementSet>(value);
                }
                {
                    var mapSize = obj.GetObjectCount(2);
                    update.ComponentWriteAcl = new global::Improbable.Gdk.Core.Option <global::System.Collections.Generic.Dictionary <uint, global::Improbable.WorkerRequirementSet> >(new global::System.Collections.Generic.Dictionary <uint, global::Improbable.WorkerRequirementSet>());
                    for (var i = 0; i < mapSize; i++)
                    {
                        var mapObj = obj.IndexObject(2, (uint)i);
                        var key    = mapObj.GetUint32(1);
                        var value  = global::Improbable.WorkerRequirementSet.Serialization.Deserialize(mapObj.GetObject(2));
                        update.ComponentWriteAcl.Value.Add(key, value);
                    }
                }
                return(update);
            }
コード例 #8
0
            public static global::Improbable.DependentSchema.DependentComponent.Update DeserializeUpdate(global::Improbable.Worker.CInterop.SchemaComponentData data)
            {
                var update = new global::Improbable.DependentSchema.DependentComponent.Update();
                var obj    = data.GetFields();

                update.A = global::Improbable.TestSchema.ExhaustiveRepeatedData.Serialization.Deserialize(obj.GetObject(1));

                update.B = (global::Improbable.TestSchema.SomeEnum)obj.GetEnum(2);

                if (obj.GetEnumCount(3) == 1)
                {
                    update.C = new global::Improbable.Gdk.Core.Option <global::Improbable.TestSchema.SomeEnum?>((global::Improbable.TestSchema.SomeEnum)obj.GetEnum(3));
                }

                {
                    var listSize = obj.GetObjectCount(4);
                    update.D = new global::Improbable.Gdk.Core.Option <global::System.Collections.Generic.List <global::Improbable.TestSchema.SomeType> >(new global::System.Collections.Generic.List <global::Improbable.TestSchema.SomeType>());

                    for (var i = 0; i < listSize; i++)
                    {
                        var value = global::Improbable.TestSchema.SomeType.Serialization.Deserialize(obj.IndexObject(4, (uint)i));
                        update.D.Value.Add(value);
                    }
                }

                {
                    var map     = new global::System.Collections.Generic.Dictionary <global::Improbable.TestSchema.SomeEnum, global::Improbable.TestSchema.SomeType>();
                    var mapSize = obj.GetObjectCount(5);
                    update.E = map;

                    for (var i = 0; i < mapSize; i++)
                    {
                        var mapObj = obj.IndexObject(5, (uint)i);
                        var key    = (global::Improbable.TestSchema.SomeEnum)mapObj.GetEnum(1);
                        var value  = global::Improbable.TestSchema.SomeType.Serialization.Deserialize(mapObj.GetObject(2));
                        map.Add(key, value);
                    }
                }

                return(update);
            }
コード例 #9
0
            public static global::Improbable.TestSchema.ExhaustiveEntity.Update DeserializeUpdate(global::Improbable.Worker.CInterop.SchemaComponentData data)
            {
                var update = new global::Improbable.TestSchema.ExhaustiveEntity.Update();
                var obj    = data.GetFields();

                {
                    var value = obj.GetEntity(1);
                    update.Field1 = new global::Improbable.Gdk.Core.Option <global::Improbable.Gdk.Core.EntitySnapshot>(value);
                }
                {
                    if (obj.GetEntityCount(2) == 1)
                    {
                        var value = obj.GetEntity(2);
                        update.Field2 = new global::Improbable.Gdk.Core.Option <global::Improbable.Gdk.Core.EntitySnapshot?>(new global::Improbable.Gdk.Core.EntitySnapshot?(value));
                    }
                }
                {
                    var listSize = obj.GetEntityCount(3);
                    update.Field3 = new global::Improbable.Gdk.Core.Option <global::System.Collections.Generic.List <global::Improbable.Gdk.Core.EntitySnapshot> >(new global::System.Collections.Generic.List <global::Improbable.Gdk.Core.EntitySnapshot>());
                    for (var i = 0; i < listSize; i++)
                    {
                        var value = obj.IndexEntity(3, (uint)i);
                        update.Field3.Value.Add(value);
                    }
                }
                {
                    var mapSize = obj.GetObjectCount(4);
                    update.Field4 = new global::Improbable.Gdk.Core.Option <global::System.Collections.Generic.Dictionary <global::Improbable.Gdk.Core.EntitySnapshot, string> >(new global::System.Collections.Generic.Dictionary <global::Improbable.Gdk.Core.EntitySnapshot, string>());
                    for (var i = 0; i < mapSize; i++)
                    {
                        var mapObj = obj.IndexObject(4, (uint)i);
                        var key    = mapObj.GetEntity(1);
                        var value  = mapObj.GetString(2);
                        update.Field4.Value.Add(key, value);
                    }
                }
                {
                    var mapSize = obj.GetObjectCount(5);
                    update.Field5 = new global::Improbable.Gdk.Core.Option <global::System.Collections.Generic.Dictionary <string, global::Improbable.Gdk.Core.EntitySnapshot> >(new global::System.Collections.Generic.Dictionary <string, global::Improbable.Gdk.Core.EntitySnapshot>());
                    for (var i = 0; i < mapSize; i++)
                    {
                        var mapObj = obj.IndexObject(5, (uint)i);
                        var key    = mapObj.GetString(1);
                        var value  = mapObj.GetEntity(2);
                        update.Field5.Value.Add(key, value);
                    }
                }
                return(update);
            }
コード例 #10
0
            public static global::Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithEvents.Update DeserializeUpdate(global::Improbable.Worker.CInterop.SchemaComponentData data)
            {
                var update = new global::Improbable.Gdk.Tests.ComponentsWithNoFields.ComponentWithNoFieldsWithEvents.Update();
                var obj    = data.GetFields();

                return(update);
            }
コード例 #11
0
            public static Improbable.PlayerLifecycle.PlayerHeartbeatClient.Update DeserializeUpdate(global::Improbable.Worker.CInterop.SchemaComponentData data)
            {
                var update = new Improbable.PlayerLifecycle.PlayerHeartbeatClient.Update();
                var obj    = data.GetFields();

                return(update);
            }
コード例 #12
0
            public static global::Improbable.TestSchema.RecursiveComponent.Update DeserializeUpdate(global::Improbable.Worker.CInterop.SchemaComponentData data)
            {
                var update = new global::Improbable.TestSchema.RecursiveComponent.Update();
                var obj    = data.GetFields();

                update.A = global::Improbable.TestSchema.TypeA.Serialization.Deserialize(obj.GetObject(1));

                update.B = global::Improbable.TestSchema.TypeB.Serialization.Deserialize(obj.GetObject(2));

                update.C = global::Improbable.TestSchema.TypeC.Serialization.Deserialize(obj.GetObject(3));

                return(update);
            }
コード例 #13
0
ファイル: OwningWorker.cs プロジェクト: DB823/unity
            public static global::Improbable.Gdk.PlayerLifecycle.OwningWorker.Update DeserializeUpdate(global::Improbable.Worker.CInterop.SchemaComponentData data)
            {
                var update = new global::Improbable.Gdk.PlayerLifecycle.OwningWorker.Update();
                var obj    = data.GetFields();

                update.WorkerId = obj.GetString(1);

                return(update);
            }
コード例 #14
0
            public static global::Improbable.Restricted.PlayerClient.Update DeserializeUpdate(global::Improbable.Worker.CInterop.SchemaComponentData data)
            {
                var update = new global::Improbable.Restricted.PlayerClient.Update();
                var obj    = data.GetFields();

                update.PlayerIdentity = global::Improbable.Restricted.PlayerIdentity.Serialization.Deserialize(obj.GetObject(1));

                return(update);
            }
コード例 #15
0
ファイル: Worker.cs プロジェクト: DB823/unity
            public static global::Improbable.Restricted.Worker.Update DeserializeUpdate(global::Improbable.Worker.CInterop.SchemaComponentData data)
            {
                var update = new global::Improbable.Restricted.Worker.Update();
                var obj    = data.GetFields();

                update.WorkerId = obj.GetString(1);

                update.WorkerType = obj.GetString(2);

                update.Connection = global::Improbable.Restricted.Connection.Serialization.Deserialize(obj.GetObject(3));

                return(update);
            }