Add files via upload

This commit is contained in:
Dima YaFlay
2023-10-16 18:24:17 +03:00
committed by GitHub
parent b6655c1b9e
commit a48ccdf95b
4 changed files with 177 additions and 89 deletions

9
src/Types/PaymentData.cs Normal file
View File

@@ -0,0 +1,9 @@
namespace spworlds.Types;
public class PaymentData
{
public int Amount;
public string RedirectUrl;
public string WebHookUrl;
public string Data;
}

13
src/Types/SkinPart.cs Normal file
View File

@@ -0,0 +1,13 @@
namespace spworlds.Types;
public enum SkinPart
{
face;
front;
front_full;
head;
bust;
full;
skin;
}

23
src/Types/User.cs Normal file
View File

@@ -0,0 +1,23 @@
using spworlds;
using System.Text.Json.Nodes;
namespace spworlds.Types;
public class User
{
private string Name { get; }
private HttpClient client = new();
private string nonSerializedUuid = await client.GetStringAsync($"https://api.mojang.com/users/profiles/minecraft/{Name}");
private JsonNode uuid = JsonNode.Parse(nonSerializedUuid);
private string Uuid { get; } = uuid["id"]
string nonSerializedProfileId = await client.GetStringAsync($"https://sessionserver.mojang.com/session/minecraft/profile/{Uuid}");
private JsonNode profile = JsonNode.Parse(nonSerializedProfileId);
public async Task<string> GetSkinPart(SkinPart skinPart, string size)
{
return (string)$"https://visage.surgeplay.com/{skinPart}/{size}/{this.profile["profileId"]}"
}
public string GetName() => this.Name;
public string GetUuid() => this.Uuid;
public JsonNode GetProfile() => return this.profile;
public bool IsPlayer() => this.Name != null : false;
}