Jelajahi Sumber

Merge branch 'main' of ssh://192.168.0.8:29418/xianjing into hy_en

gdl_123 7 bulan lalu
induk
melakukan
093f3c8e45

+ 4 - 3
Assets/Editor/AssetBundle/CheckHotUpdateRes.cs

@@ -57,6 +57,7 @@ public class CheckHotUpdateRes : EditorWindow
         string path = "Assets/Editor/AssetBundle/CheckHotResWindownInfo.asset";
         //Debug.Log();
         info = AssetDatabase.LoadAssetAtPath<CheckResWindowInfo>(path);
+        info.InitTags();
         curResInfo = info.GetResInfo();
         if (curResInfo == null)
         {
@@ -117,10 +118,10 @@ public class CheckHotUpdateRes : EditorWindow
         GUILayout.Box("", GUILayout.Width(790));
         GUILayout.BeginHorizontal();
         GUILayout.Label("平台", GUILayout.Width(65));
-        BuildTag tag = (BuildTag)EditorGUILayout.EnumPopup(info.buildTag, GUILayout.Width(100));
-        if (tag != info.buildTag)
+        int TagIndex = EditorGUILayout.Popup(info.buildTag, info.Tags, GUILayout.Width(100));
+        if (TagIndex != info.buildTag)
         {
-            info.buildTag = tag;
+            info.buildTag = TagIndex;
             ResInfo ri = info.GetResInfo();
             if (ri != null)
             {

+ 16 - 2
Assets/Editor/AssetBundle/CheckResWindowInfo.cs

@@ -53,15 +53,16 @@ public class CheckResWindowInfo : ScriptableObject
     public BuildLanguage Language = BuildLanguage.cn;
 
 
-    public BuildTag buildTag = BuildTag.Hy_Test;
+    public int buildTag = 0;
 
     public List<ResInfo> ResInfos;
+    public string[] Tags = null; 
 
     private ResInfo curResInfo;
     public ResInfo GetResInfo()
     {
         ResInfo resInfo = null;
-        string curName = buildTag.ToString();
+        string curName = Tags[buildTag];
         if (curResInfo != null && curResInfo.Name == curName)
         {
             resInfo = curResInfo;
@@ -84,5 +85,18 @@ public class CheckResWindowInfo : ScriptableObject
 
         return resInfo;
     }
+
+    public void InitTags()
+    {
+        if (ResInfos != null && ResInfos.Count > 0)
+        {
+            List<string> tags = new List<string>();
+            foreach (var item in ResInfos)
+            {
+                tags.Add(item.Name);
+            }
+            Tags = tags.ToArray();
+        }
+    }
 }
 

+ 227 - 26
Build/BuildDependenceResource/PackConfig.json

@@ -511,7 +511,112 @@
             "keyaliasName": "game",
             "keyaliasPass": "KlYX666Ro"
         },
-          {
+        {
+            "channelName": "游逸",
+            "appName": "Рагнарёк Онлайн",
+            "distributeName": "測試服(俄语版)",
+            "channelUniqueId": "12002022",
+            "bundleId": "com.xjro.rutest",
+            "gameVersionCode": {
+                "major": 1,
+                "minor": 0,
+                "release": 0,
+                "patch": 6
+            },
+            "resVersionCode": {
+                "major": 0,
+                "minor": 1,
+                "release": 0,
+                "patch": 0
+            },
+            "iconRelativePath": "XinLiWuYu",
+            "defineSymbols": [
+                "USE_LUA",
+                "VUPLEX_CCU",
+                "FPS_DISABLE",
+                "GAME_DEBUG"
+            ],
+            "logo1RelativePath": "xlwy.png",
+            "loginRelativePath": "Default",
+            "gameAssetsPath": "Default",
+            "specialFuncShield": false,
+            "splashScreenRelativeFiles": [],
+            "obscureKey": "",
+            "obscureOffsetMin": 0,
+            "obscureOffsetValues": [],
+            "sdkVerifyUrl": "http://110.40.223.119:81//",
+            "serverListUrl": "http://110.40.223.119:81//serverlist",
+            "notifyUrl": "http://110.40.223.119:88/res/NoticeNew/",
+            "specialInfoUrl": "http://110.40.223.119:81//channel",
+            "customerServiceInfoUrl": "http://110.40.223.119:81//vipService",
+            "leBian_MainChId": "69423",
+            "leBian_ClientChId": "youyi_bt_jj",
+            "leBian_SECID": "dmcve6kq.c",
+            "plugins": [
+                "common",
+                "YOUYI_1.6.9"
+            ],
+            "sdkBridges": [
+                "TZ_android"
+            ],
+            "keystoreName": "wenting.keystore",
+            "keystorePass": "n9P5j2b7blMm",
+            "keyaliasName": "game",
+            "keyaliasPass": "KlYX666Ro"
+        },
+        {
+            "channelName": "游逸",
+            "appName": "Рагнарёк Онлайн",
+            "distributeName": "正式服(俄语版)",
+            "channelUniqueId": "12002023",
+            "bundleId": "com.xjroapp.ru",
+            "gameVersionCode": {
+                "major": 1,
+                "minor": 0,
+                "release": 0,
+                "patch": 0
+            },
+            "resVersionCode": {
+                "major": 0,
+                "minor": 1,
+                "release": 0,
+                "patch": 0
+            },
+            "iconRelativePath": "XinLiWuYu",
+            "defineSymbols": [
+                "USE_LUA",
+                "VUPLEX_CCU",
+                "FPS_DISABLE"
+            ],
+            "logo1RelativePath": "xlwy.png",
+            "loginRelativePath": "Default",
+            "gameAssetsPath": "Default",
+            "specialFuncShield": false,
+            "splashScreenRelativeFiles": [],
+            "obscureKey": "",
+            "obscureOffsetMin": 0,
+            "obscureOffsetValues": [],
+            "sdkVerifyUrl": "http://165.154.215.99:81//",
+            "serverListUrl": "http://165.154.215.99:81//serverlist",
+            "notifyUrl": "http://165.154.215.99:88/res/NoticeNew/",
+            "specialInfoUrl": "http://165.154.215.99:81//channel",
+            "customerServiceInfoUrl": "http://165.154.215.99:81//vipService",
+            "leBian_MainChId": "69423",
+            "leBian_ClientChId": "youyi_bt_jj",
+            "leBian_SECID": "dmcve6kq.c",
+            "plugins": [
+                "common",
+                "YOUYI_1.6.9"
+            ],
+            "sdkBridges": [
+                "TZ_android"
+            ],
+            "keystoreName": "wenting.keystore",
+            "keystorePass": "n9P5j2b7blMm",
+            "keyaliasName": "game",
+            "keyaliasPass": "KlYX666Ro"
+        },
+        {
             "channelName": "游逸",
             "appName": "Rookie's Odyssey",
             "distributeName": "正式服(英文版)(+混淆)",
@@ -540,9 +645,13 @@
             "gameAssetsPath": "Default",
             "specialFuncShield": false,
             "splashScreenRelativeFiles": [],
-            "obscureKey": "",
+            "obscureKey": "1ada09c25fda1fa9bcafe3c",
             "obscureOffsetMin": 0,
-            "obscureOffsetValues": [],
+            "obscureOffsetValues": [
+                4,
+                16,
+                8
+            ],
             "sdkVerifyUrl": "http://165.154.202.27:81//",
             "serverListUrl": "http://165.154.202.27:81//serverlist",
             "notifyUrl": "http://165.154.202.27:88/res/NoticeNew/",
@@ -556,7 +665,7 @@
                 "YOUYI_1.6.9"
             ],
             "sdkBridges": [
-                "YOUYI_1.6.9"
+                "Android_en_hx"
             ],
             "keystoreName": "wenting.keystore",
             "keystorePass": "n9P5j2b7blMm",
@@ -564,11 +673,11 @@
             "keyaliasPass": "KlYX666Ro"
         },
         {
-            "channelName": "游",
-            "appName": "心力物语",
-            "distributeName": "測試服(俄语版)",
-            "channelUniqueId": "12002022",
-            "bundleId": "com.xjro.yy",
+            "channelName": "游",
+            "appName": "东南亚测试服",
+            "distributeName": "測試服(东南亚)",
+            "channelUniqueId": "12002025",
+            "bundleId": "com.xjro.rutest",
             "gameVersionCode": {
                 "major": 1,
                 "minor": 0,
@@ -606,7 +715,6 @@
             "leBian_SECID": "dmcve6kq.c",
             "plugins": [
                 "common",
-                "FairGuard",
                 "YOUYI_1.6.9"
             ],
             "sdkBridges": [
@@ -618,11 +726,11 @@
             "keyaliasPass": "KlYX666Ro"
         },
         {
-            "channelName": "游",
-            "appName": "心力物语",
-            "distributeName": "正式服(俄语版)",
-            "channelUniqueId": "12002023",
-            "bundleId": "com.xjro.yy",
+            "channelName": "游",
+            "appName": "东南亚正式服",
+            "distributeName": "正式服(东南亚)",
+            "channelUniqueId": "12002026",
+            "bundleId": "com.xjro.rutest",
             "gameVersionCode": {
                 "major": 1,
                 "minor": 0,
@@ -639,7 +747,6 @@
             "defineSymbols": [
                 "USE_LUA",
                 "VUPLEX_CCU",
-                "BUGLY",
                 "FPS_DISABLE"
             ],
             "logo1RelativePath": "xlwy.png",
@@ -650,25 +757,71 @@
             "obscureKey": "",
             "obscureOffsetMin": 0,
             "obscureOffsetValues": [],
-            "sdkVerifyUrl": "http://165.154.202.27:81//",
-            "serverListUrl": "http://165.154.202.27:81//serverlist",
-            "notifyUrl": "http://165.154.202.27:88/res/NoticeNew/",
-            "specialInfoUrl": "http://165.154.202.27:81//channel",
-            "customerServiceInfoUrl": "http://165.154.202.27:81//vipService",
+            "sdkVerifyUrl": "http://129.226.159.67:81//",
+            "serverListUrl": "http://129.226.159.67:81//serverlist",
+            "notifyUrl": "http://129.226.159.67:88/res/NoticeNew/",
+            "specialInfoUrl": "http://129.226.159.67:81//channel",
+            "customerServiceInfoUrl": "http://129.226.159.67:81//vipService",
             "leBian_MainChId": "69423",
             "leBian_ClientChId": "youyi_bt_jj",
             "leBian_SECID": "dmcve6kq.c",
             "plugins": [
                 "common",
-                "Bugly",
-                "FairGuard",
-                "Lebian",
                 "YOUYI_1.6.9"
             ],
             "sdkBridges": [
-                "Bugly",
-                "YOUYI_1.6.9"
+                "TZ_android"
+            ],
+            "keystoreName": "wenting.keystore",
+            "keystorePass": "n9P5j2b7blMm",
+            "keyaliasName": "game",
+            "keyaliasPass": "KlYX666Ro"
+        },
+        {
+            "channelName": "无",
+            "appName": "SDK_NULL",
+            "distributeName": "NULL_SDK",
+            "channelUniqueId": "12002027",
+            "bundleId": "com.xjro.null",
+            "gameVersionCode": {
+                "major": 1,
+                "minor": 0,
+                "release": 0,
+                "patch": 6
+            },
+            "resVersionCode": {
+                "major": 0,
+                "minor": 1,
+                "release": 0,
+                "patch": 0
+            },
+            "iconRelativePath": "XinLiWuYu",
+            "defineSymbols": [
+                "USE_LUA",
+                "VUPLEX_CCU",
+                "NULLSDK",
+                "FPS_DISABLE"
             ],
+            "logo1RelativePath": "xlwy.png",
+            "loginRelativePath": "Default",
+            "gameAssetsPath": "Default",
+            "specialFuncShield": false,
+            "splashScreenRelativeFiles": [],
+            "obscureKey": "",
+            "obscureOffsetMin": 0,
+            "obscureOffsetValues": [],
+            "sdkVerifyUrl": "http://129.226.159.67:81//",
+            "serverListUrl": "http://129.226.159.67:81//serverlist",
+            "notifyUrl": "http://129.226.159.67:88/res/NoticeNew/",
+            "specialInfoUrl": "http://129.226.159.67:81//channel",
+            "customerServiceInfoUrl": "http://129.226.159.67:81//vipService",
+            "leBian_MainChId": "69423",
+            "leBian_ClientChId": "youyi_bt_jj",
+            "leBian_SECID": "dmcve6kq.c",
+            "plugins": [
+                "common"
+            ],
+            "sdkBridges": [],
             "keystoreName": "wenting.keystore",
             "keystorePass": "n9P5j2b7blMm",
             "keyaliasName": "game",
@@ -1138,6 +1291,54 @@
             "sdkBridges": [
                 "quick_cn_android"
             ]
+        },
+        {
+            "channelName": "俄语",
+            "appName": "Рыцарская легенда",
+            "distributeName": "正式服(俄语)",
+            "channelUniqueId": "22002010",
+            "bundleId": "com.qscq.joy",
+            "gameVersionCode": {
+                "major": 0,
+                "minor": 1,
+                "release": 0,
+                "patch": 0
+            },
+            "resVersionCode": {
+                "major": 0,
+                "minor": 1,
+                "release": 0,
+                "patch": 0
+            },
+            "iconRelativePath": "ChuXinZheDaMaoxianNew_IOS",
+            "defineSymbols": [
+                "USE_LUA",
+                "VUPLEX_CCU",
+                "FPS_DISABLE"
+            ],
+            "logo1RelativePath": "ntquick.png",
+            "loginRelativePath": "Default",
+            "gameAssetsPath": "Default",
+            "specialFuncShield": true,
+            "splashScreenRelativeFiles": [],
+            "obscureKey": "",
+            "obscureOffsetMin": 0,
+            "obscureOffsetValues": [],
+            "sdkVerifyUrl": "http://165.154.215.99:81//",
+            "serverListUrl": "http://165.154.215.99:81//serverlist",
+            "notifyUrl": "http://165.154.215.99:88/res/NoticeNew/",
+            "specialInfoUrl": "http://165.154.215.99:81//channel",
+            "customerServiceInfoUrl": "http://165.154.215.99:81//vipService",
+            "leBian_MainChId": "69031",
+            "leBian_ClientChId": "cxzjj_bt",
+            "leBian_SECID": "tx75web0.c",
+            "plugins": [
+                "common",
+                "QkSdk_en"
+            ],
+            "sdkBridges": [
+                "Q_IOS"
+            ]
         }
     ],
     "pCs": [

+ 172 - 0
Build/BuildDependenceResource/Plugins/SDKBridge/Android_en_hx/YouYiListener.cs

@@ -0,0 +1,172 @@
+using System.Collections;
+using System.Text;
+using UnityEngine;
+using UnityEngine.Networking;
+namespace quicksdk
+{
+    public class YouYiListener : MonoBehaviour
+    {
+        private UnityWebRequest m_CheckLoginWebRequest;
+        private string m_Token = string.Empty;
+        private string m_Uid = string.Empty;
+        private Coroutine m_CheckCoroutine = null;
+
+        public void OnInitSuccess()
+        {
+            SDKMgr.Instance.SetInited(true);
+            SDKEventUtil.SendMessage(SDKCBEnum.INIT_SUCCESS_CB);
+        }
+
+        public void OnInitFailed()
+        {
+            SDKMgr.Instance.SetInited(false);
+            SDKEventUtil.SendMessage(SDKCBEnum.INIT_FAILED_CB);
+        }
+
+        public void OnLoginSuccess(string token)
+        {
+            SDKMgr.Instance.SetLogined(true);
+            m_Token = token;
+            // StartCheckLogin();
+            UserInfo userInfo = new UserInfo()
+            {
+                uid = m_Uid,
+                userName = "",
+                token = m_Token,
+            };
+            SDKMgr.Instance.SetInited(true);
+            SDKEventUtil.SendMessage(SDKCBEnum.LOGIN_SUCCESS_CB, userInfo);
+        }
+
+        public void SetUserId(string uid)
+        {
+            m_Uid = uid;
+        }
+
+        public void OnLoginFailed()
+        {
+            SDKEventUtil.SendMessage(SDKCBEnum.LOGIN_FAILED_CB);
+            StopCheckLogin();
+        }
+
+        public void OnLogoutSuccess()
+        {
+            m_Token = string.Empty;
+            SDKMgr.Instance.SetLogined(false);
+            SDKEventUtil.SendMessage(SDKCBEnum.LOGOUT_SUCCESS_CB);
+        }
+
+        public void OnExitSuccess()
+        {
+            SDKEventUtil.SendMessage(SDKCBEnum.EXIT_SUCCESS_CB);
+        }
+
+        public void OnPaySuccess()
+        {
+            SDKEventUtil.SendMessage(SDKCBEnum.PAY_SUCCESS_CB);
+        }
+
+        public void OnPayFailed()
+        {
+            SDKEventUtil.SendMessage(SDKCBEnum.PAY_FAILED_CB);
+        }
+
+        public void OnCanEnterServerJudge(string args)
+        {
+            SDKEventUtil.SendMessage(SDKCBEnum.CAN_ENTER_SERVER_JUDGE_CB, args);
+        }
+
+        private void StopCheckLogin()
+        {
+            if (m_CheckCoroutine != null)
+            {
+                StopCoroutine(m_CheckCoroutine);
+                m_CheckCoroutine = null;
+            }
+            if (m_CheckLoginWebRequest != null)
+            {
+                m_CheckLoginWebRequest.Dispose();
+                m_CheckLoginWebRequest = null;
+            }
+        }
+
+        public void StartCheckLogin()
+        {
+            StopCheckLogin();
+            m_CheckCoroutine = StartCoroutine(CheckLogin());
+        }
+
+        private IEnumerator CheckLogin()
+        {
+            StringBuilder sb = new StringBuilder();
+            sb.Append(SDKMgr.Instance.httpCheckUrl);
+            sb.Append("sdkcheck?platform=");
+            if (SDKMgr.Instance.sdk != null)
+            {
+                sb.Append(SDKMgr.Instance.sdk.SDKName);
+                string subplatform = SDKMgr.Instance.GetChannelName();
+                if (!string.IsNullOrEmpty(subplatform))
+                {
+                    sb.Append("&sub_platform=");
+                    sb.Append(subplatform);
+                }
+            }
+            sb.Append("&sauthjson=");
+            sb.Append(m_Token);
+            m_CheckLoginWebRequest = UnityWebRequest.Get(sb.ToString());
+            yield return m_CheckLoginWebRequest.SendWebRequest();
+            if (!string.IsNullOrEmpty(m_CheckLoginWebRequest.error))
+            {
+                OnLoginFailed();
+                yield break;
+            }
+            var downloadHandler = m_CheckLoginWebRequest.downloadHandler;
+            if (downloadHandler == null)
+            {
+                OnLoginFailed();
+                yield break;
+            }
+            string text = downloadHandler.text;
+            try
+            {
+                var result = JsonUtility.FromJson<CheckLoginResult>(text);
+                if (result.code == 0 && !string.IsNullOrEmpty(result.userinfo))
+                {
+                    var arr = result.userinfo.Split('.');
+                    var userinfoStr = Encoding.UTF8.GetString(System.Convert.FromBase64String(arr[0]));
+                    var userinfo = JsonUtility.FromJson<LoginResultUserInfo>(userinfoStr);
+                    UserInfo userInfo = new UserInfo()
+                    {
+                        uid = m_Uid,
+                        userName = "",
+                        token = m_Token,
+                    };
+                    SDKMgr.Instance.SetInited(true);
+                    SDKEventUtil.SendMessage(SDKCBEnum.LOGIN_SUCCESS_CB, userInfo);
+                }
+                else
+                {
+                    OnLoginFailed();
+                    SDKMgr.Instance.Logout();
+                }
+            }
+            catch
+            {
+                OnLoginFailed();
+                Debug.LogWarning("CheckLogin Fail   " + sb.ToString());
+            }
+        }
+
+        private class CheckLoginResult
+        {
+            public int code = 0;
+            public string userinfo = string.Empty;
+            public string platform = string.Empty;
+        }
+
+        private class LoginResultUserInfo
+        {
+            public string aid = string.Empty;
+        }
+    }
+}

+ 11 - 0
Build/BuildDependenceResource/Plugins/SDKBridge/Android_en_hx/YouYiListener.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 487a476c504f9f74da509ffeb5deb207
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 298 - 0
Build/BuildDependenceResource/Plugins/SDKBridge/Android_en_hx/YouYiSDKAndroid.cs

@@ -0,0 +1,298 @@
+#if UNITY_ANDROID
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+namespace quicksdk
+{
+    public class YouYiSDKAndroid : SDKBase
+    {
+        private AndroidJavaObject m_AJO;
+        private YouYiListener m_YouYiListener;
+
+        public YouYiSDKAndroid()
+        {
+            using (AndroidJavaClass ajc = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
+            {
+                m_AJO = ajc.GetStatic<AndroidJavaObject>("currentActivity");
+            }
+            m_YouYiListener = SDKMgr.Instance.gameObject.AddComponent<YouYiListener>();
+            SDKName = "SDKHwQuick";
+        }
+
+        public override void Init()
+        {
+            base.Init();
+            if (m_AJO != null)
+            {
+                m_AJO.Call("init", "SDKMgr");
+            }
+            else
+            {
+                m_YouYiListener.OnInitFailed();
+            }
+        }
+
+
+        public override void Login()
+        {
+            if (m_AJO != null)
+            {
+                m_AJO.Call("login");
+            }
+            else
+            {
+                m_YouYiListener.OnLoginFailed();
+            }
+        }
+
+        public override void Logout()
+        {
+            if (m_AJO != null)
+            {
+                m_AJO.Call("switchAccountLogin");
+            }
+        }
+
+        public override void SwitchAccount()
+        {
+            if (m_AJO != null)
+            {
+                m_AJO.Call("switchAccountLogin");
+            }
+        }
+
+        public override void Pay(int goodsId, string goodsName, string goodsDesc, int count, float amount, string cpOrderId, string extrasParams)
+    {
+        if (m_AJO != null)
+        {
+            GameRoleInfo gameRoleInfo = SDKMgr.Instance.GetGameRoleInfo();
+
+
+
+            if (gameRoleInfo != null)
+            {
+                Dictionary<string, SDKMgr.ProductInfo> cfgs = SDKMgr.Instance.ProductInfos;
+
+                string pice = amount.ToString("F2");
+
+                if (cfgs.ContainsKey(pice))
+                {
+                    SDKMgr.ProductInfo productInfo = cfgs[pice];
+                    m_AJO.Call("pay", cpOrderId, amount.ToString(), productInfo.ID, productInfo.Name, gameRoleInfo.roleId.ToString(), gameRoleInfo.roleName, gameRoleInfo.serverId.ToString(), gameRoleInfo.serverName, gameRoleInfo.roleLv, extrasParams, goodsName,productInfo.Other);
+
+                }
+                else
+                    m_YouYiListener.OnPayFailed();
+            }
+            else
+                m_YouYiListener.OnPayFailed();
+        }
+        else
+        {
+            m_YouYiListener.OnPayFailed();
+        }
+    }
+
+        public override void CreateRole()
+        {
+            GameRoleInfo gameRoleInfo = SDKMgr.Instance.GetGameRoleInfo();
+            if (gameRoleInfo == null || !gameRoleInfo.Valid())
+            {
+                Debug.LogError("[YouYiSDK][CreateRole] GameRoleInfo is null or not valid !!!");
+                return;
+            }
+            if (m_AJO != null)
+            {
+                m_AJO.Call("createRoleLog", gameRoleInfo.roleId.ToString(), gameRoleInfo.roleName, gameRoleInfo.serverId.ToString(), gameRoleInfo.serverName, gameRoleInfo.roleLv, gameRoleInfo.openServerTime.ToString());
+            }
+        }
+
+        public override void EnterGame()
+        {
+            GameRoleInfo gameRoleInfo = SDKMgr.Instance.GetGameRoleInfo();
+            if (gameRoleInfo == null || !gameRoleInfo.Valid())
+            {
+                Debug.LogError("[YouYiSDK][EnterGame] GameRoleInfo is null or not valid !!!");
+                return;
+            }
+            if (m_AJO != null)
+            {
+                m_AJO.Call("loginRoleLog", gameRoleInfo.roleId.ToString(), gameRoleInfo.roleName, gameRoleInfo.serverId.ToString(), gameRoleInfo.serverName, gameRoleInfo.roleLv, gameRoleInfo.openServerTime.ToString());
+            }
+        }
+
+        public override void UpdateRoleLv()
+        {
+            GameRoleInfo gameRoleInfo = SDKMgr.Instance.GetGameRoleInfo();
+            if (gameRoleInfo == null || !gameRoleInfo.Valid())
+            {
+                Debug.LogError("[YouYiSDK][UpdateRoleLv] GameRoleInfo is null or not valid !!!");
+                return;
+            }
+            if (m_AJO != null)
+            {
+                m_AJO.Call("levelLog", gameRoleInfo.roleId.ToString(), gameRoleInfo.roleName, gameRoleInfo.serverId.ToString(), gameRoleInfo.serverName, gameRoleInfo.roleLv, gameRoleInfo.openServerTime.ToString());
+            }
+        }
+
+        public override void ExitGame()
+        {
+
+        }
+
+        public override bool Exit()
+        {
+            return false;
+        }
+
+        public override bool Quit()
+        {
+            return false;
+        }
+
+        public override void CallInitSuccessCB()
+        {
+            m_YouYiListener.OnInitSuccess();
+        }
+
+        public override void CallLoginSuccessCB()
+        {
+            m_YouYiListener.StartCheckLogin();
+        }
+
+        public override bool CheckHasModul(SDKModulType needCheckModulType)
+        {
+            if (needCheckModulType == SDKModulType.EXIT_VIEW)
+            {
+                return true;
+            }
+            return base.CheckHasModul(needCheckModulType);
+        }
+
+        public override void OpenModul(SDKModulType sDKModulType)
+        {
+            if (sDKModulType == SDKModulType.EXIT_VIEW)
+            {
+                if (m_AJO != null)
+                {
+                    m_AJO.Call("exit");
+                }
+                return;
+            }
+            base.OpenModul(sDKModulType);
+        }
+
+        public override bool IsReportAction() { return true; }
+
+        public override void ReportAction(Dictionary<object, object> datas)
+        {
+            base.ReportAction(datas);
+            if (m_AJO != null)
+            {
+                using (AndroidJavaObject hashMapAJO = DictionaryToJavaHashMap(datas))
+                {
+                    m_AJO.Call("reportAction", hashMapAJO);
+                }
+            }
+        }
+
+        public override bool HasCanEnterServerJudge() { return true; }
+        public override void CanEnterServerJudge(string serverId, string serverName)
+        {
+            base.CanEnterServerJudge(serverId, serverName);
+            if (m_AJO != null)
+            {
+                m_AJO.Call("canEnterServerJudge", serverId, serverName);
+            }
+        }
+
+
+        private AndroidJavaObject DictionaryToJavaHashMap(Dictionary<object, object> datas)
+        {
+            AndroidJavaObject hashMapAJO = new AndroidJavaObject("java.util.HashMap");
+            object[] args = new object[2];
+            System.IntPtr putMethod = AndroidJNIHelper.GetMethodID(
+                hashMapAJO.GetRawClass(), "put",
+                "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
+            foreach (var data in datas)
+            {
+                AndroidJavaObject key = GetAndroidJavaObject(data.Key);
+                if (key == null) continue;
+                AndroidJavaObject value = GetAndroidJavaObject(data.Value);
+                if (value == null) continue;
+                args[0] = key;
+                args[1] = value;
+                AndroidJNI.CallObjectMethod(
+                    hashMapAJO.GetRawObject(),
+                    putMethod,
+                    AndroidJNIHelper.CreateJNIArgArray(args));
+                key.Dispose();
+                value.Dispose();
+            }
+            return hashMapAJO;
+        }
+
+        private AndroidJavaObject GetAndroidJavaObject(object value)
+        {
+            System.Type type = value.GetType();
+            if (type.IsPrimitive)
+            {
+                if (type.Equals(typeof(int)))
+                {
+                    return new AndroidJavaObject("java.lang.Integer", value);
+                }
+                if (type.Equals(typeof(bool)))
+                {
+                    return new AndroidJavaObject("java.lang.Boolean", value);
+                }
+                if (type.Equals(typeof(byte)))
+                {
+                    return new AndroidJavaObject("java.lang.Byte", value);
+                }
+                if (type.Equals(typeof(short)))
+                {
+                    return new AndroidJavaObject("java.lang.Short", value);
+                }
+                if (type.Equals(typeof(long)))
+                {
+                    return new AndroidJavaObject("java.lang.Long", value);
+                }
+                if (type.Equals(typeof(float)))
+                {
+                    return new AndroidJavaObject("java.lang.Float", value);
+                }
+                if (type.Equals(typeof(double)))
+                {
+                    double dVal = (double)value;
+                    if (dVal > int.MinValue && dVal < int.MaxValue)
+                    {
+                        int intVal = (int)dVal;
+                        if (intVal == dVal)
+                        {
+                            return new AndroidJavaObject("java.lang.Integer", intVal);
+                        }
+                    }
+                    return new AndroidJavaObject("java.lang.Double", value);
+                }
+                if (type.Equals(typeof(char)))
+                {
+                    return new AndroidJavaObject("java.lang.Character", value);
+                }
+            }
+            else
+            {
+                if (type.Equals(typeof(string)))
+                {
+                    return new AndroidJavaObject("java.lang.String", value);
+                }
+                else if (type.Equals(typeof(AndroidJavaObject)))
+                {
+                    return value as AndroidJavaObject;
+                }
+            }
+            return null;
+        }
+    }
+}
+#endif

+ 11 - 0
Build/BuildDependenceResource/Plugins/SDKBridge/Android_en_hx/YouYiSDKAndroid.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e7f8c4f237e05ee41a270d9e329ae034
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 69 - 0
Build/BuildDependenceResource/Plugins/SDKBridge/Q_IOS/QSDKMgr.cs

@@ -0,0 +1,69 @@
+using System;
+using System.Runtime.InteropServices;
+
+namespace qsdk
+{
+    public class QSdkMgr
+    {
+
+        public static QKSDKInitState InitState = QKSDKInitState.None;
+        public static void SetListener(string listener)
+        {
+#if UNITY_IOS
+            QSDK_SetListener(listener);
+#endif
+        }
+
+        public static void Init()
+        {
+#if UNITY_IOS
+            QSDK_Init();
+#endif
+        }
+        public static void Login()
+        {
+#if UNITY_IOS
+            QSDK_login();
+#endif
+        }
+        public static void Pay(string productId, string productName, string amount, string orderNo,
+                    string callBackUrl, string extrasParams,
+                    string gameName, string serverName, string productDesc)
+        {
+#if UNITY_IOS
+            QSDK_Pay( productId,  productName,  amount,  orderNo,
+                     callBackUrl,  extrasParams,
+                     gameName,  serverName,  productDesc);
+#endif
+        }
+        public static void Logout()
+        {
+#if UNITY_IOS
+            QSDK_logout();
+#endif
+        }
+
+
+
+
+#if UNITY_IOS
+        [DllImport("__Internal")]
+        private static extern void QSDK_SetListener(string callbackGoName);
+
+        [DllImport("__Internal")]
+        private static extern void QSDK_Init();
+
+        [DllImport("__Internal")]
+        private static extern void QSDK_login();
+
+        [DllImport("__Internal")]
+        private static extern void QSDK_Pay(string productId, string productName, string amount, string orderNo,
+                    string callBackUrl, string extrasParams,
+                    string gameName, string serverName, string productDesc);
+
+
+        [DllImport("__Internal")]
+        private static extern void QSDK_logout();
+#endif
+    }
+}

+ 79 - 0
Build/BuildDependenceResource/Plugins/SDKBridge/Q_IOS/QSdkListener.cs

@@ -0,0 +1,79 @@
+using UnityEngine;
+using System.Collections;
+#if UNITY_IOS
+namespace qsdk
+{
+
+    public class QSdkListener : MonoBehaviour
+    {
+
+        private YouYiListener m_YouYiListener;
+
+        public void InitListener(YouYiListener youYiListener)
+        {
+            m_YouYiListener = youYiListener;
+        }
+
+        public void onInitSuccess(string msg)
+        {
+            Debug.Log("QKSDK 初始化:"+ msg);
+            //执行初始化成功操作
+            if (msg == "Fail")
+            {
+                Debug.Log("QKSDK初始化失败");
+                QKGame.InitState = QKSDKInitState.Fail;
+                m_YouYiListener.OnInitFailed();
+            }
+            else
+            {
+                QKGame.InitState = QKSDKInitState.Success;
+                Debug.Log("QKSDK初始化成功");
+                m_YouYiListener.OnInitSuccess();
+            }
+               
+
+        }
+
+        public void onLoginSuccess(string userInfo)
+        {         
+             string[] data = userInfo.Split("[]", System.StringSplitOptions.RemoveEmptyEntries);
+            string token = data[2];
+
+            m_YouYiListener.UID = data[3];
+            m_YouYiListener.OnLoginSuccess(token);
+        }
+
+        public void onLoginFail(string msg)
+        {
+            m_YouYiListener.OnLoginFailed();
+        }
+
+
+
+        public void onGameLogoutSuccess(string msg)
+        {
+            m_YouYiListener.OnLogoutSuccess();
+            //游戏主动调用logout操作完成回调
+        }
+
+        public void onLogoutSuccess(string msg)
+        {
+            m_YouYiListener.OnLogoutSuccess();
+            //玩家主动点击个人中心切换账号成功回调
+        }
+
+        public void onPaySuccess(string orderInfos)
+        {
+            //购买成功回调
+            m_YouYiListener.OnPaySuccess();
+        }
+
+        public void onPayFail()
+        {
+            //购买失败回调
+            m_YouYiListener.OnPayFailed();
+        }
+       
+    }
+}
+#endif

+ 162 - 0
Build/BuildDependenceResource/Plugins/SDKBridge/Q_IOS/YouYiListener.cs

@@ -0,0 +1,162 @@
+using System.Collections;
+using System.Text;
+using UnityEngine;
+using UnityEngine.Networking;
+
+public class YouYiListener : MonoBehaviour
+{
+    private UnityWebRequest m_CheckLoginWebRequest;
+    private string m_Token = string.Empty;
+    private string m_Uid = string.Empty;
+    private Coroutine m_CheckCoroutine = null;
+
+    public string UID { set { m_Uid = value; } }
+    public void OnInitSuccess()
+    {
+        SDKMgr.Instance.SetInited(true);
+        SDKEventUtil.SendMessage(SDKCBEnum.INIT_SUCCESS_CB);
+    }
+    
+    public void OnInitFailed()
+    {
+        SDKMgr.Instance.SetInited(false);
+        SDKEventUtil.SendMessage(SDKCBEnum.INIT_FAILED_CB);
+    }
+    
+    public void OnLoginSuccess(string token)
+    {
+        SDKMgr.Instance.SetLogined(true);
+        m_Token = token;
+        // StartCheckLogin();
+        UserInfo userInfo = new UserInfo()
+        {
+            uid = m_Uid,
+            userName = "",
+            token = m_Token,
+        };
+        SDKMgr.Instance.SetInited(true);
+        SDKEventUtil.SendMessage(SDKCBEnum.LOGIN_SUCCESS_CB, userInfo);
+
+    }
+
+    public void OnLoginFailed()
+    {
+        SDKEventUtil.SendMessage(SDKCBEnum.LOGIN_FAILED_CB);
+        StopCheckLogin();
+    }
+
+    public void OnLogoutSuccess()
+    {
+        m_Token = string.Empty;
+        SDKMgr.Instance.SetLogined(false);
+        SDKEventUtil.SendMessage(SDKCBEnum.LOGOUT_SUCCESS_CB);
+    }
+
+    public void OnExitSuccess()
+    {
+        SDKEventUtil.SendMessage(SDKCBEnum.EXIT_SUCCESS_CB);
+    }
+    
+    public void OnPaySuccess()
+    {
+        SDKEventUtil.SendMessage(SDKCBEnum.PAY_SUCCESS_CB);
+    }
+
+    public void OnPayFailed()
+    {
+        SDKEventUtil.SendMessage(SDKCBEnum.PAY_FAILED_CB);
+    }
+
+    private void StopCheckLogin()
+    {
+        if (m_CheckCoroutine != null)
+        {
+            StopCoroutine(m_CheckCoroutine);
+            m_CheckCoroutine = null;
+        }
+        if (m_CheckLoginWebRequest != null)
+        {
+            m_CheckLoginWebRequest.Dispose();
+            m_CheckLoginWebRequest = null;
+        }
+    }
+
+    public void StartCheckLogin()
+    {
+        StopCheckLogin();
+        m_CheckCoroutine = StartCoroutine(CheckLogin());
+    }
+
+    private IEnumerator CheckLogin()
+    {
+        StringBuilder sb = new StringBuilder();
+        sb.Append(SDKMgr.Instance.httpCheckUrl);
+        sb.Append("sdkcheck?platform=");
+        if (SDKMgr.Instance.sdk != null)
+        {
+            sb.Append(SDKMgr.Instance.sdk.SDKName);
+            string subplatform = SDKMgr.Instance.GetChannelName();
+            if (!string.IsNullOrEmpty(subplatform))
+            {
+                sb.Append("&sub_platform=");
+                sb.Append(subplatform);
+            }
+        }
+        sb.Append("&sauthjson=");
+        sb.Append(m_Token);
+        m_CheckLoginWebRequest = UnityWebRequest.Get(sb.ToString());
+        yield return m_CheckLoginWebRequest.SendWebRequest();
+        if (!string.IsNullOrEmpty(m_CheckLoginWebRequest.error))
+        {
+            OnLoginFailed();
+            yield break;
+        }
+        var downloadHandler = m_CheckLoginWebRequest.downloadHandler;
+        if (downloadHandler == null)
+        {
+            OnLoginFailed();
+            yield break;
+        }
+        string text = downloadHandler.text;
+        try
+        {
+            var result = JsonUtility.FromJson<CheckLoginResult>(text);
+            if (result.code == 0 && !string.IsNullOrEmpty(result.userinfo))
+            {
+                var arr = result.userinfo.Split('.');
+                var userinfoStr = Encoding.UTF8.GetString(System.Convert.FromBase64String(arr[0]));
+                var userinfo = JsonUtility.FromJson<LoginResultUserInfo>(userinfoStr);
+                UserInfo userInfo = new UserInfo()
+                {
+                    uid = userinfo.aid,
+                    userName = "",
+                    token = result.userinfo,
+                };
+                SDKMgr.Instance.SetInited(true);
+                SDKEventUtil.SendMessage(SDKCBEnum.LOGIN_SUCCESS_CB , userInfo);
+            }
+            else
+            {
+                OnLoginFailed();
+                SDKMgr.Instance.Logout();
+            }
+        }
+        catch
+        {
+            OnLoginFailed();
+            Debug.LogWarning("CheckLogin Fail   " + sb.ToString());
+        }
+    }
+
+    private class CheckLoginResult
+    {
+        public int code = 0;
+        public string userinfo = string.Empty;
+        public string platform = string.Empty;
+    }
+
+    private class LoginResultUserInfo
+    {
+        public string aid = string.Empty;
+    }
+}

+ 11 - 0
Build/BuildDependenceResource/Plugins/SDKBridge/Q_IOS/YouYiListener.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 487a476c504f9f74da509ffeb5deb207
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 144 - 0
Build/BuildDependenceResource/Plugins/SDKBridge/Q_IOS/YouYiSDKiOS.cs

@@ -0,0 +1,144 @@
+#if UNITY_IOS
+using System.Runtime.InteropServices;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+using qsdk;
+
+public class YouYiSDKiOS : SDKBase
+{
+    private YouYiListener m_YouYiListener;
+
+    public QKGame qKGamesdk;
+    private QSdkListener qListenter;
+    public YouYiSDKiOS()
+    {
+        SDKName = "SDKYOUYI_IOS";
+        m_YouYiListener = SDKMgr.Instance.gameObject.AddComponent<YouYiListener>();
+        qListenter = SDKMgr.Instance.gameObject.AddComponent<QSdkListener>();
+        qKGamesdk = new QKGame();
+        //YouYi_SetCallbackGoName(SDKMgr.Instance.gameObject.name);
+        qListenter.InitListener(m_YouYiListener);
+        QSdkMgr.SetListener(qListenter.gameObject.name);
+    }
+
+    public override void Init()
+    {
+        base.Init();
+        //YouYi_Init();
+        if (QSdkMgr.InitState == QKSDKInitState.Success)
+        {
+            CallInitSuccessCB();
+            return;
+        }
+
+        QSdkMgr.Init();
+    }
+
+    public override void OnApplicationFocus(bool focusStatus)
+    {
+        base.OnApplicationFocus(focusStatus);
+    }
+
+    public override void Login()
+    {
+        QSdkMgr.Login();
+    }
+
+    public override void Logout()
+    {
+        //YouYi_Logout();
+        QSdkMgr.Logout();
+    }
+
+    public override void SwitchAccount()
+    {
+        //YouYi_SwitchAccount();
+        
+    }
+
+    public override void Pay(int goodsId, string goodsName, string goodsDesc, int count, float amount, string cpOrderId, string extrasParams)
+    {
+        GameRoleInfo gameRoleInfo = SDKMgr.Instance.GetGameRoleInfo();
+       
+        if (gameRoleInfo == null || !gameRoleInfo.Valid())
+        {
+            Debug.LogError("[YISDK][Pay] GameRoleInfo is null or not valid !!!");
+            m_YouYiListener.OnPayFailed();
+            return;
+        }
+        Dictionary<string, SDKMgr.ProductInfo> cfgs = SDKMgr.Instance.ProductInfos;
+
+        int itemp = Mathf.FloorToInt(amount);
+        string pice = "";
+        if ((itemp + 0.005f) > amount)
+        {
+            pice = itemp.ToString();
+        }
+        else
+        {
+            pice = amount.ToString("F2");
+        }
+
+        Debug.Log("价格 = " + pice);
+        if (cfgs.ContainsKey(pice))
+        {
+            Debug.Log("有 价格 = " + pice);
+            SDKMgr.ProductInfo productInfo = cfgs[pice];
+
+            //Debug.Log($"=========================={productInfo.ID}======={productInfo.Name}");
+
+
+            QSdkMgr.Pay(productInfo.ID, productInfo.Name, amount.ToString(), cpOrderId, goodsName, extrasParams, Application.productName, gameRoleInfo.serverName, goodsDesc);
+        }
+        else
+        {
+            Debug.Log("没有 价格 = " + pice);
+            m_YouYiListener.OnPayFailed();
+        } 
+    }
+
+    public override void CreateRole()
+    {
+       
+    }
+
+    public override void EnterGame()
+    {
+  
+    }
+
+    public override void UpdateRoleLv()
+    {
+       
+    }
+
+    public override void ExitGame()
+    {
+
+    }
+
+    public override bool Exit()
+    {
+        return false;
+    }
+
+    public override bool Quit()
+    {
+        return false;
+    }
+
+    public override void CallInitSuccessCB()
+    {
+        m_YouYiListener.OnInitSuccess();
+    }
+
+    public override void CallLoginSuccessCB()
+    {
+        m_YouYiListener.StartCheckLogin();
+    }
+
+   
+}
+#endif

+ 11 - 0
Build/BuildDependenceResource/Plugins/SDKBridge/Q_IOS/YouYiSDKiOS.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6e5b82231d5ff544fa992ba91963107c
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 138 - 40
Build/BuildDependenceResource/Plugins/SDKBridge/TZ_android/YouYiSDKAndroid.cs

@@ -8,7 +8,7 @@ public class YouYiSDKAndroid : SDKBase
 {
     private AndroidJavaObject m_AJO;
     private YouYiListener m_YouYiListener;
-
+    private SDKGameRoleInfo mSDKGameRoleInfo;
     public YouYiSDKAndroid()
     {
         using (AndroidJavaClass ajc = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
@@ -71,10 +71,21 @@ public class YouYiSDKAndroid : SDKBase
 
                 Dictionary<string, SDKMgr.ProductInfo> cfgs = SDKMgr.Instance.ProductInfos;
 
-                string pice = amount.ToString("F2");
+                 int itemp = Mathf.FloorToInt(amount);
+                string pice = "";
+                if ((itemp + 0.005f) > amount)
+                {
+                    pice = itemp.ToString();
+                }
+                else
+                {
+                    pice = amount.ToString("F2");
+                }
 
+                Debug.Log("价格 = "+ pice);
                 if (cfgs.ContainsKey(pice))
                 {
+                    Debug.Log("有 价格 = " + pice);
                     SDKMgr.ProductInfo productInfo = cfgs[pice];
 
                     GameOrderInfo gameOrderInfo = new GameOrderInfo()
@@ -95,9 +106,12 @@ public class YouYiSDKAndroid : SDKBase
                     m_AJO.Call("pay", gameRoleInfo, gameOderString);
                 }
                 else
+                {
+                    Debug.Log("没有 价格 = " + pice);
                     m_YouYiListener.OnPayFailed();
+                }
             }
-                //m_AJO.Call("pay", cpOrderId, amount.ToString(), goodsId.ToString(), goodsName, gameRoleInfo.roleId.ToString(), gameRoleInfo.roleName, gameRoleInfo.serverId.ToString(), gameRoleInfo.serverName, gameRoleInfo.roleLv, extrasParams);
+            //m_AJO.Call("pay", cpOrderId, amount.ToString(), goodsId.ToString(), goodsName, gameRoleInfo.roleId.ToString(), gameRoleInfo.roleName, gameRoleInfo.serverId.ToString(), gameRoleInfo.serverName, gameRoleInfo.roleLv, extrasParams);
             else
                 m_YouYiListener.OnPayFailed();
         }
@@ -117,8 +131,9 @@ public class YouYiSDKAndroid : SDKBase
         }
         if (m_AJO != null)
         {
-            JsonUtility.ToJson(gameRoleInfo);
-            m_AJO.Call("createRoleLog", gameRoleInfo);
+            SetSDKGameRoleInfo(gameRoleInfo);
+            string data = JsonUtility.ToJson(mSDKGameRoleInfo);
+            m_AJO.Call("createRoleLog", data);
             //m_AJO.Call("createRoleLog", gameRoleInfo.roleId.ToString(), gameRoleInfo.roleName, gameRoleInfo.serverId.ToString(), gameRoleInfo.serverName, gameRoleInfo.roleLv, gameRoleInfo.openServerTime.ToString());
         }
     }
@@ -133,9 +148,10 @@ public class YouYiSDKAndroid : SDKBase
         }
         if (m_AJO != null)
         {
-            JsonUtility.ToJson(gameRoleInfo);
-            m_AJO.Call("loginRoleLog", gameRoleInfo);
-           // m_AJO.Call("loginRoleLog", gameRoleInfo.roleId.ToString(), gameRoleInfo.roleName, gameRoleInfo.serverId.ToString(), gameRoleInfo.serverName, gameRoleInfo.roleLv, gameRoleInfo.openServerTime.ToString());
+            SetSDKGameRoleInfo(gameRoleInfo);
+            string data = JsonUtility.ToJson(mSDKGameRoleInfo);
+            m_AJO.Call("loginRoleLog", data);
+            // m_AJO.Call("loginRoleLog", gameRoleInfo.roleId.ToString(), gameRoleInfo.roleName, gameRoleInfo.serverId.ToString(), gameRoleInfo.serverName, gameRoleInfo.roleLv, gameRoleInfo.openServerTime.ToString());
         }
     }
 
@@ -149,8 +165,9 @@ public class YouYiSDKAndroid : SDKBase
         }
         if (m_AJO != null)
         {
-            JsonUtility.ToJson(gameRoleInfo);
-            m_AJO.Call("loginRoleLog", gameRoleInfo);
+            SetSDKGameRoleInfo(gameRoleInfo);
+            string data = JsonUtility.ToJson(mSDKGameRoleInfo);
+            m_AJO.Call("levelLog", data);
             //m_AJO.Call("levelLog", gameRoleInfo.roleId.ToString(), gameRoleInfo.roleName, gameRoleInfo.serverId.ToString(), gameRoleInfo.serverName, gameRoleInfo.roleLv, gameRoleInfo.openServerTime.ToString());
         }
     }
@@ -181,26 +198,26 @@ public class YouYiSDKAndroid : SDKBase
     }
 
     public override bool CheckHasModul(SDKModulType needCheckModulType)
-	{
-		if (needCheckModulType == SDKModulType.EXIT_VIEW)
-		{
+    {
+        if (needCheckModulType == SDKModulType.EXIT_VIEW)
+        {
             return true;
-        }	
-		return base.CheckHasModul(needCheckModulType);
-	}
-
-	public override void OpenModul(SDKModulType sDKModulType)
-	{
-		if (sDKModulType == SDKModulType.EXIT_VIEW)
-		{
-			if (m_AJO != null)
+        }
+        return base.CheckHasModul(needCheckModulType);
+    }
+
+    public override void OpenModul(SDKModulType sDKModulType)
+    {
+        if (sDKModulType == SDKModulType.EXIT_VIEW)
+        {
+            if (m_AJO != null)
             {
                 m_AJO.Call("exit");
             }
-			return;
-		}
-		base.OpenModul(sDKModulType);
-	}
+            return;
+        }
+        base.OpenModul(sDKModulType);
+    }
 
     public override bool IsReportAction() { return true; }
 
@@ -232,20 +249,20 @@ public class YouYiSDKAndroid : SDKBase
         AndroidJavaObject hashMapAJO = new AndroidJavaObject("java.util.HashMap");
         object[] args = new object[2];
         System.IntPtr putMethod = AndroidJNIHelper.GetMethodID(
-			hashMapAJO.GetRawClass(), "put",
-			"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
-        foreach(var data in datas)
+            hashMapAJO.GetRawClass(), "put",
+            "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
+        foreach (var data in datas)
         {
             AndroidJavaObject key = GetAndroidJavaObject(data.Key);
             if (key == null) continue;
             AndroidJavaObject value = GetAndroidJavaObject(data.Value);
             if (value == null) continue;
             args[0] = key;
-			args[1] = value;
-			AndroidJNI.CallObjectMethod(
-				hashMapAJO.GetRawObject(),
-				putMethod, 
-				AndroidJNIHelper.CreateJNIArgArray(args));
+            args[1] = value;
+            AndroidJNI.CallObjectMethod(
+                hashMapAJO.GetRawObject(),
+                putMethod,
+                AndroidJNIHelper.CreateJNIArgArray(args));
             key.Dispose();
             value.Dispose();
         }
@@ -303,7 +320,7 @@ public class YouYiSDKAndroid : SDKBase
         {
             if (type.Equals(typeof(string)))
             {
-                return new AndroidJavaObject ("java.lang.String", value);
+                return new AndroidJavaObject("java.lang.String", value);
             }
             else if (type.Equals(typeof(AndroidJavaObject)))
             {
@@ -316,16 +333,30 @@ public class YouYiSDKAndroid : SDKBase
     private string GetCurRoleInfo()
     {
         string ret = null;
-
-        GameRoleInfo gameRoleInfo = SDKMgr.Instance.GetGameRoleInfo();
-        if (gameRoleInfo != null)
+        SetSDKGameRoleInfo();
+        //GameRoleInfo gameRoleInfo = SDKMgr.Instance.GetGameRoleInfo();
+        if (mSDKGameRoleInfo != null)
         {
-            ret = JsonUtility.ToJson(gameRoleInfo);
+            ret = JsonUtility.ToJson(mSDKGameRoleInfo);
         }
 
         return ret;
     }
-    
+
+    private void SetSDKGameRoleInfo(GameRoleInfo gameRoleInfo = null)
+    {
+        if (gameRoleInfo == null)
+            gameRoleInfo = SDKMgr.Instance.GetGameRoleInfo();
+        if (gameRoleInfo == null) return;
+        if (mSDKGameRoleInfo == null)
+        {
+            mSDKGameRoleInfo = new SDKGameRoleInfo(gameRoleInfo);
+        }
+        else
+        {
+            mSDKGameRoleInfo.Set(gameRoleInfo);
+        }
+    }
 }
 
 
@@ -341,5 +372,72 @@ public class GameOrderInfo
     public string cpExtra;
     public string callbackUrl;
 }
+public class SDKGameRoleInfo
+{
+    // 必填参数
+    public String openId;
+    public int serverId;
+    public String serverName;
+    public String roleId;
+    public String roleName;
+
+    public int roleLv;
+    public long roleCreateTime;
+    public long roleUpLvTime;
+
+    // 非必填参数
+    public int vipLv;
+    public int gender;
+    public int jobId;
+    public String jobName;
+    public long guildId;
+    public String guildName;
+    public int fightPower;
+    public String balance;
+
+
+    // 其它参数
+    public long lastLogoutTime;
+    public long loginTime;
+    public long openServerTime;
+
+    public SDKGameRoleInfo()
+    {
 
+    }
+    public SDKGameRoleInfo(GameRoleInfo roleInfo)
+    {
+        Set(roleInfo);
+    }
+
+    public void Set(GameRoleInfo roleInfo)
+    {
+        // 必填参数
+        openId = roleInfo.openId;
+        serverId = roleInfo.serverId;
+        serverName = roleInfo.serverName;
+        roleId = roleInfo.roleId;
+        roleName = roleInfo.roleName;
+
+        roleLv = roleInfo.roleLv;
+        roleCreateTime = roleInfo.roleCreateTime;
+        roleUpLvTime = roleInfo.roleUpLvTime;
+
+        // 非必填参数
+        vipLv = roleInfo.vipLv;
+        gender = roleInfo.gender;
+        jobId = roleInfo.jobId;
+        jobName = roleInfo.jobName;
+        guildId = roleInfo.guildId;
+        guildName = roleInfo.guildName;
+        fightPower = roleInfo.fightPower;
+        balance = roleInfo.balance;
+
+
+        // 其它参数
+        lastLogoutTime = roleInfo.lastLogoutTime;
+        loginTime = roleInfo.loginTime;
+        openServerTime = roleInfo.openServerTime;
+    }
+}
 #endif

+ 190 - 0
Build/BuildDependenceResource/Plugins/iOS/MianYou_SDK_IOS/QsdkMgr.mm

@@ -0,0 +1,190 @@
+#import <Foundation/Foundation.h>
+
+@import OEGFramework;
+
+extern "C" 
+{
+    static  NSString* UnityListenerGoName;
+
+
+    void QSDK_SetListener(const char *gameObjectName){
+       UnityListenerGoName = QsdkCreateNSString(gameObjectName);
+    }
+
+
+    void SendMsgToUnity(NSString* messageName,messageName* parameters)
+    {
+
+        if (!UnityListenerGoName) {
+            NSLog(@"U3D not set listener");
+            return;
+        }
+        if ([parameters isKindOfClass:NSString.class] && [parameters length]) {
+            UnitySendMessage([UnityListenerGoName UTF8String], [messageName UTF8String], [parameters UTF8String]);
+        }
+        else{
+            UnitySendMessage([UnityListenerGoName UTF8String], [messageName UTF8String], "");
+        }
+    }
+
+    NSString* QsdkCreateNSString (const char* string)
+    {
+        if (string)
+            return [NSString stringWithUTF8String: string];
+        else
+            return [NSString stringWithUTF8String: ""];
+    }
+
+
+void QSDK_Init() {
+    
+    //SDK初始化 code: 0:成功, 1:失败
+    [[CrudeMingle share] InitEhuoia:^(int code, NSString * _Nonnull msg) {
+        NSLog(@"code=%d, msg=%@", code, msg);
+        if(code == 0)
+        {
+            SendMsgToUnity(@"onInitSuccess",@"Init:Init Success");
+        }
+        else
+        {
+            SendMsgToUnity(@"onInitSuccess",@"Fail");
+        }
+    }];
+
+}
+
+void QSDK_login() {
+
+    //使用SDK登录界面登录
+    [[CrudeMingle share] LoginEhuoiaWithCallback:^(int code, NSString * _Nonnull msg, NSString * _Nonnull sessionID, NSString * _Nonnull accountid, NSString * _Nonnull fbid, NSString * _Nonnull loginType) {
+        NSLog(@"code=%d, msg=%@, sessionID=%@, accountid=%@, loginType=%@", code, msg, sessionID, accountid, loginType);
+
+        if (code == 0)
+        {
+            SendMsgToUnity(@"onLoginSuccess",[NSString stringWithFormat:@"%d[]%@[]%@[]%@[]%@",code,msg, sessionID, accountid, loginType]);
+        }
+        else
+        {
+             SendMsgToUnity(@"onLoginFail",msg);
+        }
+    }];
+
+}
+
+void QSDK_Pay(const char *productId,const char *productName,const char * amount,const char *orderNo,
+                const char *callBackUrl,const char *extrasParams, 
+                const char * gameName,const char * serverName,const char* productDesc) {
+    
+    //支付
+    [[CrudeMingle share] FuEhuoiaWithPrice:QsdkCreateNSString(amount)
+         GameName:QsdkCreateNSString(gameName)
+       ServerName:QsdkCreateNSString(serverName)
+    CustomOrderId:QsdkCreateNSString(orderNo)
+       CustomInfo:QsdkCreateNSString(extrasParams)
+        ProductId:QsdkCreateNSString(productId)
+      ProductDesc:QsdkCreateNSString(productDesc)
+      CallBackUrl:QsdkCreateNSString(callBackUrl) AndCallBack:^(int code, NSString * _Nonnull msg, NSString * _Nonnull orderID) {
+          
+          NSLog(@"支付回调:code=%d, msg=%@, orderID=%@", code, msg, orderID);
+        if (code == 0)
+        {
+            SendMsgToUnity(@"onPaySuccess",@"支付Suc");
+        }
+        else
+        {
+             SendMsgToUnity(@"onPayFail",@"");
+        }
+      }];
+    
+}
+
+void QSDK_logout() {
+    
+    //退出登录
+    if ([[CrudeMingle share] logout]) {
+        NSLog(@"退出登录成功");
+         SendMsgToUnity(@"onLogoutSuccess",@"");
+    };
+}
+
+}
+// 1. OEGActionType:
+// typedef enum {
+//     Register = 0,
+//     LoginOEGID,
+//     LoginFacebook,
+//     LoginGoogle,
+//     LoginApple,
+//     Playnow,
+//     Logout,
+//     Profile,
+//     ChangePassword,
+//     ForgotPassword,
+//     VerifyEmail,
+//     VerifyPhone,
+//     Close
+// }OEGActionType;
+void SDK_OEG_AccountCallback(OEGActionType type, id _Nullable response, BOOL success, NSError  * _Nullable error)
+{
+    if(error)
+    {
+        NSLog(@"error:%@",error);
+    }
+    else
+    {
+        if(type == OEGActionType.Logout)
+        {
+            if(success)
+            {
+                NSLog(@"退出登录成功");
+                SendMsgToUnity(@"onLogoutSuccess",@"");
+            }
+            return;
+        }
+
+        if(success)
+        {
+            NSString status = response[@"status"];
+            NSString token = response[@"token"];
+            NSString uuid = response[@"uuid"];
+            NSString message = response[@"message"];
+
+            if(status == @"success")
+            {
+                int code = 0;
+                SendMsgToUnity(@"onLoginSuccess",[NSString stringWithFormat:@"%d[]%@[]%@[]%@[]%@",code,message, token, uuid, "111"]);
+            }
+            else
+            {
+                SendMsgToUnity(@"onLoginFail",message);
+            }
+        }
+    }
+}
+
+// typedef enum {
+//         OEGPurchasing = 0,
+//         OEGPurchased, // Purchased with Apple and verify server error
+//         OEGRestored,
+//         OEGFailed,
+//         OEGRequestError, // Request Product ID error
+//         OEGVerified // Purchased with Apple and verify server success
+// }OEGIAPStatus;
+void SDK_OEG_Pay_IAPCallback(OEGIAPStatus status, NSString *message, NSError  * _Nullable error)
+{
+    if(error)
+    {
+          NSLog(@"error:%@",error);
+    }
+    else
+    {
+        if(status == OEGIAPStatus.OEGVerified)
+        {
+            SendMsgToUnity(@"onPaySuccess",@"支付Suc");
+        }
+        else
+        {
+             SendMsgToUnity(@"onPayFail",@"");
+        }
+    }
+}