client_Hale
2018-10-12 1a9012be7aff5b5cf1d03795fcfa1740c6a6f9cf
Project/mr_sdk/src/game_mrgame/java/com/secondworld/univeralsdk/H2EngineSDK.java
@@ -33,6 +33,8 @@
    private static final String TAG = "H2EngineSDK";
    private static String APP_ID = "";
    private static boolean PushEnable = true;
    public static void HandleUnityMessage(String json)
    {
        LogUtil.i(TAG, "收到Unity发来的信息: " + json);
@@ -100,7 +102,8 @@
                    MrPlatformUtil.getInstance().pay(_activity,
                                                     _json.getString("cpInfo"),
                                                     _json.getString("roleID"),
                                                     _json.getString("roleName").trim().replace(" ",""),
                                                     _json.getString("roleName").trim().replace(" ",
                                                                                                ""),
                                                     _json.getString("level"),
                                                     _extraData.toString(),
                                                     _json.getString("sid"),
@@ -116,7 +119,9 @@
                    MrPlatformUtil.getInstance().createRole(_activity,
                                                            _json.getString("roleID"),
                                                            _json.getString("sid"),
                                                            _json.getString("roleName").trim().replace(" ",""),
                                                            _json.getString(
                                                                    "roleName").trim().replace(" ",
                                                                                               ""),
                                                            "1",
                                                            "0");
                    break;
@@ -124,7 +129,9 @@
                    MrPlatformUtil.getInstance().enterWorld(_activity,
                                                            _json.getString("roleID"),
                                                            _json.getString("sid"),
                                                            _json.getString("roleName").trim().replace(" ",""),
                                                            _json.getString(
                                                                    "roleName").trim().replace(" ",
                                                                                               ""),
                                                            _json.getString("level"),
                                                            _json.getString("vipLevel"));
                    break;
@@ -152,6 +159,8 @@
    public static void addLocalNotification(Activity activity, int id, String title, String content,
                                            long fireTime)
    {
        if (PushEnable)
        {
        try
        {
            JPushLocalNotification ln = new JPushLocalNotification();
@@ -167,10 +176,14 @@
            e.printStackTrace();
        }
    }
    }
    public static void removeNotification(Activity activity, int id)
    {
        if (PushEnable)
        {
        JPushInterface.removeLocalNotification(activity, id);
        }
    }
    public static void GetExternalStorage()
@@ -282,6 +295,8 @@
            return;
        }
        PushEnable = activity.getPackageName().equals("com.ziyouyouxi08.snxxz");
        new Thread(new Runnable()
        {
            @Override
@@ -305,6 +320,9 @@
                UniversalUtil.sendMessageToUnity(_msgStruct);
                // ------------------------------- 极光推送 -------------------------------
                String _registrationID = "0";
                if (PushEnable)
                {
                JPushInterface.setDebugMode(true);
                JPushInterface.init(activity);
@@ -315,6 +333,7 @@
                    // 等待获取极光registrationID
                    if (!JPushInterface.getRegistrationID(activity).equals(""))
                    {
                            _registrationID = JPushInterface.getRegistrationID(activity);
                        break;
                    }
@@ -326,10 +345,10 @@
                        break;
                    }
                }
                }
                _msgStruct.clear();
                _msgStruct.put("code", CodeA2U.PushClientID);
                _msgStruct.put("clientID", JPushInterface.getRegistrationID(activity));
                _msgStruct.put("clientID", _registrationID);
                UniversalUtil.sendMessageToUnity(_msgStruct);
                _msgStruct.clear();