Esempio n. 1
0
 public bool RemoveOnChangedStatusListener(GamebaseCallback.DataDelegate <GamebaseNetworkType> stateDelegate)
 {
     networkStateDelegate -= stateDelegate;
     if (networkStateDelegate == null)
     {
         network.RemoveOnChangedStatusListener();
         GamebaseCallbackHandler.UnregisterCallback(networkStateHandle);
         networkStateHandle = 0;
     }
     return(true);
 }
 public bool RemoveUpdateStatusListener(GamebaseCallback.DataDelegate <GamebaseResponse.Launching.LaunchingStatus> statusDelegate)
 {
     launchingStatusDelegate -= statusDelegate;
     if (launchingStatusDelegate == null)
     {
         launching.RemoveUpdateStatusListener(launchingStatusHandle);
         GamebaseCallbackHandler.UnregisterCallback(launchingStatusHandle);
         launchingStatusHandle = 0;
     }
     return(true);
 }
Esempio n. 3
0
 public bool AddOnChangedStatusListener(GamebaseCallback.DataDelegate <GamebaseNetworkType> stateDelegate)
 {
     if (networkStateDelegate == null)
     {
         networkStateHandle = GamebaseCallbackHandler.RegisterCallback(new GamebaseCallback.DataDelegate <GamebaseNetworkType>(OnChangedStatus));
         if (!network.AddOnChangedStatusListener(networkStateHandle))
         {
             GamebaseCallbackHandler.UnregisterCallback(networkStateHandle);
             return(false);
         }
     }
     networkStateDelegate += stateDelegate;
     return(true);
 }
        public bool AddUpdateStatusListener(GamebaseCallback.DataDelegate <GamebaseResponse.Launching.LaunchingStatus> statusDelegate)
        {
            if (launchingStatusDelegate == null)
            {
                launchingStatusHandle = GamebaseCallbackHandler.RegisterCallback(new GamebaseCallback.DataDelegate <GamebaseResponse.Launching.LaunchingStatus>(OnLaunchingStatus));

                if (!launching.AddUpdateStatusListener(launchingStatusHandle))
                {
                    GamebaseCallbackHandler.UnregisterCallback(launchingStatusHandle);
                    return(false);
                }
            }
            launchingStatusDelegate += statusDelegate;
            return(true);
        }
        public void ShowWebView(string url, GamebaseRequest.Webview.GamebaseWebViewConfiguration configuration = null, GamebaseCallback.ErrorDelegate closeCallback = null, List <string> schemeList = null, GamebaseCallback.GamebaseDelegate <string> schemeEvent = null)
        {
            int closeCallbackHandle = -1;
            int schemeEventHandle   = -1;

            if (null != closeCallback)
            {
                closeCallbackHandle = GamebaseCallbackHandler.RegisterCallback(closeCallback);
            }

            if (null != schemeEvent)
            {
                schemeEventHandle = GamebaseCallbackHandler.RegisterCallback(schemeEvent);
            }

            webview.ShowWebView(url, configuration, closeCallbackHandle, schemeList, schemeEventHandle);
        }
        public void Initialize(GamebaseRequest.GamebaseConfiguration configuration, GamebaseCallback.GamebaseDelegate <GamebaseResponse.Launching.LaunchingInfo> callback)
        {
            var sb = new StringBuilder();

            sb.AppendLine(string.Format("Gamebase VERSION:{0}", GamebaseUnitySDK.SDKVersion));
            sb.AppendLine(string.Format("Gamebase Configuration:{0}", JsonMapper.ToJson(configuration)));
            GamebaseLog.Debug(string.Format("{0}", sb), this, "Initialize");

            if (true == string.IsNullOrEmpty(GamebaseUnitySDK.ObjectName))
            {
                GamebaseLog.Error(GamebaseStrings.NOT_FOUND_GAMEOBJECT, this, "Initialize");
                return;
            }

            InitializeUnitySDK();
            SetGamebaseConfiguration(configuration);

            GamebaseCallback.GamebaseDelegate <GamebaseResponse.Launching.LaunchingInfo> initializeCallback = (launchingInfo, error) =>
            {
                GamebaseWaterMark.ShowWaterMark();

                IndicatorReport.Instance.SendIndicator(
                    IndicatorReport.Level.DEBUG,
                    IndicatorReport.FieldName.UNITY_EDITOR_VERSION,
                    new Dictionary <string, string> {
                    { IndicatorReport.SEND_DATA_KEY_UNITY_EDITOR_VERSION, Application.unityVersion }
                }
                    );

                callback(launchingInfo, error);
            };

            int handle = GamebaseCallbackHandler.RegisterCallback(initializeCallback);

            sdk.Initialize(configuration, handle);
        }
 private GamebaseObserverManager()
 {
     Handle = GamebaseCallbackHandler.RegisterCallback(new GamebaseCallback.DataDelegate <GamebaseResponse.SDK.ObserverMessage>(OnObserverEvent));
 }
        public void QueryPush(GamebaseCallback.GamebaseDelegate <GamebaseResponse.Push.PushConfiguration> callback)
        {
            int handle = GamebaseCallbackHandler.RegisterCallback(callback);

            push.QueryPush(handle);
        }
        public void Withdraw(GamebaseCallback.ErrorDelegate callback)
        {
            int handle = GamebaseCallbackHandler.RegisterCallback(callback);

            auth.Withdraw(handle);
        }
        public void ShowAlert(Dictionary <string, string> parameters, GamebaseUtilAlertType alertType, GamebaseCallback.DataDelegate <GamebaseUtilAlertButtonID> buttonCallback)
        {
            int handle = GamebaseCallbackHandler.RegisterCallback(buttonCallback);

            util.ShowAlert(parameters, alertType, handle);
        }
        public void ShowAlert(string title, string message, GamebaseCallback.VoidDelegate buttonCallback)
        {
            int handle = GamebaseCallbackHandler.RegisterCallback(buttonCallback);

            util.ShowAlert(title, message, handle);
        }
        public void IssueTransferKey(long expiresIn, GamebaseCallback.GamebaseDelegate <GamebaseResponse.Auth.TransferKeyInfo> callback)
        {
            int handle = GamebaseCallbackHandler.RegisterCallback(callback);

            auth.IssueTransferKey(expiresIn, handle);
        }
        public void LoginForLastLoggedInProvider(GamebaseCallback.GamebaseDelegate <GamebaseResponse.Auth.AuthToken> callback)
        {
            int handle = GamebaseCallbackHandler.RegisterCallback(callback);

            auth.LoginForLastLoggedInProvider(handle);
        }
        public void RequestRetryTransaction(GamebaseCallback.GamebaseDelegate <GamebaseResponse.Purchase.PurchasableRetryTransactionResult> callback)
        {
            int handle = GamebaseCallbackHandler.RegisterCallback(callback);

            purchase.RequestRetryTransaction(handle);
        }
        public void RequestPurchase(long itemSeq, GamebaseCallback.GamebaseDelegate <GamebaseResponse.Purchase.PurchasableReceipt> callback)
        {
            int handle = GamebaseCallbackHandler.RegisterCallback(callback);

            purchase.RequestPurchase(itemSeq, handle);
        }
        public void RemoveMapping(string providerName, GamebaseCallback.ErrorDelegate callback)
        {
            int handle = GamebaseCallbackHandler.RegisterCallback(callback);

            auth.RemoveMapping(providerName, handle);
        }
        public void AddMapping(Dictionary <string, object> credentialInfo, GamebaseCallback.GamebaseDelegate <GamebaseResponse.Auth.AuthToken> callback)
        {
            int handle = GamebaseCallbackHandler.RegisterCallback(callback);

            auth.AddMapping(credentialInfo, handle);
        }
        public void AddMapping(string providerName, Dictionary <string, object> additionalInfo, GamebaseCallback.GamebaseDelegate <GamebaseResponse.Auth.AuthToken> callback)
        {
            int handle = GamebaseCallbackHandler.RegisterCallback(callback);

            auth.AddMapping(providerName, additionalInfo, handle);
        }
        public void AddMapping(string providerName, GamebaseCallback.GamebaseDelegate <GamebaseResponse.Auth.AuthToken> callback)
        {
            int handle = GamebaseCallbackHandler.RegisterCallback(callback);

            auth.AddMapping(providerName, handle);
        }
        public void RegisterPush(GamebaseRequest.Push.PushConfiguration pushConfiguration, GamebaseCallback.ErrorDelegate callback)
        {
            int handle = GamebaseCallbackHandler.RegisterCallback(callback);

            push.RegisterPush(pushConfiguration, handle);
        }
        public void Logout(GamebaseCallback.ErrorDelegate callback)
        {
            int handle = GamebaseCallbackHandler.RegisterCallback(callback);

            auth.Logout(handle);
        }
        public void RequestTransfer(string transferKey, GamebaseCallback.GamebaseDelegate <GamebaseResponse.Auth.AuthToken> callback)
        {
            int handle = GamebaseCallbackHandler.RegisterCallback(callback);

            auth.RequestTransfer(transferKey, handle);
        }
        public void RequestItemListOfNotConsumed(GamebaseCallback.GamebaseDelegate <List <GamebaseResponse.Purchase.PurchasableReceipt> > callback)
        {
            int handle = GamebaseCallbackHandler.RegisterCallback(callback);

            purchase.RequestItemListOfNotConsumed(handle);
        }
Esempio n. 24
0
        public void IsConnected(GamebaseCallback.DataDelegate <bool> callback)
        {
            int handle = GamebaseCallbackHandler.RegisterCallback(callback);

            network.IsConnected(handle);
        }
        public void RequestItemListAtIAPConsole(GamebaseCallback.GamebaseDelegate <List <GamebaseResponse.Purchase.PurchasableItem> > callback)
        {
            int handle = GamebaseCallbackHandler.RegisterCallback(callback);

            purchase.RequestItemListAtIAPConsole(handle);
        }
Esempio n. 26
0
 private GamebaseServerPushEventManager()
 {
     Handle = GamebaseCallbackHandler.RegisterCallback(new GamebaseCallback.DataDelegate <GamebaseResponse.SDK.ServerPushMessage>(OnServerPushEvent));
 }