Skip to content

Commit

Permalink
Repair map packets
Browse files Browse the repository at this point in the history
  • Loading branch information
cydyn committed Feb 22, 2024
1 parent 8bf7826 commit c14f213
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 4 deletions.
33 changes: 33 additions & 0 deletions Intersect (Core)/Updater/Updater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public partial class Updater
private string mConfigUrl;
private string mBaseUrl;


public Updater(string updateUrl, string currentVersionPath, bool isClient, int maxDownloadThreads = 10)
{
if (string.IsNullOrWhiteSpace(updateUrl))
Expand Down Expand Up @@ -76,6 +77,38 @@ public Updater(string updateUrl, string currentVersionPath, bool isClient, int m

private async void RunUpdates()
{
// Usunięcie folderu game.westerre.pl:5401 przed aktualizacją
string intersectFolderPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), ".intersect");
string westerreFolderPath = Path.Combine(intersectFolderPath, "Westerre");
string gameFolderPath = Path.Combine(westerreFolderPath, "game.westerre.pl.5401");

if (Directory.Exists(gameFolderPath))
{
try
{
// Usunięcie wszystkich plików i podfolderów w folderze game.westerre.pl:5401
foreach (string filePath in Directory.EnumerateFiles(gameFolderPath))
{
File.Delete(filePath);
}
foreach (string directoryPath in Directory.EnumerateDirectories(gameFolderPath))
{
Directory.Delete(directoryPath, true);
}

Console.WriteLine($"Deleted contents of {gameFolderPath} before update.");
}
catch (Exception ex)
{
Console.WriteLine($"Failed to delete contents of {gameFolderPath}: {ex.Message}");
// Obsłużenie błędu, jeśli nie można usunąć zawartości folderu
// Możesz zdecydować, czy chcesz przerwać aktualizację lub kontynuować
}
}
else
{
Console.WriteLine($"Folder {gameFolderPath} does not exist.");
}
DeleteOldFiles();

//Download Update Config
Expand Down
Binary file modified Intersect.Client/Icon.bmp
Binary file not shown.
11 changes: 7 additions & 4 deletions Intersect.Client/Intersect.Client.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand All @@ -12,14 +12,17 @@
</PropertyGroup>

<PropertyGroup>
<PackageId>AscensionGameDev.Intersect.Client</PackageId>
<Description>Game Client - Part of the Intersect 2D Game Creation Suite</Description>
<PackageId>Westerre</PackageId>
<Description>Klient Gry Westerre</Description>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<RootNamespace>Intersect.Client</RootNamespace>
<AssemblyName>Intersect Client</AssemblyName>
<AssemblyName>Westerre</AssemblyName>
<AppDesignerFolder>Properties</AppDesignerFolder>
<ApplicationManifest>app.manifest</ApplicationManifest>
<FileAlignment>512</FileAlignment>
<Authors>Westerre</Authors>
<Product>Westerre</Product>
<Copyright>Copyright © Westerre 2023</Copyright>
</PropertyGroup>

<ItemGroup>
Expand Down
Binary file modified assets/intersect-logo-qu.bmp
Binary file not shown.
Binary file modified assets/intersect-logo-qu.ico
Binary file not shown.
Binary file modified assets/intersect-logo-qu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c14f213

Please sign in to comment.