Skip to content

Commit e2ea4bb

Browse files
authored
Merge pull request #84 from Nik497926/GML-13
Gml 13
2 parents 8d14f4b + 9ebf2f1 commit e2ea4bb

5 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/Gml.Core.Interfaces/Procedures/IUserProcedures.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ Task<IUser> GetAuthData(
1616
string protocol,
1717
IPAddress? address,
1818
string? customUuid,
19-
string? hwid);
19+
string? hwid,
20+
bool isSlim);
2021
Task<IUser?> GetUserByUuid(string uuid);
2122
Task<IUser?> GetUserByName(string userName);
2223
Task<IUser?> GetUserBySkinGuid(string guid);

src/Gml.Core.Interfaces/User/IUser.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public interface IUser
1414
string? TextureCloakGuid { get; set; }
1515
public string ServerUuid { get; set; }
1616
bool IsBanned { get; set; }
17+
bool IsSlim { get; set; }
1718
public DateTime ServerExpiredDate { get; set; }
1819
public DateTime ExpiredDate { get; set; }
1920
List<ISession> Sessions { get; set; }

src/Gml.Core/Core/Helpers/User/UserProcedures.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public async Task<IUser> GetAuthData(string login,
4141
string protocol,
4242
IPAddress? address,
4343
string? customUuid,
44-
string? hwid)
44+
string? hwid,
45+
bool isSlim)
4546
{
4647
var authUser = await _storage.GetUserAsync<AuthUser>(login, new JsonSerializerOptions
4748
{
@@ -56,6 +57,7 @@ public async Task<IUser> GetAuthData(string login,
5657
authUser.Uuid = customUuid ?? UsernameToUuid(login);
5758
authUser.ExpiredDate = DateTime.Now + TimeSpan.FromDays(30);
5859
authUser.Manager = _gmlManager;
60+
authUser.IsSlim = isSlim;
5961

6062
await _storage.SetUserAsync(login, authUser.Uuid, authUser);
6163

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public class User : IUser
3131
public string? AccessToken { get; set; }
3232
public string? Uuid { get; set; }
3333
public DateTime ExpiredDate { get; set; }
34+
public bool IsSlim { get; set; }
3435
public List<ISession> Sessions { get; set; } = [];
3536
[JsonIgnore]
3637
public IGmlManager Manager { get; set; }

tests/GmlCore.Tests/UserTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public async Task SetupOnce()
3131

3232
if (user is null)
3333
{
34-
await _gmlManager.Users.GetAuthData(TestUserName, TestUserName, "Desktop", "1.0", IPAddress.Parse("127.0.0.1"), null, null);
34+
await _gmlManager.Users.GetAuthData(TestUserName, TestUserName, "Desktop", "1.0", IPAddress.Parse("127.0.0.1"), null, null, false);
3535
}
3636
}
3737

@@ -46,7 +46,7 @@ public async Task GetAuthData_ReturnsValidUser()
4646
IPAddress address = IPAddress.Parse("127.0.0.1");
4747

4848
// Act
49-
var result = await _gmlManager.Users.GetAuthData(login, password, device, protocol, address, null, null);
49+
var result = await _gmlManager.Users.GetAuthData(login, password, device, protocol, address, null, null, false);
5050

5151
// Assert
5252
Assert.That(result, Is.Not.Null);
@@ -65,7 +65,7 @@ public async Task GetAuthData_WithCustomUuid_ReturnsValidUser()
6565
string customUuid = "custom-uuid";
6666

6767
// Act
68-
var result = await _gmlManager.Users.GetAuthData(login, password, device, protocol, null, customUuid, null);
68+
var result = await _gmlManager.Users.GetAuthData(login, password, device, protocol, null, customUuid, null, false);
6969

7070
// Assert
7171
Assert.That(result, Is.Not.Null);

0 commit comments

Comments
 (0)