summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/Bugly/XBuglyMgr.cs
blob: 0a90ac8db47e977edc7afb2d759daf94a0f535b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55


using UnityEngine;
using XUtliPoolLib;
using System.Collections;
using System;
using System.Text;
#if !DISABLE_JOYSDK
using Assets.SDK;
#endif


public class XBuglyMgr : MonoBehaviour, IXBuglyMgr
{
	#if !DISABLE_JOYSDK
    private JoyYouSDK _interface;
	#endif
    void Awake()
    {
		#if !DISABLE_JOYSDK
        _interface = new JoyYouSDK();
		#endif

#if BUGLY
        BuglyAgent.ConfigDebugMode(false);
        switch (Application.platform)
        {
            case RuntimePlatform.IPhonePlayer:
                BuglyAgent.InitWithAppId("i1105309683");
                break;
            case RuntimePlatform.Android:
                BuglyAgent.InitWithAppId("1105309683");
                break;
        }
        BuglyAgent.EnableExceptionHandler();
#endif
    }

    public void ReportCrashToBugly(string serverid, string rolename, uint rolelevel, int roleprof, string openid, string version, string realtime, string scenename, string sceneid, string content)
    {
#if BUGLY
        //((IHuanlePlatform)_interface).SendGameExtData("BuglyReport", token.ToString());
        BuglyAgent.ReportException("Exception", string.Format("ServerID: {0}  RoleName: {1}  RoleLevel: {2}  RoleProf: {3}  OpenID: {4}  Version: {5}  RealTime:  {6}  SceneName:  {7}({8})",
            serverid, rolename, rolelevel, roleprof, openid, version, realtime, scenename, sceneid), content);
#endif
    }

    public bool Deprecated
    {
        get;
        set;
    }
}