Пример #1
0
        public void AddBasicData(Dictionary <string, string> data)
        {
            if (data == null)
            {
                return;
            }

            GamebaseLog.Debug(
                string.Format(
                    "Data : {0}",
                    GamebaseJsonUtil.ToPrettyJsonString(data)),
                this);
            MergeDictionary(ref basicDataDic, data);
        }
Пример #2
0
        public void GetIDPCredentialInfo(string providerName, GamebaseCallback.GamebaseDelegate <Dictionary <string, object> > callback)
        {
            Dictionary <string, object> credentialInfo = null;

            IDPLogin((adapterError) =>
            {
                if (Gamebase.IsSuccess(adapterError))
                {
                    credentialInfo = new Dictionary <string, object>();
                    credentialInfo.Add(GamebaseAuthProviderCredential.PROVIDER_NAME, providerName);
                    credentialInfo.Add(GamebaseAuthProviderCredential.ACCESS_TOKEN, GetIDPAccessToken(providerName));
                }
                else
                {
                    GamebaseLog.Debug(string.Format("error:{0}", GamebaseJsonUtil.ToPrettyJsonString(adapterError)), this);
                }

                callback(credentialInfo, adapterError);
            });
        }
        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}", GamebaseJsonUtil.ToPrettyJsonString(configuration)));
            GamebaseLog.Debug(string.Format("{0}", sb), this);

            InitializeUnitySDK();

            configuration.zoneType = GetVerifiedZoneType(configuration.zoneType);

            SetGamebaseConfiguration(configuration);

            GamebaseCallback.GamebaseDelegate <GamebaseResponse.Launching.LaunchingInfo> initializeCallback = (launchingInfo, error) =>
            {
                if ((error == null || error.code == GamebaseErrorCode.SUCCESS))
                {
                    GamebaseDebugSettings.Instance.SetRemoteSettings(launchingInfo);

                    GamebaseWaterMark.ShowWaterMark();
                }

                GamebaseLogReport.Instance.AddBasicData(new Dictionary <string, string>()
                {
                    { GamebaseLogReport.BASIC_DATA_KEY_APP_ID, GamebaseUnitySDK.AppID }
                });

                SendUnityEditorInfomation();

                callback(launchingInfo, error);
            };

            int handle = GamebaseCallbackHandler.RegisterCallback(initializeCallback);

            sdk.Initialize(configuration, handle);
        }
        public void Initialize(GamebaseRequest.Logger.Configuration loggerConfiguration)
        {
            GamebaseLog.Debug("Initialize", this);

            ToastLoggerConfiguration configuration = new ToastLoggerConfiguration();

            configuration.AppKey = loggerConfiguration.appKey;
            configuration.EnableCrashErrorLog = loggerConfiguration.enableCrashErrorLog;
            configuration.EnableCrashReporter = loggerConfiguration.enableCrashReporter;

            switch (loggerConfiguration.serviceZone.ToLower())
            {
            case "alpha":
            {
                configuration.ServiceZone = ToastServiceZone.ALPHA;
                break;
            }

            case "beta":
            {
                configuration.ServiceZone = ToastServiceZone.BETA;
                break;
            }

            case "real":
            default:
            {
                configuration.ServiceZone = ToastServiceZone.REAL;
                break;
            }
            }

            GamebaseLog.Debug(GamebaseJsonUtil.ToPrettyJsonString(configuration), typeof(UnityLoggerControlle));

            ToastLogger.Initialize(configuration);
        }