From f8a98e21d0f4398c492c7de9f63c45bde4ccb717 Mon Sep 17 00:00:00 2001 From: GuoWQ222 Date: Sat, 11 May 2024 21:58:22 +0800 Subject: [PATCH] add feature --- logic/Server/GameServer.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/logic/Server/GameServer.cs b/logic/Server/GameServer.cs index a9bd1bf0..886a9482 100755 --- a/logic/Server/GameServer.cs +++ b/logic/Server/GameServer.cs @@ -110,7 +110,7 @@ private void SaveGameResult(string path) } - protected void SendGameResult(int[] scores, bool crashed) // 天梯的 Server 给网站发消息记录比赛结果 + protected void SendGameResult(int[] scores, bool crashed = false) // 天梯的 Server 给网站发消息记录比赛结果 { string? url2 = Environment.GetEnvironmentVariable("FINISH_URL"); if (url2 == null) @@ -229,6 +229,17 @@ private void OnGameEnd() scores = doubleArray.Select(x => (int)x).ToArray(); SendGameResult(scores, crash); } + else if (options.Mode == 1) + { + int[] s = new int[2]; + if (scores[1] > scores[0]) + s = [0, 2]; + else if (scores[1] == scores[0]) + s = [1, 1]; + else + s = [2, 0]; + SendGameResult(s); + } endGameSem.Release(); } public void ReportGame(GameState gameState, bool requiredGaming = true)