Skip to content

Commit 003c6bd

Browse files
committed
修改match map url
1 parent ae08c17 commit 003c6bd

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

CrazyCar/Assets/Scripts/System/DataParseSystem.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public interface IDataParseSystem : ISystem {
1313
void ParseTimeTrialRank(JsonData jsonData, Action success = null);
1414
void ParseTimeTrialResult(JsonData jsonData, Action success = null);
1515
void ParseMatchClassData(JsonData jsonData, Action success = null);
16+
void ParseMatchMapData(JsonData jsonData, Action success = null);
1617
public void ParseSelectMatch(JsonData jsonData, Action success = null);
1718
void ParseMatchRank(JsonData data, Action success = null);
1819
void ParseEquipRes(JsonData jsonData, Action success = null);
@@ -133,6 +134,24 @@ public void ParseTimeTrialResult(JsonData jsonData, Action success = null) {
133134
}
134135

135136
public void ParseMatchClassData(JsonData jsonData, Action success = null) {
137+
var matchModel = this.GetModel<IMatchModel>();
138+
matchModel.MatchDic.Clear();
139+
for (int i = 0; i < jsonData.Count; i++) {
140+
MatchInfo info = new MatchInfo();
141+
info.cid = (int)jsonData[i]["cid"];
142+
info.name = (string)jsonData[i]["name"];
143+
info.star = (int)jsonData[i]["star"];
144+
info.mapId = (int)jsonData[i]["map_id"];
145+
info.limitTime = (int)jsonData[i]["limit_time"];
146+
info.times = (int)jsonData[i]["times"];
147+
info.startTime = (long)jsonData[i]["start_time"];
148+
info.enrollTime = (long)jsonData[i]["enroll_time"];
149+
matchModel.MatchDic[info.cid] = info;
150+
}
151+
success?.Invoke();
152+
}
153+
154+
public void ParseMatchMapData(JsonData jsonData, Action success = null) {
136155
var matchModel = this.GetModel<IMatchModel>();
137156
matchModel.MatchDic.Clear();
138157
int defaultSelect = 0;

CrazyCar/Assets/Scripts/UI/Homepage/HomepageUI.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ private void Start() {
5555
}
5656

5757
StartCoroutine(this.GetSystem<INetworkSystem>().POSTHTTP(url: this.GetSystem<INetworkSystem>().HttpBaseUrl +
58-
RequestUrl.matchDetailUrl,
58+
RequestUrl.matchMapUrl,
5959
token: this.GetModel<IGameModel>().Token.Value,
6060
succData: (data) => {
61-
this.GetSystem<IDataParseSystem>().ParseMatchClassData(data, () => {
61+
this.GetSystem<IDataParseSystem>().ParseMatchMapData(data, () => {
6262
if (this.GetModel<IMatchModel>().MatchDic.Count > 0) {
6363
this.SendCommand(new ShowPageCommand(UIPageType.MatchRoomUI));
6464
} else {

CrazyCar/Assets/Scripts/Utility/PathRecorderUtility.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ public static class RequestUrl {
1919
public static string equipUrl = "Equip";
2020
public static string buyEquipUrl = "BuyEquip";
2121
public static string changeEquipUrl = "ChangeEquip";
22-
public static string matchDetailUrl = "TimeTrialDetail";
22+
public static string matchDetailUrl = "MatchDetail";
23+
public static string matchMapUrl = "TimeTrialDetail";
2324
public static string matchResultUrl = "MatchResult";
2425
public static string createMatchUrl = "CreateMatch";
2526
public static string kcpServerUrl = "KCPRttServer";

0 commit comments

Comments
 (0)