From eadddb19ed5d18f93042fac17de26814b5826ba5 Mon Sep 17 00:00:00 2001 From: client_Hale <339726288@qq.com> Date: 星期二, 22 十月 2019 00:13:14 +0800 Subject: [PATCH] update 修改错误的逻辑 --- Project/ky_sdk/src/game_ky/java/com/secondworld/univeralsdk/H2EngineSDK.java | 55 ++++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 38 insertions(+), 17 deletions(-) diff --git a/Project/ky_sdk/src/game_ky/java/com/secondworld/univeralsdk/H2EngineSDK.java b/Project/ky_sdk/src/game_ky/java/com/secondworld/univeralsdk/H2EngineSDK.java index 3711c27..002f552 100644 --- a/Project/ky_sdk/src/game_ky/java/com/secondworld/univeralsdk/H2EngineSDK.java +++ b/Project/ky_sdk/src/game_ky/java/com/secondworld/univeralsdk/H2EngineSDK.java @@ -1,5 +1,6 @@ package com.secondworld.univeralsdk; +import android.Manifest; import android.app.Activity; import android.app.AlertDialog; import android.content.ClipData; @@ -103,10 +104,10 @@ KYPlatformUtil.getInstance().switchAccount(); break; case CodeU2A.FreePlatformLogout: - KYPlatformUtil.getInstance().logout(); + KYPlatformUtil.getInstance().switchAccount(); break; case CodeU2A.FreePlatformPay: - JSONObject _extraData = new JSONObject(); +// JSONObject _extraData = new JSONObject(); // String productId, // String productName, // String money, @@ -115,18 +116,20 @@ // String orderId, // String extraData, // String serverID - _extraData.put("appid", APP_ID); - _extraData.put("cpinfo", _json.getString("cpInfo")); - _extraData.put("cporderid", _json.getString("orderId")); - _extraData.put("productid", GAME_ID); +// _extraData.put("appid", APP_ID); +// _extraData.put("cpinfo", _json.getString("cpInfo")); +// _extraData.put("cporderid", _json.getString("orderId")); +// _extraData.put("productid", GAME_ID); + String _extraData = APP_ID + "|" + _json.getString("cpInfo") + "|" + _json.getString("orderId") + "|" + GAME_ID; KYPlatformUtil.getInstance().pay(_json.getString("cpInfo"), _json.getString("title"), _json.getString("mount"), _json.getString("roleID"), _json.getString("roleName"), _json.getString("orderId"), - _extraData.toString(), - _json.getString("sid")); + _extraData, + _json.getString("sid"), + _json.getString("notifyurl")); KYPlatformUtil.getInstance().payProcessing = true; break; @@ -152,7 +155,8 @@ case CodeU2A.CreateRole: KYPlatformUtil.getInstance().createRole(_json.getString("roleID"), _json.getString("sid"), - _json.getString("roleName")); + _json.getString("roleName").trim().replace(" ", + "")); break; case CodeU2A.RoleLogin: KYPlatformUtil.getInstance().enterWorld(_json.getString("roleID"), @@ -164,11 +168,7 @@ _json.getString("job")); break; case CodeU2A.ClientPackage: - // 鍒濆鍖栫儹浜� - Tracking.initWithKeyAndChannelId(_activity, - UniversalUtil.getMetaString(_activity, - "TrackAppID"), - _json.getString("clientPkgID")); + break; case CodeU2A.JPushAddLocalMessage: addLocalNotification(_activity, @@ -185,6 +185,12 @@ break; case CodeU2A.SendLoginEvent: KYPlatformUtil.getInstance().SendLoginEvent(); + break; + case CodeU2A.DownloadStart: + KYPlatformUtil.getInstance().DownloadStart(); + break; + case CodeU2A.DownloadEnd: + KYPlatformUtil.getInstance().DownloadEnd(); break; } @@ -396,11 +402,9 @@ _msgStruct.clear(); _msgStruct.put("code", CodeA2U.SdkInitComplete); _msgStruct.put("channelPlatform", "ky"); - _msgStruct.put("kyAppID", UniversalUtil.getMetaString(activity, - "XOPENSDK_APPKEY")); + _msgStruct.put("kyAppID", "323"); UniversalUtil.sendMessageToUnity(_msgStruct); - LogUtil.i(TAG, "鍒濆鍖栨墽琛屽畬姣�"); } }).start(); @@ -408,6 +412,23 @@ public static void onCreate(Activity activity, Bundle savedInstanceState) { + AppPermissionUtil.requestPermissions(activity, + new String[]{ + Manifest.permission.WRITE_EXTERNAL_STORAGE, + Manifest.permission.READ_EXTERNAL_STORAGE, + Manifest.permission.RECORD_AUDIO, + Manifest.permission.READ_PHONE_STATE + },new AppPermissionUtil.OnPermissionListener() { + @Override + public void onPermissionGranted() { + //鎺堟潈 + } + + @Override + public void onPermissionDenied() { + //娌℃湁鎺堟潈锛屾垨鑰呮湁涓�涓潈闄愭病鏈夋巿鏉� + } + }); // ------------------------------- 鐚�砈DK ------------------------------- KYPlatformUtil.getInstance().init(activity); -- Gitblit v1.8.0