Skip to content

Commit

Permalink
add feature
Browse files Browse the repository at this point in the history
  • Loading branch information
GuoWQ222 committed May 11, 2024
1 parent 1f5815a commit bae11f1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion logic/Server/GameServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit bae11f1

Please sign in to comment.