mirror of
https://github.com/yawaflua/spworlds-csharp-library.git
synced 2025-12-10 04:29:25 +02:00
Add files via upload
This commit is contained in:
9
src/Types/PaymentData.cs
Normal file
9
src/Types/PaymentData.cs
Normal 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
13
src/Types/SkinPart.cs
Normal 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
23
src/Types/User.cs
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user