From 87f7b707463f2ac18a271f2ad3525c6ed7e18e39 Mon Sep 17 00:00:00 2001 From: xiangmy21 <90919434+xiangmy21@users.noreply.github.com> Date: Wed, 8 May 2024 03:40:42 +0800 Subject: [PATCH] fix(http): ContestResult type (#321) * Update run.sh * Update HttpSender.cs * fix(http): ContestResult type --- logic/Server/GameServer.cs | 3 ++- logic/Server/HttpSender.cs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/logic/Server/GameServer.cs b/logic/Server/GameServer.cs index acee6f86..35292541 100755 --- a/logic/Server/GameServer.cs +++ b/logic/Server/GameServer.cs @@ -15,7 +15,8 @@ namespace Server { public class ContestResult { - public int score; + public string status; + public int[] scores; } partial class GameServer : ServerBase { diff --git a/logic/Server/HttpSender.cs b/logic/Server/HttpSender.cs index c9652b5d..8c3e6db1 100755 --- a/logic/Server/HttpSender.cs +++ b/logic/Server/HttpSender.cs @@ -58,8 +58,8 @@ public async Task GetLadderScore(double[] scores) var jsonString = await response.Content.ReadAsStringAsync(); // 解析 JSON 字符串 - var result = JsonConvert.DeserializeObject(jsonString); - return result.Scores.Select(score => (double)score).ToArray();; + var result = JsonConvert.DeserializeObject(jsonString); + return result.Scores.Select(score => (double)score).ToArray(); } catch (Exception e) {