cxhy 1 년 전
부모
커밋
7eb562a850
2개의 변경된 파일27개의 추가작업 그리고 2개의 파일을 삭제
  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");
+            });
+        }
     }
 }