Skip to content

Commit ea41cdb

Browse files
authored
Merge pull request #98 from Gml-Launcher/develop
Update to v2025.3
2 parents 43d1506 + 4969d1f commit ea41cdb

173 files changed

Lines changed: 1860 additions & 62 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docker-package-publish.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/nuget-package.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ name: Publish NuGet Package
22

33
on:
44
push:
5-
tags:
6-
- 'v*' # Публикуем только при пуше тега, например v1.2.3
5+
tags: [ 'v*.*.*', 'v*.*', 'v*.*.*-alpha*', 'v*.*-alpha*' ]
76

87
jobs:
98
publish:
109
runs-on: ubuntu-latest
1110

1211
steps:
1312
- uses: actions/checkout@v4
13+
with:
14+
submodules: recursive
1415

1516
- name: Setup .NET
1617
uses: actions/setup-dotnet@v4
@@ -23,13 +24,26 @@ jobs:
2324
- name: Restore dependencies
2425
run: dotnet restore
2526

26-
- name: Pack NuGet package
27-
run: dotnet pack src/Gml.Core.Interfaces/Gml.Core.Interfaces.csproj --configuration Release --output ./nupkgs
27+
- name: Build Gml.Interfaces
28+
run: dotnet build src/Gml.Interfaces/Gml.Interfaces.csproj --configuration Release
29+
30+
- name: Pack Gml.Interfaces
31+
run: dotnet pack src/Gml.Interfaces/Gml.Interfaces.csproj --configuration Release --no-build --output ./nupkgs
32+
33+
- name: Build Gml.Domains
34+
run: dotnet build src/Gml.Domains/Gml.Domains.csproj --configuration Release
35+
36+
- name: Pack Gml.Domains
37+
run: dotnet pack src/Gml.Domains/Gml.Domains.csproj --configuration Release --no-build --output ./nupkgs
38+
39+
- name: Build Gml.Dto
40+
run: dotnet build src/Gml.Dto/Gml.Dto.csproj --configuration Release
41+
42+
- name: Pack Gml.Dto
43+
run: dotnet pack src/Gml.Dto/Gml.Dto.csproj --configuration Release --no-build --output ./nupkgs
2844

29-
# Публикуем в nuget.org
3045
- name: Publish to NuGet.org
31-
run: dotnet nuget push "./nupkgs/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
46+
run: dotnet nuget push "./nupkgs/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
3247

33-
# Публикуем в GitHub Packages
3448
- name: Publish to GitHub Packages
35-
run: dotnet nuget push "./nupkgs/*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
49+
run: dotnet nuget push "./nupkgs/*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --skip-duplicate

Gml.Core.sln

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "common", "common", "{94BDAC
88
ProjectSection(SolutionItems) = preProject
99
.editorconfig = .editorconfig
1010
.gitignore = .gitignore
11-
.github\workflows\docker-package-publish.yml = .github\workflows\docker-package-publish.yml
1211
README.md = README.md
1312
LICENSE = LICENSE
13+
.github\workflows\nuget-package.yml = .github\workflows\nuget-package.yml
1414
EndProjectSection
1515
EndProject
1616
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gml.Core", "src\Gml.Core\Gml.Core.csproj", "{21CA74E3-F9EA-4640-B5EF-EA3428FEECE8}"
1717
EndProject
18-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gml.Core.Interfaces", "src\Gml.Core.Interfaces\Gml.Core.Interfaces.csproj", "{3426695D-144A-4055-AC70-ED29B8180217}"
19-
EndProject
2018
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GmlCore.Tests", "tests\GmlCore.Tests\GmlCore.Tests.csproj", "{F437E3A7-05A0-481F-88F2-5769F116A39F}"
2119
EndProject
2220
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CmlLib.Core.Installer.Forge", "src\CmlLib.Core.Installer.Forge\CmlLib.Core.Installer.Forge\CmlLib.Core.Installer.Forge.csproj", "{32674E30-4ED0-46F4-9133-696A21E6887A}"
@@ -45,6 +43,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sample", "sample", "{083462
4543
EndProject
4644
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gml.Core.Sample.Console", "src\Gml.Core.Sample.Console\Gml.Core.Sample.Console.csproj", "{62B4117D-94E6-433E-B76C-38A79E788180}"
4745
EndProject
46+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gml.Interfaces", "src\Gml.Interfaces\Gml.Interfaces.csproj", "{FABFCC93-2A2F-4B0E-96B3-1AE24F210B8A}"
47+
EndProject
48+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gml.Dto", "src\Gml.Dto\Gml.Dto.csproj", "{AB8DEDD3-FED6-44F5-9DF9-02E7A4B2E9DF}"
49+
EndProject
50+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gml.Domains", "src\Gml.Domains\Gml.Domains.csproj", "{9A258A51-9828-49A5-A473-F100AB8A804D}"
51+
EndProject
4852
Global
4953
GlobalSection(SolutionConfigurationPlatforms) = preSolution
5054
Debug|Any CPU = Debug|Any CPU
@@ -55,10 +59,6 @@ Global
5559
{21CA74E3-F9EA-4640-B5EF-EA3428FEECE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
5660
{21CA74E3-F9EA-4640-B5EF-EA3428FEECE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
5761
{21CA74E3-F9EA-4640-B5EF-EA3428FEECE8}.Release|Any CPU.Build.0 = Release|Any CPU
58-
{3426695D-144A-4055-AC70-ED29B8180217}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
59-
{3426695D-144A-4055-AC70-ED29B8180217}.Debug|Any CPU.Build.0 = Debug|Any CPU
60-
{3426695D-144A-4055-AC70-ED29B8180217}.Release|Any CPU.ActiveCfg = Release|Any CPU
61-
{3426695D-144A-4055-AC70-ED29B8180217}.Release|Any CPU.Build.0 = Release|Any CPU
6262
{F437E3A7-05A0-481F-88F2-5769F116A39F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
6363
{F437E3A7-05A0-481F-88F2-5769F116A39F}.Debug|Any CPU.Build.0 = Debug|Any CPU
6464
{F437E3A7-05A0-481F-88F2-5769F116A39F}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -95,6 +95,18 @@ Global
9595
{62B4117D-94E6-433E-B76C-38A79E788180}.Debug|Any CPU.Build.0 = Debug|Any CPU
9696
{62B4117D-94E6-433E-B76C-38A79E788180}.Release|Any CPU.ActiveCfg = Release|Any CPU
9797
{62B4117D-94E6-433E-B76C-38A79E788180}.Release|Any CPU.Build.0 = Release|Any CPU
98+
{FABFCC93-2A2F-4B0E-96B3-1AE24F210B8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
99+
{FABFCC93-2A2F-4B0E-96B3-1AE24F210B8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
100+
{FABFCC93-2A2F-4B0E-96B3-1AE24F210B8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
101+
{FABFCC93-2A2F-4B0E-96B3-1AE24F210B8A}.Release|Any CPU.Build.0 = Release|Any CPU
102+
{AB8DEDD3-FED6-44F5-9DF9-02E7A4B2E9DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
103+
{AB8DEDD3-FED6-44F5-9DF9-02E7A4B2E9DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
104+
{AB8DEDD3-FED6-44F5-9DF9-02E7A4B2E9DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
105+
{AB8DEDD3-FED6-44F5-9DF9-02E7A4B2E9DF}.Release|Any CPU.Build.0 = Release|Any CPU
106+
{9A258A51-9828-49A5-A473-F100AB8A804D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
107+
{9A258A51-9828-49A5-A473-F100AB8A804D}.Debug|Any CPU.Build.0 = Debug|Any CPU
108+
{9A258A51-9828-49A5-A473-F100AB8A804D}.Release|Any CPU.ActiveCfg = Release|Any CPU
109+
{9A258A51-9828-49A5-A473-F100AB8A804D}.Release|Any CPU.Build.0 = Release|Any CPU
98110
EndGlobalSection
99111
GlobalSection(NestedProjects) = preSolution
100112
{F437E3A7-05A0-481F-88F2-5769F116A39F} = {89C1B6A5-3BEE-45EE-9CB2-BFB6E095DE0B}
@@ -108,9 +120,11 @@ Global
108120
{7A24CB48-82C7-4F8D-9511-DF69E8F8A342} = {0A839A5D-6C25-49CA-BCB1-FE261FC828E5}
109121
{02F6EFE2-6A85-40EE-9E7A-F3E32CFDF075} = {7A24CB48-82C7-4F8D-9511-DF69E8F8A342}
110122
{21CA74E3-F9EA-4640-B5EF-EA3428FEECE8} = {7A24CB48-82C7-4F8D-9511-DF69E8F8A342}
111-
{3426695D-144A-4055-AC70-ED29B8180217} = {7A24CB48-82C7-4F8D-9511-DF69E8F8A342}
112123
{FC610D36-F382-4BFA-A865-A70F18EFD771} = {0A839A5D-6C25-49CA-BCB1-FE261FC828E5}
113124
{FEBB9BAD-A445-4965-927C-3DED320900BD} = {FC610D36-F382-4BFA-A865-A70F18EFD771}
114125
{62B4117D-94E6-433E-B76C-38A79E788180} = {08346264-61DD-450B-93E9-F85E84E5C8F9}
126+
{FABFCC93-2A2F-4B0E-96B3-1AE24F210B8A} = {7A24CB48-82C7-4F8D-9511-DF69E8F8A342}
127+
{AB8DEDD3-FED6-44F5-9DF9-02E7A4B2E9DF} = {FC610D36-F382-4BFA-A865-A70F18EFD771}
128+
{9A258A51-9828-49A5-A473-F100AB8A804D} = {FC610D36-F382-4BFA-A865-A70F18EFD771}
115129
EndGlobalSection
116130
EndGlobal

src/Gml.Common/Gml.Common/Gml.Common.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<ProjectReference Include="..\..\Gml.Core.Interfaces\Gml.Core.Interfaces.csproj" />
9+
<ProjectReference Include="..\..\Gml.Interfaces\Gml.Interfaces.csproj" />
1010
</ItemGroup>
1111

1212
<ItemGroup>

src/Gml.Core.Sample.Console/Gml.Core.Sample.Console.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<ProjectReference Include="..\..\tests\GmlCore.Tests\GmlCore.Tests.csproj" />
1212
<ProjectReference Include="..\Gml.Core.Interfaces\Gml.Core.Interfaces.csproj" />
1313
<ProjectReference Include="..\Gml.Core\Gml.Core.csproj" />
14+
<ProjectReference Include="..\Gml.Interfaces\Gml.Interfaces.csproj" />
1415
</ItemGroup>
1516

1617
</Project>

src/Gml.Core/Core/Helpers/Profiles/ProfileProcedures.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,6 @@ public async Task<IEnumerable<IFileInfo>> GetProfileFiles(IGameProfile baseProfi
342342
if (profile == null)
343343
return null;
344344

345-
_ = profile.CreateUserSessionAsync(user);
346-
347345
var profileDirectory = Path.Combine(profile.ClientPath, "platforms", startupOptions.OsName,
348346
startupOptions.OsArch);
349347
var relativePath = Path.Combine("clients", profileName);
@@ -1034,7 +1032,7 @@ public Task AddFolderToWhiteList(IGameProfile profile, IEnumerable<IFolderInfo>
10341032
return SaveProfiles();
10351033
}
10361034

1037-
public async Task CreateUserSessionAsync(IGameProfile profile, IUser user)
1035+
public async Task CreateUserSessionAsync(IGameProfile profile, IUser user, string? hostValue = null)
10381036
{
10391037
try
10401038
{
@@ -1048,8 +1046,8 @@ public async Task CreateUserSessionAsync(IGameProfile profile, IUser user)
10481046
{
10491047
Task[] tasks =
10501048
[
1051-
player.DownloadAndInstallCloakAsync(cloakUrl),
1052-
player.DownloadAndInstallSkinAsync(skinUrl),
1049+
player.DownloadAndInstallCloakAsync(cloakUrl, hostValue),
1050+
player.DownloadAndInstallSkinAsync(skinUrl, hostValue),
10531051
];
10541052

10551053
Task.WaitAll(tasks);

src/Gml.Core/Core/User/User.cs

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ public class User : IUser
2222

2323
public string Name { get; set; } = null!;
2424
public string? TextureSkinUrl { get; set; }
25+
public string? ExternalTextureSkinUrl { get; set; }
2526
public string? TextureCloakUrl { get; set; }
27+
public string? ExternalTextureCloakUrl { get; set; }
2628
public string ServerUuid { get; set; }
2729

2830
public string? TextureSkinGuid { get; set; }
@@ -58,25 +60,62 @@ public virtual async Task Unblock(bool isPermanent)
5860
await Manager.Users.UpdateUser(this);
5961
}
6062

61-
public async Task DownloadAndInstallSkinAsync(string skinUrl)
63+
private UriBuilder ReplaceHost(string url, string hostValue)
64+
{
65+
var originalUri = new Uri(url);
66+
var builder = new UriBuilder(originalUri);
67+
68+
if (hostValue.Contains(':'))
69+
{
70+
var parts = hostValue.Split(':');
71+
builder.Host = parts[0];
72+
builder.Port = int.Parse(parts[1]);
73+
}
74+
else
75+
{
76+
builder.Host = hostValue;
77+
builder.Port = 80;
78+
}
79+
80+
return builder;
81+
}
82+
83+
public async Task DownloadAndInstallSkinAsync(string skinUrl, string? hostValue = null)
6284
{
6385
Debug.WriteLine($"Get skin: {skinUrl}");
6486
TextureSkinUrl = await Manager.Integrations.TextureProvider.SetSkin(this, skinUrl);
65-
6687
TextureSkinGuid = !string.IsNullOrEmpty(TextureSkinUrl)
6788
? Guid.NewGuid().ToString()
6889
: string.Empty;
90+
91+
if (hostValue is not null && !string.IsNullOrEmpty(TextureSkinUrl))
92+
{
93+
var host = ReplaceHost(TextureSkinUrl, hostValue);
94+
95+
host.Path = $"/api/v1/integrations/texture/skins/{TextureSkinGuid}";
96+
97+
ExternalTextureSkinUrl = host.Uri.AbsoluteUri;
98+
}
6999
}
70100

71101

72-
public async Task DownloadAndInstallCloakAsync(string cloakUrl)
102+
public async Task DownloadAndInstallCloakAsync(string cloakUrl, string? hostValue = null)
73103
{
74104
Debug.WriteLine($"Get cloak: {cloakUrl}");
75105
TextureCloakUrl = await Manager.Integrations.TextureProvider.SetCloak(this, cloakUrl);
76106

77107
TextureCloakGuid = !string.IsNullOrEmpty(TextureCloakUrl)
78108
? Guid.NewGuid().ToString()
79109
: string.Empty;
110+
111+
if (hostValue is not null && !string.IsNullOrEmpty(TextureCloakUrl))
112+
{
113+
var host = ReplaceHost(TextureCloakUrl, hostValue);
114+
115+
host.Path = $"/api/v1/integrations/texture/capes/{TextureCloakGuid}";
116+
117+
ExternalTextureCloakUrl = host.Uri.AbsoluteUri;
118+
}
80119
}
81120

82121
public Task SaveUserAsync()

src/Gml.Core/Gml.Core.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
<ItemGroup>
1212
<PackageReference Include="CurseForge.APIClient" Version="3.0.0" />
13-
<PackageReference Include="Gml.Web.Api.Domains" Version="2025.1.3.18" />
1413
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="8.14.0" />
1514
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
1615
<PackageReference Include="Spectre.Console" Version="0.50.0" />
@@ -24,7 +23,7 @@
2423
<ProjectReference Include="..\CmlLib.Core.Installer.Forge\CmlLib.Core.Installer.Forge\CmlLib.Core.Installer.Forge.csproj"/>
2524
<ProjectReference Include="..\CmlLib.Core.Installer.NeoForge\CmlLib.Core.Installer.NeoForge\CmlLib.Core.Installer.NeoForge.csproj" />
2625
<ProjectReference Include="..\Gml.Common\Gml.Common\Gml.Common.csproj" />
27-
<ProjectReference Include="..\Gml.Core.Interfaces\Gml.Core.Interfaces.csproj" />
26+
<ProjectReference Include="..\Gml.Interfaces\Gml.Interfaces.csproj" />
2827
<ProjectReference Include="..\Modrinth.Api\src\Modrinth.Api\Modrinth.Api.csproj" />
2928
<ProjectReference Include="..\Pingo\Pingo\Pingo.csproj" />
3029
</ItemGroup>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
3+
namespace Gml.Domains.Auth;
4+
5+
public class ApplicationPermission
6+
{
7+
public Guid ApplicationId { get; set; }
8+
public ExternalApplication Application { get; set; } = null!;
9+
10+
public int PermissionId { get; set; }
11+
public Permission Permission { get; set; } = null!;
12+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
using System.Collections.Generic;
3+
4+
namespace Gml.Domains.Auth;
5+
6+
public class ExternalApplication
7+
{
8+
public Guid Id { get; set; } = Guid.NewGuid();
9+
public int UserId { get; set; }
10+
public string Name { get; set; } = null!;
11+
public string TokenHash { get; set; } = null!;
12+
public DateTime CreatedAtUtc { get; set; } = DateTime.UtcNow;
13+
14+
public ICollection<ApplicationPermission> ApplicationPermissions { get; set; } = new List<ApplicationPermission>();
15+
}

0 commit comments

Comments
 (0)