Pārlūkot izejas kodu

分享次数记录。 每日首次分享获得奖励

hexiaojie 1 gadu atpakaļ
vecāks
revīzija
9432f46f24

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Platform/ShareSDK/QDShareManager.cs

@@ -97,8 +97,9 @@ namespace GFGGame
         {
             if (state == ResponseState.Success)
             {
-                
+                ShareRecordSProxy.ReqShareRecord().Coroutine();
             }
+
             Debug.Log($"OnShareResult");
         }
 

+ 32 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/ShareRecordSProxy.cs

@@ -0,0 +1,32 @@
+using ET;
+
+namespace GFGGame
+{
+    public class ShareRecordSProxy
+    {
+        /// <summary>
+        /// 分享成功请求服务端进行分享次数记录
+        /// </summary>
+        /// <returns></returns>
+        public static async ETTask<bool> ReqShareRecord()
+        {
+            M2C_ShareRecordTimes response;
+            response = (M2C_ShareRecordTimes)await MessageHelper.SendToServer(new C2M_ShareRecordTimes());
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    if (response.RewardList.Count > 0)
+                    {
+                        // 奖励弹窗
+                        BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(response.RewardList));
+                    }
+
+                    return true;
+                }
+            }
+
+            return false;
+        }
+    }
+}

+ 3 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/ShareRecordSProxy.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 1528643098e44dbdb608418961271e07
+timeCreated: 1718375771