Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.0.2 #333

Merged
merged 15 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CAPI/python/PyAPI/Communication.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import proto.Message2Clients_pb2 as Message2Clients
import threading
import grpc

import time
from typing import Union


Expand Down
2 changes: 1 addition & 1 deletion installer/Data/MD5FileData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions installer/ViewModel/DebugViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,15 +370,15 @@ 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)
{
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;
}
Expand Down
3 changes: 2 additions & 1 deletion logic/Client/ViewModel/GeneralViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion logic/GameClass/GameObj/Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading