Skip to content

Commit a016e78

Browse files
committed
删除起用的网络逻辑
1 parent a284509 commit a016e78

File tree

3 files changed

+452
-273
lines changed

3 files changed

+452
-273
lines changed

CrazyCar/Assets/Scripts/System/NetworkSystem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public IEnumerator POSTHTTP(string url, byte[] data = null, string token = null,
7171

7272
yield return request.SendWebRequest();
7373

74-
if (request.isNetworkError || request.isHttpError) {
74+
if (request.result == UnityWebRequest.Result.ConnectionError || request.result == UnityWebRequest.Result.ProtocolError) {
7575
Debug.LogError("Is Network Error url = " + url);
7676
} else {
7777
this.SendEvent(new SetLoadingUIEvent(false));

CrazyCar/Assets/Scripts/UI/Login/DownloadResUI.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ private void Start() {
3030
Debug.Log("++++++ " + this.GetSystem<INetworkSystem>().HttpBaseUrl);
3131
byte[] bytes = Encoding.UTF8.GetBytes(sb.ToString());
3232
// Unity 2021 不能开启游戏就发送HTTP会有报错
33-
Util.DelayExecuteWithSecond(0.4f, () => {
34-
StartCoroutine(this.GetSystem<INetworkSystem>().POSTHTTP(url: this.GetSystem<INetworkSystem>().HttpBaseUrl + RequestUrl.forcedUpdatingUrl,
33+
StartCoroutine(this.GetSystem<INetworkSystem>().POSTHTTP(url: this.GetSystem<INetworkSystem>().HttpBaseUrl + RequestUrl.forcedUpdatingUrl,
3534
data: bytes, succData: (data) => {
3635
if ((bool)data["is_forced_updating"]) {
3736
this.SendCommand(new ShowInfoConfirmAlertCommand(content: this.GetSystem<II18NSystem>().GetText("Version is too low"),
@@ -45,7 +44,6 @@ private void Start() {
4544
DownloadRes();
4645
}
4746
}));
48-
});
4947
}
5048

5149
private void DownloadRes() {

0 commit comments

Comments
 (0)