mirror of
https://github.com/yawaflua/SPWorldsWrapper.git
synced 2025-12-14 01:26:21 +02:00
Compare commits
1 Commits
yawaflua-p
...
yawaflua-p
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9a51cd600 |
4
.github/workflows/nuget.yml
vendored
4
.github/workflows/nuget.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
- name: Setup .NET Core
|
- name: Setup .NET Core
|
||||||
uses: actions/setup-dotnet@v1
|
uses: actions/setup-dotnet@v1
|
||||||
with:
|
with:
|
||||||
dotnet-version: '7.x.x'
|
dotnet-version: '8.x.x'
|
||||||
- name: Set output
|
- name: Set output
|
||||||
id: vars
|
id: vars
|
||||||
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
|
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
|
||||||
@@ -22,7 +22,7 @@ jobs:
|
|||||||
PROJECT_FILE_PATH: SPWorldsWrapper/SPWorldsWrapper.csproj
|
PROJECT_FILE_PATH: SPWorldsWrapper/SPWorldsWrapper.csproj
|
||||||
VERSION_STATIC: ${{ steps.vars.outputs.tags }}
|
VERSION_STATIC: ${{ steps.vars.outputs.tags }}
|
||||||
TAG_COMMIT: true
|
TAG_COMMIT: true
|
||||||
TAG_FORMAT: ${{ steps.meta.outputs.tags }}
|
TAG_FORMAT: '*'
|
||||||
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
|
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
|
||||||
NUGET_SOURCE: https://api.nuget.org
|
NUGET_SOURCE: https://api.nuget.org
|
||||||
INCLUDE_SYMBOLS: false
|
INCLUDE_SYMBOLS: false
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<PackageId>SPWorldsWrapper</PackageId>
|
<PackageId>SPWorldsWrapper</PackageId>
|
||||||
<Description>Библиотека для работы с сайтом spworlds.ru</Description>
|
<Description>Библиотека для работы с сайтом spworlds.ru</Description>
|
||||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||||
<Version>1.0.5</Version>
|
<Version>1.0.2</Version>
|
||||||
<Authors>yawaflua</Authors>
|
<Authors>yawaflua</Authors>
|
||||||
<Company>yawaflua</Company>
|
<Company>yawaflua</Company>
|
||||||
<RepositoryUrl>https://github.com/yawaflua/SPWorldsWrapper</RepositoryUrl>
|
<RepositoryUrl>https://github.com/yawaflua/SPWorldsWrapper</RepositoryUrl>
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
using System;
|
using Microsoft.VisualBasic;
|
||||||
|
using SPWorldsWrapper.Types.UserTypes;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -6,45 +8,59 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace SPWorldsWrapper.Types
|
namespace SPWorldsWrapper.Types
|
||||||
{
|
{
|
||||||
public class CardsOwned
|
|
||||||
{
|
|
||||||
public string name { get; set; }
|
|
||||||
public int color { get; set; }
|
|
||||||
public string number { get; set; }
|
|
||||||
public string id { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class City
|
|
||||||
{
|
|
||||||
public Mayor mayor { get; set; }
|
|
||||||
public string name { get; set; }
|
|
||||||
public int x { get; set; }
|
|
||||||
public int z { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Mayor
|
|
||||||
{
|
|
||||||
public string id { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SPUser
|
public class SPUser
|
||||||
{
|
{
|
||||||
public string id { get; set; }
|
public string id { get; set; }
|
||||||
public bool isBanned { get; set; }
|
public bool isBanned { get; set; }
|
||||||
public User user { get; set; }
|
public User user { get; set; }
|
||||||
public List<string> roles { get; set; }
|
public string[] roles { get; set; }
|
||||||
public City? city { get; set; }
|
public City? city { get; set; }
|
||||||
public string status { get; set; }
|
public string status { get; set; }
|
||||||
public DateTime createdAt { get; set; }
|
public DateTime createdAt { get; set; }
|
||||||
public List<CardsOwned> cardsOwned { get; set; }
|
public List<CardsOwned> cardsOwned { get; set; }
|
||||||
public bool isFollowed { get; set; }
|
public bool isFollowed { get; set; }
|
||||||
public bool isFollowingYou { get; set; }
|
public bool isFollowingYou { get; set; }
|
||||||
}
|
|
||||||
|
|
||||||
public class User
|
public Dictionary<string, object> toKeyValuePairs()
|
||||||
{
|
{
|
||||||
public bool isAdmin { get; set; }
|
string cards = "[\n";
|
||||||
public string minecraftUUID { get; set; }
|
foreach (var card in cardsOwned)
|
||||||
public string username { get; set; }
|
{
|
||||||
|
cards += " {\n";
|
||||||
|
foreach (var kvp in card.toKeyValuePairs())
|
||||||
|
{
|
||||||
|
cards += $" {kvp.Key}: {kvp.Value},\n";
|
||||||
|
}
|
||||||
|
cards += " },\n";
|
||||||
|
}
|
||||||
|
cards += "]";
|
||||||
|
return new ()
|
||||||
|
{
|
||||||
|
{ "id", id },
|
||||||
|
{ "isBanned", isBanned },
|
||||||
|
{ "status", status },
|
||||||
|
{ "created_at", createdAt },
|
||||||
|
{ "isFollowed", isFollowed },
|
||||||
|
{ "isFollowingYou", isFollowingYou },
|
||||||
|
{ "user", user.ToString() },
|
||||||
|
{ "roles", $"[{string.Join(", ", roles)}]" },
|
||||||
|
{ "city", city?.ToString() ?? "Null" },
|
||||||
|
{ "cardsOwner", cards },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
string stringToReturn = "{\n";
|
||||||
|
foreach (var kvp in toKeyValuePairs())
|
||||||
|
{
|
||||||
|
stringToReturn += $"\n {kvp.Key}: {kvp.Value},";
|
||||||
|
}
|
||||||
|
stringToReturn += "\n}";
|
||||||
|
return stringToReturn;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user