ComponentUpdateSerialize(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         = (Update)global::Improbable.Worker.Internal.ClientHandles.Instance.Dereference(handle);
         var updateObject = new global::Improbable.Worker.CInterop.SchemaComponentUpdate(112);
         var fieldsObject = updateObject.GetFields();
         if (data.neighborList.HasValue)
         {
             if (data.neighborList.Value.Count == 0)
             {
                 updateObject.AddClearedField(1);
             }
             if (data.neighborList.Value != null)
             {
                 for (int _i = 0; _i < data.neighborList.Value.Count; ++_i)
                 {
                     fieldsObject.AddInt64(1, data.neighborList.Value[_i].Id);
                 }
             }
         }
         return(updateObject);
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
         return(null);
     }
 }
 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);
 }
Exemple #3
0
 CommandResponseDeserialize(global::System.UInt32 componentId,
                            global::System.UIntPtr userData,
                            global::Improbable.Worker.CInterop.SchemaCommandResponse source,
                            out global::System.UIntPtr handleOut)
 {
     handleOut = global::System.UIntPtr.Zero;
     try
     {
         var data   = new global::Improbable.Worker.Internal.GenericCommandObject();
         var handle = global::Improbable.Worker.Internal.ClientHandles.HandleAlloc();
         *handle   = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
         handleOut = (global::System.UIntPtr)handle;
         if (source.GetCommandIndex() == 1)
         {
             data.CommandId     = 1;
             data.CommandObject = new Commands.Disconnect.Response(global::Improbable.Restricted.DisconnectResponse_Internal.Read(source.GetObject()));
             return(true);
         }
         return(false);
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
         return(false);
     }
 }
Exemple #4
0
 ClientSerialize(global::System.UInt32 componentId,
                 void *userData,
                 global::System.Byte handleType,
                 global::Improbable.Worker.Internal.ComponentProtocol.ClientHandle *handle,
                 global::Improbable.Worker.Internal.Pbio.Object *root)
 {
     try
     {
         var _pool = global::Improbable.Worker.Internal.ClientHandles.Instance.GetGcHandlePool(*handle);
         if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Update)
         {
             var data        = (Update)global::Improbable.Worker.Internal.ClientHandles.Instance.Dereference(*handle);
             var stateObject = global::Improbable.Worker.Internal.Pbio.AddObject(
                 global::Improbable.Worker.Internal.Pbio.AddObject(root, /* entity_state */ 2), 50);
             if (data.readAcl.HasValue)
             {
                 {
                     global::Improbable.WorkerRequirementSet_Internal.Write(_pool, data.readAcl.Value, global::Improbable.Worker.Internal.Pbio.AddObject(stateObject, 1));
                 }
             }
             if (data.componentWriteAcl.HasValue)
             {
                 if (data.componentWriteAcl.Value.Count == 0)
                 {
                     global::Improbable.Worker.Internal.Pbio.AddUint32(root, /* fields to clear */ 1, 2);
                 }
                 if (data.componentWriteAcl.Value != null)
                 {
                     for (var _node = data.componentWriteAcl.Value.First; _node != null; _node = _node.Next)
                     {
                         var _pair = global::Improbable.Worker.Internal.Pbio.AddObject(stateObject, 2);
                         {
                             global::Improbable.Worker.Internal.Pbio.AddUint32(_pair, 1, _node.Value.Key);
                         }
                         {
                             global::Improbable.WorkerRequirementSet_Internal.Write(_pool, _node.Value.Value, global::Improbable.Worker.Internal.Pbio.AddObject(_pair, 2));
                         }
                     }
                 }
             }
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Snapshot)
         {
             var data = (Data)global::Improbable.Worker.Internal.ClientHandles.Instance.Dereference(*handle);
             global::Improbable.EntityAclData_Internal.Write(_pool, data.Value, global::Improbable.Worker.Internal.Pbio.AddObject(root, 50));
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Request)
         {
             global::Improbable.Worker.Internal.Pbio.AddObject(root, 50);
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Response)
         {
             global::Improbable.Worker.Internal.Pbio.AddObject(root, 50);
         }
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
     }
 }
 ClientSerialize(global::System.UInt32 componentId,
                 void *userData,
                 global::System.Byte handleType,
                 global::Improbable.Worker.Internal.ComponentProtocol.ClientHandle *handle,
                 global::Improbable.Worker.Internal.Pbio.Object *root)
 {
     try
     {
         var _pool = global::Improbable.Worker.Internal.ClientHandles.Instance.GetGcHandlePool(*handle);
         if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Update)
         {
             global::Improbable.Worker.Internal.Pbio.AddObject(
                 global::Improbable.Worker.Internal.Pbio.AddObject(root, /* entity_state */ 2), 55);
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Snapshot)
         {
             var data = (Data)global::Improbable.Worker.Internal.ClientHandles.Instance.Dereference(*handle);
             global::Improbable.PersistenceData_Internal.Write(_pool, data.Value, global::Improbable.Worker.Internal.Pbio.AddObject(root, 55));
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Request)
         {
             global::Improbable.Worker.Internal.Pbio.AddObject(root, 55);
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Response)
         {
             global::Improbable.Worker.Internal.Pbio.AddObject(root, 55);
         }
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
     }
 }
Exemple #6
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);
 }
Exemple #7
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);
 }
 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();
             **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::Demo.PingResponderData_Internal.Read(
                                     global::Improbable.Worker.Internal.Pbio.GetObject(root, 101)));
             **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);
             var commandObject = global::Improbable.Worker.Internal.Pbio.GetObject(root, 101);
             if (global::Improbable.Worker.Internal.Pbio.GetObjectCount(commandObject, 1) != 0)
             {
                 data.CommandId     = 1;
                 data.CommandObject = new Commands.Ping.Request(global::Demo.PingRequest_Internal.Read(global::Improbable.Worker.Internal.Pbio.GetObject(commandObject, 1)));
                 return(1);
             }
             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);
             var commandObject = global::Improbable.Worker.Internal.Pbio.GetObject(root, 101);
             if (global::Improbable.Worker.Internal.Pbio.GetObjectCount(commandObject, 2) != 0)
             {
                 data.CommandId     = 1;
                 data.CommandObject = new Commands.Ping.Response(global::Demo.Pong_Internal.Read(global::Improbable.Worker.Internal.Pbio.GetObject(commandObject, 2)));
                 return(1);
             }
             return(0);
         }
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
         return(0);
     }
     return(1);
 }
 public virtual global::MonoMac.AppKit.NSView ViewAtIndex(global::System.UInt32 index)
 {
     if (IsDirectBinding)
     {
         return((global::MonoMac.AppKit.NSView)Runtime.GetNSObject(MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSend_UInt32(this.Handle, selViewAtIndex_Handle, index)));
     }
     else
     {
         return((global::MonoMac.AppKit.NSView)Runtime.GetNSObject(MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper_UInt32(this.SuperHandle, selViewAtIndex_Handle, index)));
     }
 }
        //public static string strSQL = "select * from matchinfo";

        #endregion

        #region 工厂方法

        /// <summary>
        /// 创建新的 Matchinfo 对象。
        /// </summary>
        /// <param name="id">Id 属性的初始值。</param>
        /// <param name="serverId">ServerId 属性的初始值。</param>
        /// <param name="serverName">ServerName 属性的初始值。</param>
        /// <param name="serverIp">ServerIp 属性的初始值。</param>
        /// <param name="gameId">GameId 属性的初始值。</param>
        public static MatchinfoTable2 CreateMatchinfoTable2(global::System.UInt32 id, global::System.UInt32 serverId, global::System.String serverName, global::System.String serverIp, global::System.UInt32 gameId)
        {
            MatchinfoTable2 matchinfo = new MatchinfoTable2();

            matchinfo.Id         = id;
            matchinfo.ServerId   = serverId;
            matchinfo.ServerName = serverName;
            matchinfo.ServerIp   = serverIp;
            matchinfo.GameId     = gameId;
            return(matchinfo);
        }
 public virtual void VibraMotorStrength(global::System.UInt32 i)
 {
     if (IsDirectBinding)
     {
         MonoTouch.ObjCRuntime.Messaging.void_objc_msgSend_UInt32(this.Handle, selVibraMotorStrength_Handle, i);
     }
     else
     {
         MonoTouch.ObjCRuntime.Messaging.void_objc_msgSendSuper_UInt32(this.SuperHandle, selVibraMotorStrength_Handle, i);
     }
 }
        public void GetGlyphsTest()
        {
            TestRuntime.AssertSystemVersion(PlatformName.iOS, 7, 0, throwIfOtherPlatform: false);

            using (var txt = new NSTextStorage()) {
                var str = "hello world\n\t";
                txt.SetString(new NSAttributedString(str));
                using (var lm = new NSLayoutManager()) {
                    lm.TextStorage = txt;
                    var glyphs          = new short[str.Length];
                    var props           = new NSGlyphProperty [glyphs.Length];
                    var charIndexBuffer = new nuint [glyphs.Length];
                    var bidiLevelBuffer = new byte [glyphs.Length];
                    lm.GetGlyphs(new NSRange(0, str.Length), glyphs, props, charIndexBuffer, bidiLevelBuffer);
                    Assert.That(glyphs, Is.EqualTo(new short [] { 75, 72, 79, 79, 82, 3, 90, 82, 85, 79, 71, -1, -1 }), "glyphs");
                    Assert.That(props, Is.EqualTo(new NSGlyphProperty [] {
                        0,
                        0,
                        0,
                        0,
                        0,
                        NSGlyphProperty.Elastic,
                        0,
                        0,
                        0,
                        0,
                        0,
                        NSGlyphProperty.ControlCharacter,
                        NSGlyphProperty.ControlCharacter
                    }), "props");
                    Assert.That(charIndexBuffer, Is.EqualTo(new nuint [] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }), "charIndexBuffer");
                    Assert.That(bidiLevelBuffer, Is.EqualTo(new byte [str.Length]), "bidiLevelBuffer");
                }
            }

            using (var txt = new NSTextStorage()) {
                var str = "hello world\n\t";
                txt.SetString(new NSAttributedString(str));
                using (var lm = new NSLayoutManager()) {
                    lm.TextStorage = txt;
                    var glyphs          = new short[str.Length];
                    var charIndexBuffer = new nuint [glyphs.Length];
                    var bidiLevelBuffer = new byte [glyphs.Length];
                    lm.GetGlyphs(new NSRange(0, str.Length), glyphs, null, charIndexBuffer, bidiLevelBuffer);
                    Assert.That(glyphs, Is.EqualTo(new short [] { 75, 72, 79, 79, 82, 3, 90, 82, 85, 79, 71, -1, -1 }), "glyphs");

                    Assert.That(charIndexBuffer, Is.EqualTo(new nuint [] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }), "charIndexBuffer");
                    Assert.That(bidiLevelBuffer, Is.EqualTo(new byte [str.Length]), "bidiLevelBuffer");
                }
            }
        }
 ClientSerialize(global::System.UInt32 componentId,
                 void *userData,
                 global::System.Byte handleType,
                 global::Improbable.Worker.Internal.ComponentProtocol.ClientHandle *handle,
                 global::Improbable.Worker.Internal.Pbio.Object *root)
 {
     try
     {
         var _pool = global::Improbable.Worker.Internal.ClientHandles.Instance.GetGcHandlePool(*handle);
         if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Update)
         {
             global::Improbable.Worker.Internal.Pbio.AddObject(
                 global::Improbable.Worker.Internal.Pbio.AddObject(root, /* entity_state */ 2), 101);
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Snapshot)
         {
             var data = (Data)global::Improbable.Worker.Internal.ClientHandles.Instance.Dereference(*handle);
             global::Demo.PingResponderData_Internal.Write(_pool, data.Value, global::Improbable.Worker.Internal.Pbio.AddObject(root, 101));
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Request)
         {
             var data = (global::Improbable.Worker.Internal.GenericCommandObject)
                        global::Improbable.Worker.Internal.ClientHandles.Instance.Dereference(*handle);
             var commandObject = global::Improbable.Worker.Internal.Pbio.AddObject(root, 101);
             if (data.CommandId == 1)
             {
                 var requestObject = (Commands.Ping.Request)data.CommandObject;
                 {
                     global::Demo.PingRequest_Internal.Write(_pool, requestObject.Value, global::Improbable.Worker.Internal.Pbio.AddObject(commandObject, 1));
                 }
             }
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Response)
         {
             var data = (global::Improbable.Worker.Internal.GenericCommandObject)
                        global::Improbable.Worker.Internal.ClientHandles.Instance.Dereference(*handle);
             var commandObject = global::Improbable.Worker.Internal.Pbio.AddObject(root, 101);
             if (data.CommandId == 1)
             {
                 var responseObject = (Commands.Ping.Response)data.CommandObject;
                 {
                     global::Demo.Pong_Internal.Write(_pool, responseObject.Value, global::Improbable.Worker.Internal.Pbio.AddObject(commandObject, 2));
                 }
             }
         }
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
     }
 }
 CommandResponseSerialize(global::System.UInt32 componentId,
                          global::System.UIntPtr userData,
                          global::System.UIntPtr handle)
 {
     try
     {
         var _pool = global::Improbable.Worker.Internal.ClientHandles.Instance.GetGcHandlePool(handle);
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
     }
     return(null);
 }
Exemple #15
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);
 }
Exemple #16
0
 ClientSerialize(global::System.UInt32 componentId,
                 void *userData,
                 global::System.Byte handleType,
                 global::Improbable.Worker.Internal.ComponentProtocol.ClientHandle *handle,
                 global::Improbable.Worker.Internal.Pbio.Object *root)
 {
     try
     {
         var _pool = global::Improbable.Worker.Internal.ClientHandles.Instance.GetGcHandlePool(*handle);
         if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Update)
         {
             var data        = (Update)global::Improbable.Worker.Internal.ClientHandles.Instance.Dereference(*handle);
             var stateObject = global::Improbable.Worker.Internal.Pbio.AddObject(
                 global::Improbable.Worker.Internal.Pbio.AddObject(root, /* entity_state */ 2), 53);
             if (data.entityType.HasValue)
             {
                 {
                     if (data.entityType.Value != null)
                     {
                         var _buffer = global::System.Text.Encoding.UTF8.GetBytes(data.entityType.Value);
                         global::Improbable.Worker.Internal.Pbio.AddBytes(stateObject, 1, (byte *)_pool.Pin(_buffer), (uint)_buffer.Length);
                     }
                     else
                     {
                         global::Improbable.Worker.Internal.Pbio.AddBytes(stateObject, 1, null, 0);
                     }
                 }
             }
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Snapshot)
         {
             var data = (Data)global::Improbable.Worker.Internal.ClientHandles.Instance.Dereference(*handle);
             global::Improbable.MetadataData_Internal.Write(_pool, data.Value, global::Improbable.Worker.Internal.Pbio.AddObject(root, 53));
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Request)
         {
             global::Improbable.Worker.Internal.Pbio.AddObject(root, 53);
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Response)
         {
             global::Improbable.Worker.Internal.Pbio.AddObject(root, 53);
         }
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
     }
 }
 ComponentUpdateSerialize(global::System.UInt32 componentId,
                          global::System.UIntPtr userData,
                          global::System.UIntPtr handle)
 {
     try
     {
         var _pool        = global::Improbable.Worker.Internal.ClientHandles.Instance.GetGcHandlePool(handle);
         var updateObject = new global::Improbable.Worker.CInterop.SchemaComponentUpdate(55);
         return(updateObject);
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
         return(null);
     }
 }
 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);
     }
 }
Exemple #19
0
 ComponentUpdateSerialize(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         = (Update)global::Improbable.Worker.Internal.ClientHandles.Instance.Dereference(handle);
         var updateObject = new global::Improbable.Worker.CInterop.SchemaComponentUpdate(50);
         var fieldsObject = updateObject.GetFields();
         if (data.readAcl.HasValue)
         {
             {
                 global::Improbable.WorkerRequirementSet_Internal.Write(_pool, data.readAcl.Value, fieldsObject.AddObject(1));
             }
         }
         if (data.componentWriteAcl.HasValue)
         {
             if (data.componentWriteAcl.Value.Count == 0)
             {
                 updateObject.AddClearedField(2);
             }
             if (data.componentWriteAcl.Value != null)
             {
                 for (var _node = data.componentWriteAcl.Value.First; _node != null; _node = _node.Next)
                 {
                     var _pair = fieldsObject.AddObject(2);
                     {
                         _pair.AddUint32(1, _node.Value.Key);
                     }
                     {
                         global::Improbable.WorkerRequirementSet_Internal.Write(_pool, _node.Value.Value, _pair.AddObject(2));
                     }
                 }
             }
         }
         return(updateObject);
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
         return(null);
     }
 }
Exemple #20
0
 ComponentUpdateSerialize(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         = (Update)global::Improbable.Worker.Internal.ClientHandles.Instance.Dereference(handle);
         var updateObject = new global::Improbable.Worker.CInterop.SchemaComponentUpdate(111);
         var fieldsObject = updateObject.GetFields();
         if (data.curIsAlive.HasValue)
         {
             {
                 fieldsObject.AddBool(1, data.curIsAlive.Value);
             }
         }
         if (data.curSequenceId.HasValue)
         {
             {
                 fieldsObject.AddUint64(2, data.curSequenceId.Value);
             }
         }
         if (data.prevIsAlive.HasValue)
         {
             {
                 fieldsObject.AddBool(3, data.prevIsAlive.Value);
             }
         }
         if (data.prevSequenceId.HasValue)
         {
             {
                 fieldsObject.AddUint64(4, data.prevSequenceId.Value);
             }
         }
         return(updateObject);
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
         return(null);
     }
 }
 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);
 }
 CommandResponseDeserialize(global::System.UInt32 componentId,
                            global::System.UIntPtr userData,
                            global::Improbable.Worker.CInterop.SchemaCommandResponse source,
                            out global::System.UIntPtr handleOut)
 {
     handleOut = global::System.UIntPtr.Zero;
     try
     {
         var data   = new global::Improbable.Worker.Internal.GenericCommandObject();
         var handle = global::Improbable.Worker.Internal.ClientHandles.HandleAlloc();
         *handle   = global::Improbable.Worker.Internal.ClientHandles.Instance.CreateHandle(data);
         handleOut = (global::System.UIntPtr)handle;
         return(false);
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
         return(false);
     }
 }
 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);
 }
 ClientSerialize(global::System.UInt32 componentId,
                 global::System.Byte handleType,
                 global::Improbable.Worker.Internal.ComponentProtocol.ClientHandle *handle,
                 global::Improbable.Worker.Internal.Pbio.Object *root)
 {
     try
     {
         var _pool = global::Improbable.Worker.Internal.ClientHandles.Instance.GetGcHandlePool(*handle);
         if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Update)
         {
             var data        = (Update)global::Improbable.Worker.Internal.ClientHandles.Instance.Dereference(*handle);
             var stateObject = global::Improbable.Worker.Internal.Pbio.AddObject(
                 global::Improbable.Worker.Internal.Pbio.AddObject(root, /* entity_state */ 2), 20152);
             if (data.nestedType.HasValue)
             {
                 {
                     global::Improbable.Gdk.Tests.TypeName_Internal.Write(_pool, data.nestedType.Value, global::Improbable.Worker.Internal.Pbio.AddObject(stateObject, 1));
                 }
             }
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Snapshot)
         {
             var data = (Data)global::Improbable.Worker.Internal.ClientHandles.Instance.Dereference(*handle);
             global::Improbable.Gdk.Tests.NestedComponentData_Internal.Write(_pool, data.Value, global::Improbable.Worker.Internal.Pbio.AddObject(root, 20152));
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Request)
         {
             global::Improbable.Worker.Internal.Pbio.AddObject(root, 20152);
         }
         else if (handleType == (byte)global::Improbable.Worker.Internal.ComponentProtocol.ClientHandleType.Response)
         {
             global::Improbable.Worker.Internal.Pbio.AddObject(root, 20152);
         }
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
     }
 }
Exemple #25
0
 CommandResponseSerialize(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  = (global::Improbable.Worker.Internal.GenericCommandObject)
                     global::Improbable.Worker.Internal.ClientHandles.Instance.Dereference(handle);
         if (data.CommandId == 1)
         {
             var command        = new global::Improbable.Worker.CInterop.SchemaCommandResponse(60, 1);
             var responseObject = (Commands.Disconnect.Response)data.CommandObject;
             global::Improbable.Restricted.DisconnectResponse_Internal.Write(_pool, responseObject.Value, command.GetObject());
             return(command);
         }
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
     }
     return(null);
 }
Exemple #26
0
 ComponentUpdateSerialize(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         = (Update)global::Improbable.Worker.Internal.ClientHandles.Instance.Dereference(handle);
         var updateObject = new global::Improbable.Worker.CInterop.SchemaComponentUpdate(53);
         var fieldsObject = updateObject.GetFields();
         if (data.entityType.HasValue)
         {
             {
                 fieldsObject.AddString(1, data.entityType.Value);
             }
         }
         return(updateObject);
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
         return(null);
     }
 }
 ComponentUpdateSerialize(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         = (Update)global::Improbable.Worker.Internal.ClientHandles.Instance.Dereference(handle);
         var updateObject = new global::Improbable.Worker.CInterop.SchemaComponentUpdate(61);
         var fieldsObject = updateObject.GetFields();
         if (data.playerIdentity.HasValue)
         {
             {
                 global::Improbable.Restricted.PlayerIdentity_Internal.Write(_pool, data.playerIdentity.Value, fieldsObject.AddObject(1));
             }
         }
         return(updateObject);
     }
     catch (global::System.Exception e)
     {
         global::Improbable.Worker.ClientError.LogClientException(e);
         return(null);
     }
 }
Exemple #28
0
 public extern static void void_objc_msgSendSuper_IntPtr_UInt32(IntPtr receiver, IntPtr selector, IntPtr arg1, global::System.UInt32 arg2);
Exemple #29
0
 public extern static IntPtr IntPtr_objc_msgSendSuper_UInt32(IntPtr receiver, IntPtr selector, global::System.UInt32 arg1);
        public async global::System.Threading.Tasks.Task <global::System.UInt32> RequestNameAsync(global::System.String name, global::System.UInt32 flags)
        {
            var sendBody  = global::Dbus.Encoder.StartNew();
            var sendIndex = 0;

            global::Dbus.Encoder.Add(sendBody, ref sendIndex, name);
            global::Dbus.Encoder.Add(sendBody, ref sendIndex, flags);

            var receivedMessage = await connection.SendMethodCall(
                this.path,
                "org.freedesktop.DBus",
                "RequestName",
                this.destination,
                sendBody,
                "su"
                );

            assertSignature(receivedMessage.Signature, "u");
            var decoderIndex = 0;
            var result       = global::Dbus.Decoder.GetUInt32(receivedMessage.Body, ref decoderIndex);

            return(result);
        }
Exemple #31
0
		public override NSNumber NumberForPlot (CPTPlot plot, CPTPlotField forFieldEnum, nuint index)
		{
			if (forFieldEnum == CPTPlotField.BarLocation)
				return data [(int)index].X;
			return data [(int)index].Y;
		}
 private static extern IntPtr _StringFromAnnotationType(nuint annotationType);
		public override CPTPlotSymbol GetSymbol (CPTScatterPlot plot, nuint recordIndex)
		{
			return CPTPlotSymbol.DiamondPlotSymbol;	
		}
 private static extern IntPtr _StringFromPSPDFGalleryItemContentState(nuint state);
Exemple #35
0
		public override CPTFill GetBarFill (CPTBarPlot barPlot, nuint recordIndex)
		{
			if (Math.Abs (data [(int)recordIndex].Y - minVal) < float.Epsilon)
				return new CPTFill (CPTColor.RedColor);
			if (Math.Abs (data [(int)recordIndex].Y - maxVal) < float.Epsilon)
				return new CPTFill (CPTColor.GreenColor);
			
			return null;
		}
 public virtual PSPDFAnnotation[] AnnotationsForPage(nuint page, PSPDFAnnotationType type, CGPDFPage pageRef)
 {
     if (pageRef == null)
         return AnnotationsForPage (page, type, IntPtr.Zero);
     else
         return AnnotationsForPage (page, type, pageRef.Handle);
 }
 public PSPDFTextParser(CGPDFPage pageRef, nuint page, PSPDFDocumentProvider documentProvider, NSMutableDictionary fontCache, bool hideGlyphsOutsidePageRect, CGPDFBox pdfBox)
     : this(pageRef.Handle, page, documentProvider, fontCache, hideGlyphsOutsidePageRect, pdfBox)
 {
 }
		public override NSNumber NumberForPlot (CPTPlot plot, CPTPlotField forFieldEnum, nuint index)
		{
			var space = graph.DefaultPlotSpace as CPTXYPlotSpace;
			
			switch (forFieldEnum){
			case CPTPlotField.ScatterPlotFieldX:
				switch (index){
				case 0:
					return NSNumber.FromDouble (space.GlobalXRange.MinLimitDouble);
					
				case 1:
					return NSNumber.FromDouble (space.GlobalXRange.MaxLimitDouble);
					
				case 2:
				case 3:
				case 4:
					return 1;
				}
				break;
				
			case CPTPlotField.ScatterPlotFieldY:
				switch (index){
				case 0:
				case 1:
				case 2:
					return 1;
				case 3:
					return NSNumber.FromDouble (space.GlobalYRange.MinLimitDouble);
					
				case 4:
					return NSNumber.FromDouble (space.GlobalYRange.MaxLimitDouble);
				}
				break;
			}
			return NSNumber.FromDouble (2);
		}
 public virtual PSPDFPageInfo PageInfoForPage(nuint page, CGPDFPage pageRef)
 {
     if (pageRef == null)
         return PageInfoForPage (page, IntPtr.Zero);
     else
         return PageInfoForPage (page, pageRef.Handle);
 }
		public override NSNumber NumberForPlot (CPTPlot plot, CPTPlotField forFieldEnum, nuint index)
		{
			int fieldNum = (int)forFieldEnum;
			Dictionary<int, float> dataVal = data[(int)index];
			Console.WriteLine (string.Format ("{0} {1}", fieldNum, dataVal [fieldNum]));
			return dataVal[fieldNum];
		}
		public override NSNumber NumberForPlot (CPTPlot plot, CPTPlotField forFieldEnum, nuint index)
		{
			if (forFieldEnum == CPTPlotField.ScatterPlotFieldX)
				return Data [(int)index].X;
			return Data [(int)index].Y;
		}
        public virtual CGRect BoxRectForPage(CGPDFBox boxType, nuint page, out NSError error)
        {
            unsafe {
                IntPtr val;
                IntPtr val_addr = (IntPtr) ((IntPtr *) &val);

                CGRect ret = BoxRectForPage (boxType, page, val_addr);
                error = (NSError) Runtime.GetNSObject (val);

                return ret;
            }
        }
        public static CGRect ConvertViewRectToPDFRect(CGRect viewRect, CGRect cropBox, nuint rotation, CGRect bounds)
        {
            IntPtr viewRectPtr = Marshal.AllocHGlobal (Marshal.SizeOf (viewRect));
            IntPtr cropBoxPtr = Marshal.AllocHGlobal (Marshal.SizeOf (cropBox));
            IntPtr rotationPtr = Marshal.AllocHGlobal (Marshal.SizeOf (rotation));
            IntPtr boundsPtr = Marshal.AllocHGlobal (Marshal.SizeOf (bounds));

            IntPtr resultPtr;
            CGRect result;

            try {
                Marshal.StructureToPtr ((object)viewRect, viewRectPtr, true);
                Marshal.StructureToPtr ((object)cropBox, cropBoxPtr, true);
                Marshal.StructureToPtr ((object)rotation, rotationPtr, true);
                Marshal.StructureToPtr ((object)bounds, boundsPtr, true);

                resultPtr = PSPDFConvertPDFRectToViewRect (viewRectPtr, cropBoxPtr, rotationPtr, boundsPtr);
                result = (CGRect)Marshal.PtrToStructure (resultPtr, typeof (CGRect));
            }
            finally {
                Marshal.FreeHGlobal (viewRectPtr);
                Marshal.FreeHGlobal (cropBoxPtr);
                Marshal.FreeHGlobal (rotationPtr);
                Marshal.FreeHGlobal (boundsPtr);
            }
            return result;
        }