From f9c71b44b427a77e287faeded794f5ef16af73f6 Mon Sep 17 00:00:00 2001 From: DreamEnderKing Date: Wed, 8 May 2024 12:17:02 +0800 Subject: [PATCH 1/5] fix: :bug: Fix the bug caused by low priority of ?? operator. --- installer/ViewModel/DebugViewModel.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/ViewModel/DebugViewModel.cs b/installer/ViewModel/DebugViewModel.cs index c6f19f96..62823b4c 100644 --- a/installer/ViewModel/DebugViewModel.cs +++ b/installer/ViewModel/DebugViewModel.cs @@ -370,7 +370,7 @@ public bool LaunchPyAPI(int team, int player) { FileName = "cmd.exe", Arguments = "/c python " - + Downloader.Data.Config.DevPyPath ?? Path.Combine(Downloader.Data.Config.InstallPath, "CAPI", "python", "PyAPI", "main.py") + + (Downloader.Data.Config.DevPyPath ?? Path.Combine(Downloader.Data.Config.InstallPath, "CAPI", "python", "PyAPI", "main.py")) + $" -I {IP} -P {Port} -t {team} -p {player} -o" }); if (py is null) @@ -378,7 +378,7 @@ public bool LaunchPyAPI(int team, int player) Log.LogError($"未能启动main.py, team:{team}, player: {player}!"); return false; } - Log.LogError($"main.py启动成功, team:{team}, player: {player}!"); + Log.LogInfo($"main.py启动成功, team:{team}, player: {player}!"); children.Add(py); return true; } From 6d64ca4a3621eb8563f21ac751251961ad13235f Mon Sep 17 00:00:00 2001 From: DreamEnderKing Date: Wed, 8 May 2024 12:18:39 +0800 Subject: [PATCH 2/5] chore: :bookmark: Update installer version. --- installer/Data/MD5FileData.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/Data/MD5FileData.cs b/installer/Data/MD5FileData.cs index f30e30b1..ef3ba870 100644 --- a/installer/Data/MD5FileData.cs +++ b/installer/Data/MD5FileData.cs @@ -26,7 +26,7 @@ public class TVersion { // 代码库版本 [JsonInclude] - public Version LibVersion = new Version(1, 0, 2, 1); + public Version LibVersion = new Version(1, 0, 2, 2); // 选手代码模板版本 [JsonInclude] public Version TemplateVersion = new Version(1, 0, 0, 3); From 65cb19f944c190d8628c0ab0e977bdbf87b6a710 Mon Sep 17 00:00:00 2001 From: Xuc Pan Date: Wed, 8 May 2024 21:39:03 +0800 Subject: [PATCH 3/5] fix: :bug: Home add money after destroyed --- logic/GameClass/GameObj/Base.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logic/GameClass/GameObj/Base.cs b/logic/GameClass/GameObj/Base.cs index f4d57256..cb4d24a1 100644 --- a/logic/GameClass/GameObj/Base.cs +++ b/logic/GameClass/GameObj/Base.cs @@ -20,7 +20,7 @@ public class Base : IPlayer public Home Home { get; set; } public MoneyPool MoneyPool { get; } = new(); public AtomicInt FactoryNum { get; } = new(0); - public int MoneyAddPerSecond => GameData.ScoreHomePerSecond + FactoryNum * GameData.ScoreFactoryPerSecond; + public int MoneyAddPerSecond => FactoryNum * GameData.ScoreFactoryPerSecond + (Home.HP > 0 ? GameData.ScoreHomePerSecond : 0); public Base(Home home) { TeamID = new(home.TeamID); From f2a356c504b8b8ca30b609adabe6a2a7e57e4238 Mon Sep 17 00:00:00 2001 From: Grange <2634070476@qq.com> Date: Wed, 8 May 2024 22:44:46 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix:=20=F0=9F=90=9B=20[playback]=20No=20cha?= =?UTF-8?q?nges=20but=20it=20works,=20don't=20know=20why?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logic/Client/ViewModel/GeneralViewModel.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/logic/Client/ViewModel/GeneralViewModel.cs b/logic/Client/ViewModel/GeneralViewModel.cs index 01e7132f..05ad23ee 100644 --- a/logic/Client/ViewModel/GeneralViewModel.cs +++ b/logic/Client/ViewModel/GeneralViewModel.cs @@ -1078,7 +1078,7 @@ Show the error message myLogger.LogInfo(String.Format("ip:{0}, port:{1}, playerid:{2}, teamid:{3}, shiptype:{4}, playbackfile:{5}, playbackspeed:{6}", ip, port, playerID, teamID, shipTypeID, playbackFile, playbackSpeed)); - //Playback("E:\\program\\Project\\THUAI7\\logic\\Client\\114514.thuaipb", 2.0); + //Playback("E:\\program\\Project\\playback.thuaipb", 0.5); if (playbackFile.Length == 0) { try @@ -1106,6 +1106,7 @@ Show the error message } else { + //myLogger.LogInfo(String.Format("PlaybackFile:{0}", playbackFile)); Playback(playbackFile, playbackSpeed); } //连接Server,comInfo[] 的格式:0 - ip 1 - port 2 - playerID 3 - teamID 4 - ShipType From c1670f98d6c2b64293f68478b6eb7ae6ef68434e Mon Sep 17 00:00:00 2001 From: sigureling <1678348940@qq.com> Date: Thu, 9 May 2024 00:05:27 +0800 Subject: [PATCH 5/5] fix: :bug: fix import time --- CAPI/python/PyAPI/Communication.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CAPI/python/PyAPI/Communication.py b/CAPI/python/PyAPI/Communication.py index 3a997cc9..9733011f 100644 --- a/CAPI/python/PyAPI/Communication.py +++ b/CAPI/python/PyAPI/Communication.py @@ -6,7 +6,7 @@ import proto.Message2Clients_pb2 as Message2Clients import threading import grpc - +import time from typing import Union