Example #1
0
 static CallbackHandler()
 {
     xformCallback            = new SetXformCallback(motionStateCallback);
     contactStartedCallback   = new ContactCallback(contactStartedCallbackFunc);
     contactEndedCallback     = new ContactCallback(contactEndedCallbackFunc);
     contactContinuesCallback = new ContactCallback(contactContinuesCallbackFunc);
 }
Example #2
0
 public void SetContactCallbackListener(Action <string,string>onGetContactComplete,Action onGetContactFail)
 {
     #if UNITY_ANDROID
     if(Application.platform == RuntimePlatform.Android){
         ContactCallback contactCallback = new ContactCallback();
         contactCallback.onGetContactComplete = onGetContactComplete;
         contactCallback.onGetContactFail = onGetContactFail;
         jo.CallStatic("setContactCallbackListener",contactCallback);
     }else{
         AUP.Utils.Message(TAG,"warning: must run in actual android device");
     }
     #endif
 }
Example #3
0
 public void SetContactCallbackListener(Action <string, string> onGetContactComplete, Action onGetContactFail)
 {
             #if UNITY_ANDROID
     if (Application.platform == RuntimePlatform.Android)
     {
         ContactCallback contactCallback = new ContactCallback();
         contactCallback.onGetContactComplete = onGetContactComplete;
         contactCallback.onGetContactFail     = onGetContactFail;
         jo.CallStatic("setContactCallbackListener", contactCallback);
     }
     else
     {
         AUP.Utils.Message(TAG, "warning: must run in actual android device");
     }
             #endif
 }
Example #4
0
        /// <summary>
        /// Sip account contact.
        /// </summary>
        /// <param name="account">The Sip account.</param>
        /// <param name="contactConnection">The Sip contact connection configuration.</param>
        public Contact(Account account, ContactConnection contactConnection)
        {
            if (account == null)
            {
                throw new ArgumentNullException(nameof(account));
            }
            if (contactConnection == null)
            {
                throw new ArgumentNullException(nameof(contactConnection));
            }

            _account           = account;
            _contactConnection = contactConnection;
            _pjContact         = new ContactCallback(account.PjAccount);

            // Add this contact.
            _contactUri = contactConnection.Uri;
            _account.Contacts.Add(this);
        }
Example #5
0
        /// <summary>
        /// Dispose(bool disposing) executes in two distinct scenarios.
        /// If disposing equals true, the method has been called directly
        /// or indirectly by a user's code. Managed and unmanaged resources
        /// can be disposed.
        /// If disposing equals false, the method has been called by the
        /// runtime from inside the finalizer and you should not reference
        /// other objects. Only unmanaged resources can be disposed.
        /// </summary>
        protected virtual void Dispose(bool disposing)
        {
            // Check to see if Dispose has already been called.
            if (!this._disposed)
            {
                // Note disposing has been done.
                _disposed = true;

                // If disposing equals true, dispose all managed
                // and unmanaged resources.
                if (disposing)
                {
                    if (_pjContact != null)
                    {
                        _pjContact.Dispose();
                    }
                }

                // Call the appropriate methods to clean up
                // unmanaged resources here.
                _pjContact = null;
            }
        }
Example #6
0
        public void ParseContact(string jsontext, ContactCallback mcb, ErrorCallback ecb)
        {
            bool success = true;

            var json = Json.JsonDecode(jsontext, ref success);

            if (success && json is Dictionary<string, object>) {
                var data = json as Dictionary<string, object>;

                var contact = new Contact();

                contact.Email = data["jid"] as string;
                if (data.ContainsKey("name")) contact.Name = data["name"] as string;
                if (data.ContainsKey("photo")) contact.PhotoHash = data["photo"] as string;

                var sessions = data["sessions"] as Dictionary<string, object>;

                if (sessions != null) {
                    foreach (var element in sessions) {
                        var session = new ContactSession {
                            JID = element.Key
                        };

                        var s = element.Value as Dictionary<string, object>;

                        if (s != null) {
                            if (s.ContainsKey("show")) session.Show = s["show"] as string;
                            if (s.ContainsKey("status")) session.Status = s["status"] as string;
                            if (s.ContainsKey("caps")) {
                                var caps = s["caps"] as List<object>;
                                if(caps != null) {
                                    foreach(var o in caps) {
                                        session.Capabilities.Add(o.ToString());
                                    }
                                }
                            }

                            contact.AddSession(session);
                        }
                    }
                }

                mcb(contact);
            } else {
                ecb("Invalid JSON");
            }
        }
Example #7
0
 public ContactReportPair(Actor a, Actor b, ContactCallback callback)
 {
     this.ActorA   = a;
     this.ActorB   = b;
     this.Callback = callback;
 }
Example #8
0
		public ContactReportPair(Actor a, Actor b, ContactCallback callback)
		{
			this.ActorA = a;
			this.ActorB = b;
			this.Callback = callback;
		}
Example #9
0
 public static extern void add_contact_listener(
     IntPtr body,
     ContactCallback cc,
     CollisionStarted cs,
     CollisionEnded ce);
Example #10
0
        public void ParseContact(string cipher, bool ciphered, ContactCallback mcb, ErrorCallback ecb)
        {
            bool success = true;

            var json = Json.JsonDecode(ciphered ? aes.Decipher(cipher) : cipher, ref success);

            if (success && json is Dictionary <string, object> )
            {
                var data = json as Dictionary <string, object>;

                var contact = new Contact();

                contact.Email = data["jid"] as string;
                if (data.ContainsKey("name"))
                {
                    contact.Name = data["name"] as string;
                }
                if (data.ContainsKey("photo"))
                {
                    contact.PhotoHash = data["photo"] as string;
                }

                var sessions = data["sessions"] as Dictionary <string, object>;

                if (sessions != null)
                {
                    foreach (var element in sessions)
                    {
                        var session = new ContactSession {
                            JID = element.Key
                        };

                        var s = element.Value as Dictionary <string, object>;

                        if (s != null)
                        {
                            if (s.ContainsKey("show"))
                            {
                                session.Show = s["show"] as string;
                            }
                            if (s.ContainsKey("status"))
                            {
                                session.Status = s["status"] as string;
                            }
                            if (s.ContainsKey("caps"))
                            {
                                var caps = s["caps"] as List <object>;
                                if (caps != null)
                                {
                                    foreach (var o in caps)
                                    {
                                        session.Capabilities.Add(o.ToString());
                                    }
                                }
                            }

                            contact.AddSession(session);
                        }
                    }
                }

                mcb(contact);
            }
            else
            {
                ecb("Invalid JSON");
            }
        }
Example #11
0
        private static extern IntPtr MotionState_Create(SetXformCallback xformCallback, ContactCallback contactStartedCallback, ContactCallback contactEndedCallback, ContactCallback contactContinuesCallback, float maxContactDistance, ref Vector3 initialTrans, ref Quaternion initialRot
#if FULL_AOT_COMPILE
                                                        , IntPtr instanceHandle
#endif
                                                        );