diff --git a/src/Gml.Core b/src/Gml.Core index aaff2d4..48d0a05 160000 --- a/src/Gml.Core +++ b/src/Gml.Core @@ -1 +1 @@ -Subproject commit aaff2d4f6f244e712ea14df1ee7bd29343913612 +Subproject commit 48d0a05cfe033bebccf9f14f7e8febf77a270171 diff --git a/src/Gml.Web.Api/Core/Handlers/MinecraftHandler.cs b/src/Gml.Web.Api/Core/Handlers/MinecraftHandler.cs index 4e751a1..df2bb3e 100644 --- a/src/Gml.Web.Api/Core/Handlers/MinecraftHandler.cs +++ b/src/Gml.Web.Api/Core/Handlers/MinecraftHandler.cs @@ -87,19 +87,25 @@ public static async Task HasJoined(HttpContext context, IGmlManager gml Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(), ProfileName = user.Name, ProfileId = user.Uuid, - Textures = new Textures - { - Skin = new SkinCape - { - Url = string.Concat(address, $"/api/v1/integrations/texture/skins/{user.TextureSkinGuid}") - }, - Cape = new SkinCape - { - Url = string.Concat(address, $"/api/v1/integrations/texture/capes/{user.TextureCloakGuid}") - } - } + Textures = new Textures() }; + if (!string.IsNullOrEmpty(user.TextureSkinGuid)) + { + texture.Textures.Skin = new SkinCape + { + Url = string.Concat(address, $"/api/v1/integrations/texture/skins/{user.TextureSkinGuid}") + }; + } + + if (!string.IsNullOrEmpty(user.TextureSkinGuid)) + { + texture.Textures.Cape = new SkinCape + { + Url = string.Concat(address, $"/api/v1/integrations/texture/capes/{user.TextureCloakGuid}") + }; + } + var jsonData = JsonConvert.SerializeObject(texture); Debug.WriteLine($"New user {jsonData}"); @@ -154,19 +160,25 @@ public static async Task GetProfile(HttpContext context, IGmlManager gm ProfileName = user.Name, ProfileId = uuid, SignatureRequired = unsigned == false, - Textures = new Textures - { - Skin = new SkinCape - { - Url = string.Concat(address, $"/api/v1/integrations/texture/skins/{user.TextureSkinGuid}") - }, - Cape = new SkinCape - { - Url = string.Concat(address, $"/api/v1/integrations/texture/capes/{user.TextureCloakGuid}") - } - } + Textures = new Textures() }; + if (!string.IsNullOrEmpty(user.TextureSkinGuid)) + { + texture.Textures.Skin = new SkinCape + { + Url = string.Concat(address, $"/api/v1/integrations/texture/skins/{user.TextureSkinGuid}") + }; + } + + if (!string.IsNullOrEmpty(user.TextureSkinGuid)) + { + texture.Textures.Cape = new SkinCape + { + Url = string.Concat(address, $"/api/v1/integrations/texture/capes/{user.TextureCloakGuid}") + }; + } + var jsonData = JsonConvert.SerializeObject(texture); Debug.WriteLine($"New user {jsonData}");