Explorar o código

依次为基准

gfgios hai 1 ano
pai
achega
49fbc98b1f

+ 16 - 13
GameClient/Assets/Game/HotUpdate/Platform/QDDouYouManagerIos.cs

@@ -49,7 +49,7 @@ namespace GFGGame
         {
             QDManager.PushRoleAction(DouYouRoleLogReportType.ExitGame);
         }
-        
+
         // 辅助方法:处理空值
         private static string HandleNullString(string value)
         {
@@ -73,13 +73,13 @@ namespace GFGGame
             }
 
             string currencyName = string.Empty;
-           
-            if (shopCfg.costType ==  CostType.FREE)
+
+            if (shopCfg.costType == CostType.FREE)
             {
                 //免费
                 currencyName = "免费";
             }
-            else if(shopCfg.costType ==  CostType.ITEM)
+            else if (shopCfg.costType == CostType.ITEM)
             {
                 //货币
                 ItemCfg costItemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.costId);
@@ -89,10 +89,10 @@ namespace GFGGame
                 }
                 else
                 {
-                    currencyName = costItemCfg.name; 
+                    currencyName = costItemCfg.name;
                 }
             }
-            else if(shopCfg.costType ==  CostType.RMB)
+            else if (shopCfg.costType == CostType.RMB)
             {
                 //人民币
                 currencyName = "人民币";
@@ -102,7 +102,7 @@ namespace GFGGame
                 //指定渠道商品id
                 currencyName = $"指定商品id{shopCfg.costId}";
             }
-            
+
             var zoneScene = GameGlobal.zoneScene;
             if (zoneScene == null) return;
 
@@ -125,8 +125,8 @@ namespace GFGGame
             string cpOrderId = orderID;
             string productPrice = price.ToString();
             string productId = shopCfg.id.ToString();
-            string productName = shopCfg.productName;
-            string productDesc = "";
+            string productName = shopCfg?.itemName ?? "";
+            string productDesc = shopCfg?.itemName ?? "";
             string productCount = count.ToString();
             string exchangeRate = 1.ToString();
             string serverId = (serverInfosComponent?.CurrentServerId ?? 0).ToString();
@@ -139,7 +139,10 @@ namespace GFGGame
             string roleBalence = "0";
             string other = orderID + "|gfg|" + roleInfo.Id;
 
-            Debug.Log($"Ios ShowPay: cpOrderId:{cpOrderId} productPrice:{productPrice} productId:{productId} productName:{productName} productDesc:{productDesc} productCount:{productCount} exchangeRate:{exchangeRate} serverId:{serverId} serverName:{serverName} roleId:{roleId} roleName:{roleName} roleLevel:{roleLevel} roleVip:{roleVip} partyName:{partyName} roleBalence:{roleBalence} other:{other}");
+            Debug.Log(
+                $"Ios ShowPay: cpOrderId:{cpOrderId} productPrice:{productPrice} productId:{productId} productName:{productName} productDesc:{productDesc} " +
+                $"productCount:{productCount} exchangeRate:{exchangeRate} serverId:{serverId} serverName:{serverName} roleId:{roleId} roleName:{roleName} " +
+                $"roleLevel:{roleLevel} roleVip:{roleVip} partyName:{partyName} roleBalence:{roleBalence} other:{other} currencyName:{currencyName}");
             QDDouYouManagerInitIos.Instance.ShowPay(cpOrderId, productPrice, productId, productName, productDesc,
                 productCount, exchangeRate, currencyName, serverId, serverName, roleId, roleName, roleLevel, roleVip,
                 partyName, roleBalence, other);
@@ -177,10 +180,10 @@ namespace GFGGame
         /// <param name="message">resUid + "|gfg|" + token</param>
         public void LoginSuccessAb(string message)
         {
-      
             Debug.Log("Game.HotUpdate ios LoginSuccessAb: " + message);
-            
-            DouYouIosSdkLoginResModel douYouIosSdkLoginResModel = LitJson.JsonMapper.ToObject<DouYouIosSdkLoginResModel>(message);
+
+            DouYouIosSdkLoginResModel douYouIosSdkLoginResModel =
+                LitJson.JsonMapper.ToObject<DouYouIosSdkLoginResModel>(message);
             if (douYouIosSdkLoginResModel == null)
             {
                 Log.Error($"注意,解析登录回调失败,回调的字符串为 {message} douYouIosSdkLoginResModel is null.");

+ 3 - 1
GameClient/Assets/Game/Launcher/Platform/QDDouYouManagerInitIos.cs

@@ -78,7 +78,9 @@ namespace GFGGame.Launcher
             string roleBalence, string ext)
         {
             Debug.Log(
-                $"QDDouYouManagerInitIos.ShowPay: cpOrderId:{cpOrderId} productPrice:{productPrice} productId:{productId} productName:{productName} productDesc:{productDesc} productCount:{productCount} exchangeRate:{exchangeRate} serverId:{serverId} serverName:{serverName} roleId:{roleId} roleName:{roleName} roleLevel:{roleLevel} roleVip:{roleVip} partyName:{partyName} roleBalence:{roleBalence} other:{ext}");
+                $"QDDouYouManagerInitIos.ShowPay: cpOrderId:{cpOrderId} productPrice:{productPrice} productId:{productId} productName:{productName} " +
+                $"productDesc:{productDesc} productCount:{productCount} exchangeRate:{exchangeRate} serverId:{serverId} serverName:{serverName} " +
+                $"roleId:{roleId} roleName:{roleName} roleLevel:{roleLevel} roleVip:{roleVip} partyName:{partyName} roleBalence:{roleBalence} other:{ext}");
 
             douYouIosSDKHandler.SdkPaymentWithJson(cpOrderId, productPrice, productId, productName, productDesc,
                 productCount, exchangeRate, currencyName, serverId, serverName, roleId, roleName, roleLevel, roleVip,

+ 26 - 26
GameClient/Assets/Plugins/iOS/StraightPush/SDKManagerExt.mm

@@ -22,23 +22,23 @@ void __ImportPaymentWithJson(const char *cpOrderId, const char *productPrice, co
             const char *serverName, const char *roleId, const char *roleName, const char *roleLevel, const char *roleVip, const char *partyName,
             const char *roleBalence, const char *ext) {
                 NSDictionary *bayInfo = @{
-                @"product_id": productId ?: @"",
-                @"product_price" :productPrice ?: @"",
-                @"product_name" :productName ?: @"",
-                @"role_id" : roleId ?: @"",
-                @"role_name" : roleName ?: @"",
-                @"role_level" : roleLevel ?: @"",
-                @"server_id" : serverId ?: @"",
-                @"server_name": serverName ?: @"",
-                @"role_vip" : roleVip ?: @"",
-                @"party_name" : partyName ?: @"",
-                @"role_balence" : roleBalence ?: @"",
-                @"cp_order_id" : cpOrderId ?: @"",
-                @"product_count" : productCount ?: @"",
-                @"product_desc" : productDesc ?: @"",
-                @"exchange_rate" : exchangeRate ?: @"",
-                @"currency_name" : currencyName ?: @"",
-                @"ext" : ext ?: @"",
+                @"product_id": [NSString stringWithUTF8String:productId],
+                @"product_price" :[NSString stringWithUTF8String:productPrice],
+                @"product_name" :[NSString stringWithUTF8String:productName],
+                @"role_id" : [NSString stringWithUTF8String:roleId],
+                @"role_name" : [NSString stringWithUTF8String:roleName],
+                @"role_level" : [NSString stringWithUTF8String:roleLevel],
+                @"server_id" : [NSString stringWithUTF8String:serverId],
+                @"server_name": [NSString stringWithUTF8String:serverName],
+                @"role_vip" : [NSString stringWithUTF8String:roleVip],
+                @"party_name" : [NSString stringWithUTF8String:partyName],
+                @"role_balence" : [NSString stringWithUTF8String:roleBalence],
+                @"cp_order_id" : [NSString stringWithUTF8String:cpOrderId],
+                @"product_count" : [NSString stringWithUTF8String:productCount],
+                @"product_desc" : [NSString stringWithUTF8String:productDesc],
+                @"exchange_rate" : [NSString stringWithUTF8String:exchangeRate],
+                @"currency_name" : [NSString stringWithUTF8String:currencyName],
+                @"ext" : [NSString stringWithUTF8String:ext]
             };
           [[SDKManager sharedInstance] PaymentWithJson:bayInfo];
 }
@@ -46,15 +46,15 @@ void __ImportPaymentWithJson(const char *cpOrderId, const char *productPrice, co
 void __ImportRoleInfoWithJson(const char *type, const char *serverId, const char *serverName, const char *roleId, const char *roleName,
             const char *roleLevel, const char *roleVip, const char *partyName, const char *roleBalence) {
             NSDictionary *roleInfo = @{
-            @"type" : type ?: @"",
-            @"server_id" : serverId ?: @"",
-            @"server_name" :serverName ?: @"",
-            @"role_id" : roleId ?: @"",
-            @"role_name" : roleName ?: @"",
-            @"role_level" : roleLevel ?: @"",
-            @"role_vip" : roleVip ?: @"",
-            @"party_name" :partyName ?: @"",
-            @"role_balence" : roleBalence ?: @"" 
+            @"type" : [NSString stringWithUTF8String:type],
+            @"server_id" : [NSString stringWithUTF8String:serverId],
+            @"server_name" : [NSString stringWithUTF8String:serverName],
+            @"role_id" : [NSString stringWithUTF8String:roleId],
+            @"role_name" : [NSString stringWithUTF8String:roleName],
+            @"role_level" : [NSString stringWithUTF8String:roleLevel],
+            @"role_vip" : [NSString stringWithUTF8String:roleVip],
+            @"party_name" : [NSString stringWithUTF8String:partyName],
+            @"role_balence" : [NSString stringWithUTF8String:roleBalence]
         };
         [[SDKManager sharedInstance] RoleInfoWithJson:roleInfo];
     }