cxhy 1 vuosi sitten
vanhempi
commit
7eb562a850
2 muutettua tiedostoa jossa 27 lisäystä ja 2 poistoa
  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");
+            });
+        }
     }
 }