Skip to content

Commit

Permalink
Merge branch 'dev' of ssh://ssh.github.com:443/hhzzff/THUAI7 into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
hhzzff committed Apr 16, 2024
2 parents fa9b9a1 + b209fa2 commit c9d0291
Show file tree
Hide file tree
Showing 23 changed files with 977 additions and 360 deletions.
8 changes: 8 additions & 0 deletions CAPI/python/generate_proto.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
python3 -m pip install -r requirements.txt

mkdir -p proto

python3 -m grpc_tools.protoc -I../../dependency/proto/ --python_out=./proto --pyi_out=./proto MessageType.proto
python3 -m grpc_tools.protoc -I../../dependency/proto/ --python_out=./proto --pyi_out=./proto Message2Clients.proto
python3 -m grpc_tools.protoc -I../../dependency/proto/ --python_out=./proto --pyi_out=./proto Message2Server.proto
python3 -m grpc_tools.protoc -I../../dependency/proto/ --python_out=./proto --pyi_out=./proto --grpc_python_out=./proto Services.proto
48 changes: 43 additions & 5 deletions installer/Data/ConfigFileData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,18 @@ public record CommandFile

public bool Launched { get; set; } = false;

public int TeamID { get; set; } = 0;

public int PlayerID { get; set; } = 2024;

public int ShipType { get; set; } = 0;
}

public record ConfigDataFile
{
public string Description { get; set; } = "THUAI7-2024";
public string MD5DataPath { get; set; } = ".\\hash.json";
public bool Installed { get; set; } = false;
public string InstallPath { get; set; } = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
"THUAI7", "Data"
Expand Down Expand Up @@ -159,6 +164,19 @@ public bool Launched
}


public int TeamID
{
get => file.TeamID;
set
{
var temp = file.TeamID;
file.TeamID = value;
if (temp != value)
OnMemoryChanged?.Invoke(this, new EventArgs());
}
}


public int PlayerID
{
get => file.PlayerID;
Expand All @@ -170,6 +188,19 @@ public int PlayerID
OnMemoryChanged?.Invoke(this, new EventArgs());
}
}


public int ShipType
{
get => file.ShipType;
set
{
var temp = file.ShipType;
file.ShipType = value;
if (temp != value)
OnMemoryChanged?.Invoke(this, new EventArgs());
}
}
}

public class ConfigData
Expand Down Expand Up @@ -270,6 +301,18 @@ public string MD5DataPath
}
}

public bool Installed
{
get => file.Installed;
set
{
var temp = file.Installed;
file.Installed = value;
if (temp != value)
OnMemoryChanged?.Invoke(this, new EventArgs());
}
}

public string InstallPath
{
get => file.InstallPath;
Expand All @@ -282,11 +325,6 @@ public string InstallPath
}
}

public string InstallerPath
{
get => file.InstallerPath;
}

public string Token
{
get => file.Token;
Expand Down
8 changes: 0 additions & 8 deletions installer/Data/DownloadReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,6 @@ public long Completed
}
}

public event PropertyChangingEventHandler? OnReport;

public override void OnPropertyChanged([CallerMemberName] string propertyName = "")
{
OnReport?.Invoke(this, null);
base.OnPropertyChanged(propertyName);
}

private bool bFTE;
private long cot;
private long com;
Expand Down
Loading

0 comments on commit c9d0291

Please sign in to comment.