cxhy il y a 1 an
Parent
commit
7eb562a850
2 fichiers modifiés avec 27 ajouts et 2 suppressions
  1. 14 2
      Assets/Scripts/Api/ApiComp.cs
  2. 13 0
      Assets/Scripts/UI/GameStartJumper.cs

+ 14 - 2
Assets/Scripts/Api/ApiComp.cs

@@ -344,7 +344,7 @@ namespace Api
             ApiNotSession(path, req, success, errAction);
         }
 
-        public void GetBattleDetail(string battleSession,  Action<BattleDetailListObj> success,
+        public void GetBattleDetail(string battleSession, Action<BattleDetailListObj> success,
             Action<int, string> errAction)
         {
             var req = new ModelApiRequest
@@ -357,6 +357,18 @@ namespace Api
                 success(resp.battleInfo);
             }, errAction);
         }
-        
+
+
+        public void playerQuitGame(string battleSession, Action<ResponseSuccessData> success,
+            Action<int, string> errAction)
+        {
+            var req = new ModelApiRequest
+            {
+                api = "playerQuitGame",
+                battleSession = battleSession
+            };
+            Api(req, success, errAction);
+        }
+
     }
 }

+ 13 - 0
Assets/Scripts/UI/GameStartJumper.cs

@@ -25,5 +25,18 @@ namespace UI
             PageManagerComp.singleton.DisplayUI();
             HallComp.Instance.BackToHallAndRefreshUI();
         }
+
+
+        public static void PlayerQuitGame()
+        {
+            ApiComp.Instance.playerQuitGame(GameCore.Instance.curBattleSession, data =>
+            {
+                Debug.Log("player quit game success");
+                BackToUI();
+            }, (code, msg) =>
+            {
+                Debug.Log("player quit game fail");
+            });
+        }
     }
 }