示例#1
0
 static public int SetUserId_s(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         System.String a1;
         checkType(l, 1, out a1);
         BuglyAgent.SetUserId(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
示例#2
0
        /// <summary>
        /// Configs the default.
        /// </summary>
        /// <param name="channel">Channel.</param>
        /// <param name="version">Version.</param>
        /// <param name="user">User.</param>
        /// <param name="delay">Delay.</param>
        //void ConfigDefault(string channel, string version, string user, long delay)
        //{
        //    BuglyAgent.ConfigDefault(channel, version, user, delay);
        //}

        /// <summary>
        /// Sets the user identifier.
        /// </summary>
        /// <param name="userId">User identifier.</param>
        public void SetUserId(string userid)
        {
            if (!isRuntime)
            {
                return;
            }
            BuglyAgent.SetUserId(userid);
        }
        private void buglySetup()
        {
            string account = mLocalChildInfoAgent.getChildSN();

            if (!string.IsNullOrEmpty(account))
            {
                BuglyAgent.SetUserId(account);
            }
        }
示例#4
0
        private void InitBugly()
        {
            // 开启SDK的日志打印,发布版本请务必关闭
            BuglyAgent.ConfigDebugMode(Debug.isDebugBuild);
            BuglyAgent.InitWithAppId(GameApp.Options.BuglyAppID);
            BuglyAgent.SetScene(Application.loadedLevel);
            BuglyAgent.SetUserId(Application.companyName + "." + Application.productName);

            if (GameApp.Options.EnableLog2File)
            {
                BuglyAgent.RegisterLogCallback(Application_logMessageReceived);
                RemoteOldFile();
            }
        }
示例#5
0
        public void OnLogin()
        {
            PlayerVo vo = GlobalData.PlayerModel.PlayerVo;
            Dictionary <string, string> dict = new Dictionary <string, string>();

            dict.Add("roleId", vo.UserId.ToString());
            dict.Add("roleName", vo.UserName);
            dict.Add("zoneId", AppConfig.Instance.serverId);
            dict.Add("zoneName", AppConfig.Instance.serverName);

            GalaSDKBaseFunction.Trace(GalaSDKBaseFunction.GalaTraceSDKType.ALL,
                                      GalaSDKBaseFunction.GalaTraceType.OnLogin, dict);

            BuglyAgent.SetUserId(vo.UserId + "_" + GlobalData.PlayerModel.PlayerVo.UserName);
        }
示例#6
0
        static int _m_SetUserId_xlua_st_(RealStatePtr L)
        {
            try {
                {
                    string _userId = LuaAPI.lua_tostring(L, 1);

                    BuglyAgent.SetUserId(_userId);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
示例#7
0
 public static object loginByEmail()
 {
     return(new ThunkAction <AppState>((dispatcher, getState) => {
         var email = getState().loginState.email;
         var password = getState().loginState.password;
         return LoginApi.LoginByEmail(email: email, password: password)
         .Then(loginInfo => {
             var user = new User {
                 id = loginInfo.userId,
                 fullName = loginInfo.userFullName,
                 avatar = loginInfo.userAvatar,
                 title = loginInfo.title,
                 coverImage = loginInfo.coverImageWithCDN
             };
             var dict = new Dictionary <string, User> {
                 { user.id, user }
             };
             dispatcher.dispatch(new UserMapAction {
                 userMap = dict
             });
             dispatcher.dispatch(new LoginByEmailSuccessAction {
                 loginInfo = loginInfo
             });
             dispatcher.dispatch(fetchChannels(1));
             dispatcher.dispatch(fetchCreateChannelFilter());
             dispatcher.dispatch <IPromise>(fetchUserProfile(loginInfo.userId));
             dispatcher.dispatch(new CleanEmailAndPasswordAction());
             UserInfoManager.saveUserInfo(loginInfo);
             AnalyticsManager.LoginEvent("email");
             AnalyticsManager.AnalyticsLogin("email", loginInfo.userId);
             JPushPlugin.setJPushAlias(loginInfo.userId);
             BuglyAgent.SetUserId(loginInfo.userId);
             EventBus.publish(sName: EventBusConstant.login_success, new List <object> {
                 loginInfo.userId
             });
             dispatcher.dispatch(new MainNavigatorPopAction());
         })
         .Catch(error => {
             dispatcher.dispatch(new LoginByEmailFailureAction());
             Debuger.LogError(message: error);
             var customSnackBar = new CustomSnackBar(
                 "登录失败,请重试。"
                 );
             customSnackBar.show();
         });
     }));
 }
示例#8
0
 public void SetUserId(string userId)
 {
     BuglyAgent.SetUserId(userId);
 }
示例#9
0
 public void BuglySetUserId(string uid)
 {
     BuglyAgent.SetUserId(uid);
 }
示例#10
0
    IEnumerator InitVersionAndBugly()
    {
        sr.AdjustResolution();
        sr.setDesignContentScale();
        //Util.AutoAdjustCameraRect(UICamera.mainCamera);
        Debug.Log(string.Format("Resolution: {0}", Screen.currentResolution));
        yield return(Yielders.GetWaitForSeconds(0.1f));

        string versionFile = string.Format("{0}{1}/version.txt", Util.AppContentPath(), LuaConst.osDir);

        Debug.Log(versionFile);
        string version = string.Empty;

        if (Application.isMobilePlatform && Application.platform == RuntimePlatform.Android)
        {
            WWW www = new WWW(versionFile);
            yield return(www);

            if (www.error != null)
            {
                Debug.LogError(www.error);
                version = Application.version;
            }
            else
            {
                version = www.text;
            }
            www.Dispose();
            Debug.Log(string.Format("package version: {0}", version));
        }
        else
        {
            if (File.Exists(versionFile))
            {
                version = File.ReadAllText(versionFile);
            }
            else
            {
                version = Application.version;
            }
        }
        GameManager.packVersion = GameVersion.CreateVersion(version);
        string localVersionFile = Path.Combine(Util.DataPath, "version.txt");

        GameManager.localVersion = GameVersion.CreateVersion(localVersionFile, GameManager.packVersion.ToString());

#if UNITY_EDITOR
        //BuglyAgent.ConfigDebugMode(true);
#else
        //BuglyAgent.ConfigDebugMode(false);
#endif
#if UNITY_IOS
        BuglyAgent.InitWithAppId("1ce5a132bc");
#elif UNITY_ANDROID
        //BuglyAgent.InitWithAppId("529dceaf06");
#endif
        BuglyAgent.SetUserId(string.Format("{0}:{1}", SystemInfo.deviceModel, SystemInfo.deviceName));
        BuglyAgent.ConfigAutoReportLogLevel(LogSeverity.LogAssert);
        BuglyAgent.EnableExceptionHandler();

        InitOtherSetting();
        yield return(Yielders.GetWaitForSeconds(2f));

        SceneManager.LoadScene("UpdateScene");
    }
示例#11
0
    void OnGUI()
    {
        GUI.skin = defaultSkin;
        float scale = 1.0f;

        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            scale = Screen.width / 360;
        }
        //GUI.skin.button.fontSize = Convert.ToInt32(16 * scale);

        GUILayout.BeginArea(new Rect(0, 0, Screen.width, Screen.height));

//      GUILayout.BeginArea (new Rect((Screen.width - 280) / 2,(Screen.height - 320) / 2, 280, 320));
        GUILayout.FlexibleSpace();

        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();

        GUILayout.BeginVertical();

        // set the user
        GUILayout.BeginHorizontal();
        GUILayout.Label("User ID :", GUILayout.MinHeight(28 * scale), GUILayout.Width(80 * scale));
        TextUserId = GUILayout.TextField(TextUserId, GUILayout.MinHeight(28 * scale), GUILayout.MinWidth(160 * scale));
        GUILayout.EndHorizontal();

        GUILayout.Space(5 * scale);
        // set the channel
        GUILayout.BeginHorizontal();
        GUILayout.Label("Channel ID :", GUILayout.MinHeight(28 * scale), GUILayout.Width(80 * scale));
        TextChannelId = GUILayout.TextField(TextChannelId, GUILayout.MinHeight(28 * scale), GUILayout.MinWidth(160 * scale));
        GUILayout.EndHorizontal();

        GUILayout.Space(20 * scale);
        GUILayout.BeginHorizontal();
        LogEnable = GUILayout.Toggle(LogEnable, "Log Trigger", GUILayout.MinHeight(28 * scale), GUILayout.Width(80 * scale));
//      GUILayout.Space (10);
        if (GUILayout.Button("Login", GUILayout.MinHeight(28 * scale), GUILayout.MinWidth(160 * scale)))
        {
            if (string.IsNullOrEmpty(TextUserId) || "Input user id".Equals(TextUserId))
            {
                TextTips = "Please input the user id !";
                return;
            }

            TextTips = "";

            if (string.IsNullOrEmpty(TextChannelId) || "Input channel name".Equals(TextChannelId))
            {
                TextChannelId = "channel_bugly_test";
            }

            BuglyAgent.SetUserId(TextUserId);

            Debug.Log("Login with user");

            Application.LoadLevel(Application.loadedLevel + 1);
        }

        GUILayout.EndHorizontal();

        GUILayout.Label(TextTips, GUILayout.MinHeight(48 * scale));
        GUILayout.EndVertical();

        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();

        GUILayout.FlexibleSpace();
//      GUILayout.EndArea ();

        GUILayout.EndArea();
    }
示例#12
0
 public void SetUserId(string id)
 {
     BuglyAgent.SetUserId(id);
 }