Esempio n. 1
0
        protected void OnCheckAuthExistsResponse(string error_code, SnipeObject data)
        {
            if (!string.IsNullOrEmpty(error_code))
            {
                AccountExists = (error_code == SnipeErrorCodes.OK);
            }

            bool is_me = data.SafeGetValue("isSame", false);

            if (AccountExists == true && is_me)
            {
                IsBindDone = true;
            }

            if (mCheckAuthExistsCallback != null)
            {
                mCheckAuthExistsCallback.Invoke(this, AccountExists == true, is_me, data.SafeGetString("name"));
                mCheckAuthExistsCallback = null;
            }

            if (AccountExists.HasValue)
            {
                if (AccountExists == false)
                {
                    RequestBind();
                }
                else if (!is_me)
                {
                    DebugLogger.Log($"[BindProvider] ({ProviderId}) OnCheckAuthExistsResponse - another account found - InvokeAccountBindingCollisionEvent");
                    SnipeCommunicator.Instance.Auth.InvokeAccountBindingCollisionEvent(this, data.SafeGetString("name"));
                }
            }
        }
    public override bool CheckAuthExists(CheckAuthExistsCallback callback = null)
    {
        void advertising_id_callback(string advertising_id, bool tracking_enabled, string error)
        {
            DebugLogger.Log($"[AdvertisingIdAuthProvider] CheckAuthExists - advertising_id : {advertising_id} , error : {error}");

            AdvertisingId = advertising_id;

            if (CheckAdvertisingId(advertising_id))
            {
                CheckAuthExists(AdvertisingId, callback);
            }
            else
            {
                DebugLogger.Log("[AdvertisingIdAuthProvider] CheckAuthExists - advertising_id is invalid");

                if (callback != null)
                {
                    callback.Invoke(this, false, false);
                }
            }
        }

        return(Application.RequestAdvertisingIdentifierAsync(advertising_id_callback));
    }
Esempio n. 3
0
    public override bool CheckAuthExists(CheckAuthExistsCallback callback = null)
    {
        if (SystemInfo.unsupportedIdentifier != SystemInfo.deviceUniqueIdentifier)
        {
            CheckAuthExists(GetUserId(), callback);
            return(true);
        }

        return(false);
    }
    public override bool CheckAuthExists(CheckAuthExistsCallback callback = null)
    {
        if (FB.IsLoggedIn && AccessToken.CurrentAccessToken != null)
        {
            CheckAuthExists(GetUserId(), callback);
            return(true);
        }

        return(false);
    }
Esempio n. 5
0
    public override bool CheckAuthExists(CheckAuthExistsCallback callback = null)
    {
        if (!AppleGameCenterProvider.InstanceInitialized)
        {
            return(false);
        }

        CheckAuthExists(GetUserId(), callback);
        return(true);
    }
        protected virtual void CheckAuthExists(string user_id, CheckAuthExistsCallback callback)
        {
            mCheckAuthExistsCallback = callback;

            Debug.Log($"[BindProvider] ({ProviderId}) CheckAuthExists {user_id}");

            ExpandoObject data = new ExpandoObject();

            data["messageType"] = REQUEST_USER_EXISTS;
            data["provider"]    = ProviderId;
            data["login"]       = user_id;

            string login_id = PlayerPrefs.GetString(SnipePrefs.LOGIN_USER_ID);

            if (!string.IsNullOrEmpty(login_id))
            {
                data["id"] = Convert.ToInt32(login_id);
            }

            SingleRequestClient.Request(SnipeConfig.Instance.auth, data, OnCheckAuthExistsResponse);
        }
Esempio n. 7
0
        protected virtual void CheckAuthExists(string user_id, CheckAuthExistsCallback callback)
        {
            mCheckAuthExistsCallback = callback;

            DebugLogger.Log($"[BindProvider] ({ProviderId}) CheckAuthExists {user_id}");

            SnipeObject data = new SnipeObject()
            {
                ["ckey"]     = SnipeConfig.Instance.ClientKey,
                ["provider"] = ProviderId,
                ["login"]    = user_id,
            };

            int login_id = SnipeCommunicator.Instance.Auth.UserID;

            if (login_id != 0)
            {
                data["userID"] = login_id;
            }

            SnipeCommunicator.Instance.CreateRequest(SnipeMessageTypes.AUTH_USER_EXISTS)?.RequestAuth(data, OnCheckAuthExistsResponse);
        }
    public override bool CheckAuthExists(CheckAuthExistsCallback callback = null)
    {
        void advertising_id_callback(string advertising_id, bool tracking_enabled, string error)
        {
            Debug.Log($"[AdvertisingIdAuthProvider] CheckAuthExists - advertising_id : {advertising_id} , error : {error}");

            AdvertisingId = advertising_id;

            if (CheckAdvertisingId(advertising_id))
            {
                CheckAuthExists(AdvertisingId, callback);
            }
            else
            {
                Debug.Log("[AdvertisingIdAuthProvider] CheckAuthExists - advertising_id is invalid");

                if (callback != null)
                {
                    callback.Invoke(this, false, false);
                }
            }
        }

        if (!Application.RequestAdvertisingIdentifierAsync(advertising_id_callback))
        {
            if (DeviceIdFallbackEnabled && SystemInfo.unsupportedIdentifier != SystemInfo.deviceUniqueIdentifier)
            {
                advertising_id_callback(SystemInfo.deviceUniqueIdentifier, false, "");
                return(true);
            }

            return(false);
        }

        return(true);
    }
Esempio n. 9
0
 public virtual bool CheckAuthExists(CheckAuthExistsCallback callback = null)
 {
     // Override this method.
     return(false);
 }