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 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); 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; } 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 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);